From d7d0b63094101f71325b362f0f931027db6c3c2e Mon Sep 17 00:00:00 2001 From: Jack Francis Date: Fri, 20 Mar 2020 17:05:30 -0700 Subject: [PATCH 1/3] feat: deprecate CoreOS support --- cmd/generate_test.go | 15 --- docs/topics/clusterdefinitions.md | 4 +- docs/topics/features.md | 4 +- examples/coreos/kubernetes-coreos-hybrid.json | 64 ----------- examples/coreos/kubernetes-coreos.json | 40 ------- .../e2e-tests/kubernetes/coreos/coreos.json | 105 ----------------- parts/k8s/cloud-init/artifacts/cse_config.sh | 9 +- parts/k8s/cloud-init/artifacts/cse_helpers.sh | 5 +- parts/k8s/cloud-init/artifacts/cse_install.sh | 22 +--- parts/k8s/cloud-init/artifacts/cse_main.sh | 13 +-- parts/k8s/cloud-init/masternodecustomdata.yml | 100 +--------------- parts/k8s/cloud-init/nodecustomdata.yml | 60 +--------- pkg/api/addons.go | 8 +- pkg/api/addons_test.go | 28 ----- pkg/api/azenvtypes.go | 12 -- pkg/api/const.go | 2 +- pkg/api/defaults-kubelet_test.go | 2 +- pkg/api/defaults.go | 2 +- pkg/api/mocks.go | 1 - pkg/api/types.go | 20 ---- pkg/api/types_test.go | 107 ------------------ pkg/api/vlabs/const.go | 4 +- pkg/api/vlabs/types.go | 20 ---- pkg/api/vlabs/types_test.go | 24 ---- pkg/api/vlabs/validate.go | 31 ----- pkg/api/vlabs/validate_test.go | 90 +-------------- pkg/armhelpers/support_validator.go | 2 - pkg/engine/template_generator.go | 3 - pkg/engine/virtualmachinescalesets.go | 6 - pkg/engine/vmextensions.go | 6 - 30 files changed, 25 insertions(+), 784 deletions(-) delete mode 100644 examples/coreos/kubernetes-coreos-hybrid.json delete mode 100644 examples/coreos/kubernetes-coreos.json delete mode 100644 examples/e2e-tests/kubernetes/coreos/coreos.json diff --git a/cmd/generate_test.go b/cmd/generate_test.go index d6709ba133..43a3bd792c 100644 --- a/cmd/generate_test.go +++ b/cmd/generate_test.go @@ -360,16 +360,6 @@ func TestExampleAPIModels(t *testing.T) { apiModelPath: "../examples/addons/node-problem-detector/node-problem-detector.json", setArgs: defaultSet, }, - { - name: "coreos", - apiModelPath: "../examples/coreos/kubernetes-coreos.json", - setArgs: defaultSet, - }, - { - name: "coreos hybrid", - apiModelPath: "../examples/coreos/kubernetes-coreos-hybrid.json", - setArgs: defaultSet, - }, { name: "cosmos etcd", apiModelPath: "../examples/cosmos-etcd/kubernetes-3-masters-cosmos.json", @@ -795,11 +785,6 @@ func TestExampleAPIModels(t *testing.T) { apiModelPath: "../examples/kubernetes-non-vhd-distros.json", setArgs: defaultSet, }, - { - name: "e2e coreos", - apiModelPath: "../examples/e2e-tests/kubernetes/coreos/coreos.json", - setArgs: defaultSet, - }, { name: "e2e gpu", apiModelPath: "../examples/e2e-tests/kubernetes/gpu-enabled/definition.json", diff --git a/docs/topics/clusterdefinitions.md b/docs/topics/clusterdefinitions.md index 5450eaf03b..d1a50dfeac 100644 --- a/docs/topics/clusterdefinitions.md +++ b/docs/topics/clusterdefinitions.md @@ -682,7 +682,7 @@ Below is a list of sysctl configuration that aks-engine will configure by defaul | imageReference.subscriptionId | no | ID of subscription containing the Linux OS image. Applies only to Shared Image Galleries. All of name, resourceGroup, subscription, gallery, image name, and version must be specified for this scenario. | | imageReference.gallery | no | Name of Shared Image Gallery containing the Linux OS image. Applies only to Shared Image Galleries. All of name, resourceGroup, subscription, gallery, image name, and version must be specified for this scenario. | | imageReference.version | no | Version containing the Linux OS image. Applies only to Shared Image Galleries. All of name, resourceGroup, subscription, gallery, image name, and version must be specified for this scenario. | -| distro | no | Specifies the masters' Linux distribution. Currently supported values are: `ubuntu`, `ubuntu-18.04`, `ubuntu-18.04-gen2` (Ubuntu 18.04-LTS running on a [Generation 2 VM](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/generation-2)), `aks-ubuntu-16.04` (previously `aks`), `aks-ubuntu-18.04`, and `coreos` (CoreOS support is currently experimental - [Example of CoreOS Master with CoreOS Agents](../../examples/coreos/kubernetes-coreos.json)). For Azure Public Cloud, Azure US Government Cloud and Azure China Cloud, defaults to `aks-ubuntu-16.04`. For other Sovereign Clouds, the default is `ubuntu-16.04` (There is a [known issue](https://github.com/Azure/aks-engine/issues/761) with `ubuntu-18.04` + Azure CNI). `aks-ubuntu-16.04` is a custom image based on `ubuntu-16.04` that comes with pre-installed software necessary for Kubernetes deployments. | +| distro | no | Specifies the masters' Linux distribution. Currently supported values are: `ubuntu`, `ubuntu-18.04`, `ubuntu-18.04-gen2` (Ubuntu 18.04-LTS running on a [Generation 2 VM](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/generation-2)), `aks-ubuntu-16.04` (previously `aks`), and `aks-ubuntu-18.04`. For Azure Public Cloud, Azure US Government Cloud and Azure China Cloud, defaults to `aks-ubuntu-16.04`. For other Sovereign Clouds, the default is `ubuntu-16.04` (There is a [known issue](https://github.com/Azure/aks-engine/issues/761) with `ubuntu-18.04` + Azure CNI). `aks-ubuntu-16.04` is a custom image based on `ubuntu-16.04` that comes with pre-installed software necessary for Kubernetes deployments. | | customFiles | no | The custom files to be provisioned to the master nodes. Defined as an array of json objects with each defined as `"source":"absolute-local-path", "dest":"absolute-path-on-masternodes"`.[See examples](../../examples/customfiles) | | availabilityProfile | no | Supported values are `AvailabilitySet` (default) and `VirtualMachineScaleSets` (still under development: upgrade not supported; requires Kubernetes clusters version 1.10+ and agent pool availabilityProfile must also be `VirtualMachineScaleSets`). When MasterProfile is using `VirtualMachineScaleSets`, to SSH into a master node, you need to use `ssh -p 50001` instead of port 22. | | agentVnetSubnetId | only required when using custom VNET and when MasterProfile is using `VirtualMachineScaleSets` | Specifies the Id of an alternate VNET subnet for all the agent pool nodes. The subnet id must specify a valid VNET ID owned by the same subscription. ([bring your own VNET examples](../../examples/vnet)). When MasterProfile is using `VirtualMachineScaleSets`, this value should be the subnetId of the subnet for all agent pool nodes. | @@ -717,7 +717,7 @@ A cluster can have 0 to 12 agent pool profiles. Agent Pool Profiles are used for | imageReference.name | no | The name of a a Linux OS image. Needs to be used in conjunction with resourceGroup, below | | imageReference.resourceGroup | no | Resource group that contains the Linux OS image. Needs to be used in conjunction with name, above | | osType | no | Specifies the agent pool's Operating System. Supported values are `Windows` and `Linux`. Defaults to `Linux` | -| distro | no | Specifies the masters' Linux distribution. Currently supported values are: `ubuntu`, `ubuntu-18.04`, `aks-ubuntu-16.04` (previously `aks`), `aks-ubuntu-18.04`, `ubuntu-18.04-gen2` (Ubuntu 18.04-LTS running on a [Generation 2 VM](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/generation-2)), and `coreos` (CoreOS support is currently experimental - [Example of CoreOS Master with CoreOS Agents](../../examples/coreos/kubernetes-coreos.json)). For Azure Public Cloud, Azure US Government Cloud and Azure China Cloud, defaults to `aks-ubuntu-16.04`. For Sovereign Clouds, the default is `ubuntu-16.04` (There is a [known issue](https://github.com/Azure/aks-engine/issues/761) with `ubuntu-18.04` + Azure CNI). `aks-ubuntu-16.04` is a custom image based on `ubuntu-16.04` that comes with pre-installed software necessary for Kubernetes deployments. | +| distro | no | Specifies the masters' Linux distribution. Currently supported values are: `ubuntu`, `ubuntu-18.04`, `aks-ubuntu-16.04` (previously `aks`), `aks-ubuntu-18.04`, and `ubuntu-18.04-gen2` (Ubuntu 18.04-LTS running on a [Generation 2 VM](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/generation-2)). For Azure Public Cloud, Azure US Government Cloud and Azure China Cloud, defaults to `aks-ubuntu-16.04`. For Sovereign Clouds, the default is `ubuntu-16.04` (There is a [known issue](https://github.com/Azure/aks-engine/issues/761) with `ubuntu-18.04` + Azure CNI). `aks-ubuntu-16.04` is a custom image based on `ubuntu-16.04` that comes with pre-installed software necessary for Kubernetes deployments. | | acceleratedNetworkingEnabled | no | Use [Azure Accelerated Networking](https://azure.microsoft.com/en-us/blog/maximize-your-vm-s-performance-with-accelerated-networking-now-generally-available-for-both-windows-and-linux/) feature for Linux agents (You must select a VM SKU that supports Accelerated Networking). Defaults to `true` if the VM SKU selected supports Accelerated Networking | | acceleratedNetworkingEnabledWindows | no | Currently unstable, and disabled for new clusters! | | vmssOverProvisioningEnabled | no | Use [Overprovisioning](https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-design-overview#overprovisioning) with VMSS. This configuration is only valid on an agent pool with an `"availabilityProfile"` value of `"VirtualMachineScaleSets"`. Defaults to `false` | diff --git a/docs/topics/features.md b/docs/topics/features.md index a2d377ae9e..e3cf815b1c 100644 --- a/docs/topics/features.md +++ b/docs/topics/features.md @@ -466,7 +466,7 @@ az ad sp list --spn ## Use a Shared Image Gallery image -This is possible by specifying `imageReference` under `masterProfile` or on a given `agentPoolProfile`. It also requires setting the distro to an appropriate value (`ubuntu` or `coreos`). When using `imageReference` with Shared Image Galleries, provide an image name and version, as well as the resource group, subscription, and name of the gallery. Example: +This is possible by specifying `imageReference` under `masterProfile` or on a given `agentPoolProfile`. It also requires setting the distro to an appropriate value (e.g., `ubuntu`). When using `imageReference` with Shared Image Galleries, provide an image name and version, as well as the resource group, subscription, and name of the gallery. Example: ```json { @@ -573,4 +573,4 @@ These parameters are all required. As of March 3, 2020, the ContainerD and network plugin repos don't have public builds available. This repo has a script that will build them from source and create two ZIP files: [build-windows-containerd.sh](../../scripts/build-windows-containerd.sh) -Upload these ZIP files to a location that your cluster will be able to reach, then put those URLs in `windowsContainerdURL` and `windowsSdnPluginURL` in the AKS-Engine apimodel shown above. \ No newline at end of file +Upload these ZIP files to a location that your cluster will be able to reach, then put those URLs in `windowsContainerdURL` and `windowsSdnPluginURL` in the AKS-Engine apimodel shown above. diff --git a/examples/coreos/kubernetes-coreos-hybrid.json b/examples/coreos/kubernetes-coreos-hybrid.json deleted file mode 100644 index 1b5efd51c0..0000000000 --- a/examples/coreos/kubernetes-coreos-hybrid.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "apiVersion": "vlabs", - "properties": { - "orchestratorProfile": { - "orchestratorType": "Kubernetes", - "kubernetesConfig": { - "networkPlugin": "kubenet" - } - }, - "masterProfile": { - "count": 1, - "dnsPrefix": "", - "vmSize": "Standard_D2_v3", - "distro": "coreos" - }, - "agentPoolProfiles": [ - { - "name": "ubuntupool", - "count": 2, - "vmSize": "Standard_D2_v3", - "availabilityProfile": "AvailabilitySet", - "distro": "ubuntu" - }, - { - "name": "coreospool", - "count": 2, - "vmSize": "Standard_D2_v3", - "availabilityProfile": "AvailabilitySet", - "distro": "coreos" - }, - { - "name": "windowspool", - "count": 2, - "vmSize": "Standard_D2_v3", - "availabilityProfile": "AvailabilitySet", - "osType": "Windows" - }, - { - "name": "ubuntupool2", - "count": 1, - "vmSize": "Standard_D2_v3", - "availabilityProfile": "AvailabilitySet" - } - ], - "windowsProfile": { - "adminUsername": "azureuser", - "adminPassword": "replacepassword1234$" - }, - "linuxProfile": { - "adminUsername": "azureuser", - "ssh": { - "publicKeys": [ - { - "keyData": "" - } - ] - } - }, - "servicePrincipalProfile": { - "clientId": "", - "secret": "" - } - } -} diff --git a/examples/coreos/kubernetes-coreos.json b/examples/coreos/kubernetes-coreos.json deleted file mode 100644 index 01d5f0cc1a..0000000000 --- a/examples/coreos/kubernetes-coreos.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "apiVersion": "vlabs", - "properties": { - "orchestratorProfile": { - "orchestratorType": "Kubernetes", - "kubernetesConfig": { - "networkPlugin": "kubenet" - } - }, - "masterProfile": { - "count": 1, - "dnsPrefix": "", - "vmSize": "Standard_D2_v3", - "distro": "coreos" - }, - "agentPoolProfiles": [ - { - "name": "agentpool1", - "count": 3, - "vmSize": "Standard_D2_v3", - "availabilityProfile": "AvailabilitySet", - "distro": "coreos" - } - ], - "linuxProfile": { - "adminUsername": "azureuser", - "ssh": { - "publicKeys": [ - { - "keyData": "" - } - ] - } - }, - "servicePrincipalProfile": { - "clientId": "", - "secret": "" - } - } -} diff --git a/examples/e2e-tests/kubernetes/coreos/coreos.json b/examples/e2e-tests/kubernetes/coreos/coreos.json deleted file mode 100644 index b1f165b92b..0000000000 --- a/examples/e2e-tests/kubernetes/coreos/coreos.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "apiVersion": "vlabs", - "properties": { - "orchestratorProfile": { - "orchestratorType": "Kubernetes", - "kubernetesConfig": { - "clusterSubnet": "10.239.0.0/16", - "addons": [ - { - "name": "tiller", - "enabled": true, - "config": { - "max-history": "10" - }, - "containers": [ - { - "name": "tiller", - "cpuRequests": "1", - "memoryRequests": "1Gi", - "cpuLimits": "1", - "memoryLimits": "1Gi" - } - ] - }, - { - "name": "kubernetes-dashboard", - "enabled": true, - "containers": [ - { - "name": "kubernetes-dashboard", - "cpuRequests": "50m", - "memoryRequests": "512Mi", - "cpuLimits": "50m", - "memoryLimits": "512Mi" - } - ] - }, - { - "name": "rescheduler", - "enabled": true, - "containers": [ - { - "name": "rescheduler", - "cpuRequests": "20m", - "memoryRequests": "200Mi", - "cpuLimits": "20m", - "memoryLimits": "200Mi" - } - ] - }, - { - "name": "keyvault-flexvolume", - "enabled": false - }, - { - "name": "blobfuse-flexvolume", - "enabled": false - } - ] - } - }, - "masterProfile": { - "count": 3, - "dnsPrefix": "", - "vmSize": "Standard_D2_v3", - "OSDiskSizeGB": 200, - "vnetSubnetId": "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/virtualNetworks/VNET_NAME/subnets/SUBNET_NAME", - "firstConsecutiveStaticIP": "10.239.255.239", - "vnetCidr": "10.239.0.0/16", - "distro": "coreos" - }, - "agentPoolProfiles": [ - { - "name": "agentmd", - "count": 3, - "distro": "coreos", - "vmSize": "Standard_D2_v3", - "OSDiskSizeGB": 200, - "storageProfile": "ManagedDisks", - "diskSizesGB": [ - 128, - 128, - 128, - 128 - ], - "availabilityProfile": "AvailabilitySet", - "vnetSubnetId": "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/virtualNetworks/VNET_NAME/subnets/SUBNET_NAME" - } - ], - "linuxProfile": { - "adminUsername": "azureuser", - "ssh": { - "publicKeys": [ - { - "keyData": "" - } - ] - } - }, - "servicePrincipalProfile": { - "clientId": "", - "secret": "" - } - } -} diff --git a/parts/k8s/cloud-init/artifacts/cse_config.sh b/parts/k8s/cloud-init/artifacts/cse_config.sh index 30e3c1d2ab..52d9b6701f 100755 --- a/parts/k8s/cloud-init/artifacts/cse_config.sh +++ b/parts/k8s/cloud-init/artifacts/cse_config.sh @@ -1,11 +1,7 @@ #!/bin/bash NODE_INDEX=$(hostname | tail -c 2) NODE_NAME=$(hostname) -if [[ $OS == $COREOS_OS_NAME ]]; then - PRIVATE_IP=$(ip a show eth0 | grep -Po 'inet \K[\d.]+') -else - PRIVATE_IP=$(hostname -I | cut -d' ' -f1) -fi +PRIVATE_IP=$(hostname -I | cut -d' ' -f1) ETCD_PEER_URL="https://${PRIVATE_IP}:2380" ETCD_CLIENT_URL="https://${PRIVATE_IP}:2379" @@ -256,9 +252,6 @@ ensureDocker() { wait_for_file 1200 1 $DOCKER_SERVICE_EXEC_START_FILE || exit $ERR_FILE_WATCH_TIMEOUT usermod -aG docker ${ADMINUSER} DOCKER_MOUNT_FLAGS_SYSTEMD_FILE=/etc/systemd/system/docker.service.d/clear_mount_propagation_flags.conf - if [[ $OS != $COREOS_OS_NAME ]]; then - wait_for_file 1200 1 $DOCKER_MOUNT_FLAGS_SYSTEMD_FILE || exit $ERR_FILE_WATCH_TIMEOUT - fi DOCKER_JSON_FILE=/etc/docker/daemon.json for i in $(seq 1 1200); do if [ -s $DOCKER_JSON_FILE ]; then diff --git a/parts/k8s/cloud-init/artifacts/cse_helpers.sh b/parts/k8s/cloud-init/artifacts/cse_helpers.sh index 522c153397..98e079da1f 100755 --- a/parts/k8s/cloud-init/artifacts/cse_helpers.sh +++ b/parts/k8s/cloud-init/artifacts/cse_helpers.sh @@ -65,12 +65,11 @@ ERR_BCC_INSTALL_TIMEOUT=168 ERR_BPFTRACE_BIN_DOWNLOAD_FAIL=169 ERR_BPFTRACE_TOOLS_DOWNLOAD_FAIL=170 -OS=$(sort -r /etc/*-release | gawk 'match($0, /^(ID_LIKE=(coreos)|ID=(.*))$/, a) { print toupper(a[2] a[3]); exit }') +OS=$(sort -r /etc/*-release | gawk 'match($0, /^(ID=(.*))$/, a) { print toupper(a[2] a[3]); exit }') UBUNTU_OS_NAME="UBUNTU" RHEL_OS_NAME="RHEL" -COREOS_OS_NAME="COREOS" DEBIAN_OS_NAME="DEBIAN" -if ! echo "${UBUNTU_OS_NAME} ${RHEL_OS_NAME} ${COREOS_OS_NAME} ${DEBIAN_OS_NAME}" | grep -q "${OS}"; then +if ! echo "${UBUNTU_OS_NAME} ${RHEL_OS_NAME} ${DEBIAN_OS_NAME}" | grep -q "${OS}"; then OS=$(sort -r /etc/*-release | gawk 'match($0, /^(ID_LIKE=(.*))$/, a) { print toupper(a[2] a[3]); exit }') fi KUBECTL=/usr/local/bin/kubectl diff --git a/parts/k8s/cloud-init/artifacts/cse_install.sh b/parts/k8s/cloud-init/artifacts/cse_install.sh index c4bc2bb529..906bf82d0a 100755 --- a/parts/k8s/cloud-init/artifacts/cse_install.sh +++ b/parts/k8s/cloud-init/artifacts/cse_install.sh @@ -13,11 +13,7 @@ UBUNTU_RELEASE=$(lsb_release -r -s) UBUNTU_CODENAME=$(lsb_release -c -s) removeEtcd() { - if [[ $OS == $COREOS_OS_NAME ]]; then - rm -rf /opt/bin/etcd - else - rm -rf /usr/bin/etcd - fi + rm -rf /usr/bin/etcd } removeMoby() { @@ -37,11 +33,7 @@ installEtcd() { CURRENT_VERSION=$(etcd --version | grep "etcd Version" | cut -d ":" -f 2 | tr -d '[:space:]') if [[ "$CURRENT_VERSION" != "${ETCD_VERSION}" ]]; then CLI_TOOL=$1 - if [[ $OS == $COREOS_OS_NAME ]]; then - path="/opt/bin" - else - path="/usr/bin" - fi + local path="/usr/bin" CONTAINER_IMAGE=${ETCD_DOWNLOAD_URL}etcd:v${ETCD_VERSION} pullContainerImage $CLI_TOOL ${CONTAINER_IMAGE} removeEtcd @@ -331,14 +323,8 @@ extractHyperkube() { img unpack -o "$path" ${HYPERKUBE_URL} fi - if [[ $OS == $COREOS_OS_NAME ]]; then - cp "$path/hyperkube" "/opt/kubelet" - mv "$path/hyperkube" "/opt/kubectl" - chmod a+x /opt/kubelet /opt/kubectl - else - cp "$path/hyperkube" "/usr/local/bin/kubelet-${KUBERNETES_VERSION}" - mv "$path/hyperkube" "/usr/local/bin/kubectl-${KUBERNETES_VERSION}" - fi + cp "$path/hyperkube" "/usr/local/bin/kubelet-${KUBERNETES_VERSION}" + mv "$path/hyperkube" "/usr/local/bin/kubectl-${KUBERNETES_VERSION}" } extractKubeBinaries() { diff --git a/parts/k8s/cloud-init/artifacts/cse_main.sh b/parts/k8s/cloud-init/artifacts/cse_main.sh index 4ed9f1d292..3caea99a60 100755 --- a/parts/k8s/cloud-init/artifacts/cse_main.sh +++ b/parts/k8s/cloud-init/artifacts/cse_main.sh @@ -46,11 +46,6 @@ ETCD_PEER_CERT=$(echo ${ETCD_PEER_CERTIFICATES} | cut -d'[' -f 2 | cut -d']' -f ETCD_PEER_KEY=$(echo ${ETCD_PEER_PRIVATE_KEYS} | cut -d'[' -f 2 | cut -d']' -f 1 | cut -d',' -f $((${NODE_INDEX}+1))) set -x -if [[ $OS == $COREOS_OS_NAME ]]; then - echo "Changing default kubectl bin location" - KUBECTL=/opt/kubectl -fi - if [ -f /var/run/reboot-required ]; then REBOOTREQUIRED=true trace_info "RebootRequired" "reboot=true" @@ -110,9 +105,7 @@ if [[ "$FULL_INSTALL_REQUIRED" = "true" ]]; then time_metric "InstallBpftrace" installBpftrace fi -{{- if not HasCoreOS}} time_metric "InstallContainerRuntime" installContainerRuntime -{{end}} {{- if NeedsContainerd}} time_metric "InstallContainerd" installContainerd @@ -144,11 +137,7 @@ docker login -u $SERVICE_PRINCIPAL_CLIENT_ID -p $SERVICE_PRINCIPAL_CLIENT_SECRET {{end}} time_metric "InstallKubeletAndKubectl" installKubeletAndKubectl - -if [[ $OS != $COREOS_OS_NAME ]]; then - time_metric "EnsureRPC" ensureRPC -fi - +time_metric "EnsureRPC" ensureRPC time_metric "CreateKubeManifestDir" createKubeManifestDir {{- if HasDCSeriesSKU}} diff --git a/parts/k8s/cloud-init/masternodecustomdata.yml b/parts/k8s/cloud-init/masternodecustomdata.yml index 21d7fdb4db..ae757627d3 100644 --- a/parts/k8s/cloud-init/masternodecustomdata.yml +++ b/parts/k8s/cloud-init/masternodecustomdata.yml @@ -76,11 +76,7 @@ write_files: {{CloudInitData "kubeletSystemdService"}} {{if not .MasterProfile.IsVHDDistro}} - {{if .MasterProfile.IsCoreOS}} -- path: /opt/bin/health-monitor.sh - {{else}} - path: /usr/local/bin/health-monitor.sh - {{end}} permissions: "0544" encoding: gzip owner: root @@ -154,15 +150,13 @@ write_files: {{end}} {{if .OrchestratorProfile.KubernetesConfig.RequiresDocker}} - {{if not .MasterProfile.IsCoreOS}} - {{if not .MasterProfile.IsVHDDistro}} + {{if not .MasterProfile.IsVHDDistro}} - path: /etc/systemd/system/docker.service.d/clear_mount_propagation_flags.conf permissions: "0644" encoding: gzip owner: root content: !!binary | {{CloudInitData "dockerClearMountPropagationFlags"}} - {{end}} {{end}} - path: /etc/systemd/system/docker.service.d/exec_start.conf @@ -171,11 +165,7 @@ write_files: content: | [Service] ExecStart= - {{if .MasterProfile.IsCoreOS}} - ExecStart=/usr/bin/env PATH=${TORCX_BINDIR}:${PATH} ${TORCX_BINDIR}/dockerd --host=fd:// --containerd=/var/run/docker/libcontainerd/docker-containerd.sock --storage-driver=overlay2 --bip={{WrapAsParameter "dockerBridgeCidr"}} $DOCKER_SELINUX $DOCKER_OPTS $DOCKER_CGROUPS $DOCKER_OPT_BIP $DOCKER_OPT_MTU $DOCKER_OPT_IPMASQ - {{else}} ExecStart=/usr/bin/dockerd -H fd:// --storage-driver=overlay2 --bip={{WrapAsParameter "dockerBridgeCidr"}} - {{end}} ExecStartPost=/sbin/iptables -P FORWARD ACCEPT #EOF @@ -413,11 +403,7 @@ MASTER_CONTAINER_ADDONS_PLACEHOLDER #!/bin/bash set -e {{if IsMasterVirtualMachineScaleSets}} - {{if .MasterProfile.IsCoreOS}} - PRIVATE_IP=$(hostname -I | cut -d" " -f1) - {{else}} PRIVATE_IP=$(hostname -i | cut -d" " -f1) - {{end}} sed -i "s||https://$PRIVATE_IP:443|g" "/var/lib/kubelet/kubeconfig" {{end}} {{if gt .MasterProfile.Count 1}} @@ -474,11 +460,7 @@ MASTER_CONTAINER_ADDONS_PLACEHOLDER MASTER_VM_NAME_BASE=$(hostname | sed "s/.$//") MASTER_FIRSTADDR={{WrapAsParameter "firstConsecutiveStaticIP"}} MASTER_INDEX=$(hostname | tail -c 2) - {{if .MasterProfile.IsCoreOS}} - PRIVATE_IP=$(hostname -I | cut -d" " -f1) - {{else}} PRIVATE_IP=$(hostname -i | cut -d" " -f1) - {{end}} MASTER_COUNT={{WrapAsVariable "masterCount"}} IPADDRESS_COUNT={{WrapAsVariable "masterIpAddressCount"}} echo $IPADDRESS_COUNT @@ -527,87 +509,7 @@ MASTER_CONTAINER_ADDONS_PLACEHOLDER {{WrapAsVariable "environmentJSON"}} {{end}} -{{if .MasterProfile.IsCoreOS}} -- path: /opt/azure/containers/provision-setup.sh - permissions: "0755" - owner: root - content: | - #!/bin/bash - source {{GetCSEHelpersScriptFilepath}} - /opt/azure/containers/mountetcd.sh - retrycmd_if_failure 5 5 10 curl --retry 5 --retry-delay 10 --retry-max-time 10 --max-time 60 https://127.0.0.1:2379/v2/machines - - {{if EnableAggregatedAPIs}} - sudo bash /etc/kubernetes/generate-proxy-certs.sh - {{end}} - - touch /opt/azure/containers/runcmd.complete - -- path: "/etc/kubernetes/manifests/.keep" - -{{if .OrchestratorProfile.KubernetesConfig.RequiresDocker}} -groups: - - docker: [{{WrapAsParameter "linuxAdminUsername"}}] -{{end}} - -coreos: - units: - - name: start-provision-setup.service - command: "start" - content: | - [Unit] - Description=Start provision setup service - - [Service] - ExecStart=/opt/azure/containers/provision-setup.sh - - name: kubelet.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Unit] - Requires=rpc-statd.service - After=etcd.service - ConditionPathExists= - ConditionPathExists=/opt/kubelet - [Service] - ExecStart= - ExecStart=/opt/kubelet \ - --enable-server \ - --node-labels="${KUBELET_NODE_LABELS}" \ - --v=2 \ - --volume-plugin-dir=/etc/kubernetes/volumeplugins \ - $KUBELET_CONFIG $KUBELET_OPTS \ - $KUBELET_REGISTER_NODE $KUBELET_REGISTER_WITH_TAINTS - - name: kubelet-monitor.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Service] - ExecStart= - ExecStart=/opt/bin/health-monitor.sh kubelet - - name: docker-monitor.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Service] - ExecStart= - ExecStart=/opt/bin/health-monitor.sh container-runtime - - name: etcd.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Service] - ExecStart= - ExecStart=/opt/bin/etcd $DAEMON_ARGS - - name: etcd-member.service - mask: true -{{else}} runcmd: - set -x - . {{GetCSEHelpersScriptFilepath}} - aptmarkWALinuxAgent hold{{GetKubernetesMasterPreprovisionYaml}} -{{end}} diff --git a/parts/k8s/cloud-init/nodecustomdata.yml b/parts/k8s/cloud-init/nodecustomdata.yml index 54c50b36fe..d11c72de31 100644 --- a/parts/k8s/cloud-init/nodecustomdata.yml +++ b/parts/k8s/cloud-init/nodecustomdata.yml @@ -84,11 +84,7 @@ write_files: {{CloudInitData "kubeletSystemdService"}} {{if not .IsVHDDistro}} - {{if .IsCoreOS}} -- path: /opt/bin/health-monitor.sh - {{else}} - path: /usr/local/bin/health-monitor.sh - {{end}} permissions: "0544" encoding: gzip owner: root @@ -148,15 +144,13 @@ write_files: {{end}} {{if .KubernetesConfig.RequiresDocker}} - {{if not .IsCoreOS}} - {{if not .IsVHDDistro}} + {{if not .IsVHDDistro}} - path: /etc/systemd/system/docker.service.d/clear_mount_propagation_flags.conf permissions: "0644" encoding: gzip owner: "root" content: !!binary | {{CloudInitData "dockerClearMountPropagationFlags"}} - {{end}} {{end}} - path: /etc/systemd/system/docker.service.d/exec_start.conf @@ -165,11 +159,7 @@ write_files: content: | [Service] ExecStart= - {{if .IsCoreOS}} - ExecStart=/usr/bin/env PATH=${TORCX_BINDIR}:${PATH} ${TORCX_BINDIR}/dockerd --host=fd:// --containerd=/var/run/docker/libcontainerd/docker-containerd.sock --storage-driver=overlay2 --bip={{WrapAsParameter "dockerBridgeCidr"}} $DOCKER_SELINUX $DOCKER_OPTS $DOCKER_CGROUPS $DOCKER_OPT_BIP $DOCKER_OPT_MTU $DOCKER_OPT_IPMASQ - {{else}} ExecStart=/usr/bin/dockerd -H fd:// --storage-driver=overlay2 --bip={{WrapAsParameter "dockerBridgeCidr"}} - {{end}} ExecStartPost=/sbin/iptables -P FORWARD ACCEPT #EOF @@ -386,55 +376,7 @@ write_files: {{WrapAsVariable "environmentJSON"}} {{end}} -{{if .IsCoreOS}} -- path: "/etc/kubernetes/manifests/.keep" - -{{if .KubernetesConfig.RequiresDocker}} -groups: - - docker: [{{WrapAsParameter "linuxAdminUsername"}}] -{{end}} - -coreos: - units: - - name: kubelet.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Unit] - Requires=rpc-statd.service - ConditionPathExists= - ConditionPathExists=/opt/kubelet - [Service] - ExecStart= - ExecStart=/opt/kubelet \ - --enable-server \ - --node-labels="${KUBELET_NODE_LABELS}" \ - --v=2 \ - --volume-plugin-dir=/etc/kubernetes/volumeplugins \ - $KUBELET_CONFIG $KUBELET_OPTS \ - $KUBELET_REGISTER_NODE $KUBELET_REGISTER_WITH_TAINTS - - name: kubelet-monitor.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Service] - ExecStart= - ExecStart=/opt/bin/health-monitor.sh kubelet - - name: docker-monitor.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Service] - ExecStart= - ExecStart=/opt/bin/health-monitor.sh container-runtime - - name: rpcbind.service - enable: true -{{else}} runcmd: - set -x - . {{GetCSEHelpersScriptFilepath}} - aptmarkWALinuxAgent hold{{GetKubernetesAgentPreprovisionYaml .}} -{{end}} diff --git a/pkg/api/addons.go b/pkg/api/addons.go index 3f78f36e9a..69585c5f86 100644 --- a/pkg/api/addons.go +++ b/pkg/api/addons.go @@ -160,7 +160,7 @@ func (cs *ContainerService) setAddonsConfig(isUpgrade bool) { defaultBlobfuseFlexVolumeAddonsConfig := KubernetesAddon{ Name: common.BlobfuseFlexVolumeAddonName, - Enabled: to.BoolPtr(DefaultBlobfuseFlexVolumeAddonEnabled && common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.8.0") && !cs.Properties.HasCoreOS() && !cs.Properties.IsAzureStackCloud()), + Enabled: to.BoolPtr(DefaultBlobfuseFlexVolumeAddonEnabled && common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.8.0") && !cs.Properties.IsAzureStackCloud()), Containers: []KubernetesContainerSpec{ { Name: common.BlobfuseFlexVolumeAddonName, @@ -175,7 +175,7 @@ func (cs *ContainerService) setAddonsConfig(isUpgrade bool) { defaultSMBFlexVolumeAddonsConfig := KubernetesAddon{ Name: common.SMBFlexVolumeAddonName, - Enabled: to.BoolPtr(DefaultSMBFlexVolumeAddonEnabled && common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.8.0") && !cs.Properties.HasCoreOS() && !cs.Properties.IsAzureStackCloud()), + Enabled: to.BoolPtr(DefaultSMBFlexVolumeAddonEnabled && common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.8.0") && !cs.Properties.IsAzureStackCloud()), Containers: []KubernetesContainerSpec{ { Name: common.SMBFlexVolumeAddonName, @@ -190,7 +190,7 @@ func (cs *ContainerService) setAddonsConfig(isUpgrade bool) { defaultKeyVaultFlexVolumeAddonsConfig := KubernetesAddon{ Name: common.KeyVaultFlexVolumeAddonName, - Enabled: to.BoolPtr(DefaultKeyVaultFlexVolumeAddonEnabled && !cs.Properties.HasCoreOS() && !cs.Properties.IsAzureStackCloud()), + Enabled: to.BoolPtr(DefaultKeyVaultFlexVolumeAddonEnabled && !cs.Properties.IsAzureStackCloud()), Containers: []KubernetesContainerSpec{ { Name: common.KeyVaultFlexVolumeAddonName, @@ -246,7 +246,7 @@ func (cs *ContainerService) setAddonsConfig(isUpgrade bool) { defaultNVIDIADevicePluginAddonsConfig := KubernetesAddon{ Name: common.NVIDIADevicePluginAddonName, - Enabled: to.BoolPtr(cs.Properties.IsNvidiaDevicePluginCapable() && !cs.Properties.HasCoreOS() && !cs.Properties.IsAzureStackCloud()), + Enabled: to.BoolPtr(cs.Properties.IsNvidiaDevicePluginCapable() && !cs.Properties.IsAzureStackCloud()), Containers: []KubernetesContainerSpec{ { Name: common.NVIDIADevicePluginAddonName, diff --git a/pkg/api/addons_test.go b/pkg/api/addons_test.go index d80692d7fa..ead964da2a 100644 --- a/pkg/api/addons_test.go +++ b/pkg/api/addons_test.go @@ -2085,34 +2085,6 @@ func TestSetAddonsConfig(t *testing.T) { }, }, }, - { - name: "CoreOS addons", - cs: &ContainerService{ - Properties: &Properties{ - OrchestratorProfile: &OrchestratorProfile{ - OrchestratorVersion: "1.15.4", - KubernetesConfig: &KubernetesConfig{ - KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR, - DNSServiceIP: DefaultKubernetesDNSServiceIP, - KubeletConfig: map[string]string{ - "--cluster-domain": "cluster.local", - }, - ClusterSubnet: DefaultKubernetesSubnet, - ProxyMode: KubeProxyModeIPTables, - NetworkPlugin: NetworkPluginAzure, - }, - }, - AgentPoolProfiles: []*AgentPoolProfile{ - { - Distro: CoreOS, - VMSize: "Standard_NC6", // to validate that CoreOS distro does not get nvidia addon - }, - }, - }, - }, - isUpgrade: false, - expectedAddons: omitFromAddons([]string{common.BlobfuseFlexVolumeAddonName, common.KeyVaultFlexVolumeAddonName}, getDefaultAddons("1.15.4", "", common.KubernetesImageBaseTypeGCR)), - }, { name: "azure disk and azure file csi driver enabled for k8s >= 1.13.0 and UseCloudControllerManager is true", cs: &ContainerService{ diff --git a/pkg/api/azenvtypes.go b/pkg/api/azenvtypes.go index 9c8f97f735..f7e847a0ca 100644 --- a/pkg/api/azenvtypes.go +++ b/pkg/api/azenvtypes.go @@ -151,14 +151,6 @@ var ( ImageVersion: "latest", } - //CoreOSImageConfig is the CoreOS Linux distribution. - CoreOSImageConfig = AzureOSImageConfig{ - ImageOffer: "CoreOS", - ImageSku: "Stable", - ImagePublisher: "CoreOS", - ImageVersion: "latest", - } - // AKSUbuntu1604OSImageConfig is the AKS image based on Ubuntu 16.04-LTS. AKSUbuntu1604OSImageConfig = AzureOSImageConfig{ ImageOffer: "aks", @@ -217,7 +209,6 @@ var ( Ubuntu1804: Ubuntu1804OSImageConfig, Ubuntu1804Gen2: Ubuntu1804Gen2OSImageConfig, RHEL: RHELOSImageConfig, - CoreOS: CoreOSImageConfig, AKSUbuntu1604: AKSUbuntu1604OSImageConfig, AKS1604Deprecated: AKSUbuntu1604OSImageConfig, // for back-compat AKSUbuntu1804: AKSUbuntu1804OSImageConfig, @@ -240,7 +231,6 @@ var ( Ubuntu1804: Ubuntu1804OSImageConfig, Ubuntu1804Gen2: Ubuntu1804Gen2OSImageConfig, RHEL: RHELOSImageConfig, - CoreOS: CoreOSImageConfig, AKSUbuntu1604: Ubuntu1604OSImageConfig, AKS1604Deprecated: Ubuntu1604OSImageConfig, // for back-compat AKSUbuntu1804: Ubuntu1604OSImageConfig, // workaround for https://github.com/Azure/aks-engine/issues/761 @@ -262,7 +252,6 @@ var ( Ubuntu1804: Ubuntu1804OSImageConfig, Ubuntu1804Gen2: Ubuntu1804Gen2OSImageConfig, RHEL: RHELOSImageConfig, - CoreOS: CoreOSImageConfig, AKSUbuntu1604: AKSUbuntu1604OSImageConfig, AKS1604Deprecated: AKSUbuntu1604OSImageConfig, // for back-compat AKSUbuntu1804: AKSUbuntu1804OSImageConfig, @@ -310,7 +299,6 @@ var ( Ubuntu1804: Ubuntu1804OSImageConfig, Ubuntu1804Gen2: Ubuntu1804Gen2OSImageConfig, RHEL: RHELOSImageConfig, - CoreOS: CoreOSImageConfig, AKSUbuntu1604: AKSUbuntu1604OSImageConfig, AKS1604Deprecated: AKSUbuntu1604OSImageConfig, // for back-compat AKSUbuntu1804: AKSUbuntu1804OSImageConfig, diff --git a/pkg/api/const.go b/pkg/api/const.go index b82491a3e5..6491786c24 100644 --- a/pkg/api/const.go +++ b/pkg/api/const.go @@ -29,7 +29,7 @@ const ( Ubuntu1804 Distro = "ubuntu-18.04" Ubuntu1804Gen2 Distro = "ubuntu-18.04-gen2" RHEL Distro = "rhel" - CoreOS Distro = "coreos" + CoreOS Distro = "coreos" // deprecated AKS1604Deprecated Distro = "aks" // deprecated AKS 16.04 distro. Equivalent to aks-ubuntu-16.04. AKS1804Deprecated Distro = "aks-1804" // deprecated AKS 18.04 distro. Equivalent to aks-ubuntu-18.04. AKSDockerEngine Distro = "aks-docker-engine" // deprecated docker-engine distro. diff --git a/pkg/api/defaults-kubelet_test.go b/pkg/api/defaults-kubelet_test.go index 8703a67081..83659702ea 100644 --- a/pkg/api/defaults-kubelet_test.go +++ b/pkg/api/defaults-kubelet_test.go @@ -740,7 +740,7 @@ func TestProtectKernelDefaults(t *testing.T) { } // Validate that --protect-kernel-defaults is not enabled for relevant distros - case Ubuntu, Ubuntu1804, Ubuntu1804Gen2, ACC1604, CoreOS: + case Ubuntu, Ubuntu1804, Ubuntu1804Gen2, ACC1604: cs = CreateMockContainerService("testcluster", "1.10.13", 3, 2, false) cs.Properties.MasterProfile.Distro = distro cs.Properties.AgentPoolProfiles[0].Distro = distro diff --git a/pkg/api/defaults.go b/pkg/api/defaults.go index 8eec539ef6..3fab103e14 100644 --- a/pkg/api/defaults.go +++ b/pkg/api/defaults.go @@ -25,7 +25,7 @@ import ( ) // DistroValues is a list of currently supported distros -var DistroValues = []Distro{"", Ubuntu, Ubuntu1804, RHEL, CoreOS, AKSUbuntu1604, AKSUbuntu1804, Ubuntu1804Gen2, ACC1604} +var DistroValues = []Distro{"", Ubuntu, Ubuntu1804, RHEL, AKSUbuntu1604, AKSUbuntu1804, Ubuntu1804Gen2, ACC1604} // PropertiesDefaultsParams is the parameters when we set the properties defaults for ContainerService. type PropertiesDefaultsParams struct { diff --git a/pkg/api/mocks.go b/pkg/api/mocks.go index b0f55b6376..60c6faff21 100644 --- a/pkg/api/mocks.go +++ b/pkg/api/mocks.go @@ -226,7 +226,6 @@ func GetMockPropertiesWithCustomCloudProfile(name string, hasCustomCloudProfile, OSImageConfig: map[Distro]AzureOSImageConfig{ Ubuntu: Ubuntu1604OSImageConfig, RHEL: RHELOSImageConfig, - CoreOS: CoreOSImageConfig, AKSUbuntu1604: AKSUbuntu1604OSImageConfig, }, } diff --git a/pkg/api/types.go b/pkg/api/types.go index 41bb738c96..cf77a6f658 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -834,16 +834,6 @@ type TelemetryProfile struct { ApplicationInsightsKey string `json:"applicationInsightsKey,omitempty"` } -// HasCoreOS returns true if the cluster contains coreos nodes -func (p *Properties) HasCoreOS() bool { - for _, agentPoolProfile := range p.AgentPoolProfiles { - if agentPoolProfile.Distro == CoreOS { - return true - } - } - return false -} - // HasWindows returns true if the cluster contains windows func (p *Properties) HasWindows() bool { for _, agentPoolProfile := range p.AgentPoolProfiles { @@ -1416,11 +1406,6 @@ func (m *MasterProfile) IsRHEL() bool { return m.Distro == RHEL } -// IsCoreOS returns true if the master specified a CoreOS distro -func (m *MasterProfile) IsCoreOS() bool { - return m.Distro == CoreOS -} - // IsVHDDistro returns true if the distro uses VHD SKUs func (m *MasterProfile) IsVHDDistro() bool { return m.Distro == AKSUbuntu1604 || m.Distro == AKSUbuntu1804 @@ -1555,11 +1540,6 @@ func (a *AgentPoolProfile) IsRHEL() bool { return a.OSType == Linux && a.Distro == RHEL } -// IsCoreOS returns true if the agent specified a CoreOS distro -func (a *AgentPoolProfile) IsCoreOS() bool { - return a.OSType == Linux && a.Distro == CoreOS -} - // IsVHDDistro returns true if the distro uses VHD SKUs func (a *AgentPoolProfile) IsVHDDistro() bool { return a.Distro == AKSUbuntu1604 || a.Distro == AKSUbuntu1804 diff --git a/pkg/api/types_test.go b/pkg/api/types_test.go index 93123ed361..903f7ac88a 100644 --- a/pkg/api/types_test.go +++ b/pkg/api/types_test.go @@ -145,9 +145,6 @@ func TestOSType(t *testing.T) { if p.HasWindows() { t.Fatalf("expected HasWindows() to return false but instead returned true") } - if p.HasCoreOS() { - t.Fatalf("expected HasCoreOS() to return false but instead returned true") - } if p.AgentPoolProfiles[0].IsWindows() { t.Fatalf("expected IsWindows() to return false but instead returned true") } @@ -160,69 +157,13 @@ func TestOSType(t *testing.T) { t.Fatalf("expected IsRHEL() to return false but instead returned true") } - if p.AgentPoolProfiles[0].IsCoreOS() { - t.Fatalf("expected IsCoreOS() to return false but instead returned true") - } - if !p.AgentPoolProfiles[1].IsRHEL() { t.Fatalf("expected IsRHEL() to return true but instead returned false") } - if p.AgentPoolProfiles[1].IsCoreOS() { - t.Fatalf("expected IsCoreOS() to return false but instead returned true") - } - if !p.MasterProfile.IsRHEL() { t.Fatalf("expected IsRHEL() to return true but instead returned false") } - - if p.MasterProfile.IsCoreOS() { - t.Fatalf("expected IsCoreOS() to return false but instead returned true") - } - - p.MasterProfile.Distro = CoreOS - p.AgentPoolProfiles[0].OSType = Windows - p.AgentPoolProfiles[1].Distro = CoreOS - - if !p.HasWindows() { - t.Fatalf("expected HasWindows() to return true but instead returned false") - } - - if !p.HasCoreOS() { - t.Fatalf("expected HasCoreOS() to return true but instead returned false") - } - - if !p.AgentPoolProfiles[0].IsWindows() { - t.Fatalf("expected IsWindows() to return true but instead returned false") - } - - if p.AgentPoolProfiles[0].IsLinux() { - t.Fatalf("expected IsLinux() to return false but instead returned true") - } - - if p.AgentPoolProfiles[0].IsRHEL() { - t.Fatalf("expected IsRHEL() to return false but instead returned true") - } - - if p.AgentPoolProfiles[0].IsCoreOS() { - t.Fatalf("expected IsCoreOS() to return false but instead returned true") - } - - if p.AgentPoolProfiles[1].IsRHEL() { - t.Fatalf("expected IsRHEL() to return false but instead returned true") - } - - if !p.AgentPoolProfiles[1].IsCoreOS() { - t.Fatalf("expected IsCoreOS() to return true but instead returned false") - } - - if p.MasterProfile.IsRHEL() { - t.Fatalf("expected IsRHEL() to return false but instead returned true") - } - - if !p.MasterProfile.IsCoreOS() { - t.Fatalf("expected IsCoreOS() to return true but instead returned false") - } } func TestAgentPoolProfileIsVHDDistro(t *testing.T) { @@ -245,13 +186,6 @@ func TestAgentPoolProfileIsVHDDistro(t *testing.T) { }, expected: true, }, - { - name: "coreos distro", - ap: AgentPoolProfile{ - Distro: CoreOS, - }, - expected: false, - }, { name: "ubuntu distro", ap: AgentPoolProfile{ @@ -382,13 +316,6 @@ func TestAgentPoolProfileIsUbuntuNonVHD(t *testing.T) { }, expected: false, }, - { - name: "coreos distro", - ap: AgentPoolProfile{ - Distro: CoreOS, - }, - expected: false, - }, { name: "ubuntu distro", ap: AgentPoolProfile{ @@ -528,13 +455,6 @@ func TestMasterProfileIsVHDDistro(t *testing.T) { }, expected: true, }, - { - name: "coreos distro", - m: MasterProfile{ - Distro: CoreOS, - }, - expected: false, - }, { name: "ubuntu 16.04 non-VHD distro", m: MasterProfile{ @@ -589,13 +509,6 @@ func TestMasterProfileIsUbuntuNonVHD(t *testing.T) { }, expected: false, }, - { - name: "coreos distro", - m: MasterProfile{ - Distro: CoreOS, - }, - expected: false, - }, { name: "ubuntu 16.04 non-VHD distro", m: MasterProfile{ @@ -2026,15 +1939,6 @@ func TestMasterIsUbuntu(t *testing.T) { }, expected: true, }, - { - p: Properties{ - MasterProfile: &MasterProfile{ - Count: 1, - Distro: CoreOS, - }, - }, - expected: false, - }, { p: Properties{ MasterProfile: &MasterProfile{ @@ -2133,17 +2037,6 @@ func TestAgentPoolIsUbuntu(t *testing.T) { }, expected: true, }, - { - p: Properties{ - AgentPoolProfiles: []*AgentPoolProfile{ - { - Count: 1, - Distro: CoreOS, - }, - }, - }, - expected: false, - }, { p: Properties{ AgentPoolProfiles: []*AgentPoolProfile{ diff --git a/pkg/api/vlabs/const.go b/pkg/api/vlabs/const.go index 9b11fc5b03..2f78704899 100644 --- a/pkg/api/vlabs/const.go +++ b/pkg/api/vlabs/const.go @@ -32,7 +32,7 @@ const ( Ubuntu1804 Distro = "ubuntu-18.04" Ubuntu1804Gen2 Distro = "ubuntu-18.04-gen2" RHEL Distro = "rhel" - CoreOS Distro = "coreos" + CoreOS Distro = "coreos" // deprecated AKS1604Deprecated Distro = "aks" // deprecated AKS 16.04 distro. Equivalent to aks-ubuntu-16.04. AKS1804Deprecated Distro = "aks-1804" // deprecated AKS 18.04 distro. Equivalent to aks-ubuntu-18.04. AKSDockerEngine Distro = "aks-docker-engine" // deprecated docker-engine distro. @@ -100,7 +100,7 @@ var ( ContainerRuntimeValues = [...]string{"", Docker, KataContainers, Containerd} // DistroValues holds the valid values for OS distros - DistroValues = []Distro{"", Ubuntu, Ubuntu1804, Ubuntu1804Gen2, RHEL, CoreOS, AKSUbuntu1604, AKSUbuntu1804, ACC1604} + DistroValues = []Distro{"", Ubuntu, Ubuntu1804, Ubuntu1804Gen2, RHEL, AKSUbuntu1604, AKSUbuntu1804, ACC1604} // DependenciesLocationValues holds the valid values for dependencies location DependenciesLocationValues = []DependenciesLocation{"", AzureStackDependenciesLocationPublic, AzureStackDependenciesLocationChina, AzureStackDependenciesLocationGerman, AzureStackDependenciesLocationUSGovernment} diff --git a/pkg/api/vlabs/types.go b/pkg/api/vlabs/types.go index 7cb78a227a..ee4d648618 100644 --- a/pkg/api/vlabs/types.go +++ b/pkg/api/vlabs/types.go @@ -592,16 +592,6 @@ type TelemetryProfile struct { ApplicationInsightsKey string `json:"applicationInsightsKey,omitempty"` } -// HasCoreOS returns true if the cluster contains coreos nodes -func (p *Properties) HasCoreOS() bool { - for _, agentPoolProfile := range p.AgentPoolProfiles { - if agentPoolProfile.Distro == CoreOS { - return true - } - } - return false -} - // HasWindows returns true if the cluster contains windows func (p *Properties) HasWindows() bool { for _, agentPoolProfile := range p.AgentPoolProfiles { @@ -684,11 +674,6 @@ func (m *MasterProfile) IsRHEL() bool { return m.Distro == RHEL } -// IsCoreOS returns true if the master specified a CoreOS distro -func (m *MasterProfile) IsCoreOS() bool { - return m.Distro == CoreOS -} - // IsUbuntu1604 returns true if the master profile distro is based on Ubuntu 16.04 func (m *MasterProfile) IsUbuntu1604() bool { switch m.Distro { @@ -783,11 +768,6 @@ func (a *AgentPoolProfile) IsRHEL() bool { return a.OSType == Linux && a.Distro == RHEL } -// IsCoreOS returns true if the agent specified a CoreOS distro -func (a *AgentPoolProfile) IsCoreOS() bool { - return a.OSType == Linux && a.Distro == CoreOS -} - // IsAvailabilitySets returns true if the customer specified disks func (a *AgentPoolProfile) IsAvailabilitySets() bool { return a.AvailabilityProfile == AvailabilitySet diff --git a/pkg/api/vlabs/types_test.go b/pkg/api/vlabs/types_test.go index 1d14e1859c..2b31686abf 100644 --- a/pkg/api/vlabs/types_test.go +++ b/pkg/api/vlabs/types_test.go @@ -269,10 +269,6 @@ func TestAgentPoolProfile(t *testing.T) { t.Fatalf("unexpectedly detected AgentPoolProfile.OSType != Linux after unmarshal") } - if !ap.IsCoreOS() { - t.Fatalf("unexpectedly detected AgentPoolProfile.Distro != CoreOS after unmarshal") - } - if !ap.IsManagedDisks() { t.Fatalf("unexpectedly detected AgentPoolProfile.StorageProfile != ManagedDisks after unmarshal") } @@ -554,15 +550,6 @@ func TestMasterIsUbuntu(t *testing.T) { }, expected: true, }, - { - p: Properties{ - MasterProfile: &MasterProfile{ - Count: 1, - Distro: CoreOS, - }, - }, - expected: false, - }, { p: Properties{ MasterProfile: &MasterProfile{ @@ -661,17 +648,6 @@ func TestAgentPoolIsUbuntu(t *testing.T) { }, expected: true, }, - { - p: Properties{ - AgentPoolProfiles: []*AgentPoolProfile{ - { - Count: 1, - Distro: CoreOS, - }, - }, - }, - expected: false, - }, { p: Properties{ AgentPoolProfiles: []*AgentPoolProfile{ diff --git a/pkg/api/vlabs/validate.go b/pkg/api/vlabs/validate.go index b5c9f6881c..1d81ee0931 100644 --- a/pkg/api/vlabs/validate.go +++ b/pkg/api/vlabs/validate.go @@ -390,12 +390,6 @@ func (a *Properties) validateMasterProfile(isUpdate bool) error { if m.IsVirtualMachineScaleSets() && m.VnetSubnetID != "" && m.FirstConsecutiveStaticIP != "" { return errors.New("when masterProfile's availabilityProfile is VirtualMachineScaleSets and a vnetSubnetID is specified, the firstConsecutiveStaticIP should be empty and will be determined by an offset from the first IP in the vnetCidr") } - // validate distro is ubuntu if dual stack or ipv6 only feature is enabled - if a.FeatureFlags.IsIPv6DualStackEnabled() || a.FeatureFlags.IsIPv6OnlyEnabled() { - if m.Distro == CoreOS { - return errors.Errorf("Dual stack and single stack IPv6 feature is currently supported only with Ubuntu, but master is of distro type %s", m.Distro) - } - } } if m.ImageRef != nil { @@ -457,16 +451,6 @@ func (a *Properties) validateAgentPoolProfiles(isUpdate bool) error { return e } - // validate os type is linux if dual stack feature is enabled - if a.FeatureFlags.IsIPv6DualStackEnabled() || a.FeatureFlags.IsIPv6OnlyEnabled() { - if agentPoolProfile.OSType == Windows { - return errors.Errorf("Dual stack and single stack IPv6 feature is supported only with Linux, but agent pool '%s' is of os type %s", agentPoolProfile.Name, agentPoolProfile.OSType) - } - if agentPoolProfile.Distro == CoreOS { - return errors.Errorf("Dual stack and single stack IPv6 feature is currently supported only with Ubuntu, but agent pool '%s' is of distro type %s", agentPoolProfile.Name, agentPoolProfile.Distro) - } - } - // validate that each AgentPoolProfile Name is unique if _, ok := profileNames[agentPoolProfile.Name]; ok { return errors.Errorf("profile name '%s' already exists, profile names must be unique across pools", agentPoolProfile.Name) @@ -681,25 +665,10 @@ func (a *Properties) validateAddons() error { if IsNSeriesSKU && !isValidVersion { return errors.New("NVIDIA Device Plugin add-on can only be used Kubernetes 1.10 or above. Please specify \"orchestratorRelease\": \"1.10\"") } - if a.HasCoreOS() { - return errors.New("NVIDIA Device Plugin add-on not currently supported on coreos. Please use node pools with Ubuntu only") - } case "aad": if !a.HasAADAdminGroupID() { return errors.New("aad addon can't be enabled without a valid aadProfile w/ adminGroupID") } - case "blobfuse-flexvolume": - if a.HasCoreOS() { - return errors.New("flexvolume add-ons not currently supported on coreos distro. Please use Ubuntu") - } - case "smb-flexvolume": - if a.HasCoreOS() { - return errors.New("flexvolume add-ons not currently supported on coreos distro. Please use Ubuntu") - } - case "keyvault-flexvolume": - if a.HasCoreOS() { - return errors.New("flexvolume add-ons not currently supported on coreos distro. Please use Ubuntu") - } case "appgw-ingress": if (a.ServicePrincipalProfile == nil || len(a.ServicePrincipalProfile.ObjectID) == 0) && !a.OrchestratorProfile.KubernetesConfig.UseManagedIdentity { diff --git a/pkg/api/vlabs/validate_test.go b/pkg/api/vlabs/validate_test.go index 64044f0a83..417fdce571 100644 --- a/pkg/api/vlabs/validate_test.go +++ b/pkg/api/vlabs/validate_test.go @@ -2249,62 +2249,6 @@ func Test_Properties_ValidateAddons(t *testing.T) { ) } - p.AgentPoolProfiles = []*AgentPoolProfile{ - { - AvailabilityProfile: AvailabilitySet, - Distro: CoreOS, - }, - } - - p.MasterProfile = &MasterProfile{ - Distro: CoreOS, - } - - p.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{ - Addons: []KubernetesAddon{ - { - Name: "smb-flexvolume", - Enabled: to.BoolPtr(true), - }, - }, - } - - if err := p.validateAddons(); err == nil { - t.Errorf( - "should error using incompatible addon with coreos (smb-flexvolume)", - ) - } - - p.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{ - Addons: []KubernetesAddon{ - { - Name: "keyvault-flexvolume", - Enabled: to.BoolPtr(true), - }, - }, - } - - if err := p.validateAddons(); err == nil { - t.Errorf( - "should error using incompatible addon with coreos (keyvault-flexvolume)", - ) - } - - p.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{ - Addons: []KubernetesAddon{ - { - Name: "blobfuse-flexvolume", - Enabled: to.BoolPtr(true), - }, - }, - } - - if err := p.validateAddons(); err == nil { - t.Errorf( - "should error using incompatible addon with coreos (blobfuse-flexvolume)", - ) - } - // appgw-ingress add-on // Basic test with UseManagedIdentity @@ -3556,36 +3500,6 @@ func TestValidateProperties_OrchestratorSpecificProperties(t *testing.T) { t.Errorf("expected error with message : %s, but got %s", expectedMsg, err.Error()) } }) - - t.Run("Should not support os type other than linux for single stack ipv6 and dual stack feature", func(t *testing.T) { - t.Parallel() - cs := getK8sDefaultContainerService(true) - for _, featureFlags := range []FeatureFlags{{EnableIPv6DualStack: true}, {EnableIPv6Only: true}} { - cs.Properties.FeatureFlags = &featureFlags - masterProfile := cs.Properties.MasterProfile - masterProfile.Distro = CoreOS - expectedMsg := fmt.Sprintf("Dual stack and single stack IPv6 feature is currently supported only with Ubuntu, but master is of distro type %s", masterProfile.Distro) - if err := cs.Properties.validateMasterProfile(false); err.Error() != expectedMsg { - t.Errorf("expected error with message : %s, but got %s", expectedMsg, err.Error()) - } - - masterProfile.Distro = Ubuntu - agentPoolProfiles := cs.Properties.AgentPoolProfiles - agentPoolProfiles[0].OSType = Windows - expectedMsg = fmt.Sprintf("Dual stack and single stack IPv6 feature is supported only with Linux, but agent pool '%s' is of os type %s", agentPoolProfiles[0].Name, agentPoolProfiles[0].OSType) - if err := cs.Properties.validateAgentPoolProfiles(false); err.Error() != expectedMsg { - t.Errorf("expected error with message : %s, but got %s", expectedMsg, err.Error()) - } - - agentPoolProfiles[0].OSType = Linux - agentPoolProfiles[0].Distro = CoreOS - expectedMsg = fmt.Sprintf("Dual stack and single stack IPv6 feature is currently supported only with Ubuntu, but agent pool '%s' is of distro type %s", agentPoolProfiles[0].Name, agentPoolProfiles[0].Distro) - if err := cs.Properties.validateAgentPoolProfiles(false); err.Error() != expectedMsg { - t.Errorf("expected error with message : %s, but got %s", expectedMsg, err.Error()) - } - } - - }) } func TestValidateProperties_CustomNodeLabels(t *testing.T) { @@ -3779,7 +3693,7 @@ func TestAgentPoolProfile_ValidateAuditDEnabled(t *testing.T) { agentPoolProfiles[0].Distro = distro agentPoolProfiles[0].AuditDEnabled = to.BoolPtr(true) switch distro { - case RHEL, CoreOS: + case RHEL: expectedMsg := fmt.Sprintf("You have enabled auditd in agent pool %s, but you did not specify an Ubuntu-based distro", agentPoolProfiles[0].Name) if err := cs.Properties.validateAgentPoolProfiles(false); err.Error() != expectedMsg { t.Errorf("expected error with message : %s, but got %s", expectedMsg, err.Error()) @@ -3802,7 +3716,7 @@ func TestMasterProfile_ValidateAuditDEnabled(t *testing.T) { masterProfile.Distro = distro masterProfile.AuditDEnabled = to.BoolPtr(true) switch distro { - case RHEL, CoreOS: + case RHEL: expectedMsg := fmt.Sprintf("You have enabled auditd for master vms, but you did not specify an Ubuntu-based distro.") if err := cs.Properties.validateMasterProfile(false); err.Error() != expectedMsg { t.Errorf("expected error with message : %s, but got %s", expectedMsg, err.Error()) diff --git a/pkg/armhelpers/support_validator.go b/pkg/armhelpers/support_validator.go index 1bdf1e1135..f9cdc30da2 100644 --- a/pkg/armhelpers/support_validator.go +++ b/pkg/armhelpers/support_validator.go @@ -82,8 +82,6 @@ func toImageConfig(distro api.Distro) api.AzureOSImageConfig { return api.Ubuntu1804Gen2OSImageConfig case api.RHEL: return api.RHELOSImageConfig - case api.CoreOS: - return api.CoreOSImageConfig case api.AKSUbuntu1604: return api.AKSUbuntu1604OSImageConfig case api.AKSUbuntu1804: diff --git a/pkg/engine/template_generator.go b/pkg/engine/template_generator.go index c4bbaf84e3..da75b68871 100644 --- a/pkg/engine/template_generator.go +++ b/pkg/engine/template_generator.go @@ -691,9 +691,6 @@ func getContainerServiceFuncMap(cs *api.ContainerService) template.FuncMap { "HasDCSeriesSKU": func() bool { return cs.Properties.HasDCSeriesSKU() }, - "HasCoreOS": func() bool { - return cs.Properties.HasCoreOS() - }, "RequiresDocker": func() bool { return cs.Properties.OrchestratorProfile.KubernetesConfig.RequiresDocker() }, diff --git a/pkg/engine/virtualmachinescalesets.go b/pkg/engine/virtualmachinescalesets.go index 477ad13d31..4cf2db80f6 100644 --- a/pkg/engine/virtualmachinescalesets.go +++ b/pkg/engine/virtualmachinescalesets.go @@ -277,9 +277,6 @@ func CreateMasterVMSS(cs *api.ContainerService) VirtualMachineScaleSetARM { outBoundCmd := "" registry := "" ncBinary := "nc" - if cs.Properties.MasterProfile != nil && cs.Properties.MasterProfile.IsCoreOS() { - ncBinary = "ncat" - } // TODO The AzureStack constraint has to be relaxed, it should only apply to *disconnected* instances if !cs.Properties.FeatureFlags.IsFeatureEnabled("BlockOutboundInternet") && !cs.Properties.IsAzureStackCloud() && cs.Properties.IsHostedMasterProfile() { if cs.GetCloudSpecConfig().CloudName == api.AzureChinaCloud { @@ -709,9 +706,6 @@ func CreateAgentVMSS(cs *api.ContainerService, profile *api.AgentPoolProfile) Vi outBoundCmd := "" registry := "" ncBinary := "nc" - if profile.IsCoreOS() { - ncBinary = "ncat" - } featureFlags := cs.Properties.FeatureFlags if !featureFlags.IsFeatureEnabled("BlockOutboundInternet") && cs.Properties.IsHostedMasterProfile() { diff --git a/pkg/engine/vmextensions.go b/pkg/engine/vmextensions.go index 1b2795dff7..9b8a4c0930 100644 --- a/pkg/engine/vmextensions.go +++ b/pkg/engine/vmextensions.go @@ -53,9 +53,6 @@ func CreateCustomScriptExtension(cs *api.ContainerService) VirtualMachineExtensi outBoundCmd := "" registry := "" ncBinary := "nc" - if cs.Properties.MasterProfile != nil && cs.Properties.MasterProfile.IsCoreOS() { - ncBinary = "ncat" - } var userAssignedIDEnabled bool if cs.Properties.OrchestratorProfile != nil && cs.Properties.OrchestratorProfile.KubernetesConfig != nil { userAssignedIDEnabled = cs.Properties.OrchestratorProfile.KubernetesConfig.UserAssignedIDEnabled() @@ -112,9 +109,6 @@ func createAgentVMASCustomScriptExtension(cs *api.ContainerService, profile *api outBoundCmd := "" registry := "" ncBinary := "nc" - if profile.IsCoreOS() { - ncBinary = "ncat" - } var userAssignedIDEnabled bool if cs.Properties.OrchestratorProfile != nil && cs.Properties.OrchestratorProfile.KubernetesConfig != nil { userAssignedIDEnabled = cs.Properties.OrchestratorProfile.KubernetesConfig.UserAssignedIDEnabled() From 1d4d6abf7885c87a7ce6415326e611486368d2e9 Mon Sep 17 00:00:00 2001 From: Jack Francis Date: Mon, 23 Mar 2020 13:40:59 -0700 Subject: [PATCH 2/3] chore: generated code --- pkg/engine/templates_generated.go | 209 ++---------------------------- 1 file changed, 10 insertions(+), 199 deletions(-) diff --git a/pkg/engine/templates_generated.go b/pkg/engine/templates_generated.go index 5276eb5ae1..acf24affc1 100644 --- a/pkg/engine/templates_generated.go +++ b/pkg/engine/templates_generated.go @@ -34623,11 +34623,7 @@ func k8sCloudInitArtifactsCisSh() (*asset, error) { var _k8sCloudInitArtifactsCse_configSh = []byte(`#!/bin/bash NODE_INDEX=$(hostname | tail -c 2) NODE_NAME=$(hostname) -if [[ $OS == $COREOS_OS_NAME ]]; then - PRIVATE_IP=$(ip a show eth0 | grep -Po 'inet \K[\d.]+') -else - PRIVATE_IP=$(hostname -I | cut -d' ' -f1) -fi +PRIVATE_IP=$(hostname -I | cut -d' ' -f1) ETCD_PEER_URL="https://${PRIVATE_IP}:2380" ETCD_CLIENT_URL="https://${PRIVATE_IP}:2379" @@ -34878,9 +34874,6 @@ ensureDocker() { wait_for_file 1200 1 $DOCKER_SERVICE_EXEC_START_FILE || exit $ERR_FILE_WATCH_TIMEOUT usermod -aG docker ${ADMINUSER} DOCKER_MOUNT_FLAGS_SYSTEMD_FILE=/etc/systemd/system/docker.service.d/clear_mount_propagation_flags.conf - if [[ $OS != $COREOS_OS_NAME ]]; then - wait_for_file 1200 1 $DOCKER_MOUNT_FLAGS_SYSTEMD_FILE || exit $ERR_FILE_WATCH_TIMEOUT - fi DOCKER_JSON_FILE=/etc/docker/daemon.json for i in $(seq 1 1200); do if [ -s $DOCKER_JSON_FILE ]; then @@ -35385,12 +35378,11 @@ ERR_BCC_INSTALL_TIMEOUT=168 ERR_BPFTRACE_BIN_DOWNLOAD_FAIL=169 ERR_BPFTRACE_TOOLS_DOWNLOAD_FAIL=170 -OS=$(sort -r /etc/*-release | gawk 'match($0, /^(ID_LIKE=(coreos)|ID=(.*))$/, a) { print toupper(a[2] a[3]); exit }') +OS=$(sort -r /etc/*-release | gawk 'match($0, /^(ID=(.*))$/, a) { print toupper(a[2] a[3]); exit }') UBUNTU_OS_NAME="UBUNTU" RHEL_OS_NAME="RHEL" -COREOS_OS_NAME="COREOS" DEBIAN_OS_NAME="DEBIAN" -if ! echo "${UBUNTU_OS_NAME} ${RHEL_OS_NAME} ${COREOS_OS_NAME} ${DEBIAN_OS_NAME}" | grep -q "${OS}"; then +if ! echo "${UBUNTU_OS_NAME} ${RHEL_OS_NAME} ${DEBIAN_OS_NAME}" | grep -q "${OS}"; then OS=$(sort -r /etc/*-release | gawk 'match($0, /^(ID_LIKE=(.*))$/, a) { print toupper(a[2] a[3]); exit }') fi KUBECTL=/usr/local/bin/kubectl @@ -35643,11 +35635,7 @@ UBUNTU_RELEASE=$(lsb_release -r -s) UBUNTU_CODENAME=$(lsb_release -c -s) removeEtcd() { - if [[ $OS == $COREOS_OS_NAME ]]; then - rm -rf /opt/bin/etcd - else - rm -rf /usr/bin/etcd - fi + rm -rf /usr/bin/etcd } removeMoby() { @@ -35667,11 +35655,7 @@ installEtcd() { CURRENT_VERSION=$(etcd --version | grep "etcd Version" | cut -d ":" -f 2 | tr -d '[:space:]') if [[ "$CURRENT_VERSION" != "${ETCD_VERSION}" ]]; then CLI_TOOL=$1 - if [[ $OS == $COREOS_OS_NAME ]]; then - path="/opt/bin" - else - path="/usr/bin" - fi + local path="/usr/bin" CONTAINER_IMAGE=${ETCD_DOWNLOAD_URL}etcd:v${ETCD_VERSION} pullContainerImage $CLI_TOOL ${CONTAINER_IMAGE} removeEtcd @@ -35961,14 +35945,8 @@ extractHyperkube() { img unpack -o "$path" ${HYPERKUBE_URL} fi - if [[ $OS == $COREOS_OS_NAME ]]; then - cp "$path/hyperkube" "/opt/kubelet" - mv "$path/hyperkube" "/opt/kubectl" - chmod a+x /opt/kubelet /opt/kubectl - else - cp "$path/hyperkube" "/usr/local/bin/kubelet-${KUBERNETES_VERSION}" - mv "$path/hyperkube" "/usr/local/bin/kubectl-${KUBERNETES_VERSION}" - fi + cp "$path/hyperkube" "/usr/local/bin/kubelet-${KUBERNETES_VERSION}" + mv "$path/hyperkube" "/usr/local/bin/kubectl-${KUBERNETES_VERSION}" } extractKubeBinaries() { @@ -36102,11 +36080,6 @@ ETCD_PEER_CERT=$(echo ${ETCD_PEER_CERTIFICATES} | cut -d'[' -f 2 | cut -d']' -f ETCD_PEER_KEY=$(echo ${ETCD_PEER_PRIVATE_KEYS} | cut -d'[' -f 2 | cut -d']' -f 1 | cut -d',' -f $((${NODE_INDEX}+1))) set -x -if [[ $OS == $COREOS_OS_NAME ]]; then - echo "Changing default kubectl bin location" - KUBECTL=/opt/kubectl -fi - if [ -f /var/run/reboot-required ]; then REBOOTREQUIRED=true trace_info "RebootRequired" "reboot=true" @@ -36166,9 +36139,7 @@ if [[ "$FULL_INSTALL_REQUIRED" = "true" ]]; then time_metric "InstallBpftrace" installBpftrace fi -{{- if not HasCoreOS}} time_metric "InstallContainerRuntime" installContainerRuntime -{{end}} {{- if NeedsContainerd}} time_metric "InstallContainerd" installContainerd @@ -36200,11 +36171,7 @@ docker login -u $SERVICE_PRINCIPAL_CLIENT_ID -p $SERVICE_PRINCIPAL_CLIENT_SECRET {{end}} time_metric "InstallKubeletAndKubectl" installKubeletAndKubectl - -if [[ $OS != $COREOS_OS_NAME ]]; then - time_metric "EnsureRPC" ensureRPC -fi - +time_metric "EnsureRPC" ensureRPC time_metric "CreateKubeManifestDir" createKubeManifestDir {{- if HasDCSeriesSKU}} @@ -37749,11 +37716,7 @@ write_files: {{CloudInitData "kubeletSystemdService"}} {{if not .MasterProfile.IsVHDDistro}} - {{if .MasterProfile.IsCoreOS}} -- path: /opt/bin/health-monitor.sh - {{else}} - path: /usr/local/bin/health-monitor.sh - {{end}} permissions: "0544" encoding: gzip owner: root @@ -37827,15 +37790,13 @@ write_files: {{end}} {{if .OrchestratorProfile.KubernetesConfig.RequiresDocker}} - {{if not .MasterProfile.IsCoreOS}} - {{if not .MasterProfile.IsVHDDistro}} + {{if not .MasterProfile.IsVHDDistro}} - path: /etc/systemd/system/docker.service.d/clear_mount_propagation_flags.conf permissions: "0644" encoding: gzip owner: root content: !!binary | {{CloudInitData "dockerClearMountPropagationFlags"}} - {{end}} {{end}} - path: /etc/systemd/system/docker.service.d/exec_start.conf @@ -37844,11 +37805,7 @@ write_files: content: | [Service] ExecStart= - {{if .MasterProfile.IsCoreOS}} - ExecStart=/usr/bin/env PATH=${TORCX_BINDIR}:${PATH} ${TORCX_BINDIR}/dockerd --host=fd:// --containerd=/var/run/docker/libcontainerd/docker-containerd.sock --storage-driver=overlay2 --bip={{WrapAsParameter "dockerBridgeCidr"}} $DOCKER_SELINUX $DOCKER_OPTS $DOCKER_CGROUPS $DOCKER_OPT_BIP $DOCKER_OPT_MTU $DOCKER_OPT_IPMASQ - {{else}} ExecStart=/usr/bin/dockerd -H fd:// --storage-driver=overlay2 --bip={{WrapAsParameter "dockerBridgeCidr"}} - {{end}} ExecStartPost=/sbin/iptables -P FORWARD ACCEPT #EOF @@ -38086,11 +38043,7 @@ MASTER_CONTAINER_ADDONS_PLACEHOLDER #!/bin/bash set -e {{if IsMasterVirtualMachineScaleSets}} - {{if .MasterProfile.IsCoreOS}} - PRIVATE_IP=$(hostname -I | cut -d" " -f1) - {{else}} PRIVATE_IP=$(hostname -i | cut -d" " -f1) - {{end}} sed -i "s||https://$PRIVATE_IP:443|g" "/var/lib/kubelet/kubeconfig" {{end}} {{if gt .MasterProfile.Count 1}} @@ -38147,11 +38100,7 @@ MASTER_CONTAINER_ADDONS_PLACEHOLDER MASTER_VM_NAME_BASE=$(hostname | sed "s/.$//") MASTER_FIRSTADDR={{WrapAsParameter "firstConsecutiveStaticIP"}} MASTER_INDEX=$(hostname | tail -c 2) - {{if .MasterProfile.IsCoreOS}} - PRIVATE_IP=$(hostname -I | cut -d" " -f1) - {{else}} PRIVATE_IP=$(hostname -i | cut -d" " -f1) - {{end}} MASTER_COUNT={{WrapAsVariable "masterCount"}} IPADDRESS_COUNT={{WrapAsVariable "masterIpAddressCount"}} echo $IPADDRESS_COUNT @@ -38200,90 +38149,10 @@ MASTER_CONTAINER_ADDONS_PLACEHOLDER {{WrapAsVariable "environmentJSON"}} {{end}} -{{if .MasterProfile.IsCoreOS}} -- path: /opt/azure/containers/provision-setup.sh - permissions: "0755" - owner: root - content: | - #!/bin/bash - source {{GetCSEHelpersScriptFilepath}} - /opt/azure/containers/mountetcd.sh - retrycmd_if_failure 5 5 10 curl --retry 5 --retry-delay 10 --retry-max-time 10 --max-time 60 https://127.0.0.1:2379/v2/machines - - {{if EnableAggregatedAPIs}} - sudo bash /etc/kubernetes/generate-proxy-certs.sh - {{end}} - - touch /opt/azure/containers/runcmd.complete - -- path: "/etc/kubernetes/manifests/.keep" - -{{if .OrchestratorProfile.KubernetesConfig.RequiresDocker}} -groups: - - docker: [{{WrapAsParameter "linuxAdminUsername"}}] -{{end}} - -coreos: - units: - - name: start-provision-setup.service - command: "start" - content: | - [Unit] - Description=Start provision setup service - - [Service] - ExecStart=/opt/azure/containers/provision-setup.sh - - name: kubelet.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Unit] - Requires=rpc-statd.service - After=etcd.service - ConditionPathExists= - ConditionPathExists=/opt/kubelet - [Service] - ExecStart= - ExecStart=/opt/kubelet \ - --enable-server \ - --node-labels="${KUBELET_NODE_LABELS}" \ - --v=2 \ - --volume-plugin-dir=/etc/kubernetes/volumeplugins \ - $KUBELET_CONFIG $KUBELET_OPTS \ - $KUBELET_REGISTER_NODE $KUBELET_REGISTER_WITH_TAINTS - - name: kubelet-monitor.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Service] - ExecStart= - ExecStart=/opt/bin/health-monitor.sh kubelet - - name: docker-monitor.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Service] - ExecStart= - ExecStart=/opt/bin/health-monitor.sh container-runtime - - name: etcd.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Service] - ExecStart= - ExecStart=/opt/bin/etcd $DAEMON_ARGS - - name: etcd-member.service - mask: true -{{else}} runcmd: - set -x - . {{GetCSEHelpersScriptFilepath}} - aptmarkWALinuxAgent hold{{GetKubernetesMasterPreprovisionYaml}} -{{end}} `) func k8sCloudInitMasternodecustomdataYmlBytes() ([]byte, error) { @@ -38387,11 +38256,7 @@ write_files: {{CloudInitData "kubeletSystemdService"}} {{if not .IsVHDDistro}} - {{if .IsCoreOS}} -- path: /opt/bin/health-monitor.sh - {{else}} - path: /usr/local/bin/health-monitor.sh - {{end}} permissions: "0544" encoding: gzip owner: root @@ -38451,15 +38316,13 @@ write_files: {{end}} {{if .KubernetesConfig.RequiresDocker}} - {{if not .IsCoreOS}} - {{if not .IsVHDDistro}} + {{if not .IsVHDDistro}} - path: /etc/systemd/system/docker.service.d/clear_mount_propagation_flags.conf permissions: "0644" encoding: gzip owner: "root" content: !!binary | {{CloudInitData "dockerClearMountPropagationFlags"}} - {{end}} {{end}} - path: /etc/systemd/system/docker.service.d/exec_start.conf @@ -38468,11 +38331,7 @@ write_files: content: | [Service] ExecStart= - {{if .IsCoreOS}} - ExecStart=/usr/bin/env PATH=${TORCX_BINDIR}:${PATH} ${TORCX_BINDIR}/dockerd --host=fd:// --containerd=/var/run/docker/libcontainerd/docker-containerd.sock --storage-driver=overlay2 --bip={{WrapAsParameter "dockerBridgeCidr"}} $DOCKER_SELINUX $DOCKER_OPTS $DOCKER_CGROUPS $DOCKER_OPT_BIP $DOCKER_OPT_MTU $DOCKER_OPT_IPMASQ - {{else}} ExecStart=/usr/bin/dockerd -H fd:// --storage-driver=overlay2 --bip={{WrapAsParameter "dockerBridgeCidr"}} - {{end}} ExecStartPost=/sbin/iptables -P FORWARD ACCEPT #EOF @@ -38689,58 +38548,10 @@ write_files: {{WrapAsVariable "environmentJSON"}} {{end}} -{{if .IsCoreOS}} -- path: "/etc/kubernetes/manifests/.keep" - -{{if .KubernetesConfig.RequiresDocker}} -groups: - - docker: [{{WrapAsParameter "linuxAdminUsername"}}] -{{end}} - -coreos: - units: - - name: kubelet.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Unit] - Requires=rpc-statd.service - ConditionPathExists= - ConditionPathExists=/opt/kubelet - [Service] - ExecStart= - ExecStart=/opt/kubelet \ - --enable-server \ - --node-labels="${KUBELET_NODE_LABELS}" \ - --v=2 \ - --volume-plugin-dir=/etc/kubernetes/volumeplugins \ - $KUBELET_CONFIG $KUBELET_OPTS \ - $KUBELET_REGISTER_NODE $KUBELET_REGISTER_WITH_TAINTS - - name: kubelet-monitor.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Service] - ExecStart= - ExecStart=/opt/bin/health-monitor.sh kubelet - - name: docker-monitor.service - enable: true - drop-ins: - - name: "10-coreos.conf" - content: | - [Service] - ExecStart= - ExecStart=/opt/bin/health-monitor.sh container-runtime - - name: rpcbind.service - enable: true -{{else}} runcmd: - set -x - . {{GetCSEHelpersScriptFilepath}} - aptmarkWALinuxAgent hold{{GetKubernetesAgentPreprovisionYaml .}} -{{end}} `) func k8sCloudInitNodecustomdataYmlBytes() ([]byte, error) { From 638cdadaf56ef5be288a192b1a7e2093378f6548 Mon Sep 17 00:00:00 2001 From: Jack Francis Date: Tue, 24 Mar 2020 15:53:35 -0700 Subject: [PATCH 3/3] fix: restore ipv6 Windows validation --- pkg/api/vlabs/validate.go | 7 +++++++ pkg/api/vlabs/validate_test.go | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/pkg/api/vlabs/validate.go b/pkg/api/vlabs/validate.go index 1d81ee0931..a384d30ccd 100644 --- a/pkg/api/vlabs/validate.go +++ b/pkg/api/vlabs/validate.go @@ -451,6 +451,13 @@ func (a *Properties) validateAgentPoolProfiles(isUpdate bool) error { return e } + // validate os type is linux if dual stack feature is enabled + if a.FeatureFlags.IsIPv6DualStackEnabled() || a.FeatureFlags.IsIPv6OnlyEnabled() { + if agentPoolProfile.OSType == Windows { + return errors.Errorf("Dual stack and single stack IPv6 feature is supported only with Linux, but agent pool '%s' is of os type %s", agentPoolProfile.Name, agentPoolProfile.OSType) + } + } + // validate that each AgentPoolProfile Name is unique if _, ok := profileNames[agentPoolProfile.Name]; ok { return errors.Errorf("profile name '%s' already exists, profile names must be unique across pools", agentPoolProfile.Name) diff --git a/pkg/api/vlabs/validate_test.go b/pkg/api/vlabs/validate_test.go index 417fdce571..cc93b70f76 100644 --- a/pkg/api/vlabs/validate_test.go +++ b/pkg/api/vlabs/validate_test.go @@ -3500,6 +3500,23 @@ func TestValidateProperties_OrchestratorSpecificProperties(t *testing.T) { t.Errorf("expected error with message : %s, but got %s", expectedMsg, err.Error()) } }) + + t.Run("Should not support os type other than linux for single stack ipv6 and dual stack feature", func(t *testing.T) { + t.Parallel() + cs := getK8sDefaultContainerService(true) + for _, featureFlags := range []FeatureFlags{{EnableIPv6DualStack: true}, {EnableIPv6Only: true}} { + cs.Properties.FeatureFlags = &featureFlags + masterProfile := cs.Properties.MasterProfile + masterProfile.Distro = Ubuntu + agentPoolProfiles := cs.Properties.AgentPoolProfiles + agentPoolProfiles[0].OSType = Windows + expectedMsg := fmt.Sprintf("Dual stack and single stack IPv6 feature is supported only with Linux, but agent pool '%s' is of os type %s", agentPoolProfiles[0].Name, agentPoolProfiles[0].OSType) + if err := cs.Properties.validateAgentPoolProfiles(false); err.Error() != expectedMsg { + t.Errorf("expected error with message : %s, but got %s", expectedMsg, err.Error()) + } + } + + }) } func TestValidateProperties_CustomNodeLabels(t *testing.T) {