mirror of https://github.com/k3s-io/k3s
Expose etcd version.
parent
07f78836ea
commit
c2248324c1
|
@ -702,6 +702,15 @@ NUM_NODES: $(yaml-quote ${NUM_NODES})
|
|||
STORAGE_BACKEND: $(yaml-quote ${STORAGE_BACKEND:-})
|
||||
ENABLE_GARBAGE_COLLECTOR: $(yaml-quote ${ENABLE_GARBAGE_COLLECTOR:-})
|
||||
EOF
|
||||
# ETCD_IMAGE (if set) allows to use a custom etcd image.
|
||||
if [ -n "${ETCD_IMAGE:-}" ]; then
|
||||
cat >>$file <<EOF
|
||||
ETCD_IMAGE: $(yaml-quote ${ETCD_IMAGE})
|
||||
EOF
|
||||
fi
|
||||
# ETCD_VERSION (if set) allows you to use custom version of etcd.
|
||||
# The main purpose of using it may be rollback of etcd v3 API,
|
||||
# where we need 3.0.* image, but are rolling back to 2.3.7.
|
||||
if [ -n "${ETCD_VERSION:-}" ]; then
|
||||
cat >>$file <<EOF
|
||||
ETCD_VERSION: $(yaml-quote ${ETCD_VERSION})
|
||||
|
|
|
@ -94,7 +94,9 @@ ENABLE_L7_LOADBALANCING="${KUBE_ENABLE_L7_LOADBALANCING:-glbc}"
|
|||
# standalone - Heapster only. Metrics available via Heapster REST API.
|
||||
ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-influxdb}"
|
||||
|
||||
# Set etcd version (e.g. 3.0.4-migration.1) if you need non-default version.
|
||||
# Set etcd image (e.g. 3.0.13-experimental.1) version (e.g. 3.0.13) if you need
|
||||
# non-default version.
|
||||
ETCD_IMAGE="${TEST_ETCD_IMAGE:-}"
|
||||
ETCD_VERSION="${TEST_ETCD_VERSION:-}"
|
||||
|
||||
# Default Log level for all components in test clusters and variables to override it in specific components.
|
||||
|
|
|
@ -470,12 +470,17 @@ EOF
|
|||
kubelet_port: '$(echo "$KUBELET_PORT" | sed -e "s/'/''/g")'
|
||||
EOF
|
||||
fi
|
||||
# Configuration changes for test clusters
|
||||
if [ -n "${ETCD_VERSION:-}" ]; then
|
||||
if [ -n "${ETCD_IMAGE:-}" ]; then
|
||||
cat <<EOF >>/srv/salt-overlay/pillar/cluster-params.sls
|
||||
etcd_docker_tag: '$(echo "$ETCD_VERSION" | sed -e "s/'/''/g")'
|
||||
etcd_docker_tag: '$(echo "$ETCD_IMAGE" | sed -e "s/'/''/g")'
|
||||
EOF
|
||||
fi
|
||||
if [ -n "${ETCD_VERSION:-}" ]; then
|
||||
cat <<EOF >>/srv/salt-overlay/pillar/cluster-params.sls
|
||||
etcd_version: '$(echo "$ETCD_VERSION" | sed -e "s/'/''/g")'
|
||||
EOF
|
||||
fi
|
||||
# Configuration changes for test clusters
|
||||
if [ -n "${APISERVER_TEST_ARGS:-}" ]; then
|
||||
cat <<EOF >>/srv/salt-overlay/pillar/cluster-params.sls
|
||||
apiserver_test_args: '$(echo "$APISERVER_TEST_ARGS" | sed -e "s/'/''/g")'
|
||||
|
|
|
@ -626,11 +626,16 @@ function prepare-etcd-manifest {
|
|||
sed -i -e "s@{{ *etcd_cluster *}}@$etcd_cluster@g" "${temp_file}"
|
||||
sed -i -e "s@{{ *storage_backend *}}@${STORAGE_BACKEND:-}@g" "${temp_file}"
|
||||
sed -i -e "s@{{ *cluster_state *}}@$cluster_state@g" "${temp_file}"
|
||||
if [[ -n "${ETCD_VERSION:-}" ]]; then
|
||||
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@${ETCD_VERSION}@g" "${temp_file}"
|
||||
if [[ -n "${ETCD_IMAGE:-}" ]]; then
|
||||
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@${ETCD_IMAGE}@g" "${temp_file}"
|
||||
else
|
||||
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@\1@g" "${temp_file}"
|
||||
fi
|
||||
if [[ -n "${ETCD_VERSION:-}" ]]; then
|
||||
sed -i -e "s@{{ *pillar\.get('etcd_version', '\(.*\)') *}}@${ETCD_VERSION}@g" "${temp_file}"
|
||||
else
|
||||
sed -i -e "s@{{ *pillar\.get('etcd_version', '\(.*\)') *}}@\1@g" "${temp_file}"
|
||||
fi
|
||||
# Replace the volume host path.
|
||||
sed -i -e "s@/mnt/master-pd/var/etcd@/mnt/disks/master-pd/var/etcd@g" "${temp_file}"
|
||||
mv "${temp_file}" /etc/kubernetes/manifests
|
||||
|
|
|
@ -458,11 +458,16 @@ prepare_etcd_manifest() {
|
|||
sed -i -e "s@{{ *etcd_cluster *}}@$etcd_cluster@g" "${etcd_temp_file}"
|
||||
sed -i -e "s@{{ *storage_backend *}}@${STORAGE_BACKEND:-}@g" "${temp_file}"
|
||||
sed -i -e "s@{{ *cluster_state *}}@$cluster_state@g" "${etcd_temp_file}"
|
||||
if [[ -n "${ETCD_VERSION:-}" ]]; then
|
||||
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@${ETCD_VERSION}@g" "${etcd_temp_file}"
|
||||
if [[ -n "${ETCD_IMAGE:-}" ]]; then
|
||||
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@${ETCD_IMAGE}@g" "${etcd_temp_file}"
|
||||
else
|
||||
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@\1@g" "${etcd_temp_file}"
|
||||
fi
|
||||
if [[ -n "${ETCD_VERSION:-}" ]]; then
|
||||
sed -i -e "s@{{ *pillar\.get('etcd_version', '\(.*\)') *}}@${ETCD_VERSION}@g" "${etcd_temp_file}"
|
||||
else
|
||||
sed -i -e "s@{{ *pillar\.get('etcd_version', '\(.*\)') *}}@\1@g" "${etcd_temp_file}"
|
||||
fi
|
||||
# Replace the volume host path
|
||||
sed -i -e "s@/mnt/master-pd/var/etcd@/mnt/disks/master-pd/var/etcd@g" "${etcd_temp_file}"
|
||||
mv "${etcd_temp_file}" /etc/kubernetes/manifests
|
||||
|
|
|
@ -46,7 +46,9 @@ CLUSTER_IP_RANGE="${CLUSTER_IP_RANGE:-10.240.0.0/11}"
|
|||
RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}"
|
||||
TERMINATED_POD_GC_THRESHOLD=${TERMINATED_POD_GC_THRESHOLD:-100}
|
||||
|
||||
# Set etcd version (e.g. 3.0.4-migration.1) if you need non-default version.
|
||||
# Set etcd image (e.g. 3.0.13-experimental.1) version (e.g. 3.0.13) if you need
|
||||
# non-default version.
|
||||
ETCD_IMAGE="${TEST_ETCD_IMAGE:-}"
|
||||
ETCD_VERSION="${TEST_ETCD_VERSION:-}"
|
||||
# Storage backend. 'etcd2' supported, 'etcd3' experimental.
|
||||
STORAGE_BACKEND=${STORAGE_BACKEND:-etcd2}
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
"value": "{{ storage_backend }}"
|
||||
},
|
||||
{ "name": "TARGET_VERSION",
|
||||
"value": "{{ pillar.get('etcd_docker_tag', '2.2.1') }}"
|
||||
"value": "{{ pillar.get('etcd_version', '2.2.1') }}"
|
||||
},
|
||||
{ "name": "DATA_DIRECTORY",
|
||||
"value": "/var/etcd/data{{ suffix }}"
|
||||
|
|
Loading…
Reference in New Issue