Skip to content

Commit 8725d66

Browse files
Merge pull request #98 from tylerstanczak/main
Set Passwords for Default Users: Admin & App
2 parents 6681a4c + 6e73ee2 commit 8725d66

File tree

6 files changed

+35
-5
lines changed

6 files changed

+35
-5
lines changed

charts/ibm-mq/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
apiVersion: v2
1515
name: ibm-mq
1616
description: IBM MQ queue manager
17-
version: 10.0.0
17+
version: 10.1.0
1818
type: application
1919
appVersion: 9.4.0.0
2020
kubeVersion: ">=1.18.0-0"

charts/ibm-mq/README.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,11 @@ Alternatively, each parameter can be specified by using the `--set key=value[,ke
106106
| ------------------------------- | --------------------------------------------------------------- | ------------------------------------------ |
107107
| `license` | Set to `accept` to accept the terms of the IBM license | `"not accepted"` |
108108
| `image.repository` | Image full name including repository | `ibmcom/mq` |
109-
| `image.tag` | Image tag | `9.4.0.0-r1` |
109+
| `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.secret` | 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/stateful-set.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ spec:
131131
volumes:
132132
{{- else if .Values.security.readOnlyRootFilesystem }}
133133
volumes:
134+
{{- else if .Values.credentials.enable }}
135+
volumes:
134136
{{- end}}
135137
{{- if .Values.queueManager.multiinstance.enable }}
136138
- name: {{ $dataVolumeClaimName }}
@@ -260,6 +262,12 @@ spec:
260262
- name: tmp-volume
261263
emptyDir: {}
262264
{{- end }}
265+
{{- if .Values.credentials.enable }}
266+
- name: mq-credentials
267+
secret:
268+
defaultMode: 420
269+
secretName: {{ .Values.credentials.secret }}
270+
{{- end }}
263271
terminationGracePeriodSeconds: {{.Values.queueManager.terminationGracePeriodSeconds}}
264272
containers:
265273
- name: qmgr
@@ -352,6 +360,8 @@ spec:
352360
volumeMounts:
353361
{{- else if .Values.security.readOnlyRootFilesystem }}
354362
volumeMounts:
363+
{{- else if .Values.credentials.enable }}
364+
volumeMounts:
355365
{{- end}}
356366
{{- if .Values.queueManager.nativeha.tls }}
357367
{{- if .Values.queueManager.nativeha.tls.secretName }}
@@ -443,6 +453,10 @@ spec:
443453
- mountPath: "/tmp"
444454
name: tmp-volume
445455
{{- end }}
456+
{{- if .Values.credentials.enable }}
457+
- name: mq-credentials
458+
mountPath: "/var/run/secrets"
459+
{{- end }}
446460
securityContext:
447461
allowPrivilegeEscalation: false
448462
readOnlyRootFilesystem: {{ .Values.security.readOnlyRootFilesystem }}

charts/ibm-mq/values.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,19 @@ image:
1919
# repository is the container repository to use
2020
repository: icr.io/ibm-messaging/mq
2121
# tag is the tag to use for the container repository
22-
tag: 9.4.0.0-r1
22+
tag: 9.4.0.0-r3
2323
# pullSecret is the secret to use when pulling the image from a private registry
2424
pullSecret:
2525
# pullPolicy is either IfNotPresent or Always (https://kubernetes.io/docs/concepts/containers/images/)
2626
pullPolicy: IfNotPresent
2727

28+
# set passwords for users: "admin" and "app"
29+
credentials:
30+
# enabled is whether to configure user credentials via secret or not. (in MQ /run/secrets directory)
31+
enable: false
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+
secret: "mq-credentials"
34+
2835
# 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,...
2936
metadata:
3037
labels: {}

samples/OpenShiftIBMPower/deploy/ibmpower.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
license: accept
1515
image:
1616
repository: cp.icr.io/cp/ibm-mqadvanced-server
17-
tag: 9.4.0.0-r1-ppc64le
17+
tag: 9.4.0.0-r3-ppc64le
1818
pullSecret: ibm-entitlement-key
1919
queueManager:
2020
mqscConfigMaps:

samples/OpenShiftNativeHAMQAdvancedContainer/deploy/secureapp_nativeha.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
image:
1515
repository: cp.icr.io/cp/ibm-mqadvanced-server
16-
tag: 9.4.0.0-r1-amd64
16+
tag: 9.4.0.0-r3-amd64
1717
pullSecret: ibm-entitlement-key
1818
license: accept
1919
queueManager:

0 commit comments

Comments
 (0)