6a22b3adfe
This update modifies the Kubernetes patch kubeadm-create-platform-pods-with-zero-CPU-resources.patch to set the CoreDNS memory request to zero. Test Plan: PASS: Run all Kubelet, kubeadm, kubectl make tests for affected code. PASS: All affected versions of kubernetes package build successfully. PASS: Verify the CoreDNS pod by describing it and ensure that the memory request is set to zero. Story: 2011047 Task: 51024 Change-Id: If1ed7346817cc0de01589afb5add15c2f1621d54 Signed-off-by: Boovan Rajendran <boovan.rajendran@windriver.com>
119 lines
6.1 KiB
Diff
119 lines
6.1 KiB
Diff
From 38a9c61d87efb1385c8cf372bf013465d52632a1 Mon Sep 17 00:00:00 2001
|
|
From: Chris Friesen <chris.friesen@windriver.com>
|
|
Date: Fri, 3 Sep 2021 18:05:15 -0400
|
|
Subject: [PATCH] kubeadm: create platform pods with zero CPU resources
|
|
|
|
We want to specify zero CPU resources when creating the manifests
|
|
for the static platform pods, as a workaround for the lack of
|
|
separate resource tracking for platform resources.
|
|
|
|
We also specify zero CPU and Memory resources for the
|
|
coredns deployment.
|
|
manifests.go appears to be the main file for this, not
|
|
sure if the others are used but I changed them just in case.
|
|
|
|
Signed-off-by: Daniel Safta <daniel.safta@windriver.com>
|
|
Signed-off-by: Boovan Rajendran <boovan.rajendran@windriver.com>
|
|
---
|
|
cluster/addons/dns/coredns/coredns.yaml.base | 4 ++--
|
|
cluster/addons/dns/coredns/coredns.yaml.in | 4 ++--
|
|
cluster/addons/dns/coredns/coredns.yaml.sed | 4 ++--
|
|
cmd/kubeadm/app/phases/addons/dns/manifests.go | 4 ++--
|
|
cmd/kubeadm/app/phases/controlplane/manifests.go | 6 +++---
|
|
5 files changed, 11 insertions(+), 11 deletions(-)
|
|
|
|
diff --git a/cluster/addons/dns/coredns/coredns.yaml.base b/cluster/addons/dns/coredns/coredns.yaml.base
|
|
index dea3749f217..908fd2b246a 100644
|
|
--- a/cluster/addons/dns/coredns/coredns.yaml.base
|
|
+++ b/cluster/addons/dns/coredns/coredns.yaml.base
|
|
@@ -145,8 +145,8 @@ spec:
|
|
limits:
|
|
memory: __DNS__MEMORY__LIMIT__
|
|
requests:
|
|
- cpu: 100m
|
|
- memory: 70Mi
|
|
+ cpu: 0
|
|
+ memory: 0
|
|
args: [ "-conf", "/etc/coredns/Corefile" ]
|
|
volumeMounts:
|
|
- name: config-volume
|
|
diff --git a/cluster/addons/dns/coredns/coredns.yaml.in b/cluster/addons/dns/coredns/coredns.yaml.in
|
|
index 808dd54b545..1bc9c632a3a 100644
|
|
--- a/cluster/addons/dns/coredns/coredns.yaml.in
|
|
+++ b/cluster/addons/dns/coredns/coredns.yaml.in
|
|
@@ -145,8 +145,8 @@ spec:
|
|
limits:
|
|
memory: 'dns_memory_limit'
|
|
requests:
|
|
- cpu: 100m
|
|
- memory: 70Mi
|
|
+ cpu: 0
|
|
+ memory: 0
|
|
args: [ "-conf", "/etc/coredns/Corefile" ]
|
|
volumeMounts:
|
|
- name: config-volume
|
|
diff --git a/cluster/addons/dns/coredns/coredns.yaml.sed b/cluster/addons/dns/coredns/coredns.yaml.sed
|
|
index 8788f41d31c..5be046ad844 100644
|
|
--- a/cluster/addons/dns/coredns/coredns.yaml.sed
|
|
+++ b/cluster/addons/dns/coredns/coredns.yaml.sed
|
|
@@ -145,8 +145,8 @@ spec:
|
|
limits:
|
|
memory: $DNS_MEMORY_LIMIT
|
|
requests:
|
|
- cpu: 100m
|
|
- memory: 70Mi
|
|
+ cpu: 0
|
|
+ memory: 0
|
|
args: [ "-conf", "/etc/coredns/Corefile" ]
|
|
volumeMounts:
|
|
- name: config-volume
|
|
diff --git a/cmd/kubeadm/app/phases/addons/dns/manifests.go b/cmd/kubeadm/app/phases/addons/dns/manifests.go
|
|
index 97c7f8b3e60..87df378cfc0 100644
|
|
--- a/cmd/kubeadm/app/phases/addons/dns/manifests.go
|
|
+++ b/cmd/kubeadm/app/phases/addons/dns/manifests.go
|
|
@@ -95,8 +95,8 @@ spec:
|
|
limits:
|
|
memory: 170Mi
|
|
requests:
|
|
- cpu: 100m
|
|
- memory: 70Mi
|
|
+ cpu: 0
|
|
+ memory: 0
|
|
args: [ "-conf", "/etc/coredns/Corefile" ]
|
|
volumeMounts:
|
|
- name: config-volume
|
|
diff --git a/cmd/kubeadm/app/phases/controlplane/manifests.go b/cmd/kubeadm/app/phases/controlplane/manifests.go
|
|
index 8cd0bf577cd..b024263d8d1 100644
|
|
--- a/cmd/kubeadm/app/phases/controlplane/manifests.go
|
|
+++ b/cmd/kubeadm/app/phases/controlplane/manifests.go
|
|
@@ -63,7 +63,7 @@ func GetStaticPodSpecs(cfg *kubeadmapi.ClusterConfiguration, endpoint *kubeadmap
|
|
LivenessProbe: staticpodutil.LivenessProbe(staticpodutil.GetAPIServerProbeAddress(endpoint), "/livez", int(endpoint.BindPort), v1.URISchemeHTTPS),
|
|
ReadinessProbe: staticpodutil.ReadinessProbe(staticpodutil.GetAPIServerProbeAddress(endpoint), "/readyz", int(endpoint.BindPort), v1.URISchemeHTTPS),
|
|
StartupProbe: staticpodutil.StartupProbe(staticpodutil.GetAPIServerProbeAddress(endpoint), "/livez", int(endpoint.BindPort), v1.URISchemeHTTPS, cfg.APIServer.TimeoutForControlPlane),
|
|
- Resources: staticpodutil.ComponentResources("250m"),
|
|
+ Resources: staticpodutil.ComponentResources("0"),
|
|
Env: kubeadmutil.GetProxyEnvVars(),
|
|
}, mounts.GetVolumes(kubeadmconstants.KubeAPIServer),
|
|
map[string]string{kubeadmconstants.KubeAPIServerAdvertiseAddressEndpointAnnotationKey: endpoint.String()}),
|
|
@@ -75,7 +75,7 @@ func GetStaticPodSpecs(cfg *kubeadmapi.ClusterConfiguration, endpoint *kubeadmap
|
|
VolumeMounts: staticpodutil.VolumeMountMapToSlice(mounts.GetVolumeMounts(kubeadmconstants.KubeControllerManager)),
|
|
LivenessProbe: staticpodutil.LivenessProbe(staticpodutil.GetControllerManagerProbeAddress(cfg), "/healthz", kubeadmconstants.KubeControllerManagerPort, v1.URISchemeHTTPS),
|
|
StartupProbe: staticpodutil.StartupProbe(staticpodutil.GetControllerManagerProbeAddress(cfg), "/healthz", kubeadmconstants.KubeControllerManagerPort, v1.URISchemeHTTPS, cfg.APIServer.TimeoutForControlPlane),
|
|
- Resources: staticpodutil.ComponentResources("200m"),
|
|
+ Resources: staticpodutil.ComponentResources("0"),
|
|
Env: kubeadmutil.GetProxyEnvVars(),
|
|
}, mounts.GetVolumes(kubeadmconstants.KubeControllerManager), nil),
|
|
kubeadmconstants.KubeScheduler: staticpodutil.ComponentPod(v1.Container{
|
|
@@ -86,7 +86,7 @@ func GetStaticPodSpecs(cfg *kubeadmapi.ClusterConfiguration, endpoint *kubeadmap
|
|
VolumeMounts: staticpodutil.VolumeMountMapToSlice(mounts.GetVolumeMounts(kubeadmconstants.KubeScheduler)),
|
|
LivenessProbe: staticpodutil.LivenessProbe(staticpodutil.GetSchedulerProbeAddress(cfg), "/healthz", kubeadmconstants.KubeSchedulerPort, v1.URISchemeHTTPS),
|
|
StartupProbe: staticpodutil.StartupProbe(staticpodutil.GetSchedulerProbeAddress(cfg), "/healthz", kubeadmconstants.KubeSchedulerPort, v1.URISchemeHTTPS, cfg.APIServer.TimeoutForControlPlane),
|
|
- Resources: staticpodutil.ComponentResources("100m"),
|
|
+ Resources: staticpodutil.ComponentResources("0"),
|
|
Env: kubeadmutil.GetProxyEnvVars(),
|
|
}, mounts.GetVolumes(kubeadmconstants.KubeScheduler), nil),
|
|
}
|
|
--
|
|
2.25.1
|
|
|