diff --git a/cluster/addons/dns/coredns.yaml.base b/cluster/addons/dns/coredns.yaml.base index 5f2de11d915..4976ac09a6f 100644 --- a/cluster/addons/dns/coredns.yaml.base +++ b/cluster/addons/dns/coredns.yaml.base @@ -95,6 +95,12 @@ spec: - name: coredns image: coredns/coredns:0.9.10 imagePullPolicy: IfNotPresent + resources: + limits: + memory: 170Mi + requests: + cpu: 100m + memory: 70Mi args: [ "-conf", "/etc/coredns/Corefile" ] volumeMounts: - name: config-volume diff --git a/cluster/addons/dns/coredns.yaml.in b/cluster/addons/dns/coredns.yaml.in index c0cb9628ccf..d2eb1b35796 100644 --- a/cluster/addons/dns/coredns.yaml.in +++ b/cluster/addons/dns/coredns.yaml.in @@ -95,6 +95,12 @@ spec: - name: coredns image: coredns/coredns:0.9.10 imagePullPolicy: IfNotPresent + resources: + limits: + memory: 170Mi + requests: + cpu: 100m + memory: 70Mi args: [ "-conf", "/etc/coredns/Corefile" ] volumeMounts: - name: config-volume diff --git a/cluster/addons/dns/coredns.yaml.sed b/cluster/addons/dns/coredns.yaml.sed index eca384b3ac3..329ad6ca23f 100644 --- a/cluster/addons/dns/coredns.yaml.sed +++ b/cluster/addons/dns/coredns.yaml.sed @@ -95,6 +95,12 @@ spec: - name: coredns image: coredns/coredns:0.9.10 imagePullPolicy: IfNotPresent + resources: + limits: + memory: 170Mi + requests: + cpu: 100m + memory: 70Mi args: [ "-conf", "/etc/coredns/Corefile" ] volumeMounts: - name: config-volume diff --git a/cluster/gce/container-linux/configure-helper.sh b/cluster/gce/container-linux/configure-helper.sh index 03f49994a06..8daea4d0864 100755 --- a/cluster/gce/container-linux/configure-helper.sh +++ b/cluster/gce/container-linux/configure-helper.sh @@ -1228,6 +1228,36 @@ function update-prometheus-to-sd-parameters { fi } +# Prepares the manifests of coreDNS for k8s addons. +function setup-coredns-manifest { + local -r coredns_file="${dst_dir}/dns/coredns.yaml" + mv "${dst_dir}/dns/coredns.yaml.in" "${coredns_file}" + # Replace the salt configurations with variable values. + sed -i -e "s@{{ *pillar\['dns_domain'\] *}}@${DNS_DOMAIN}@g" "${coredns_file}" + sed -i -e "s@{{ *pillar\['dns_server'\] *}}@${DNS_SERVER_IP}@g" "${coredns_file}" + sed -i -e "s@{{ *pillar\['service_cluster_ip_range'\] *}}@${SERVICE_CLUSTER_IP_RANGE}@g" "${coredns_file}" +} + +# Prepares the manifests of kube-dns for k8s addons. +function setup-kube-dns-manifest { + local -r kubedns_file="${dst_dir}/dns/kube-dns.yaml" + mv "${dst_dir}/dns/kube-dns.yaml.in" "${kubedns_file}" + if [ -n "${CUSTOM_KUBE_DNS_YAML:-}" ]; then + # Replace with custom GKE kube-dns deployment. + cat > "${kubedns_file}" < "${kubedns_file}" < "${kubedns_file}" < "${kubedns_file}" <