Skip to content

Commit f322647

Browse files
committed
Make readiness check via pod lable patcher optin
1 parent dec191f commit f322647

File tree

5 files changed

+18
-0
lines changed

5 files changed

+18
-0
lines changed

charts/ibm-mq/templates/role-binding.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.readinessProbe.useLabelPatcher }}
12
apiVersion: rbac.authorization.k8s.io/v1
23
kind: RoleBinding
34
metadata:
@@ -11,3 +12,4 @@ subjects:
1112
- kind: ServiceAccount
1213
name: {{ include "ibm-mq.fullname" ( . ) }}
1314
namespace: ready-check
15+
{{ end -}}

charts/ibm-mq/templates/role.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.readinessProbe.useLabelPatcher }}
12
apiVersion: rbac.authorization.k8s.io/v1
23
kind: Role
34
metadata:
@@ -14,3 +15,4 @@ rules:
1415
{{- end }}
1516
]
1617
verbs: ["get", "list","patch"]
18+
{{ end -}}

charts/ibm-mq/templates/service.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ spec:
2626
name: qmgr
2727
selector:
2828
{{- include "ibm-mq.selectorLabels" . | nindent 4 }}
29+
{{- if .Values.readinessProbe.useLabelPatcher }}
2930
role: master
31+
{{- end }}

charts/ibm-mq/templates/stateful-set.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,14 @@ spec:
272272
defaultMode: 420
273273
secretName: {{ .Values.credentials.secret }}
274274
{{- end }}
275+
{{- if .Values.readinessProbe.useLabelPatcher }}
275276
volumes:
276277
- name: state
277278
emptyDir: {}
279+
{{- end }}
278280
terminationGracePeriodSeconds: {{.Values.queueManager.terminationGracePeriodSeconds}}
279281
containers:
282+
{{- if .Values.readinessProbe.useLabelPatcher }}
280283
- name: state-checker
281284
command:
282285
- sh
@@ -312,6 +315,7 @@ spec:
312315
volumeMounts:
313316
- mountPath: /etc/mqm/state
314317
name: state
318+
{{- end }}
315319
- name: qmgr
316320
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
317321
imagePullPolicy: {{ .Values.image.pullPolicy }}
@@ -409,8 +413,10 @@ spec:
409413
{{- else if .Values.web.manualConfig.secret.name }}
410414
volumeMounts:
411415
{{- end}}
416+
{{- if .Values.readinessProbe.useLabelPatcher }}
412417
- name: state
413418
mountPath: /etc/mqm/state
419+
{{- end }}
414420
{{- if .Values.queueManager.nativeha.tls }}
415421
{{- if .Values.queueManager.nativeha.tls.secretName }}
416422
- name: ha-tls
@@ -532,12 +538,17 @@ spec:
532538
# Set readiness probe to determine if the MQ listener is running
533539
readinessProbe:
534540
exec:
541+
{{- if .Values.readinessProbe.useLabelPatcher }}
535542
command:
536543
- sh
537544
- '-c'
538545
- >
539546
chkmqready;
540547
echo $? > /etc/mqm/state/test
548+
{{- else }}
549+
command:
550+
- chkmqready
551+
{{- end }}
541552
{{- if or .Values.queueManager.nativeha.enable .Values.queueManager.multiinstance.enable }}
542553
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds | default 0 }}
543554
{{- else }}

charts/ibm-mq/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ livenessProbe:
139139

140140
# readinessProbe section specifies setting for the MQ readiness probe, which checks when the MQ listener is running
141141
readinessProbe:
142+
useLabelPatcher: false
142143
initialDelaySeconds:
143144
periodSeconds: 5
144145
timeoutSeconds: 3

0 commit comments

Comments
 (0)