From 75293ac7a26231ff4aa55ea40ad9d7b386b34ed6 Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Mon, 30 Oct 2017 05:29:01 +0000 Subject: [PATCH] Add containerd e2e. Signed-off-by: Lantao Liu --- cluster/common.sh | 3 +++ cluster/gce/config-default.sh | 6 ++++++ cluster/gce/config-test.sh | 6 ++++++ cluster/gce/container-linux/configure-helper.sh | 2 +- cluster/gce/gci/configure-helper.sh | 12 +++++++++++- cluster/gce/gci/configure.sh | 2 +- cluster/gce/gci/master-helper.sh | 1 + cluster/gce/gci/node-helper.sh | 3 ++- 8 files changed, 31 insertions(+), 4 deletions(-) diff --git a/cluster/common.sh b/cluster/common.sh index 2b11917d77..2c9d789127 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -665,6 +665,9 @@ PROMETHEUS_TO_SD_ENDPOINT: $(yaml-quote ${PROMETHEUS_TO_SD_ENDPOINT:-}) PROMETHEUS_TO_SD_PREFIX: $(yaml-quote ${PROMETHEUS_TO_SD_PREFIX:-}) ENABLE_PROMETHEUS_TO_SD: $(yaml-quote ${ENABLE_PROMETHEUS_TO_SD:-false}) ENABLE_POD_PRIORITY: $(yaml-quote ${ENABLE_POD_PRIORITY:-}) +CONTAINER_RUNTIME: $(yaml-quote ${CONTAINER_RUNTIME:-}) +CONTAINER_RUNTIME_ENDPOINT: $(yaml-quote ${CONTAINER_RUNTIME_ENDPOINT:-}) +LOAD_IMAGE_COMMAND: $(yaml-quote ${LOAD_IMAGE_COMMAND:-}) EOF if [ -n "${KUBELET_PORT:-}" ]; then cat >>$file < "${kubelet_env_file}" @@ -1014,6 +1021,7 @@ function start-node-problem-detector { echo "Start node problem detector" local -r npd_bin="${KUBE_HOME}/bin/node-problem-detector" local -r km_config="${KUBE_HOME}/node-problem-detector/config/kernel-monitor.json" + # TODO(random-liu): Handle this for alternative container runtime. local -r dm_config="${KUBE_HOME}/node-problem-detector/config/docker-monitor.json" echo "Using node problem detector binary at ${npd_bin}" local flags="${NPD_TEST_LOG_LEVEL:-"--v=2"} ${NPD_TEST_ARGS:-}" @@ -2009,7 +2017,9 @@ fi override-kubectl # Run the containerized mounter once to pre-cache the container image. -assemble-docker-flags +if [[ "${CONTAINER_RUNTIME:-}" == "docker" ]]; then + assemble-docker-flags +fi start-kubelet if [[ "${KUBERNETES_MASTER:-}" == "true" ]]; then diff --git a/cluster/gce/gci/configure.sh b/cluster/gce/gci/configure.sh index 2210272327..e680271ee2 100644 --- a/cluster/gce/gci/configure.sh +++ b/cluster/gce/gci/configure.sh @@ -234,7 +234,7 @@ function try-load-docker-image { set +e local -r max_attempts=5 local -i attempt_num=1 - until timeout 30 docker load -i "${img}"; do + until timeout 30 ${LOAD_IMAGE_COMMAND} "${img}"; do if [[ "${attempt_num}" == "${max_attempts}" ]]; then echo "Fail to load docker image file ${img} after ${max_attempts} retries. Exit!!" exit 1 diff --git a/cluster/gce/gci/master-helper.sh b/cluster/gce/gci/master-helper.sh index c34ca113e5..58592f8d65 100755 --- a/cluster/gce/gci/master-helper.sh +++ b/cluster/gce/gci/master-helper.sh @@ -100,6 +100,7 @@ function create-master-instance-internal() { metadata="${metadata},gci-ensure-gke-docker=${KUBE_TEMP}/gci-ensure-gke-docker.txt" metadata="${metadata},gci-docker-version=${KUBE_TEMP}/gci-docker-version.txt" metadata="${metadata},kube-master-certs=${KUBE_TEMP}/kube-master-certs.yaml" + metadata="${metadata},${MASTER_EXTRA_METADATA}" local disk="name=${master_name}-pd" disk="${disk},device-name=master-pd" diff --git a/cluster/gce/gci/node-helper.sh b/cluster/gce/gci/node-helper.sh index 45cdfe6cf1..fa7c035fb0 100755 --- a/cluster/gce/gci/node-helper.sh +++ b/cluster/gce/gci/node-helper.sh @@ -25,7 +25,8 @@ function get-node-instance-metadata { metadata+="cluster-name=${KUBE_TEMP}/cluster-name.txt," metadata+="gci-update-strategy=${KUBE_TEMP}/gci-update.txt," metadata+="gci-ensure-gke-docker=${KUBE_TEMP}/gci-ensure-gke-docker.txt," - metadata+="gci-docker-version=${KUBE_TEMP}/gci-docker-version.txt" + metadata+="gci-docker-version=${KUBE_TEMP}/gci-docker-version.txt," + metadata+="${NODE_EXTRA_METADATA}" echo "${metadata}" }