Skip to content

Commit

Permalink
chore: stop services and reboot to reload containerd service
Browse files Browse the repository at this point in the history
  • Loading branch information
cwrau committed Aug 9, 2024
1 parent e5adc06 commit df55de9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ openstack

{{- define "t8s-cluster.clusterClass.preKubeadmCommands" -}}
{{- $_ := mustMerge . (pick .context "Values") -}}
{{- $commands := list -}}
{{- $commands := list "systemctl stop kubelet.service" "systemctl disable --now snapd.service snapd.socket" -}}
{{- if .Values.global.injectedCertificateAuthorities -}}
{{- $commands = append $commands "update-ca-certificates" -}}
{{- end -}}
{{- toYaml $commands }}
{{- end -}}

{{- define "t8s-cluster.clusterClass.postKubeadmCommands" -}}
{{- $commands := list "systemctl disable --now snapd.service snapd.socket" -}}
{{- $commands := list "systemctl reboot" -}}
{{- toYaml $commands }}
{{- end -}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{- define "t8s-cluster.clusterClass.kubeadmControlPlaneTemplate.preKubeadmCommands" -}}
{{- $_ := mustMerge . (pick .context "Values") -}}
{{- $commands := list -}}
{{- $commands = append $commands "bash /etc/kube-proxy-patch.sh" -}}
{{- $commands = append $commands "/etc/kube-proxy-patch.sh" -}}
{{- if .Values.global.injectedCertificateAuthorities -}}
{{- $commands = append $commands "update-ca-certificates" -}}
{{- end -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@
{{- $options = set $options "protectKernelDefaults" true -}}
{{- $options = set $options "tlsCipherSuites" (include "t8s-cluster.clusterClass.tlsCipherSuites" (dict) | fromYamlArray) -}}
{{- $options = set $options "seccompDefault" true -}}
{{/* {{- $options = set $options "enforceNodeAllocatable" (list "pods" "system-reserved" "kube-reserved") -}}*/}}
{{- $options = set $options "enforceNodeAllocatable" (list "pods") -}}
{{/* {{- $options = set $options "kubeReservedCgroup" (include "t8s-cluster.clusterClass.systemdOverride.slice.runtime" (dict) | trimSuffix ".slice") -}}*/}}
{{/* {{- $options = set $options "systemReservedCgroup" "system" -}}*/}}
{{- $options = set $options "enforceNodeAllocatable" (list "pods" "system-reserved" "kube-reserved") -}}
{{/* {{- $options = set $options "enforceNodeAllocatable" (list "pods") -}}*/}}
{{- $options = set $options "kubeReservedCgroup" (include "t8s-cluster.clusterClass.systemdOverride.slice.runtime" (dict) | trimSuffix ".slice") -}}
{{- $options = set $options "systemReservedCgroup" "system" -}}
{{/* the *Reserved need to include the memory.available, see https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/#node-pressure-eviction-good-practices */}}
{{- $options = set $options "kubeReserved" (dict
"memory" "0.2Gi"
"memory" "0.6Gi"
"ephemeral-storage" "1Gi"
) -}}
{{- $options = set $options "systemReserved" (dict
"memory" "0.4Gi"
"memory" "0.3Gi"
"ephemeral-storage" "1Gi"
) -}}
{{- $options = set $options "evictionHard" (dict "memory.available" "64Mi" "nodefs.available" "2Gi") -}}
{{- $options = set $options "evictionHard" (dict "memory.available" "128Mi" "nodefs.available" "2Gi") -}}
{{- $options | toYaml -}}
{{- end -}}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- define "t8s-cluster.clusterClass.node.systemdOverrides" -}}
{{- $files := list -}}
{{/* TODO: containerd is already running when this is set, therefore this is not working {{- range $service := list "containerd" "kubelet" -}}*/}}
{{- range $service := list "kubelet" -}}
{{- range $service := list "containerd" "kubelet" -}}
{{- $files = append $files (dict "content" (include (printf "t8s-cluster.clusterClass.node.systemdOverride.%s" $service) (dict)) "path" (printf "/etc/systemd/system/%s.service.d/slice.conf" $service)) -}}
{{- end -}}
{{- $files | toYaml -}}
Expand Down

0 comments on commit df55de9

Please sign in to comment.