From 867c07051ea38d862a6cf560336c69b5e4b0829b Mon Sep 17 00:00:00 2001 From: Luke Addison Date: Fri, 8 Jun 2018 15:59:46 +0100 Subject: [PATCH] Run kube services under /system.slice --- puppet/modules/kubernetes/manifests/kubelet.pp | 10 +++++----- .../modules/kubernetes/templates/kubelet.service.erb | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/puppet/modules/kubernetes/manifests/kubelet.pp b/puppet/modules/kubernetes/manifests/kubelet.pp index 6f4f1ebbfb..fcb1b1b170 100644 --- a/puppet/modules/kubernetes/manifests/kubelet.pp +++ b/puppet/modules/kubernetes/manifests/kubelet.pp @@ -30,12 +30,12 @@ default => 'cgroupfs', }, String $cgroup_root = '/', - Optional[String] $cgroup_kube_name = '/podruntime.slice', - Optional[String] $cgroup_kube_reserved_memory = '256Mi', - Optional[String] $cgroup_kube_reserved_cpu = '10m', + Optional[String] $cgroup_kube_name = undef, + Optional[String] $cgroup_kube_reserved_memory = '', + Optional[String] $cgroup_kube_reserved_cpu = '', Optional[String] $cgroup_system_name = '/system.slice', - Optional[String] $cgroup_system_reserved_memory = '128Mi', - Optional[String] $cgroup_system_reserved_cpu = '10m', + Optional[String] $cgroup_system_reserved_memory = '1Gi', + Optional[String] $cgroup_system_reserved_cpu = '200m', Array[String] $systemd_wants = [], Array[String] $systemd_requires = [], Array[String] $systemd_after = [], diff --git a/puppet/modules/kubernetes/templates/kubelet.service.erb b/puppet/modules/kubernetes/templates/kubelet.service.erb index 6d12406db8..9d9867e3fb 100644 --- a/puppet/modules/kubernetes/templates/kubelet.service.erb +++ b/puppet/modules/kubernetes/templates/kubelet.service.erb @@ -73,9 +73,6 @@ ExecStart=<%= scope['kubernetes::_dest_dir'] %>/kubelet \ --cgroup-driver=<%= @cgroup_driver %> \ --cgroup-root=<%= @cgroup_root %> \ <% if @cgroup_kube_name -%> - --kube-reserved-cgroup=<%= @cgroup_kube_name %> \ - --runtime-cgroups=<%= @cgroup_kube_name %> \ - --kubelet-cgroups=<%= @cgroup_kube_name %> \ <% # build kube reserved command line @cgroup_kube_reserved = [] @@ -83,6 +80,9 @@ ExecStart=<%= scope['kubernetes::_dest_dir'] %>/kubelet \ @cgroup_kube_reserved << "memory=#{@cgroup_kube_reserved_memory}" unless @cgroup_kube_reserved_memory.nil? or @cgroup_kube_reserved_memory == 'nil' if @cgroup_kube_reserved.length > 0 -%> + --kube-reserved-cgroup=<%= @cgroup_kube_name %> \ + --runtime-cgroups=<%= @cgroup_kube_name %> \ + --kubelet-cgroups=<%= @cgroup_kube_name %> \ "--kube-reserved=<%= @cgroup_kube_reserved.join(',') %>" \ <% end -%> <% end -%>