From e921a08028d2c12caf66ab492eacb7b58d3de01a Mon Sep 17 00:00:00 2001 From: Jack Francis Date: Tue, 20 Feb 2018 14:26:41 -0800 Subject: [PATCH] using --cluster-domain for kube-dns domain (#2303) --- .../addons/kubernetesmasteraddons-kube-dns-deployment.yaml | 6 +++--- parts/k8s/kubernetesmastercustomdata.yml | 3 +-- parts/k8s/kubernetesmastervars.t | 1 + parts/k8s/kubernetesparams.t | 6 ++++++ pkg/acsengine/engine.go | 1 + 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/parts/k8s/addons/kubernetesmasteraddons-kube-dns-deployment.yaml b/parts/k8s/addons/kubernetesmasteraddons-kube-dns-deployment.yaml index 4d05fc38ac..5f736b1589 100644 --- a/parts/k8s/addons/kubernetesmasteraddons-kube-dns-deployment.yaml +++ b/parts/k8s/addons/kubernetesmasteraddons-kube-dns-deployment.yaml @@ -74,7 +74,7 @@ spec: optional: true containers: - args: - - "--domain=cluster.local." + - "--domain=." - "--dns-port=10053" - "--v=2" - "--config-dir=/kube-dns-config" @@ -138,9 +138,9 @@ spec: - mountPath: /kube-dns-config name: kube-dns-config - args: - - "--cmd=nslookup kubernetes.default.svc.cluster.local 127.0.0.1 >/dev/null" + - "--cmd=nslookup kubernetes.default.svc. 127.0.0.1 >/dev/null" - "--url=/healthz-dnsmasq" - - "--cmd=nslookup kubernetes.default.svc.cluster.local 127.0.0.1:10053 >/dev/null" + - "--cmd=nslookup kubernetes.default.svc. 127.0.0.1:10053 >/dev/null" - "--url=/healthz-kubedns" - "--port=8080" - "--quiet" diff --git a/parts/k8s/kubernetesmastercustomdata.yml b/parts/k8s/kubernetesmastercustomdata.yml index 4b6ef9fa19..a7f385b028 100644 --- a/parts/k8s/kubernetesmastercustomdata.yml +++ b/parts/k8s/kubernetesmastercustomdata.yml @@ -184,9 +184,8 @@ MASTER_ARTIFACTS_CONFIG_PLACEHOLDER sed -i "s||{{WrapAsVariable "kubernetesHyperkubeSpec"}}|g" "/etc/kubernetes/manifests/kube-controller-manager.yaml" sed -i "s||{{WrapAsVariable "kubernetesHyperkubeSpec"}}|g" "/etc/kubernetes/manifests/kube-scheduler.yaml" sed -i "s||{{WrapAsVariable "kubernetesHyperkubeSpec"}}|g; s||{{WrapAsVariable "kubeClusterCidr"}}|g" "/etc/kubernetes/addons/kube-proxy-daemonset.yaml" - sed -i "s||{{WrapAsVariable "kubernetesKubeDNSSpec"}}|g; s||{{WrapAsVariable "kubernetesDNSMasqSpec"}}|g; s||{{WrapAsVariable "kubernetesExecHealthzSpec"}}|g" "/etc/kubernetes/addons/kube-dns-deployment.yaml" + sed -i "s||{{WrapAsVariable "kubernetesKubeDNSSpec"}}|g; s||{{WrapAsVariable "kubernetesDNSMasqSpec"}}|g; s||{{WrapAsVariable "kubernetesExecHealthzSpec"}}|g; s||{{WrapAsVariable "kubernetesKubeletClusterDomain"}}|g; s||{{WrapAsVariable "kubeDNSServiceIP"}}|g" "/etc/kubernetes/addons/kube-dns-deployment.yaml" sed -i "s||{{WrapAsVariable "kubernetesHeapsterSpec"}}|g; s||{{WrapAsVariable "kubernetesAddonResizerSpec"}}|g" "/etc/kubernetes/addons/kube-heapster-deployment.yaml" - sed -i "s||{{WrapAsVariable "kubeDNSServiceIP"}}|g" "/etc/kubernetes/addons/kube-dns-deployment.yaml" {{if .OrchestratorProfile.KubernetesConfig.IsDashboardEnabled}} sed -i "s||{{WrapAsVariable "kubernetesDashboardSpec"}}|g" "/etc/kubernetes/addons/kubernetes-dashboard-deployment.yaml" diff --git a/parts/k8s/kubernetesmastervars.t b/parts/k8s/kubernetesmastervars.t index 0b36aa6351..25c86c303c 100644 --- a/parts/k8s/kubernetesmastervars.t +++ b/parts/k8s/kubernetesmastervars.t @@ -126,6 +126,7 @@ "vnetCniLinuxPluginsURL":"[parameters('vnetCniLinuxPluginsURL')]", "vnetCniWindowsPluginsURL":"[parameters('vnetCniWindowsPluginsURL')]", "kubernetesNonMasqueradeCidr": "[parameters('kubernetesNonMasqueradeCidr')]", + "kubernetesKubeletClusterDomain": "[parameters('kubernetesKubeletClusterDomain')]", "maxPods": "[parameters('maxPods')]", "vnetCidr": "[parameters('vnetCidr')]", "gcHighThreshold":"[parameters('gcHighThreshold')]", diff --git a/parts/k8s/kubernetesparams.t b/parts/k8s/kubernetesparams.t index b15d97ff05..5dbfbf68a1 100644 --- a/parts/k8s/kubernetesparams.t +++ b/parts/k8s/kubernetesparams.t @@ -210,6 +210,12 @@ }, "type": "string" }, + "kubernetesKubeletClusterDomain": { + "metadata": { + "description": "--cluster-domain Kubelet config" + }, + "type": "string" + }, "kubernetesHyperkubeSpec": { {{PopulateClassicModeDefaultValue "kubernetesHyperkubeSpec"}} "metadata": { diff --git a/pkg/acsengine/engine.go b/pkg/acsengine/engine.go index 81f523643d..96f113e960 100644 --- a/pkg/acsengine/engine.go +++ b/pkg/acsengine/engine.go @@ -619,6 +619,7 @@ func getParameters(cs *api.ContainerService, isClassicMode bool, generatorCode s addValue(parametersMap, "cloudProviderRatelimitBucket", strconv.Itoa(properties.OrchestratorProfile.KubernetesConfig.CloudProviderRateLimitBucket)) addValue(parametersMap, "kubeClusterCidr", properties.OrchestratorProfile.KubernetesConfig.ClusterSubnet) addValue(parametersMap, "kubernetesNonMasqueradeCidr", properties.OrchestratorProfile.KubernetesConfig.KubeletConfig["--non-masquerade-cidr"]) + addValue(parametersMap, "kubernetesKubeletClusterDomain", properties.OrchestratorProfile.KubernetesConfig.KubeletConfig["--cluster-domain"]) addValue(parametersMap, "generatorCode", generatorCode) if properties.HostedMasterProfile != nil { addValue(parametersMap, "orchestratorName", "aks")