mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Fix non-default etcd image handling in kubemark
This commit is contained in:
parent
d2aabc8509
commit
5ffda62588
@ -22,12 +22,12 @@ source "${KUBE_ROOT}/cluster/lib/util.sh"
|
||||
# what what is default in hack/lib/etcd.sh
|
||||
# To avoid it, if it is empty, we set it to 'avoid-overwrite' and
|
||||
# clean it after that.
|
||||
if [ -z "${ETCD_VERSION}" ]; then
|
||||
ETCD_VERSION="avoid-overwrite"
|
||||
if [ -z "${ETCD_IMAGE}" ]; then
|
||||
ETCD_IMAGE="avoid-overwrite"
|
||||
fi
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
if [ "${ETCD_VERSION}" == "avoid-overwrite" ]; then
|
||||
ETCD_VERSION=""
|
||||
if [ "${ETCD_IMAGE}" == "avoid-overwrite" ]; then
|
||||
ETCD_IMAGE=""
|
||||
fi
|
||||
|
||||
detect-project &> /dev/null
|
||||
|
@ -19,10 +19,10 @@
|
||||
EVENT_STORE_IP=$1
|
||||
EVENT_STORE_URL="http://${EVENT_STORE_IP}:4002"
|
||||
NUM_NODES=$2
|
||||
KUBEMARK_ETCD_VERSION=$3
|
||||
if [[ -z "${KUBEMARK_ETCD_VERSION}" ]]; then
|
||||
KUBEMARK_ETCD_IMAGE=$3
|
||||
if [[ -z "${KUBEMARK_ETCD_IMAGE}" ]]; then
|
||||
# Default etcd version.
|
||||
KUBEMARK_ETCD_VERSION="2.2.1"
|
||||
KUBEMARK_ETCD_IMAGE="2.2.1"
|
||||
fi
|
||||
|
||||
function retry() {
|
||||
@ -88,7 +88,7 @@ if [ "${EVENT_STORE_IP}" == "127.0.0.1" ]; then
|
||||
# Retry starting etcd to avoid pulling image errors.
|
||||
retry sudo docker run --net=host \
|
||||
-v /var/etcd/data-events:/var/etcd/data -v /var/log:/var/log -d \
|
||||
gcr.io/google_containers/etcd:${KUBEMARK_ETCD_VERSION} /bin/sh -c "/usr/local/bin/etcd \
|
||||
gcr.io/google_containers/etcd:${KUBEMARK_ETCD_IMAGE} /bin/sh -c "/usr/local/bin/etcd \
|
||||
--listen-peer-urls http://127.0.0.1:2381 \
|
||||
--advertise-client-urls=http://127.0.0.1:4002 \
|
||||
--listen-client-urls=http://0.0.0.0:4002 \
|
||||
@ -98,7 +98,7 @@ fi
|
||||
# Retry starting etcd to avoid pulling image errors.
|
||||
retry sudo docker run --net=host \
|
||||
-v /var/etcd/data:/var/etcd/data -v /var/log:/var/log -d \
|
||||
gcr.io/google_containers/etcd:${KUBEMARK_ETCD_VERSION} /bin/sh -c "/usr/local/bin/etcd \
|
||||
gcr.io/google_containers/etcd:${KUBEMARK_ETCD_IMAGE} /bin/sh -c "/usr/local/bin/etcd \
|
||||
--listen-peer-urls http://127.0.0.1:2380 \
|
||||
--advertise-client-urls=http://127.0.0.1:2379 \
|
||||
--listen-client-urls=http://0.0.0.0:2379 \
|
||||
|
@ -148,7 +148,7 @@ gcloud compute copy-files --zone="${ZONE}" --project="${PROJECT}" \
|
||||
|
||||
gcloud compute ssh "${MASTER_NAME}" --zone="${ZONE}" --project="${PROJECT}" \
|
||||
--command="chmod a+x configure-kubectl.sh && chmod a+x start-kubemark-master.sh && \
|
||||
sudo ./start-kubemark-master.sh ${EVENT_STORE_IP:-127.0.0.1} ${NUM_NODES:-0} ${ETCD_VERSION:-}"
|
||||
sudo ./start-kubemark-master.sh ${EVENT_STORE_IP:-127.0.0.1} ${NUM_NODES:-0} ${ETCD_IMAGE:-}"
|
||||
|
||||
# create kubeconfig for Kubelet:
|
||||
KUBECONFIG_CONTENTS=$(echo "apiVersion: v1
|
||||
|
Loading…
Reference in New Issue
Block a user