From 28fce44b702d04a334937126eb58fcd89085ff19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 3 Jun 2026 22:06:26 +0200 Subject: [PATCH] kata-deploy: extract shared pod env/volumes into helm helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pull the kata-deploy container's environment block and host volume/volumeMount definitions out of the DaemonSet template into reusable named templates in _helpers.tpl: - kata-deploy.commonEnv - kata-deploy.commonVolumeMounts - kata-deploy.commonVolumes These are derived purely from chart values and are independent of the deployment model, so they can be shared verbatim by upcoming per-node install/cleanup Jobs without duplicating the (large) env wiring. Pure refactor: the rendered DaemonSet is byte-for-byte identical to before (verified via normalized `helm template` diff across default and multiInstallSuffix/userDropIn/customRuntimes permutations). Signed-off-by: Fabiano FidĂȘncio Assisted-by: Cursor --- .../kata-deploy/templates/_helpers.tpl | 240 ++++++++++++++++++ .../kata-deploy/templates/kata-deploy.yaml | 215 +--------------- 2 files changed, 243 insertions(+), 212 deletions(-) diff --git a/tools/packaging/kata-deploy/helm-chart/kata-deploy/templates/_helpers.tpl b/tools/packaging/kata-deploy/helm-chart/kata-deploy/templates/_helpers.tpl index cd885522e0..dae7c0ca32 100644 --- a/tools/packaging/kata-deploy/helm-chart/kata-deploy/templates/_helpers.tpl +++ b/tools/packaging/kata-deploy/helm-chart/kata-deploy/templates/_helpers.tpl @@ -409,6 +409,246 @@ Get debug value from structured config {{- end -}} {{- end -}} +{{/* +Common environment variables for any pod that runs the kata-deploy binary +(DaemonSet, staged JobSet install/cleanup Jobs, reconcile-created Jobs). + +These are all derived from chart values and are independent of the deployment +model, so they are shared verbatim. HEALTH_PORT and the health probes are NOT +included here: they only matter for the long-running install pod (DaemonSet), +not the short-lived staged Jobs. + +Emitted at column 0; callers must indent with `nindent` to the right depth, +e.g. `{{- include "kata-deploy.commonEnv" . | nindent 8 }}`. +*/}} +{{- define "kata-deploy.commonEnv" -}} +- name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName +{{- if .Values.env.multiInstallSuffix }} +- name: DAEMONSET_NAME + value: {{ printf "%s-%s" .Chart.Name .Values.env.multiInstallSuffix | quote }} +{{- else }} +- name: DAEMONSET_NAME + value: {{ .Chart.Name | quote }} +{{- end }} +- name: DEBUG + value: {{ include "kata-deploy.getDebug" . | quote }} +{{- $shimsAmd64 := include "kata-deploy.getEnabledShimsForArch" (dict "root" . "arch" "amd64") | trim -}} +{{- if $shimsAmd64 }} +- name: SHIMS_X86_64 + value: {{ $shimsAmd64 | quote }} +{{- end }} +{{- $shimsArm64 := include "kata-deploy.getEnabledShimsForArch" (dict "root" . "arch" "arm64") | trim -}} +{{- if $shimsArm64 }} +- name: SHIMS_AARCH64 + value: {{ $shimsArm64 | quote }} +{{- end }} +{{- $shimsS390x := include "kata-deploy.getEnabledShimsForArch" (dict "root" . "arch" "s390x") | trim -}} +{{- if $shimsS390x }} +- name: SHIMS_S390X + value: {{ $shimsS390x | quote }} +{{- end }} +{{- $shimsPpc64le := include "kata-deploy.getEnabledShimsForArch" (dict "root" . "arch" "ppc64le") | trim -}} +{{- if $shimsPpc64le }} +- name: SHIMS_PPC64LE + value: {{ $shimsPpc64le | quote }} +{{- end }} +{{- $defaultShimAmd64 := include "kata-deploy.getDefaultShimForArch" (dict "root" . "arch" "amd64") | trim -}} +{{- if $defaultShimAmd64 }} +- name: DEFAULT_SHIM_X86_64 + value: {{ $defaultShimAmd64 | quote }} +{{- end }} +{{- $defaultShimArm64 := include "kata-deploy.getDefaultShimForArch" (dict "root" . "arch" "arm64") | trim -}} +{{- if $defaultShimArm64 }} +- name: DEFAULT_SHIM_AARCH64 + value: {{ $defaultShimArm64 | quote }} +{{- end }} +{{- $defaultShimS390x := include "kata-deploy.getDefaultShimForArch" (dict "root" . "arch" "s390x") | trim -}} +{{- if $defaultShimS390x }} +- name: DEFAULT_SHIM_S390X + value: {{ $defaultShimS390x | quote }} +{{- end }} +{{- $defaultShimPpc64le := include "kata-deploy.getDefaultShimForArch" (dict "root" . "arch" "ppc64le") | trim -}} +{{- if $defaultShimPpc64le }} +- name: DEFAULT_SHIM_PPC64LE + value: {{ $defaultShimPpc64le | quote }} +{{- end }} +{{- $allowedHypervisorAnnotationsAmd64 := include "kata-deploy.getAllowedHypervisorAnnotationsForArch" (dict "root" . "arch" "amd64") | trim -}} +{{- if $allowedHypervisorAnnotationsAmd64 }} +- name: ALLOWED_HYPERVISOR_ANNOTATIONS_X86_64 + value: {{ $allowedHypervisorAnnotationsAmd64 | quote }} +{{- end }} +{{- $allowedHypervisorAnnotationsArm64 := include "kata-deploy.getAllowedHypervisorAnnotationsForArch" (dict "root" . "arch" "arm64") | trim -}} +{{- if $allowedHypervisorAnnotationsArm64 }} +- name: ALLOWED_HYPERVISOR_ANNOTATIONS_AARCH64 + value: {{ $allowedHypervisorAnnotationsArm64 | quote }} +{{- end }} +{{- $allowedHypervisorAnnotationsS390x := include "kata-deploy.getAllowedHypervisorAnnotationsForArch" (dict "root" . "arch" "s390x") | trim -}} +{{- if $allowedHypervisorAnnotationsS390x }} +- name: ALLOWED_HYPERVISOR_ANNOTATIONS_S390X + value: {{ $allowedHypervisorAnnotationsS390x | quote }} +{{- end }} +{{- $allowedHypervisorAnnotationsPpc64le := include "kata-deploy.getAllowedHypervisorAnnotationsForArch" (dict "root" . "arch" "ppc64le") | trim -}} +{{- if $allowedHypervisorAnnotationsPpc64le }} +- name: ALLOWED_HYPERVISOR_ANNOTATIONS_PPC64LE + value: {{ $allowedHypervisorAnnotationsPpc64le | quote }} +{{- end }} +{{- $snapshotterHandlerMappingAmd64 := include "kata-deploy.getSnapshotterHandlerMappingForArch" (dict "root" . "arch" "amd64") | trim -}} +{{- if $snapshotterHandlerMappingAmd64 }} +- name: SNAPSHOTTER_HANDLER_MAPPING_X86_64 + value: {{ $snapshotterHandlerMappingAmd64 | quote }} +{{- end }} +{{- $snapshotterHandlerMappingArm64 := include "kata-deploy.getSnapshotterHandlerMappingForArch" (dict "root" . "arch" "arm64") | trim -}} +{{- if $snapshotterHandlerMappingArm64 }} +- name: SNAPSHOTTER_HANDLER_MAPPING_AARCH64 + value: {{ $snapshotterHandlerMappingArm64 | quote }} +{{- end }} +{{- $snapshotterHandlerMappingS390x := include "kata-deploy.getSnapshotterHandlerMappingForArch" (dict "root" . "arch" "s390x") | trim -}} +{{- if $snapshotterHandlerMappingS390x }} +- name: SNAPSHOTTER_HANDLER_MAPPING_S390X + value: {{ $snapshotterHandlerMappingS390x | quote }} +{{- end }} +{{- $snapshotterHandlerMappingPpc64le := include "kata-deploy.getSnapshotterHandlerMappingForArch" (dict "root" . "arch" "ppc64le") | trim -}} +{{- if $snapshotterHandlerMappingPpc64le }} +- name: SNAPSHOTTER_HANDLER_MAPPING_PPC64LE + value: {{ $snapshotterHandlerMappingPpc64le | quote }} +{{- end }} +{{- $agentHttpsProxy := include "kata-deploy.getAgentHttpsProxy" . | trim -}} +{{- if $agentHttpsProxy }} +- name: AGENT_HTTPS_PROXY + value: {{ $agentHttpsProxy | quote }} +{{- end }} +{{- $agentNoProxy := include "kata-deploy.getAgentNoProxy" . | trim -}} +{{- if $agentNoProxy }} +- name: AGENT_NO_PROXY + value: {{ $agentNoProxy | quote }} +{{- end }} +{{- $pullTypeMappingAmd64 := include "kata-deploy.getPullTypeMappingForArch" (dict "root" . "arch" "amd64") | trim -}} +{{- if $pullTypeMappingAmd64 }} +- name: PULL_TYPE_MAPPING_X86_64 + value: {{ $pullTypeMappingAmd64 | quote }} +{{- end }} +{{- $pullTypeMappingArm64 := include "kata-deploy.getPullTypeMappingForArch" (dict "root" . "arch" "arm64") | trim -}} +{{- if $pullTypeMappingArm64 }} +- name: PULL_TYPE_MAPPING_AARCH64 + value: {{ $pullTypeMappingArm64 | quote }} +{{- end }} +{{- $pullTypeMappingS390x := include "kata-deploy.getPullTypeMappingForArch" (dict "root" . "arch" "s390x") | trim -}} +{{- if $pullTypeMappingS390x }} +- name: PULL_TYPE_MAPPING_S390X + value: {{ $pullTypeMappingS390x | quote }} +{{- end }} +{{- $pullTypeMappingPpc64le := include "kata-deploy.getPullTypeMappingForArch" (dict "root" . "arch" "ppc64le") | trim -}} +{{- if $pullTypeMappingPpc64le }} +- name: PULL_TYPE_MAPPING_PPC64LE + value: {{ $pullTypeMappingPpc64le | quote }} +{{- end }} +- name: INSTALLATION_PREFIX + value: {{ .Values.env.installationPrefix | quote }} +- name: MULTI_INSTALL_SUFFIX + value: {{ .Values.env.multiInstallSuffix | quote }} +{{- $snapshotterSetup := include "kata-deploy.getSnapshotterSetup" . | trim -}} +{{- if $snapshotterSetup }} +- name: EXPERIMENTAL_SETUP_SNAPSHOTTER + value: {{ $snapshotterSetup | quote }} +{{- end }} +{{- $forceGuestPullAmd64 := include "kata-deploy.getForceGuestPullForArch" (dict "root" . "arch" "amd64") | trim -}} +{{- if $forceGuestPullAmd64 }} +- name: EXPERIMENTAL_FORCE_GUEST_PULL_X86_64 + value: {{ $forceGuestPullAmd64 | quote }} +{{- end }} +{{- $forceGuestPullArm64 := include "kata-deploy.getForceGuestPullForArch" (dict "root" . "arch" "arm64") | trim -}} +{{- if $forceGuestPullArm64 }} +- name: EXPERIMENTAL_FORCE_GUEST_PULL_AARCH64 + value: {{ $forceGuestPullArm64 | quote }} +{{- end }} +{{- $forceGuestPullS390x := include "kata-deploy.getForceGuestPullForArch" (dict "root" . "arch" "s390x") | trim -}} +{{- if $forceGuestPullS390x }} +- name: EXPERIMENTAL_FORCE_GUEST_PULL_S390X + value: {{ $forceGuestPullS390x | quote }} +{{- end }} +{{- $forceGuestPullPpc64le := include "kata-deploy.getForceGuestPullForArch" (dict "root" . "arch" "ppc64le") | trim -}} +{{- if $forceGuestPullPpc64le }} +- name: EXPERIMENTAL_FORCE_GUEST_PULL_PPC64LE + value: {{ $forceGuestPullPpc64le | quote }} +{{- end }} +{{- if .Values.containerd.configFileName | trim }} +- name: CONTAINERD_CONFIG_FILE_NAME + value: {{ .Values.containerd.configFileName | trim | quote }} +{{- end }} +{{- if .Values.containerd.userDropIn | trim }} +- name: CONTAINERD_USER_DROP_IN_SOURCE_FILE + value: "/custom-containerd-config/containerd-user-dropin.toml" +{{- end }} +{{- with .Values.env.hostOS }} +- name: HOST_OS + value: {{ . | quote }} +{{- end }} +{{- if and .Values.customRuntimes.enabled .Values.customRuntimes.runtimes }} +- name: CUSTOM_RUNTIMES_ENABLED + value: "true" +{{- end }} +{{- end -}} + +{{/* +Common volumeMounts for any pod that runs the kata-deploy binary against the +host. Emitted at column 0; indent with `nindent` at the call site. +*/}} +{{- define "kata-deploy.commonVolumeMounts" -}} +- name: crio-conf + mountPath: /etc/crio/ +- name: containerd-conf + mountPath: /etc/containerd/ +- name: host + mountPath: /host/ +{{- if .Values.containerd.userDropIn | trim }} +- name: custom-containerd-config + mountPath: /custom-containerd-config/ + readOnly: true +{{- end }} +{{- if or (and .Values.customRuntimes.enabled .Values.customRuntimes.runtimes) (eq (include "kata-deploy.hasDefaultRuntimeDropIns" . | trim) "true") }} +- name: custom-configs + mountPath: /custom-configs/ + readOnly: true +{{- end }} +{{- end -}} + +{{/* +Common host/configMap volumes backing the mounts above. Emitted at column 0; +indent with `nindent` at the call site. +*/}} +{{- define "kata-deploy.commonVolumes" -}} +- name: crio-conf + hostPath: + path: /etc/crio/ +- name: containerd-conf + hostPath: + path: '{{- template "containerdConfPath" .Values }}' +- name: host + hostPath: + path: / +{{- if .Values.containerd.userDropIn | trim }} +- name: custom-containerd-config + configMap: +{{- if .Values.env.multiInstallSuffix }} + name: {{ .Chart.Name }}-containerd-user-dropin-{{ .Values.env.multiInstallSuffix }} +{{- else }} + name: {{ .Chart.Name }}-containerd-user-dropin +{{- end }} +{{- end }} +{{- if or (and .Values.customRuntimes.enabled .Values.customRuntimes.runtimes) (eq (include "kata-deploy.hasDefaultRuntimeDropIns" . | trim) "true") }} +- name: custom-configs + configMap: +{{- if .Values.env.multiInstallSuffix }} + name: {{ .Chart.Name }}-custom-configs-{{ .Values.env.multiInstallSuffix }} +{{- else }} + name: {{ .Chart.Name }}-custom-configs +{{- end }} +{{- end }} +{{- end -}} + {{/* Get EXPERIMENTAL_FORCE_GUEST_PULL for a specific architecture from structured config Returns comma-separated list of shim names with forceGuestPull enabled diff --git a/tools/packaging/kata-deploy/helm-chart/kata-deploy/templates/kata-deploy.yaml b/tools/packaging/kata-deploy/helm-chart/kata-deploy/templates/kata-deploy.yaml index e1a2614a64..ff02c34de6 100644 --- a/tools/packaging/kata-deploy/helm-chart/kata-deploy/templates/kata-deploy.yaml +++ b/tools/packaging/kata-deploy/helm-chart/kata-deploy/templates/kata-deploy.yaml @@ -18,7 +18,6 @@ {{- end -}} {{- end -}} {{- end -}} -{{- $hasCustomConfigs := or (and .Values.customRuntimes.enabled .Values.customRuntimes.runtimes) (eq (include "kata-deploy.hasDefaultRuntimeDropIns" . | trim) "true") -}} apiVersion: apps/v1 kind: DaemonSet metadata: @@ -153,174 +152,7 @@ spec: {{- end }} - install env: - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName -{{- if .Values.env.multiInstallSuffix }} - - name: DAEMONSET_NAME - value: {{ printf "%s-%s" .Chart.Name .Values.env.multiInstallSuffix | quote }} -{{- else }} - - name: DAEMONSET_NAME - value: {{ .Chart.Name | quote }} -{{- end }} - - name: DEBUG - value: {{ include "kata-deploy.getDebug" . | quote }} - {{- $shimsAmd64 := include "kata-deploy.getEnabledShimsForArch" (dict "root" . "arch" "amd64") | trim -}} - {{- if $shimsAmd64 }} - - name: SHIMS_X86_64 - value: {{ $shimsAmd64 | quote }} - {{- end }} - {{- $shimsArm64 := include "kata-deploy.getEnabledShimsForArch" (dict "root" . "arch" "arm64") | trim -}} - {{- if $shimsArm64 }} - - name: SHIMS_AARCH64 - value: {{ $shimsArm64 | quote }} - {{- end }} - {{- $shimsS390x := include "kata-deploy.getEnabledShimsForArch" (dict "root" . "arch" "s390x") | trim -}} - {{- if $shimsS390x }} - - name: SHIMS_S390X - value: {{ $shimsS390x | quote }} - {{- end }} - {{- $shimsPpc64le := include "kata-deploy.getEnabledShimsForArch" (dict "root" . "arch" "ppc64le") | trim -}} - {{- if $shimsPpc64le }} - - name: SHIMS_PPC64LE - value: {{ $shimsPpc64le | quote }} - {{- end }} - {{- $defaultShimAmd64 := include "kata-deploy.getDefaultShimForArch" (dict "root" . "arch" "amd64") | trim -}} - {{- if $defaultShimAmd64 }} - - name: DEFAULT_SHIM_X86_64 - value: {{ $defaultShimAmd64 | quote }} - {{- end }} - {{- $defaultShimArm64 := include "kata-deploy.getDefaultShimForArch" (dict "root" . "arch" "arm64") | trim -}} - {{- if $defaultShimArm64 }} - - name: DEFAULT_SHIM_AARCH64 - value: {{ $defaultShimArm64 | quote }} - {{- end }} - {{- $defaultShimS390x := include "kata-deploy.getDefaultShimForArch" (dict "root" . "arch" "s390x") | trim -}} - {{- if $defaultShimS390x }} - - name: DEFAULT_SHIM_S390X - value: {{ $defaultShimS390x | quote }} - {{- end }} - {{- $defaultShimPpc64le := include "kata-deploy.getDefaultShimForArch" (dict "root" . "arch" "ppc64le") | trim -}} - {{- if $defaultShimPpc64le }} - - name: DEFAULT_SHIM_PPC64LE - value: {{ $defaultShimPpc64le | quote }} - {{- end }} - {{- $allowedHypervisorAnnotationsAmd64 := include "kata-deploy.getAllowedHypervisorAnnotationsForArch" (dict "root" . "arch" "amd64") | trim -}} - {{- if $allowedHypervisorAnnotationsAmd64 }} - - name: ALLOWED_HYPERVISOR_ANNOTATIONS_X86_64 - value: {{ $allowedHypervisorAnnotationsAmd64 | quote }} - {{- end }} - {{- $allowedHypervisorAnnotationsArm64 := include "kata-deploy.getAllowedHypervisorAnnotationsForArch" (dict "root" . "arch" "arm64") | trim -}} - {{- if $allowedHypervisorAnnotationsArm64 }} - - name: ALLOWED_HYPERVISOR_ANNOTATIONS_AARCH64 - value: {{ $allowedHypervisorAnnotationsArm64 | quote }} - {{- end }} - {{- $allowedHypervisorAnnotationsS390x := include "kata-deploy.getAllowedHypervisorAnnotationsForArch" (dict "root" . "arch" "s390x") | trim -}} - {{- if $allowedHypervisorAnnotationsS390x }} - - name: ALLOWED_HYPERVISOR_ANNOTATIONS_S390X - value: {{ $allowedHypervisorAnnotationsS390x | quote }} - {{- end }} - {{- $allowedHypervisorAnnotationsPpc64le := include "kata-deploy.getAllowedHypervisorAnnotationsForArch" (dict "root" . "arch" "ppc64le") | trim -}} - {{- if $allowedHypervisorAnnotationsPpc64le }} - - name: ALLOWED_HYPERVISOR_ANNOTATIONS_PPC64LE - value: {{ $allowedHypervisorAnnotationsPpc64le | quote }} - {{- end }} - {{- $snapshotterHandlerMappingAmd64 := include "kata-deploy.getSnapshotterHandlerMappingForArch" (dict "root" . "arch" "amd64") | trim -}} - {{- if $snapshotterHandlerMappingAmd64 }} - - name: SNAPSHOTTER_HANDLER_MAPPING_X86_64 - value: {{ $snapshotterHandlerMappingAmd64 | quote }} - {{- end }} - {{- $snapshotterHandlerMappingArm64 := include "kata-deploy.getSnapshotterHandlerMappingForArch" (dict "root" . "arch" "arm64") | trim -}} - {{- if $snapshotterHandlerMappingArm64 }} - - name: SNAPSHOTTER_HANDLER_MAPPING_AARCH64 - value: {{ $snapshotterHandlerMappingArm64 | quote }} - {{- end }} - {{- $snapshotterHandlerMappingS390x := include "kata-deploy.getSnapshotterHandlerMappingForArch" (dict "root" . "arch" "s390x") | trim -}} - {{- if $snapshotterHandlerMappingS390x }} - - name: SNAPSHOTTER_HANDLER_MAPPING_S390X - value: {{ $snapshotterHandlerMappingS390x | quote }} - {{- end }} - {{- $snapshotterHandlerMappingPpc64le := include "kata-deploy.getSnapshotterHandlerMappingForArch" (dict "root" . "arch" "ppc64le") | trim -}} - {{- if $snapshotterHandlerMappingPpc64le }} - - name: SNAPSHOTTER_HANDLER_MAPPING_PPC64LE - value: {{ $snapshotterHandlerMappingPpc64le | quote }} - {{- end }} - {{- $agentHttpsProxy := include "kata-deploy.getAgentHttpsProxy" . | trim -}} - {{- if $agentHttpsProxy }} - - name: AGENT_HTTPS_PROXY - value: {{ $agentHttpsProxy | quote }} - {{- end }} - {{- $agentNoProxy := include "kata-deploy.getAgentNoProxy" . | trim -}} - {{- if $agentNoProxy }} - - name: AGENT_NO_PROXY - value: {{ $agentNoProxy | quote }} - {{- end }} - {{- $pullTypeMappingAmd64 := include "kata-deploy.getPullTypeMappingForArch" (dict "root" . "arch" "amd64") | trim -}} - {{- if $pullTypeMappingAmd64 }} - - name: PULL_TYPE_MAPPING_X86_64 - value: {{ $pullTypeMappingAmd64 | quote }} - {{- end }} - {{- $pullTypeMappingArm64 := include "kata-deploy.getPullTypeMappingForArch" (dict "root" . "arch" "arm64") | trim -}} - {{- if $pullTypeMappingArm64 }} - - name: PULL_TYPE_MAPPING_AARCH64 - value: {{ $pullTypeMappingArm64 | quote }} - {{- end }} - {{- $pullTypeMappingS390x := include "kata-deploy.getPullTypeMappingForArch" (dict "root" . "arch" "s390x") | trim -}} - {{- if $pullTypeMappingS390x }} - - name: PULL_TYPE_MAPPING_S390X - value: {{ $pullTypeMappingS390x | quote }} - {{- end }} - {{- $pullTypeMappingPpc64le := include "kata-deploy.getPullTypeMappingForArch" (dict "root" . "arch" "ppc64le") | trim -}} - {{- if $pullTypeMappingPpc64le }} - - name: PULL_TYPE_MAPPING_PPC64LE - value: {{ $pullTypeMappingPpc64le | quote }} - {{- end }} - - name: INSTALLATION_PREFIX - value: {{ .Values.env.installationPrefix | quote }} - - name: MULTI_INSTALL_SUFFIX - value: {{ .Values.env.multiInstallSuffix | quote }} - {{- $snapshotterSetup := include "kata-deploy.getSnapshotterSetup" . | trim -}} - {{- if $snapshotterSetup }} - - name: EXPERIMENTAL_SETUP_SNAPSHOTTER - value: {{ $snapshotterSetup | quote }} - {{- end }} - {{- $forceGuestPullAmd64 := include "kata-deploy.getForceGuestPullForArch" (dict "root" . "arch" "amd64") | trim -}} - {{- if $forceGuestPullAmd64 }} - - name: EXPERIMENTAL_FORCE_GUEST_PULL_X86_64 - value: {{ $forceGuestPullAmd64 | quote }} - {{- end }} - {{- $forceGuestPullArm64 := include "kata-deploy.getForceGuestPullForArch" (dict "root" . "arch" "arm64") | trim -}} - {{- if $forceGuestPullArm64 }} - - name: EXPERIMENTAL_FORCE_GUEST_PULL_AARCH64 - value: {{ $forceGuestPullArm64 | quote }} - {{- end }} - {{- $forceGuestPullS390x := include "kata-deploy.getForceGuestPullForArch" (dict "root" . "arch" "s390x") | trim -}} - {{- if $forceGuestPullS390x }} - - name: EXPERIMENTAL_FORCE_GUEST_PULL_S390X - value: {{ $forceGuestPullS390x | quote }} - {{- end }} - {{- $forceGuestPullPpc64le := include "kata-deploy.getForceGuestPullForArch" (dict "root" . "arch" "ppc64le") | trim -}} - {{- if $forceGuestPullPpc64le }} - - name: EXPERIMENTAL_FORCE_GUEST_PULL_PPC64LE - value: {{ $forceGuestPullPpc64le | quote }} - {{- end }} -{{- if .Values.containerd.configFileName | trim }} - - name: CONTAINERD_CONFIG_FILE_NAME - value: {{ .Values.containerd.configFileName | trim | quote }} -{{- end }} -{{- if .Values.containerd.userDropIn | trim }} - - name: CONTAINERD_USER_DROP_IN_SOURCE_FILE - value: "/custom-containerd-config/containerd-user-dropin.toml" -{{- end }} -{{- with .Values.env.hostOS }} - - name: HOST_OS - value: {{ . | quote }} -{{- end }} -{{- if and .Values.customRuntimes.enabled .Values.customRuntimes.runtimes }} - - name: CUSTOM_RUNTIMES_ENABLED - value: "true" -{{- end }} +{{- include "kata-deploy.commonEnv" . | nindent 8 }} {{- $healthDefaults := dict "port" 8090 "startupProbe" (dict "enabled" true "initialDelaySeconds" 1 "periodSeconds" 10 "failureThreshold" 60 "timeoutSeconds" 3) @@ -365,50 +197,9 @@ spec: {{- toYaml . | nindent 10 }} {{- end }} volumeMounts: - - name: crio-conf - mountPath: /etc/crio/ - - name: containerd-conf - mountPath: /etc/containerd/ - - name: host - mountPath: /host/ -{{- if .Values.containerd.userDropIn | trim }} - - name: custom-containerd-config - mountPath: /custom-containerd-config/ - readOnly: true -{{- end }} -{{- if $hasCustomConfigs }} - - name: custom-configs - mountPath: /custom-configs/ - readOnly: true -{{- end }} +{{- include "kata-deploy.commonVolumeMounts" . | nindent 8 }} volumes: - - name: crio-conf - hostPath: - path: /etc/crio/ - - name: containerd-conf - hostPath: - path: '{{- template "containerdConfPath" .Values }}' - - name: host - hostPath: - path: / -{{- if .Values.containerd.userDropIn | trim }} - - name: custom-containerd-config - configMap: -{{- if .Values.env.multiInstallSuffix }} - name: {{ .Chart.Name }}-containerd-user-dropin-{{ .Values.env.multiInstallSuffix }} -{{- else }} - name: {{ .Chart.Name }}-containerd-user-dropin -{{- end }} -{{- end }} -{{- if $hasCustomConfigs }} - - name: custom-configs - configMap: -{{- if .Values.env.multiInstallSuffix }} - name: {{ .Chart.Name }}-custom-configs-{{ .Values.env.multiInstallSuffix }} -{{- else }} - name: {{ .Chart.Name }}-custom-configs -{{- end }} -{{- end }} +{{- include "kata-deploy.commonVolumes" . | nindent 6 }} {{- with .Values.updateStrategy }} updateStrategy: {{- toYaml . | nindent 4 }}