Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Run kube services under /system.slice
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Addison committed Jun 8, 2018
1 parent 1f97e08 commit 867c070
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions puppet/modules/kubernetes/manifests/kubelet.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [],
Expand Down
6 changes: 3 additions & 3 deletions puppet/modules/kubernetes/templates/kubelet.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ 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 = []
@cgroup_kube_reserved << "cpu=#{@cgroup_kube_reserved_cpu}" unless @cgroup_kube_reserved_cpu.nil? or @cgroup_kube_reserved_cpu == 'nil'
@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 -%>
Expand Down

0 comments on commit 867c070

Please sign in to comment.