Skip to content

Fixed bug with hostNetwork #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/helm_lib/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
type: library
name: deckhouse_lib_helm
version: 1.50.0
version: 1.50.1
description: "Helm utils template definitions for Deckhouse modules."
19 changes: 15 additions & 4 deletions charts/helm_lib/templates/_csi_controller.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ memory: 50Mi
{{- $additionalControllerVolumes := $config.additionalControllerVolumes }}
{{- $additionalControllerVolumeMounts := $config.additionalControllerVolumeMounts }}
{{- $additionalContainers := $config.additionalContainers }}
{{- $csiControllerHostNetwork := $config.csiControllerHostNetwork | default true }}
{{- $csiControllerHostNetwork := $config.csiControllerHostNetwork | default "true" }}
{{- $livenessProbePort := $config.livenessProbePort | default 9808 }}
{{- $initContainers := $config.initContainers }}
{{- $customNodeSelector := $config.customNodeSelector }}
Expand Down Expand Up @@ -198,10 +198,10 @@ spec:
{{- end }}
{{- end }}
spec:
{{- if $csiControllerHostNetwork }}
hostNetwork: true
hostNetwork: {{ $csiControllerHostNetwork }}
{{- if eq $csiControllerHostNetwork "true" }}
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
{{- end }}
imagePullSecrets:
- name: deckhouse-registry
{{- if $additionalPullSecrets }}
Expand Down Expand Up @@ -390,14 +390,25 @@ spec:
image: {{ $livenessprobeImage | quote }}
args:
- "--csi-address=$(ADDRESS)"
{{- if eq $csiControllerHostNetwork "true" }}
- "--http-endpoint=$(HOST_IP):{{ $livenessProbePort }}"
{{- else }}
- "--http-endpoint=$(POD_IP):{{ $livenessProbePort }}"
{{- end }}
env:
- name: ADDRESS
value: /csi/csi.sock
{{- if eq $csiControllerHostNetwork "true" }}
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
{{- else }}
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- end }}
volumeMounts:
- name: socket-dir
mountPath: /csi
Expand Down
6 changes: 3 additions & 3 deletions charts/helm_lib/templates/_csi_node.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ memory: 25Mi
{{- $initContainers := $config.initContainers }}
{{- $additionalPullSecrets := $config.additionalPullSecrets }}
{{- $additionalCsiNodePodAnnotations := $config.additionalCsiNodePodAnnotations | default false }}
{{- $csiNodeHostNetwork := $config.csiNodeHostNetwork | default true }}
{{- $csiNodeHostNetwork := $config.csiNodeHostNetwork | default "true" }}
{{- $kubernetesSemVer := semver $context.Values.global.discovery.kubernetesVersion }}
{{- $driverRegistrarImageName := join "" (list "csiNodeDriverRegistrar" $kubernetesSemVer.Major $kubernetesSemVer.Minor) }}
{{- $driverRegistrarImage := include "helm_lib_module_common_image_no_fail" (list $context $driverRegistrarImageName) }}
Expand Down Expand Up @@ -127,8 +127,8 @@ spec:
{{- include "helm_lib_priority_class" (tuple $context "system-node-critical") | nindent 6 }}
{{- include "helm_lib_tolerations" (tuple $context "any-node" "with-no-csi") | nindent 6 }}
{{- include "helm_lib_module_pod_security_context_run_as_user_root" . | nindent 6 }}
{{- if $csiNodeHostNetwork }}
hostNetwork: true
hostNetwork: {{ $csiNodeHostNetwork }}
{{- if eq $csiNodeHostNetwork "true" }}
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
containers:
Expand Down