From dd59aa1c3b47836774b0d04b6e6d20bf05b051d7 Mon Sep 17 00:00:00 2001 From: Yifan Gu Date: Thu, 29 Dec 2016 15:10:06 -0800 Subject: [PATCH 1/2] cluster/gce: Rename coreos to container-linux. --- build/lib/release.sh | 2 +- cluster/common.sh | 22 +++++++++---------- cluster/gce/config-default.sh | 7 ++++++ cluster/gce/config-test.sh | 7 ++++++ .../gce/{coreos => container-linux}/OWNERS | 0 cluster/gce/container-linux/README.md | 8 +++++++ .../configure-helper.sh | 1 - .../{coreos => container-linux}/configure.sh | 4 ++-- .../health-monitor.sh | 0 .../gce/{coreos => container-linux}/helper.sh | 2 +- .../master-helper.sh | 6 ++--- .../{coreos => container-linux}/master.yaml | 0 .../node-helper.sh | 8 +++---- .../gce/{coreos => container-linux}/node.yaml | 0 cluster/gce/coreos/README.md | 8 ------- cluster/gce/util.sh | 6 ++--- .../salt/kube-addons/kube-addon-manager.yaml | 1 - 17 files changed, 47 insertions(+), 35 deletions(-) rename cluster/gce/{coreos => container-linux}/OWNERS (100%) create mode 100644 cluster/gce/container-linux/README.md rename cluster/gce/{coreos => container-linux}/configure-helper.sh (99%) rename cluster/gce/{coreos => container-linux}/configure.sh (97%) rename cluster/gce/{coreos => container-linux}/health-monitor.sh (100%) rename cluster/gce/{coreos => container-linux}/helper.sh (89%) rename cluster/gce/{coreos => container-linux}/master-helper.sh (92%) rename cluster/gce/{coreos => container-linux}/master.yaml (100%) rename cluster/gce/{coreos => container-linux}/node-helper.sh (77%) rename cluster/gce/{coreos => container-linux}/node.yaml (100%) delete mode 100644 cluster/gce/coreos/README.md diff --git a/build/lib/release.sh b/build/lib/release.sh index ee9b12c6c6a..b6dc998a1f8 100644 --- a/build/lib/release.sh +++ b/build/lib/release.sh @@ -376,7 +376,7 @@ function kube::release::package_kube_manifests_tarball() { cp "${KUBE_ROOT}/cluster/gce/gci/configure-helper.sh" "${dst_dir}/gci-configure-helper.sh" cp "${KUBE_ROOT}/cluster/gce/gci/mounter/mounter" "${dst_dir}/gci-mounter" cp "${KUBE_ROOT}/cluster/gce/gci/health-monitor.sh" "${dst_dir}/health-monitor.sh" - cp "${KUBE_ROOT}/cluster/gce/coreos/configure-helper.sh" "${dst_dir}/coreos-configure-helper.sh" + cp "${KUBE_ROOT}/cluster/gce/container-linux/configure-helper.sh" "${dst_dir}/container-linux-configure-helper.sh" cp -r "${salt_dir}/kube-admission-controls/limit-range" "${dst_dir}" local objects objects=$(cd "${KUBE_ROOT}/cluster/addons" && find . \( -name \*.yaml -or -name \*.yaml.in -or -name \*.json \) | grep -v demo) diff --git a/cluster/common.sh b/cluster/common.sh index 4bfab9e0b5a..d06e40eccd3 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -439,10 +439,10 @@ function find-release-tars() { exit 1 fi - # This tarball is used by GCI, Ubuntu Trusty, and CoreOS. + # This tarball is used by GCI, Ubuntu Trusty, and Container Linux. KUBE_MANIFESTS_TAR= - if [[ "${MASTER_OS_DISTRIBUTION:-}" == "trusty" || "${MASTER_OS_DISTRIBUTION:-}" == "gci" || "${MASTER_OS_DISTRIBUTION:-}" == "coreos" ]] || \ - [[ "${NODE_OS_DISTRIBUTION:-}" == "trusty" || "${NODE_OS_DISTRIBUTION:-}" == "gci" || "${NODE_OS_DISTRIBUTION:-}" == "coreos" ]] ; then + if [[ "${MASTER_OS_DISTRIBUTION:-}" == "trusty" || "${MASTER_OS_DISTRIBUTION:-}" == "gci" || "${MASTER_OS_DISTRIBUTION:-}" == "container-linux" ]] || \ + [[ "${NODE_OS_DISTRIBUTION:-}" == "trusty" || "${NODE_OS_DISTRIBUTION:-}" == "gci" || "${NODE_OS_DISTRIBUTION:-}" == "container-linux" ]] ; then 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" @@ -573,9 +573,9 @@ function build-kube-env { local server_binary_tar_url=$SERVER_BINARY_TAR_URL local salt_tar_url=$SALT_TAR_URL local kube_manifests_tar_url="${KUBE_MANIFESTS_TAR_URL:-}" - if [[ "${master}" == "true" && "${MASTER_OS_DISTRIBUTION}" == "coreos" ]] || \ - [[ "${master}" == "false" && "${NODE_OS_DISTRIBUTION}" == "coreos" ]] ; then - # TODO: Support fallback .tar.gz settings on CoreOS + if [[ "${master}" == "true" && "${MASTER_OS_DISTRIBUTION}" == "container-linux" ]] || \ + [[ "${master}" == "false" && "${NODE_OS_DISTRIBUTION}" == "container-linux" ]] ; then + # TODO: Support fallback .tar.gz settings on Container Linux server_binary_tar_url=$(split_csv "${SERVER_BINARY_TAR_URL}") salt_tar_url=$(split_csv "${SALT_TAR_URL}") kube_manifests_tar_url=$(split_csv "${KUBE_MANIFESTS_TAR_URL}") @@ -655,8 +655,8 @@ EOF TERMINATED_POD_GC_THRESHOLD: $(yaml-quote ${TERMINATED_POD_GC_THRESHOLD}) EOF fi - if [[ "${master}" == "true" && ("${MASTER_OS_DISTRIBUTION}" == "trusty" || "${MASTER_OS_DISTRIBUTION}" == "gci" || "${MASTER_OS_DISTRIBUTION}" == "coreos") ]] || \ - [[ "${master}" == "false" && ("${NODE_OS_DISTRIBUTION}" == "trusty" || "${NODE_OS_DISTRIBUTION}" == "gci" || "${NODE_OS_DISTRIBUTION}" == "coreos") ]] ; then + if [[ "${master}" == "true" && ("${MASTER_OS_DISTRIBUTION}" == "trusty" || "${MASTER_OS_DISTRIBUTION}" == "gci" || "${MASTER_OS_DISTRIBUTION}" == "container-linux") ]] || \ + [[ "${master}" == "false" && ("${NODE_OS_DISTRIBUTION}" == "trusty" || "${NODE_OS_DISTRIBUTION}" == "gci" || "${NODE_OS_DISTRIBUTION}" == "container-linux") ]] ; then cat >>$file <>$file <> /etc/hosts echo "::1 localhost" >> /etc/hosts diff --git a/cluster/gce/coreos/health-monitor.sh b/cluster/gce/container-linux/health-monitor.sh similarity index 100% rename from cluster/gce/coreos/health-monitor.sh rename to cluster/gce/container-linux/health-monitor.sh diff --git a/cluster/gce/coreos/helper.sh b/cluster/gce/container-linux/helper.sh similarity index 89% rename from cluster/gce/coreos/helper.sh rename to cluster/gce/container-linux/helper.sh index 714f49d231c..ddd45791266 100755 --- a/cluster/gce/coreos/helper.sh +++ b/cluster/gce/container-linux/helper.sh @@ -14,6 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# A library of helper functions and constants for the CoreOS distro +# A library of helper functions and constants for the Container Linux distro. # This file intentionally left blank diff --git a/cluster/gce/coreos/master-helper.sh b/cluster/gce/container-linux/master-helper.sh similarity index 92% rename from cluster/gce/coreos/master-helper.sh rename to cluster/gce/container-linux/master-helper.sh index c43ce748510..1d250d5ef27 100755 --- a/cluster/gce/coreos/master-helper.sh +++ b/cluster/gce/container-linux/master-helper.sh @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# A library of helper functions and constant for coreos os distro -source "${KUBE_ROOT}/cluster/gce/coreos/helper.sh" +# A library of helper functions and constant for the Container Linux distro. +source "${KUBE_ROOT}/cluster/gce/container-linux/helper.sh" # create-master-instance creates the master instance. If called with # an argument, the argument is used as the name to a reserved IP @@ -85,7 +85,7 @@ function create-master-instance-internal() { --scopes "storage-ro,compute-rw,monitoring,logging-write" \ --can-ip-forward \ --metadata-from-file \ - "kube-env=${KUBE_TEMP}/master-kube-env.yaml,user-data=${KUBE_ROOT}/cluster/gce/coreos/master.yaml,configure-sh=${KUBE_ROOT}/cluster/gce/coreos/configure.sh,cluster-name=${KUBE_TEMP}/cluster-name.txt" \ + "kube-env=${KUBE_TEMP}/master-kube-env.yaml,user-data=${KUBE_ROOT}/cluster/gce/container-linux/master.yaml,configure-sh=${KUBE_ROOT}/cluster/gce/container-linux/configure.sh,cluster-name=${KUBE_TEMP}/cluster-name.txt" \ --disk "name=${master_name}-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no" \ --boot-disk-size "${MASTER_ROOT_DISK_SIZE:-30}" \ ${preemptible_master} diff --git a/cluster/gce/coreos/master.yaml b/cluster/gce/container-linux/master.yaml similarity index 100% rename from cluster/gce/coreos/master.yaml rename to cluster/gce/container-linux/master.yaml diff --git a/cluster/gce/coreos/node-helper.sh b/cluster/gce/container-linux/node-helper.sh similarity index 77% rename from cluster/gce/coreos/node-helper.sh rename to cluster/gce/container-linux/node-helper.sh index 347a41524d5..784d36af05a 100755 --- a/cluster/gce/coreos/node-helper.sh +++ b/cluster/gce/container-linux/node-helper.sh @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# A library of helper functions and constant for the CoreOS distro -source "${KUBE_ROOT}/cluster/gce/coreos/helper.sh" +# A library of helper functions and constant for the Container Linux distro. +source "${KUBE_ROOT}/cluster/gce/container-linux/helper.sh" # $1: template name (required). function create-node-instance-template { @@ -23,8 +23,8 @@ function create-node-instance-template { create-node-template "$template_name" "${scope_flags[*]}" \ "kube-env=${KUBE_TEMP}/node-kube-env.yaml" \ - "user-data=${KUBE_ROOT}/cluster/gce/coreos/node.yaml" \ - "configure-sh=${KUBE_ROOT}/cluster/gce/coreos/configure.sh" \ + "user-data=${KUBE_ROOT}/cluster/gce/container-linux/node.yaml" \ + "configure-sh=${KUBE_ROOT}/cluster/gce/container-linux/configure.sh" \ "cluster-name=${KUBE_TEMP}/cluster-name.txt" # TODO(euank): We should include update-strategy here. We should also switch to ignition } diff --git a/cluster/gce/coreos/node.yaml b/cluster/gce/container-linux/node.yaml similarity index 100% rename from cluster/gce/coreos/node.yaml rename to cluster/gce/container-linux/node.yaml diff --git a/cluster/gce/coreos/README.md b/cluster/gce/coreos/README.md deleted file mode 100644 index e285379d437..00000000000 --- a/cluster/gce/coreos/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# CoreOS image - -The [CoreOS operating system](https://coreos.com/why/) is a Linux distribution optimized for running containers securely at scale. -CoreOS provides [an image](https://coreos.com/os/docs/latest/booting-on-google-compute-engine.html) for Google Cloud Platform (GCP). - -This folder contains configuration and tooling to allow kube-up to create a Kubernetes cluster on Google Cloud Platform running on the official CoreOS image. - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/gce/coreos/README.md?pixel)]() diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index be85fd853e3..436deb50c1d 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -23,14 +23,14 @@ source "${KUBE_ROOT}/cluster/gce/${KUBE_CONFIG_FILE-"config-default.sh"}" source "${KUBE_ROOT}/cluster/common.sh" source "${KUBE_ROOT}/cluster/lib/util.sh" -if [[ "${NODE_OS_DISTRIBUTION}" == "debian" || "${NODE_OS_DISTRIBUTION}" == "coreos" || "${NODE_OS_DISTRIBUTION}" == "trusty" || "${NODE_OS_DISTRIBUTION}" == "gci" ]]; then +if [[ "${NODE_OS_DISTRIBUTION}" == "debian" || "${NODE_OS_DISTRIBUTION}" == "container-linux" || "${NODE_OS_DISTRIBUTION}" == "trusty" || "${NODE_OS_DISTRIBUTION}" == "gci" ]]; then source "${KUBE_ROOT}/cluster/gce/${NODE_OS_DISTRIBUTION}/node-helper.sh" else echo "Cannot operate on cluster using node os distro: ${NODE_OS_DISTRIBUTION}" >&2 exit 1 fi -if [[ "${MASTER_OS_DISTRIBUTION}" == "debian" || "${MASTER_OS_DISTRIBUTION}" == "coreos" || "${MASTER_OS_DISTRIBUTION}" == "trusty" || "${MASTER_OS_DISTRIBUTION}" == "gci" ]]; then +if [[ "${MASTER_OS_DISTRIBUTION}" == "debian" || "${MASTER_OS_DISTRIBUTION}" == "container-linux" || "${MASTER_OS_DISTRIBUTION}" == "trusty" || "${MASTER_OS_DISTRIBUTION}" == "gci" ]]; then source "${KUBE_ROOT}/cluster/gce/${MASTER_OS_DISTRIBUTION}/master-helper.sh" else echo "Cannot operate on cluster using master os distro: ${MASTER_OS_DISTRIBUTION}" >&2 @@ -1666,7 +1666,7 @@ function check-resources() { # $1 - whether prepare push to node function prepare-push() { local node="${1-}" - #TODO(dawnchen): figure out how to upgrade coreos node + #TODO(dawnchen): figure out how to upgrade a Container Linux node if [[ "${node}" == "true" && "${NODE_OS_DISTRIBUTION}" != "debian" ]]; then echo "Updating nodes in a kubernetes cluster with ${NODE_OS_DISTRIBUTION} is not supported yet." >&2 exit 1 diff --git a/cluster/saltbase/salt/kube-addons/kube-addon-manager.yaml b/cluster/saltbase/salt/kube-addons/kube-addon-manager.yaml index 05316f36e78..542afdb9e5a 100644 --- a/cluster/saltbase/salt/kube-addons/kube-addon-manager.yaml +++ b/cluster/saltbase/salt/kube-addons/kube-addon-manager.yaml @@ -12,7 +12,6 @@ spec: # When updating version also bump it in: # - cluster/images/hyperkube/static-pods/addon-manager-singlenode.json # - cluster/images/hyperkube/static-pods/addon-manager-multinode.json - # - cluster/gce/coreos/kube-manifests/kube-addon-manager.yaml image: gcr.io/google-containers/kube-addon-manager:v6.1 command: - /bin/bash From 9a86ed33e5d3a54b28be226762ea69cfe3699165 Mon Sep 17 00:00:00 2001 From: Yifan Gu Date: Fri, 30 Dec 2016 14:47:58 -0800 Subject: [PATCH 2/2] hack/verify-flags/exceptions.txt: Update the exceptions. Run hack/verify-flags-underscore.py -e > hack/verify-flags/exceptions.txt --- hack/verify-flags/exceptions.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hack/verify-flags/exceptions.txt b/hack/verify-flags/exceptions.txt index 7ce2ed1defd..3e7749b7db7 100644 --- a/hack/verify-flags/exceptions.txt +++ b/hack/verify-flags/exceptions.txt @@ -12,9 +12,9 @@ cluster/gce/configure-vm.sh: cloud_config: ${CLOUD_CONFIG} cluster/gce/configure-vm.sh: env-to-grains "feature_gates" cluster/gce/configure-vm.sh: env-to-grains "runtime_config" cluster/gce/configure-vm.sh: kubelet_api_servers: '${KUBELET_APISERVER}' -cluster/gce/coreos/configure-helper.sh: local api_servers="--master=https://${KUBERNETES_MASTER_NAME}" -cluster/gce/coreos/configure-helper.sh: sed -i -e "s@{{ *storage_backend *}}@${STORAGE_BACKEND:-}@g" "${temp_file}" -cluster/gce/coreos/configure-helper.sh: sed -i -e "s@{{pillar\['allow_privileged'\]}}@true@g" "${src_file}" +cluster/gce/container-linux/configure-helper.sh: local api_servers="--master=https://${KUBERNETES_MASTER_NAME}" +cluster/gce/container-linux/configure-helper.sh: sed -i -e "s@{{ *storage_backend *}}@${STORAGE_BACKEND:-}@g" "${temp_file}" +cluster/gce/container-linux/configure-helper.sh: sed -i -e "s@{{pillar\['allow_privileged'\]}}@true@g" "${src_file}" cluster/gce/gci/configure-helper.sh: local api_servers="--master=https://${KUBERNETES_MASTER_NAME}" cluster/gce/gci/configure-helper.sh: sed -i -e "s@{{ *storage_backend *}}@${STORAGE_BACKEND:-}@g" "${temp_file}" cluster/gce/gci/configure-helper.sh: sed -i -e "s@{{pillar\['allow_privileged'\]}}@true@g" "${src_file}" @@ -67,8 +67,6 @@ cluster/ubuntu/util.sh: local node_ip=${1} cluster/vagrant/provision-utils.sh: api_servers: '$(echo "$MASTER_IP" | sed -e "s/'/''/g")' cluster/vagrant/provision-utils.sh: node_ip: '$(echo "$MASTER_IP" | sed -e "s/'/''/g")' cluster/vagrant/provision-utils.sh: runtime_config: '$(echo "$RUNTIME_CONFIG" | sed -e "s/'/''/g")' -cluster/vsphere/templates/salt-master.sh: cloud_config: $CLOUD_CONFIG -cluster/vsphere/templates/salt-minion.sh: cloud_config: $CLOUD_CONFIG examples/cluster-dns/images/frontend/client.py: service_address = socket.gethostbyname(hostname) examples/storage/cassandra/image/files/run.sh: cluster_name \ examples/storage/vitess/env.sh: node_ip=$(get_node_ip)