Skip to content

Commit 195ab72

Browse files
committed
create pw/creds secret manually
1 parent f65aae6 commit 195ab72

File tree

4 files changed

+19
-41
lines changed

4 files changed

+19
-41
lines changed

charts/ibm-mq/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ Alternatively, each parameter can be specified by using the `--set key=value[,ke
109109
| `image.tag` | Image tag | `9.4.0.0-r3` |
110110
| `image.pullPolicy` | Setting that controls when the kubelet attempts to pull the specified image. | `IfNotPresent` |
111111
| `image.pullSecret` | An optional list of references to secrets in the same namespace to use for pulling any of the images used by this QueueManager. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honoured. For more information, see [here](https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod) | `nil` |
112+
| `credentials.enable` | Enable MQ to utilize credentials from a Secret for the default "app" and "admin" users. MQ no longer sets a default password for these users, so it is highly recommended to set your own by creating a Secret. | `false` |
113+
| `credentials.secretRef` | Provide the name of a Secret that contains keys "mqAdminPassword" and "mqAppPassword" with passwords as their respective values. This Secret will be mounted into MQ. | `mq-credentials` |
112114
| `metadata.labels` | The labels field serves as a pass-through for Pod labels. Users can add any label to this field and have it apply to the Pod. | `{}` |
113115
| `metadata.annotations` | Additional annotations to be added to the Pod annotations. This is required for licensing. Please consult [here](#Supplying-licensing-annotations) |`{}` |
114116
| `persistence.dataPVC.enable` | By default all data and recovery logs are persisted to a Pod's qmPVC. dataPVC is an optional PersistentVolume which can be enabled using this field. This PersistentVolume is used for MQ persisted data, including configuration, queues and messages. If Multi-instance is enabled this value is set to true. | `false` |
@@ -208,6 +210,13 @@ By default, the MQ container output is in a basic human-readable format. You ca
208210

209211
The MQ image includes the MQ web server. The web server runs the web console, and the MQ REST APIs. By default, the MQ server deployed by this chart is accessible via a `ClusterIP` [Service](https://kubernetes.io/docs/concepts/services-networking/service/), which is only accessible from within the Kubernetes cluster. Optionally an OpenShift Route, Load balancer or Kubernetes NodePort can be configured to connect to the web console from outside of the Kubernetes cluster.
210212

213+
## Setting default passwords
214+
215+
MQ requires a Secret to set passwords for the "admin" and "app" default users. If one would like to set these passwords, create a secret using the below example command.
216+
```
217+
kubectl create secret generic mq-credentials --from-literal=mqAdminPassword=YOUR_ADMIN_PASSWORD --from-literal=mqAppPassword=YOUR-APP-PASSWORD
218+
```
219+
211220
## Considerations when upgrading the Kubernetes cluster
212221

213222
During a Kubernetes cluster upgrade the worker nodes are made unschedulable, to avoid new pods from being deployed, and drained to move the current workload to other worker nodes. Once all pods are removed, the worker node can be safely upgraded. Often additional worker nodes are created during the upgrade process to provide capacity for these drained pods. To preserve an applications availability pod disruption budget (PDB) allows you to declare the number of pods that should be available. This acts as a break in the upgrade process assuring a balance between the speed of the upgrade and application availability. The exact semantics of the upgrade process differs from one Kubernetes distribution to another but the high level process remains similar.

charts/ibm-mq/templates/secret-credentials.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ spec:
131131
volumes:
132132
{{- else if .Values.security.readOnlyRootFilesystem }}
133133
volumes:
134-
{{- else if .Values.secretCredentials.enable }}
134+
{{- else if .Values.credentials.enable }}
135135
volumes:
136136
{{- end}}
137137
{{- if .Values.queueManager.multiinstance.enable }}
@@ -262,11 +262,11 @@ spec:
262262
- name: tmp-volume
263263
emptyDir: {}
264264
{{- end }}
265-
{{- if or .Values.secretCredentials.enable }}
265+
{{- if .Values.credentials.enable }}
266266
- name: mq-credentials
267267
secret:
268268
defaultMode: 420
269-
secretName: {{ include "ibm-mq.fullname" . }}-credentials
269+
secretName: {{ .Values.credentials.secretRef }}
270270
{{- end }}
271271
terminationGracePeriodSeconds: {{.Values.queueManager.terminationGracePeriodSeconds}}
272272
containers:
@@ -360,7 +360,7 @@ spec:
360360
volumeMounts:
361361
{{- else if .Values.security.readOnlyRootFilesystem }}
362362
volumeMounts:
363-
{{- else if .Values.secretCredentials.enable }}
363+
{{- else if .Values.credentials.enable }}
364364
volumeMounts:
365365
{{- end}}
366366
{{- if .Values.queueManager.nativeha.tls }}
@@ -453,7 +453,7 @@ spec:
453453
- mountPath: "/tmp"
454454
name: tmp-volume
455455
{{- end }}
456-
{{- if .Values.secretCredentials.enable }}
456+
{{- if .Values.credentials.enable }}
457457
- name: mq-credentials
458458
mountPath: "/var/run/secrets"
459459
{{- end }}

charts/ibm-mq/values.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@ image:
2525
# pullPolicy is either IfNotPresent or Always (https://kubernetes.io/docs/concepts/containers/images/)
2626
pullPolicy: IfNotPresent
2727

28-
# User credentials configuration
29-
secretCredentials:
28+
# set passwords for users: "admin" and "app"
29+
credentials:
3030
# enabled is whether to configure user credentials via secret or not. (in MQ /run/secrets directory)
31-
enable: false
32-
# set the admin user password
33-
admin: ""
34-
# set the app user password
35-
app: ""
31+
enable: true
32+
# If enabled, provide the name of the secret that contains your user passwords. See adjacent README.md for instructions on how to create this Secret.
33+
secretRef: "mq-credentials"
3634

3735
# metadata allows setting of additional labels and annottations to be added to all resources. Set on helm install using --set metadata.labels.KEY=VALUE,metadata.labels.=VALUE,...
3836
metadata:

0 commit comments

Comments
 (0)