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