Skip to content

Commit 7b9aded

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request #54475 from wojtek-t/automated-cherry-pick-of-#54403-upstream-release-1.7
Automatic merge from submit-queue. Automated cherry pick of #54403 upstream release 1.7 Cherrypick of #54403 to the 1.7 branch #54403: Allow for configuring etcd hostname in the manifest
2 parents b78915a + 87a07f4 commit 7b9aded

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

cluster/common.sh

+5
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,11 @@ EOF
800800
if [ -n "${ETCD_VERSION:-}" ]; then
801801
cat >>$file <<EOF
802802
ETCD_VERSION: $(yaml-quote ${ETCD_VERSION})
803+
EOF
804+
fi
805+
if [ -n "${ETCD_HOSTNAME:-}" ]; then
806+
cat >>$file <<EOF
807+
ETCD_HOSTNAME: $(yaml-quote ${ETCD_HOSTNAME})
803808
EOF
804809
fi
805810
if [ -n "${APISERVER_TEST_ARGS:-}" ]; then

cluster/gce/configure-vm.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ kube_uid: '$(echo "${KUBE_UID}" | sed -e "s/'/''/g")'
446446
initial_etcd_cluster: '$(echo "${INITIAL_ETCD_CLUSTER:-}" | sed -e "s/'/''/g")'
447447
initial_etcd_cluster_state: '$(echo "${INITIAL_ETCD_CLUSTER_STATE:-}" | sed -e "s/'/''/g")'
448448
ca_cert_bundle_path: '$(echo "${CA_CERT_BUNDLE_PATH:-}" | sed -e "s/'/''/g")'
449-
hostname: $(hostname -s)
449+
hostname: '$(echo "${ETCD_HOSTNAME:-$(hostname -s)}" | sed -e "s/'/''/g")'
450450
enable_default_storage_class: '$(echo "$ENABLE_DEFAULT_STORAGE_CLASS" | sed -e "s/'/''/g")'
451451
EOF
452452
if [ -n "${STORAGE_BACKEND:-}" ]; then

cluster/gce/container-linux/configure-helper.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ function start-kube-proxy {
660660
# $4: value for variable 'cpulimit'
661661
# $5: pod name, which should be either etcd or etcd-events
662662
function prepare-etcd-manifest {
663-
local host_name=$(hostname -s)
663+
local host_name=${ETCD_HOSTNAME:-$(hostname -s)}
664664
local etcd_cluster=""
665665
local cluster_state="new"
666666
local etcd_protocol="http"

cluster/gce/gci/configure-helper.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ function start-kube-proxy {
10291029
# $4: value for variable 'cpulimit'
10301030
# $5: pod name, which should be either etcd or etcd-events
10311031
function prepare-etcd-manifest {
1032-
local host_name=$(hostname)
1032+
local host_name=${ETCD_HOSTNAME:-$(hostname -s)}
10331033
local etcd_cluster=""
10341034
local cluster_state="new"
10351035
local etcd_protocol="http"

0 commit comments

Comments
 (0)