mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #77918 from mborsz/coredns
Make dns memory limit configurable
This commit is contained in:
commit
f8d2b6b982
@ -120,7 +120,7 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: 170Mi
|
memory: __PILLAR__DNS__MEMORY__LIMIT__
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 70Mi
|
memory: 70Mi
|
||||||
|
@ -120,7 +120,7 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: 170Mi
|
memory: {{ pillar['dns_memory_limit'] }}
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 70Mi
|
memory: 70Mi
|
||||||
|
@ -120,7 +120,7 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: 170Mi
|
memory: $DNS_MEMORY_LIMIT
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 70Mi
|
memory: 70Mi
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
s/__PILLAR__DNS__SERVER__/{{ pillar['dns_server'] }}/g
|
s/__PILLAR__DNS__SERVER__/{{ pillar['dns_server'] }}/g
|
||||||
s/__PILLAR__DNS__DOMAIN__/{{ pillar['dns_domain'] }}/g
|
s/__PILLAR__DNS__DOMAIN__/{{ pillar['dns_domain'] }}/g
|
||||||
s/__PILLAR__CLUSTER_CIDR__/{{ pillar['service_cluster_ip_range'] }}/g
|
s/__PILLAR__CLUSTER_CIDR__/{{ pillar['service_cluster_ip_range'] }}/g
|
||||||
|
s/__PILLAR__DNS__MEMORY__LIMIT__/{{ pillar['dns_memory_limit'] }}/g
|
||||||
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
|
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
s/__PILLAR__DNS__SERVER__/$DNS_SERVER_IP/g
|
s/__PILLAR__DNS__SERVER__/$DNS_SERVER_IP/g
|
||||||
s/__PILLAR__DNS__DOMAIN__/$DNS_DOMAIN/g
|
s/__PILLAR__DNS__DOMAIN__/$DNS_DOMAIN/g
|
||||||
s/__PILLAR__CLUSTER_CIDR__/$SERVICE_CLUSTER_IP_RANGE/g
|
s/__PILLAR__CLUSTER_CIDR__/$SERVICE_CLUSTER_IP_RANGE/g
|
||||||
|
s/__PILLAR__DNS__MEMORY__LIMIT__/$DNS_MEMORY_LIMIT/g
|
||||||
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
|
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
|
||||||
|
@ -106,7 +106,7 @@ spec:
|
|||||||
# guaranteed class. Currently, this container falls into the
|
# guaranteed class. Currently, this container falls into the
|
||||||
# "burstable" category so the kubelet doesn't backoff from restarting it.
|
# "burstable" category so the kubelet doesn't backoff from restarting it.
|
||||||
limits:
|
limits:
|
||||||
memory: 170Mi
|
memory: __PILLAR__DNS__MEMORY__LIMIT__
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 70Mi
|
memory: 70Mi
|
||||||
|
@ -106,7 +106,7 @@ spec:
|
|||||||
# guaranteed class. Currently, this container falls into the
|
# guaranteed class. Currently, this container falls into the
|
||||||
# "burstable" category so the kubelet doesn't backoff from restarting it.
|
# "burstable" category so the kubelet doesn't backoff from restarting it.
|
||||||
limits:
|
limits:
|
||||||
memory: 170Mi
|
memory: {{ pillar['dns_memory_limit'] }}
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 70Mi
|
memory: 70Mi
|
||||||
|
@ -106,7 +106,7 @@ spec:
|
|||||||
# guaranteed class. Currently, this container falls into the
|
# guaranteed class. Currently, this container falls into the
|
||||||
# "burstable" category so the kubelet doesn't backoff from restarting it.
|
# "burstable" category so the kubelet doesn't backoff from restarting it.
|
||||||
limits:
|
limits:
|
||||||
memory: 170Mi
|
memory: $DNS_MEMORY_LIMIT
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 70Mi
|
memory: 70Mi
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
s/__PILLAR__DNS__SERVER__/{{ pillar['dns_server'] }}/g
|
s/__PILLAR__DNS__SERVER__/{{ pillar['dns_server'] }}/g
|
||||||
s/__PILLAR__DNS__DOMAIN__/{{ pillar['dns_domain'] }}/g
|
s/__PILLAR__DNS__DOMAIN__/{{ pillar['dns_domain'] }}/g
|
||||||
s/__PILLAR__CLUSTER_CIDR__/{{ pillar['service_cluster_ip_range'] }}/g
|
s/__PILLAR__CLUSTER_CIDR__/{{ pillar['service_cluster_ip_range'] }}/g
|
||||||
|
s/__PILLAR__DNS__MEMORY__LIMIT__/{{ pillar['dns_memory_limit'] }}/g
|
||||||
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
|
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
s/__PILLAR__DNS__SERVER__/$DNS_SERVER_IP/g
|
s/__PILLAR__DNS__SERVER__/$DNS_SERVER_IP/g
|
||||||
s/__PILLAR__DNS__DOMAIN__/$DNS_DOMAIN/g
|
s/__PILLAR__DNS__DOMAIN__/$DNS_DOMAIN/g
|
||||||
s/__PILLAR__CLUSTER_CIDR__/$SERVICE_CLUSTER_IP_RANGE/g
|
s/__PILLAR__CLUSTER_CIDR__/$SERVICE_CLUSTER_IP_RANGE/g
|
||||||
|
s/__PILLAR__DNS__MEMORY__LIMIT__/$DNS_MEMORY_LIMIT/g
|
||||||
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
|
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
|
||||||
|
@ -254,6 +254,7 @@ CLUSTER_DNS_CORE_DNS="${CLUSTER_DNS_CORE_DNS:-true}"
|
|||||||
ENABLE_CLUSTER_DNS="${KUBE_ENABLE_CLUSTER_DNS:-true}"
|
ENABLE_CLUSTER_DNS="${KUBE_ENABLE_CLUSTER_DNS:-true}"
|
||||||
DNS_SERVER_IP="${KUBE_DNS_SERVER_IP:-10.0.0.10}"
|
DNS_SERVER_IP="${KUBE_DNS_SERVER_IP:-10.0.0.10}"
|
||||||
DNS_DOMAIN="${KUBE_DNS_DOMAIN:-cluster.local}"
|
DNS_DOMAIN="${KUBE_DNS_DOMAIN:-cluster.local}"
|
||||||
|
DNS_MEMORY_LIMIT="${KUBE_DNS_MEMORY_LIMIT:-170Mi}"
|
||||||
|
|
||||||
# Optional: Enable DNS horizontal autoscaler
|
# Optional: Enable DNS horizontal autoscaler
|
||||||
ENABLE_DNS_HORIZONTAL_AUTOSCALER="${KUBE_ENABLE_DNS_HORIZONTAL_AUTOSCALER:-true}"
|
ENABLE_DNS_HORIZONTAL_AUTOSCALER="${KUBE_ENABLE_DNS_HORIZONTAL_AUTOSCALER:-true}"
|
||||||
|
@ -285,6 +285,7 @@ ENABLE_CLUSTER_DNS="${KUBE_ENABLE_CLUSTER_DNS:-true}"
|
|||||||
DNS_SERVER_IP="10.0.0.10"
|
DNS_SERVER_IP="10.0.0.10"
|
||||||
LOCAL_DNS_IP="${KUBE_LOCAL_DNS_IP:-169.254.20.10}"
|
LOCAL_DNS_IP="${KUBE_LOCAL_DNS_IP:-169.254.20.10}"
|
||||||
DNS_DOMAIN="cluster.local"
|
DNS_DOMAIN="cluster.local"
|
||||||
|
DNS_MEMORY_LIMIT="${KUBE_DNS_MEMORY_LIMIT:-170Mi}"
|
||||||
|
|
||||||
# Optional: Enable DNS horizontal autoscaler
|
# Optional: Enable DNS horizontal autoscaler
|
||||||
ENABLE_DNS_HORIZONTAL_AUTOSCALER="${KUBE_ENABLE_DNS_HORIZONTAL_AUTOSCALER:-true}"
|
ENABLE_DNS_HORIZONTAL_AUTOSCALER="${KUBE_ENABLE_DNS_HORIZONTAL_AUTOSCALER:-true}"
|
||||||
|
@ -2376,6 +2376,7 @@ function setup-coredns-manifest {
|
|||||||
sed -i -e "s@{{ *pillar\['dns_domain'\] *}}@${DNS_DOMAIN}@g" "${coredns_file}"
|
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\['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\['service_cluster_ip_range'\] *}}@${SERVICE_CLUSTER_IP_RANGE}@g" "${coredns_file}"
|
||||||
|
sed -i -e "s@{{ *pillar\['dns_memory_limit'\] *}}@${DNS_MEMORY_LIMIT}@g" "${coredns_file}"
|
||||||
|
|
||||||
if [[ "${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-}" == "true" ]]; then
|
if [[ "${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-}" == "true" ]]; then
|
||||||
setup-addon-manifests "addons" "dns-horizontal-autoscaler" "gce"
|
setup-addon-manifests "addons" "dns-horizontal-autoscaler" "gce"
|
||||||
@ -2427,6 +2428,7 @@ EOF
|
|||||||
# Replace the salt configurations with variable values.
|
# Replace the salt configurations with variable values.
|
||||||
sed -i -e "s@{{ *pillar\['dns_domain'\] *}}@${DNS_DOMAIN}@g" "${kubedns_file}"
|
sed -i -e "s@{{ *pillar\['dns_domain'\] *}}@${DNS_DOMAIN}@g" "${kubedns_file}"
|
||||||
sed -i -e "s@{{ *pillar\['dns_server'\] *}}@${DNS_SERVER_IP}@g" "${kubedns_file}"
|
sed -i -e "s@{{ *pillar\['dns_server'\] *}}@${DNS_SERVER_IP}@g" "${kubedns_file}"
|
||||||
|
sed -i -e "s@{{ *pillar\['dns_memory_limit'\] *}}@${DNS_MEMORY_LIMIT}@g" "${kubedns_file}"
|
||||||
|
|
||||||
if [[ "${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-}" == "true" ]]; then
|
if [[ "${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-}" == "true" ]]; then
|
||||||
setup-addon-manifests "addons" "dns-horizontal-autoscaler" "gce"
|
setup-addon-manifests "addons" "dns-horizontal-autoscaler" "gce"
|
||||||
|
@ -1123,6 +1123,7 @@ ENABLE_NODELOCAL_DNS: $(yaml-quote ${ENABLE_NODELOCAL_DNS:-false})
|
|||||||
DNS_SERVER_IP: $(yaml-quote ${DNS_SERVER_IP:-})
|
DNS_SERVER_IP: $(yaml-quote ${DNS_SERVER_IP:-})
|
||||||
LOCAL_DNS_IP: $(yaml-quote ${LOCAL_DNS_IP:-})
|
LOCAL_DNS_IP: $(yaml-quote ${LOCAL_DNS_IP:-})
|
||||||
DNS_DOMAIN: $(yaml-quote ${DNS_DOMAIN:-})
|
DNS_DOMAIN: $(yaml-quote ${DNS_DOMAIN:-})
|
||||||
|
DNS_MEMORY_LIMIT: $(yaml-quote ${DNS_MEMORY_LIMIT:-})
|
||||||
ENABLE_DNS_HORIZONTAL_AUTOSCALER: $(yaml-quote ${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-false})
|
ENABLE_DNS_HORIZONTAL_AUTOSCALER: $(yaml-quote ${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-false})
|
||||||
KUBE_PROXY_DAEMONSET: $(yaml-quote ${KUBE_PROXY_DAEMONSET:-false})
|
KUBE_PROXY_DAEMONSET: $(yaml-quote ${KUBE_PROXY_DAEMONSET:-false})
|
||||||
KUBE_PROXY_TOKEN: $(yaml-quote ${KUBE_PROXY_TOKEN:-})
|
KUBE_PROXY_TOKEN: $(yaml-quote ${KUBE_PROXY_TOKEN:-})
|
||||||
|
Loading…
Reference in New Issue
Block a user