Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace containervm with GCI as default master image for GCE clusters #26197

Merged
merged 1 commit into from
May 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cluster/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ function find-release-tars() {

# This tarball is used by GCI, Ubuntu Trusty, and CoreOS.
KUBE_MANIFESTS_TAR=
if [[ "${KUBE_OS_DISTRIBUTION:-}" == "trusty" || "${KUBE_OS_DISTRIBUTION:-}" == "gci" || "${KUBE_OS_DISTRIBUTION:-}" == "coreos" ]]; then
if [[ "${OS_DISTRIBUTION:-}" == "trusty" || "${OS_DISTRIBUTION:-}" == "gci" || "${OS_DISTRIBUTION:-}" == "coreos" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this?

Copy link
Contributor Author

@wonderfly wonderfly May 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because now that OS_DISTRIBUTION defaults to gci, one doesn't have to set KUBE_OS_DISTRIBUTION any more to start a GCI cluster. In that case, the old logic would fail.

For other distros on this list, they all have to set KUBE_OS_DISTRIBUTION as before, but OS_DISTRIBUTION will always equal to KUBE_OS_DISTRIBUTION, so it should work for them too. Are you thinking of anything that could potentially break because of this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that OS_DISTRIBUTION defaults to gci, one doesn't have to set KUBE_OS_DISTRIBUTION=gci any more to start a GCI cluster, and the old logic will start to fail in this case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining. I was concerned it wasn't set in all paths that call this, but on looking more it looks fine.

KUBE_MANIFESTS_TAR="${KUBE_ROOT}/server/kubernetes-manifests.tar.gz"
if [[ ! -f "${KUBE_MANIFESTS_TAR}" ]]; then
KUBE_MANIFESTS_TAR="${KUBE_ROOT}/_output/release-tars/kubernetes-manifests.tar.gz"
Expand Down
17 changes: 13 additions & 4 deletions cluster/gce/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,20 @@ PREEMPTIBLE_NODE=${PREEMPTIBLE_NODE:-false}
PREEMPTIBLE_MASTER=${PREEMPTIBLE_MASTER:-false}


OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION:-debian}
MASTER_IMAGE=${KUBE_GCE_MASTER_IMAGE:-container-vm-v20160321}
# Today the cluster startup scripts asssume the master and the nodes use the
# same OS distro, thus same set of initialization instructions (e.g., metadata,
# startup scripts, etc.). The current workaround is the hack in util.sh that
# reloads <os_distro>/helper.sh in the gap between when the master is created
# and when the nodes are created.
# TODO(#26183): Provide a way to differentiate master OS distro and node OS
# distro.
OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION:-gci}
# For GCI, leaving it blank will auto-select the latest GCI image on the `dev`
# channel.
MASTER_IMAGE=${KUBE_GCE_MASTER_IMAGE:-}
MASTER_IMAGE_PROJECT=${KUBE_GCE_MASTER_PROJECT:-google-containers}
NODE_IMAGE=${KUBE_GCE_NODE_IMAGE:-"${MASTER_IMAGE}"}
NODE_IMAGE_PROJECT=${KUBE_GCE_NODE_PROJECT:-"${MASTER_IMAGE_PROJECT}"}
NODE_IMAGE=${KUBE_GCE_NODE_IMAGE:-container-vm-v20160321}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why this shouldn't be blank as well to default to the latest dev channel image? Why do that for master and not node?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I realize now that gci != containervm, I guess a better question is "what's the reason for not having both be gci".. a comment indicating if this is temporary would be helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. See #26316

NODE_IMAGE_PROJECT=${KUBE_GCE_NODE_PROJECT:-google-containers}
CONTAINER_RUNTIME=${KUBE_CONTAINER_RUNTIME:-docker}
RKT_VERSION=${KUBE_RKT_VERSION:-0.5.5}

Expand Down
10 changes: 6 additions & 4 deletions cluster/gce/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ KUBE_APISERVER_REQUEST_TIMEOUT=300
PREEMPTIBLE_NODE=${PREEMPTIBLE_NODE:-false}
PREEMPTIBLE_MASTER=${PREEMPTIBLE_MASTER:-false}

OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION:-debian}
MASTER_IMAGE=${KUBE_GCE_MASTER_IMAGE:-container-vm-v20160321}
OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION:-gci}
# For GCI, leaving it blank will auto-select the latest GCI image on the `dev`
# channel.
MASTER_IMAGE=${KUBE_GCE_MASTER_IMAGE:-}
MASTER_IMAGE_PROJECT=${KUBE_GCE_MASTER_PROJECT:-google-containers}
NODE_IMAGE=${KUBE_GCE_NODE_IMAGE:-"${MASTER_IMAGE}"}
NODE_IMAGE_PROJECT=${KUBE_GCE_NODE_PROJECT:-"${MASTER_IMAGE_PROJECT}"}
NODE_IMAGE=${KUBE_GCE_NODE_IMAGE:-container-vm-v20160321}
NODE_IMAGE_PROJECT=${KUBE_GCE_NODE_PROJECT:-google-containers}
CONTAINER_RUNTIME=${KUBE_CONTAINER_RUNTIME:-docker}
RKT_VERSION=${KUBE_RKT_VERSION:-0.5.5}

Expand Down
4 changes: 2 additions & 2 deletions cluster/gce/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ if [[ "${OS_DISTRIBUTION}" == "gci" ]]; then
# Otherwise, we respect whatever set by the user.
gci_images=( $(gcloud compute images list --project google-containers \
--regexp='gci-dev.*' --format='value(name)') )
if [[ -z "${KUBE_GCE_MASTER_IMAGE:-}" ]]; then
if [[ -z "${MASTER_IMAGE:-}" ]]; then
MASTER_IMAGE="${gci_images[0]}"
MASTER_IMAGE_PROJECT="google-containers"
fi
if [[ -z "${KUBE_GCE_NODE_IMAGE:-}" ]]; then
if [[ -z "${NODE_IMAGE:-}" ]]; then
NODE_IMAGE="${gci_images[0]}"
NODE_IMAGE_PROJECT="google-containers"
fi
Expand Down
2 changes: 1 addition & 1 deletion hack/ginkgo-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export PATH=$(dirname "${e2e_test}"):"${PATH}"
--repo-root="${KUBE_ROOT}" \
--node-instance-group="${NODE_INSTANCE_GROUP:-}" \
--prefix="${KUBE_GCE_INSTANCE_PREFIX:-e2e}" \
${KUBE_OS_DISTRIBUTION:+"--os-distro=${KUBE_OS_DISTRIBUTION}"} \
${OS_DISTRIBUTION:+"--os-distro=${OS_DISTRIBUTION}"} \
${NUM_NODES:+"--num-nodes=${NUM_NODES}"} \
${E2E_CLEAN_START:+"--clean-start=true"} \
${E2E_MIN_STARTUP_PODS:+"--minStartupPods=${E2E_MIN_STARTUP_PODS}"} \
Expand Down
1 change: 1 addition & 0 deletions hack/verify-flags/exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cluster/aws/templates/configure-vm-aws.sh: env-to-grains "hostname_override"
cluster/aws/templates/configure-vm-aws.sh: env-to-grains "runtime_config"
cluster/aws/templates/configure-vm-aws.sh: kubelet_api_servers: '${KUBELET_APISERVER}'
cluster/centos/util.sh: local node_ip=${node#*@}
cluster/gce/config-default.sh:# reloads <os_distro>/helper.sh in the gap between when the master is created
cluster/gce/configure-vm.sh: advertise_address: '${EXTERNAL_IP}'
cluster/gce/configure-vm.sh: api_servers: '${KUBERNETES_MASTER_NAME}'
cluster/gce/configure-vm.sh: cloud_config: ${CLOUD_CONFIG}
Expand Down