Add option to mount host path for cgroups

Capability added to disable cgroups host path volume

Change-Id: I007d9a79b812094126fadb36fd743133495d337f
This commit is contained in:
SPEARS, DUSTIN (ds443n) 2023-09-19 13:19:41 -04:00
parent 736c936394
commit ba3657c0c1
3 changed files with 13 additions and 0 deletions

View File

@ -94,9 +94,11 @@ spec:
- /tmp/start.sh - /tmp/start.sh
{{ dict "envAll" $envAll "component" "rack" "container" "maas-rack" "type" "readiness" "probeTemplate" (include "maasrackreadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }} {{ dict "envAll" $envAll "component" "rack" "container" "maas-rack" "type" "readiness" "probeTemplate" (include "maasrackreadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
volumeMounts: volumeMounts:
{{- if not .Values.conf.maas.cgroups.disable_cgroups_rack }}
- mountPath: /sys/fs/cgroup - mountPath: /sys/fs/cgroup
name: host-sys-fs-cgroup name: host-sys-fs-cgroup
readOnly: true readOnly: true
{{- end }}
- mountPath: /run - mountPath: /run
name: pod-run name: pod-run
- mountPath: /run/lock - mountPath: /run/lock
@ -155,9 +157,11 @@ spec:
readOnly: true readOnly: true
{{ if $mounts_maas_rack.volumeMounts }}{{ toYaml $mounts_maas_rack.volumeMounts | indent 12 }}{{ end }} {{ if $mounts_maas_rack.volumeMounts }}{{ toYaml $mounts_maas_rack.volumeMounts | indent 12 }}{{ end }}
volumes: volumes:
{{- if not .Values.conf.maas.cgroups.disable_cgroups_rack }}
- name: host-sys-fs-cgroup - name: host-sys-fs-cgroup
hostPath: hostPath:
path: /sys/fs/cgroup path: /sys/fs/cgroup
{{- end }}
- name: host-cloud-init - name: host-cloud-init
hostPath: hostPath:
path: /run/cloud-init path: /run/cloud-init

View File

@ -108,9 +108,11 @@ spec:
command: command:
- /tmp/start.sh - /tmp/start.sh
volumeMounts: volumeMounts:
{{- if not .Values.conf.maas.cgroups.disable_cgroups_region }}
- mountPath: /sys/fs/cgroup - mountPath: /sys/fs/cgroup
name: host-sys-fs-cgroup name: host-sys-fs-cgroup
readOnly: true readOnly: true
{{- end }}
- mountPath: /run - mountPath: /run
name: pod-run name: pod-run
- mountPath: /run/lock - mountPath: /run/lock
@ -179,9 +181,11 @@ spec:
readOnly: true readOnly: true
{{- if $mounts_maas_region.volumeMounts }}{{ toYaml $mounts_maas_region.volumeMounts | indent 12 }}{{ end }} {{- if $mounts_maas_region.volumeMounts }}{{ toYaml $mounts_maas_region.volumeMounts | indent 12 }}{{ end }}
volumes: volumes:
{{- if not .Values.conf.maas.cgroups.disable_cgroups_region }}
- name: host-sys-fs-cgroup - name: host-sys-fs-cgroup
hostPath: hostPath:
path: /sys/fs/cgroup path: /sys/fs/cgroup
{{- end }}
- name: pod-run - name: pod-run
emptyDir: {} emptyDir: {}
- name: pod-run-lock - name: pod-run-lock

View File

@ -234,6 +234,11 @@ conf:
url: url:
maas_url: null maas_url: null
ingress_disable_gui: false ingress_disable_gui: false
cgroups:
# When set to true, this won't mount the host path /sys/fs/cgroup. Used
# to enable use of cgroups v2. Also requires running container as privileged
disable_cgroups_region: false
disable_cgroups_rack: false
ntp: ntp:
# These options allow you to mock out the ntpd binary within the container # These options allow you to mock out the ntpd binary within the container
# by overwriting it with a script that simply sleeps - this is useful in # by overwriting it with a script that simply sleeps - this is useful in