From 9405eb821b3483d0c01d08df607d90c41b15c3a8 Mon Sep 17 00:00:00 2001 From: Mohamed Omar Zaian Date: Fri, 19 May 2023 12:38:29 +0200 Subject: [PATCH] [feature] Supprt enabling cpu limit in corends deployment (#10103) --- roles/kubernetes-apps/ansible/defaults/main.yml | 3 +++ .../ansible/templates/coredns-deployment.yml.j2 | 3 +++ 2 files changed, 6 insertions(+) diff --git a/roles/kubernetes-apps/ansible/defaults/main.yml b/roles/kubernetes-apps/ansible/defaults/main.yml index 8aa767f99..e743037f9 100644 --- a/roles/kubernetes-apps/ansible/defaults/main.yml +++ b/roles/kubernetes-apps/ansible/defaults/main.yml @@ -1,5 +1,8 @@ --- # Limits for coredns + +# uncomment the line below to customize the DNS cpu limit value +# dns_cpu_limit: 300m dns_memory_limit: 300Mi dns_cpu_requests: 100m dns_memory_requests: 70Mi diff --git a/roles/kubernetes-apps/ansible/templates/coredns-deployment.yml.j2 b/roles/kubernetes-apps/ansible/templates/coredns-deployment.yml.j2 index 316425bfd..6cb760434 100644 --- a/roles/kubernetes-apps/ansible/templates/coredns-deployment.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/coredns-deployment.yml.j2 @@ -65,6 +65,9 @@ spec: # guaranteed class. Currently, this container falls into the # "burstable" category so the kubelet doesn't backoff from restarting it. limits: +{% if dns_cpu_limit is defined %} + cpu: {{ dns_cpu_limit }} +{% endif %} memory: {{ dns_memory_limit }} requests: cpu: {{ dns_cpu_requests }}