mirror of https://github.com/k3s-io/k3s
Merge pull request #30047 from zmerlynn/fix-aws-bringup
Automatic merge from submit-queue AWS/GCE: Rework use of master name * Add a pillar for `hostname` (because even if there's a good Salt function for it, I don't trust it to return the short hostname) * Move `INITIAL_ETCD_CLUSTER` to just the GCE turn-up * Remove `master_name`, which isn't neededpull/6/head
commit
10b1ffbed8
|
@ -644,7 +644,6 @@ ENABLE_MANIFEST_URL: $(yaml-quote ${ENABLE_MANIFEST_URL:-false})
|
|||
MANIFEST_URL: $(yaml-quote ${MANIFEST_URL:-})
|
||||
MANIFEST_URL_HEADER: $(yaml-quote ${MANIFEST_URL_HEADER:-})
|
||||
NUM_NODES: $(yaml-quote ${NUM_NODES})
|
||||
INITIAL_ETCD_CLUSTER: $(yaml-quote ${MASTER_NAME})
|
||||
ENABLE_GARBAGE_COLLECTOR: $(yaml-quote ${ENABLE_GARBAGE_COLLECTOR:-false})
|
||||
EOF
|
||||
if [ -n "${APISERVER_TEST_ARGS:-}" ]; then
|
||||
|
@ -675,6 +674,11 @@ EOF
|
|||
if [ -n "${SCHEDULER_TEST_LOG_LEVEL:-}" ]; then
|
||||
cat >>$file <<EOF
|
||||
SCHEDULER_TEST_LOG_LEVEL: $(yaml-quote ${SCHEDULER_TEST_LOG_LEVEL})
|
||||
EOF
|
||||
fi
|
||||
if [ -n "${INITIAL_ETCD_CLUSTER:-}" ]; then
|
||||
cat >>$file <<EOF
|
||||
INITIAL_ETCD_CLUSTER: $(yaml-quote ${INITIAL_ETCD_CLUSTER})
|
||||
EOF
|
||||
fi
|
||||
else
|
||||
|
|
|
@ -53,6 +53,7 @@ NETWORK=${KUBE_GCE_NETWORK:-default}
|
|||
INSTANCE_PREFIX="${KUBE_GCE_INSTANCE_PREFIX:-kubernetes}"
|
||||
CLUSTER_NAME="${CLUSTER_NAME:-${INSTANCE_PREFIX}}"
|
||||
MASTER_NAME="${INSTANCE_PREFIX}-master"
|
||||
INITIAL_ETCD_CLUSTER="${MASTER_NAME}"
|
||||
MASTER_TAG="${INSTANCE_PREFIX}-master"
|
||||
NODE_TAG="${INSTANCE_PREFIX}-minion"
|
||||
MASTER_IP_RANGE="${MASTER_IP_RANGE:-10.246.0.0/24}"
|
||||
|
|
|
@ -55,6 +55,7 @@ NETWORK=${KUBE_GCE_NETWORK:-e2e}
|
|||
INSTANCE_PREFIX="${KUBE_GCE_INSTANCE_PREFIX:-e2e-test-${USER}}"
|
||||
CLUSTER_NAME="${CLUSTER_NAME:-${INSTANCE_PREFIX}}"
|
||||
MASTER_NAME="${INSTANCE_PREFIX}-master"
|
||||
INITIAL_ETCD_CLUSTER="${MASTER_NAME}"
|
||||
MASTER_TAG="${INSTANCE_PREFIX}-master"
|
||||
NODE_TAG="${INSTANCE_PREFIX}-minion"
|
||||
CLUSTER_IP_RANGE="${CLUSTER_IP_RANGE:-10.180.0.0/14}"
|
||||
|
|
|
@ -452,11 +452,11 @@ network_policy_provider: '$(echo "$NETWORK_POLICY_PROVIDER" | sed -e "s/'/''/g")
|
|||
enable_manifest_url: '$(echo "${ENABLE_MANIFEST_URL:-}" | sed -e "s/'/''/g")'
|
||||
manifest_url: '$(echo "${MANIFEST_URL:-}" | sed -e "s/'/''/g")'
|
||||
manifest_url_header: '$(echo "${MANIFEST_URL_HEADER:-}" | sed -e "s/'/''/g")'
|
||||
master_name: '$(echo "${KUBERNETES_MASTER_NAME:-}" | sed -e "s/'/''/g")'
|
||||
num_nodes: $(echo "${NUM_NODES:-}" | sed -e "s/'/''/g")
|
||||
e2e_storage_test_environment: '$(echo "$E2E_STORAGE_TEST_ENVIRONMENT" | sed -e "s/'/''/g")'
|
||||
kube_uid: '$(echo "${KUBE_UID}" | sed -e "s/'/''/g")'
|
||||
initial_etcd_cluster: '$(echo "${INITIAL_ETCD_CLUSTER:-}" | sed -e "s/'/''/g")'
|
||||
hostname: $(hostname -s)
|
||||
EOF
|
||||
if [ -n "${KUBELET_PORT:-}" ]; then
|
||||
cat <<EOF >>/srv/salt-overlay/pillar/cluster-params.sls
|
||||
|
|
|
@ -541,7 +541,7 @@ function prepare-etcd-manifest {
|
|||
sed -i -e "s@{{ *port *}}@$2@g" "${temp_file}"
|
||||
sed -i -e "s@{{ *server_port *}}@$3@g" "${temp_file}"
|
||||
sed -i -e "s@{{ *cpulimit *}}@\"$4\"@g" "${temp_file}"
|
||||
sed -i -e "s@{{ *host_name *}}@$host_name@g" "${temp_file}"
|
||||
sed -i -e "s@{{ *hostname *}}@$host_name@g" "${temp_file}"
|
||||
sed -i -e "s@{{ *etcd_cluster *}}@$etcd_cluster@g" "${temp_file}"
|
||||
sed -i -e "s@{{ *cluster_state *}}@$cluster_state@g" "${temp_file}"
|
||||
# Replace the volume host path.
|
||||
|
|
|
@ -427,7 +427,7 @@ prepare_etcd_manifest() {
|
|||
sed -i -e "s@{{ *port *}}@$2@g" "${etcd_temp_file}"
|
||||
sed -i -e "s@{{ *server_port *}}@$3@g" "${etcd_temp_file}"
|
||||
sed -i -e "s@{{ *cpulimit *}}@\"$4\"@g" "${etcd_temp_file}"
|
||||
sed -i -e "s@{{ *host_name *}}@$host_name@g" "${etcd_temp_file}"
|
||||
sed -i -e "s@{{ *hostname *}}@$host_name@g" "${etcd_temp_file}"
|
||||
sed -i -e "s@{{ *etcd_cluster *}}@$etcd_cluster@g" "${etcd_temp_file}"
|
||||
sed -i -e "s@{{ *cluster_state *}}@$cluster_state@g" "${etcd_temp_file}"
|
||||
# Replace the volume host path
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% set cluster_state = 'new' -%}
|
||||
{% set host_name = pillar.get('master_name', '') -%}
|
||||
{% set etcd_cluster_array = pillar.get('initial_etcd_cluster', host_name).split(',') -%}
|
||||
{% set hostname = pillar.get('hostname', '') -%}
|
||||
{% set etcd_cluster_array = (pillar.get('initial_etcd_cluster') or hostname).split(',') -%}
|
||||
{% set etcd_cluster = '' -%}
|
||||
{# We use vars dictionary to pass variables set inside the for loop, because jinja defines new variables inside the for loop that hide variables from the outside. #}
|
||||
{% set vars = {'etcd_cluster': '', 'cluster_state': cluster_state} -%}
|
||||
|
@ -36,7 +36,7 @@
|
|||
"command": [
|
||||
"/bin/sh",
|
||||
"-c",
|
||||
"/usr/local/bin/etcd --name etcd-{{ host_name }} --listen-peer-urls http://{{ host_name }}:{{ server_port }} --initial-advertise-peer-urls http://{{ host_name }}:{{ server_port }} --advertise-client-urls http://127.0.0.1:{{ port }} --listen-client-urls http://127.0.0.1:{{ port }} --data-dir /var/etcd/data{{ suffix }} --initial-cluster-state {{ cluster_state }} --initial-cluster {{ etcd_cluster }} 1>>/var/log/etcd{{ suffix }}.log 2>&1"
|
||||
"/usr/local/bin/etcd --name etcd-{{ hostname }} --listen-peer-urls http://{{ hostname }}:{{ server_port }} --initial-advertise-peer-urls http://{{ hostname }}:{{ server_port }} --advertise-client-urls http://127.0.0.1:{{ port }} --listen-client-urls http://127.0.0.1:{{ port }} --data-dir /var/etcd/data{{ suffix }} --initial-cluster-state {{ cluster_state }} --initial-cluster {{ etcd_cluster }} 1>>/var/log/etcd{{ suffix }}.log 2>&1"
|
||||
],
|
||||
"livenessProbe": {
|
||||
"httpGet": {
|
||||
|
|
Loading…
Reference in New Issue