Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add a way to customize coredns version. #78851

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cluster/addons/dns/coredns/coredns.yaml.base
Expand Up @@ -116,7 +116,7 @@ spec:
beta.kubernetes.io/os: linux
containers:
- name: coredns
image: k8s.gcr.io/coredns:1.5.0
image: k8s.gcr.io/coredns:__PILLAR__CORE_DNS_VERSION__
imagePullPolicy: IfNotPresent
resources:
limits:
Expand Down
2 changes: 1 addition & 1 deletion cluster/addons/dns/coredns/coredns.yaml.in
Expand Up @@ -116,7 +116,7 @@ spec:
beta.kubernetes.io/os: linux
containers:
- name: coredns
image: k8s.gcr.io/coredns:1.5.0
image: k8s.gcr.io/coredns:{{ pillar['core_dns_version'] }}
imagePullPolicy: IfNotPresent
resources:
limits:
Expand Down
2 changes: 1 addition & 1 deletion cluster/addons/dns/coredns/coredns.yaml.sed
Expand Up @@ -116,7 +116,7 @@ spec:
beta.kubernetes.io/os: linux
containers:
- name: coredns
image: k8s.gcr.io/coredns:1.5.0
image: k8s.gcr.io/coredns:$CORE_DNS_VERSION
Copy link
Member

Choose a reason for hiding this comment

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

Based on changes in #78691 I think the readinessProbe.httpGet fields should also be modified

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, and the ConfigMap Corefile needs to include the ready plugin when being deployed in 1.5.0.

imagePullPolicy: IfNotPresent
resources:
limits:
Expand Down
1 change: 1 addition & 0 deletions cluster/addons/dns/coredns/transforms2salt.sed
Expand Up @@ -2,4 +2,5 @@ s/__PILLAR__DNS__SERVER__/{{ pillar['dns_server'] }}/g
s/__PILLAR__DNS__DOMAIN__/{{ pillar['dns_domain'] }}/g
s/__PILLAR__CLUSTER_CIDR__/{{ pillar['service_cluster_ip_range'] }}/g
s/__PILLAR__DNS__MEMORY__LIMIT__/{{ pillar['dns_memory_limit'] }}/g
s/__PILLAR__CORE_DNS_VERSION__/{{ pillar['core_dns_version'] }}/g
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
1 change: 1 addition & 0 deletions cluster/addons/dns/coredns/transforms2sed.sed
Expand Up @@ -2,4 +2,5 @@ s/__PILLAR__DNS__SERVER__/$DNS_SERVER_IP/g
s/__PILLAR__DNS__DOMAIN__/$DNS_DOMAIN/g
s/__PILLAR__CLUSTER_CIDR__/$SERVICE_CLUSTER_IP_RANGE/g
s/__PILLAR__DNS__MEMORY__LIMIT__/$DNS_MEMORY_LIMIT/g
s/__PILLAR__CORE_DNS_VERSION__/$CORE_DNS_VERSION/g
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
1 change: 1 addition & 0 deletions cluster/gce/config-default.sh
Expand Up @@ -259,6 +259,7 @@ fi
# Optional: Install cluster DNS.
# Set CLUSTER_DNS_CORE_DNS to 'false' to install kube-dns instead of CoreDNS.
CLUSTER_DNS_CORE_DNS="${CLUSTER_DNS_CORE_DNS:-true}"
CORE_DNS_VERSION="${KUBE_CORE_DNS_VERSION:-}"
Copy link
Member

Choose a reason for hiding this comment

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

if KUBE_CORE_DNS_VERSION is unset, will this produce an invalid manifest? If so, we should either set a valid default here or remove the :- to make this produce an error if KUBE_CORE_DNS_VERSION is not set

Copy link
Member

Choose a reason for hiding this comment

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

I don't see KUBE_CORE_DNS_VERSION specified in the repo. Won't that make kube-up for GCE break?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not required -- the default value is used in configure-helper.sh if this is not specified.

In #77918 I was adding similar config variable using slightly different approach:

This time I'm using slightly different approach to avoid breaking gke.

ENABLE_CLUSTER_DNS="${KUBE_ENABLE_CLUSTER_DNS:-true}"
DNS_SERVER_IP="${KUBE_DNS_SERVER_IP:-10.0.0.10}"
DNS_DOMAIN="${KUBE_DNS_DOMAIN:-cluster.local}"
Expand Down
1 change: 1 addition & 0 deletions cluster/gce/config-test.sh
Expand Up @@ -289,6 +289,7 @@ fi
# Optional: Install cluster DNS.
# Set CLUSTER_DNS_CORE_DNS to 'false' to install kube-dns instead of CoreDNS.
CLUSTER_DNS_CORE_DNS="${CLUSTER_DNS_CORE_DNS:-true}"
CORE_DNS_VERSION="${KUBE_CORE_DNS_VERSION:-}"
ENABLE_CLUSTER_DNS="${KUBE_ENABLE_CLUSTER_DNS:-true}"
DNS_SERVER_IP="10.0.0.10"
LOCAL_DNS_IP="${KUBE_LOCAL_DNS_IP:-169.254.20.10}"
Expand Down
1 change: 1 addition & 0 deletions cluster/gce/gci/configure-helper.sh
Expand Up @@ -2394,6 +2394,7 @@ function setup-coredns-manifest {
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}"
sed -i -e "s@{{ *pillar\['dns_memory_limit'\] *}}@${DNS_MEMORY_LIMIT:-170Mi}@g" "${coredns_file}"
sed -i -e "s@{{ *pillar\['core_dns_version'\] *}}@${CORE_DNS_VERSION:-1.5.0}@g" "${coredns_file}"

if [[ "${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-}" == "true" ]]; then
setup-addon-manifests "addons" "dns-horizontal-autoscaler" "gce"
Expand Down
1 change: 1 addition & 0 deletions cluster/gce/util.sh
Expand Up @@ -1128,6 +1128,7 @@ DNS_SERVER_IP: $(yaml-quote ${DNS_SERVER_IP:-})
LOCAL_DNS_IP: $(yaml-quote ${LOCAL_DNS_IP:-})
DNS_DOMAIN: $(yaml-quote ${DNS_DOMAIN:-})
DNS_MEMORY_LIMIT: $(yaml-quote ${DNS_MEMORY_LIMIT:-})
CORE_DNS_VERSION: $(yaml-quote ${CORE_DNS_VERSION:-})
ENABLE_DNS_HORIZONTAL_AUTOSCALER: $(yaml-quote ${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-false})
KUBE_PROXY_DAEMONSET: $(yaml-quote ${KUBE_PROXY_DAEMONSET:-false})
KUBE_PROXY_TOKEN: $(yaml-quote ${KUBE_PROXY_TOKEN:-})
Expand Down