Skip to content

Commit 463592a

Browse files
committed
chore(helm)!: Use with to set context for the Deployment/DaemonSet.
BREAKING: Helm values that were under `csiNodeDriverRegistrar` are now under `csiNodeDriver`. The reason being is that the "registrar" is only one of the containers in the DaemonSet for the Node Driver.
1 parent 8f06e62 commit 463592a

File tree

3 files changed

+55
-51
lines changed

3 files changed

+55
-51
lines changed

deploy/helm/listener-operator/templates/csi-controller-deployment.yaml

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
11
---
2+
{{- with .Values.csiProvisioner }}
23
apiVersion: apps/v1
34
kind: Deployment
45
metadata:
5-
name: {{ include "operator.fullname" . }}-csi-provisioner
6+
name: {{ include "operator.fullname" $ }}-csi-provisioner
67
labels:
7-
{{- include "operator.labels" . | nindent 4 }}
8+
{{- include "operator.labels" $ | nindent 4 }}
89
spec:
910
selector:
1011
matchLabels:
1112
app.kubernetes.io/role: provisioner
12-
{{- include "operator.selectorLabels" . | nindent 6 }}
13+
{{- include "operator.selectorLabels" $ | nindent 6 }}
1314
template:
1415
metadata:
1516
annotations:
16-
internal.stackable.tech/image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
17-
{{- with .Values.podAnnotations }}
17+
internal.stackable.tech/image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag | default $.Chart.AppVersion }}"
18+
{{- with $.Values.podAnnotations }}
1819
{{- toYaml . | nindent 8 }}
1920
{{- end }}
2021
labels:
2122
app.kubernetes.io/role: provisioner
22-
{{- include "operator.selectorLabels" . | nindent 8 }}
23+
{{- include "operator.selectorLabels" $ | nindent 8 }}
2324
spec:
24-
{{- with .Values.imagePullSecrets }}
25+
{{- with $.Values.imagePullSecrets }}
2526
imagePullSecrets:
2627
{{- toYaml . | nindent 8 }}
2728
{{- end }}
28-
serviceAccountName: {{ include "operator.fullname" . }}-serviceaccount
29+
serviceAccountName: {{ include "operator.fullname" $ }}-serviceaccount
2930
securityContext:
30-
{{- toYaml .Values.podSecurityContext | nindent 8 }}
31+
{{- toYaml $.Values.podSecurityContext | nindent 8 }}
3132
containers:
3233
- name: csi-controller-service
3334
securityContext:
34-
{{- toYaml .Values.securityContext | nindent 12 }}
35-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
36-
imagePullPolicy: {{ .Values.image.pullPolicy }}
35+
{{- toYaml $.Values.securityContext | nindent 12 }}
36+
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag | default $.Chart.AppVersion }}"
37+
imagePullPolicy: {{ $.Values.image.pullPolicy }}
3738
resources:
38-
{{ .Values.controller.resources | toYaml | nindent 12 }}
39+
{{- $.Values.controller.resources | toYaml | nindent 12 }}
3940
args:
4041
- run
4142
- controller
@@ -66,7 +67,7 @@ spec:
6667
# The name of the Kubernetes Service that point to the operator Pod, e.g. used to
6768
# construct the conversion webhook endpoint.
6869
- name: OPERATOR_SERVICE_NAME
69-
value: {{ include "operator.fullname" . }}
70+
value: {{ include "operator.fullname" $ }}
7071

7172
# Operators need to know the node name they are running on, to e.g. discover the
7273
# Kubernetes domain name from the kubelet API.
@@ -75,19 +76,19 @@ spec:
7576
fieldRef:
7677
fieldPath: spec.nodeName
7778

78-
{{- if .Values.kubernetesClusterDomain }}
79+
{{- if $.Values.kubernetesClusterDomain }}
7980
- name: KUBERNETES_CLUSTER_DOMAIN
80-
value: {{ .Values.kubernetesClusterDomain | quote }}
81+
value: {{ $.Values.kubernetesClusterDomain | quote }}
8182
{{- end }}
82-
{{- include "telemetry.envVars" . | nindent 12 }}
83+
{{- include "telemetry.envVars" $ | nindent 12 }}
8384
volumeMounts:
8485
- name: csi
8586
mountPath: /csi
8687
- name: external-provisioner
87-
image: "{{ .Values.csiProvisioner.image.repository }}:{{ .Values.csiProvisioner.image.tag }}"
88-
imagePullPolicy: {{ .Values.csiProvisioner.image.pullPolicy }}
88+
image: "{{ .image.repository }}:{{ .image.tag }}"
89+
imagePullPolicy: {{ .image.pullPolicy }}
8990
resources:
90-
{{ .Values.csiProvisioner.resources | toYaml | nindent 12 }}
91+
{{ .resources | toYaml | nindent 12 }}
9192
args:
9293
- --csi-address=/csi/csi.sock
9394
- --feature-gates=Topology=true
@@ -98,15 +99,16 @@ spec:
9899
volumes:
99100
- name: csi
100101
emptyDir: {}
101-
{{- with .Values.nodeSelector }}
102+
{{- with $.Values.nodeSelector }}
102103
nodeSelector:
103104
{{- toYaml . | nindent 8 }}
104105
{{- end }}
105-
{{- with .Values.affinity }}
106+
{{- with $.Values.affinity }}
106107
affinity:
107108
{{- toYaml . | nindent 8 }}
108109
{{- end }}
109-
{{- with .Values.tolerations }}
110+
{{- with $.Values.tolerations }}
110111
tolerations:
111112
{{- toYaml . | nindent 8 }}
112113
{{- end }}
114+
{{- end }}
Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,41 @@
11
---
2+
{{- with .Values.csiNodeDriver }}
23
apiVersion: apps/v1
34
kind: DaemonSet
45
metadata:
5-
name: {{ include "operator.fullname" . }}-csi-node-driver
6+
name: {{ include "operator.fullname" $ }}-csi-node-driver
67
labels:
7-
{{- include "operator.labels" . | nindent 4 }}
8+
{{- include "operator.labels" $ | nindent 4 }}
89
spec:
910
selector:
1011
matchLabels:
1112
app.kubernetes.io/role: node-driver
12-
{{- include "operator.selectorLabels" . | nindent 6 }}
13+
{{- include "operator.selectorLabels" $ | nindent 6 }}
1314
template:
1415
metadata:
15-
{{- with .Values.podAnnotations }}
16+
{{- with $.Values.podAnnotations }}
1617
annotations:
1718
{{- toYaml . | nindent 8 }}
1819
{{- end }}
1920
labels:
2021
app.kubernetes.io/role: node-driver
21-
{{- include "operator.selectorLabels" . | nindent 8 }}
22+
{{- include "operator.selectorLabels" $ | nindent 8 }}
2223
spec:
23-
{{- with .Values.image.pullSecrets }}
24+
{{- with $.Values.image.pullSecrets }}
2425
imagePullSecrets:
2526
{{- toYaml . | nindent 8 }}
2627
{{- end }}
27-
serviceAccountName: {{ include "operator.fullname" . }}-serviceaccount
28+
serviceAccountName: {{ include "operator.fullname" $ }}-serviceaccount
2829
securityContext:
29-
{{- toYaml .Values.podSecurityContext | nindent 8 }}
30+
{{- toYaml $.Values.podSecurityContext | nindent 8 }}
3031
containers:
3132
- name: csi-node-service
3233
securityContext:
33-
{{- toYaml .Values.securityContext | nindent 12 }}
34-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
35-
imagePullPolicy: {{ .Values.image.pullPolicy }}
34+
{{- toYaml $.Values.securityContext | nindent 12 }}
35+
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag | default $.Chart.AppVersion }}"
36+
imagePullPolicy: {{ $.Values.image.pullPolicy }}
3637
resources:
37-
{{ .Values.node.driver.resources | toYaml | nindent 12 }}
38+
{{ $.Values.node.driver.resources | toYaml | nindent 12 }}
3839
args:
3940
- run
4041
- node
@@ -65,7 +66,7 @@ spec:
6566
# The name of the Kubernetes Service that point to the operator Pod, e.g. used to
6667
# construct the conversion webhook endpoint.
6768
- name: OPERATOR_SERVICE_NAME
68-
value: {{ include "operator.fullname" . }}
69+
value: {{ include "operator.fullname" $ }}
6970

7071
# Operators need to know the node name they are running on, to e.g. discover the
7172
# Kubernetes domain name from the kubelet API.
@@ -74,24 +75,24 @@ spec:
7475
fieldRef:
7576
fieldPath: spec.nodeName
7677

77-
{{- if .Values.kubernetesClusterDomain }}
78+
{{- if $.Values.kubernetesClusterDomain }}
7879
- name: KUBERNETES_CLUSTER_DOMAIN
79-
value: {{ .Values.kubernetesClusterDomain | quote }}
80+
value: {{ $.Values.kubernetesClusterDomain | quote }}
8081
{{- end }}
81-
{{- include "telemetry.envVars" . | nindent 12 }}
82+
{{- include "telemetry.envVars" $ | nindent 12 }}
8283
volumeMounts:
8384
- name: csi
8485
mountPath: /csi
8586
- name: mountpoint
86-
mountPath: {{ .Values.kubeletDir }}/pods
87+
mountPath: {{ $.Values.kubeletDir }}/pods
8788
- name: node-driver-registrar
88-
image: "{{ .Values.csiNodeDriverRegistrar.image.repository }}:{{ .Values.csiNodeDriverRegistrar.image.tag }}"
89-
imagePullPolicy: {{ .Values.csiNodeDriverRegistrar.image.pullPolicy }}
89+
image: "{{ .image.repository }}:{{ .image.tag }}"
90+
imagePullPolicy: {{ .image.pullPolicy }}
9091
resources:
91-
{{ .Values.csiNodeDriverRegistrar.resources | toYaml | nindent 12 }}
92+
{{ .resources | toYaml | nindent 12 }}
9293
args:
9394
- --csi-address=/csi/csi.sock
94-
- --kubelet-registration-path={{ .Values.kubeletDir }}/plugins/listeners.stackable.tech/csi.sock
95+
- --kubelet-registration-path={{ $.Values.kubeletDir }}/plugins/listeners.stackable.tech/csi.sock
9596
volumeMounts:
9697
- name: registration-sock
9798
mountPath: /registration
@@ -102,22 +103,23 @@ spec:
102103
hostPath:
103104
# node-driver-registrar appends a driver-unique filename to this path to avoid conflicts
104105
# see https://github.com/stackabletech/secret-operator/issues/229 for why this path should not be too long
105-
path: {{ .Values.kubeletDir }}/plugins_registry
106+
path: {{ $.Values.kubeletDir }}/plugins_registry
106107
- name: csi
107108
hostPath:
108-
path: {{ .Values.kubeletDir }}/plugins/listeners.stackable.tech/
109+
path: {{ $.Values.kubeletDir }}/plugins/listeners.stackable.tech/
109110
- name: mountpoint
110111
hostPath:
111-
path: {{ .Values.kubeletDir }}/pods/
112-
{{- with .Values.nodeSelector }}
112+
path: {{ $.Values.kubeletDir }}/pods/
113+
{{- with $.Values.nodeSelector }}
113114
nodeSelector:
114115
{{- toYaml . | nindent 8 }}
115116
{{- end }}
116-
{{- with .Values.affinity }}
117+
{{- with $.Values.affinity }}
117118
affinity:
118119
{{- toYaml . | nindent 8 }}
119120
{{- end }}
120-
{{- with .Values.tolerations }}
121+
{{- with $.Values.tolerations }}
121122
tolerations:
122123
{{- toYaml . | nindent 8 }}
123124
{{- end }}
125+
{{- end }}

deploy/helm/listener-operator/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ csiProvisioner:
1717
limits:
1818
cpu: 100m
1919
memory: 128Mi
20-
csiNodeDriverRegistrar:
20+
csiNodeDriver:
2121
image:
2222
repository: oci.stackable.tech/sdp/sig-storage/csi-node-driver-registrar
2323
tag: v2.13.0

0 commit comments

Comments
 (0)