From 32ad4ed75fc476715338c702d7e239541f23564b Mon Sep 17 00:00:00 2001 From: Arthur Barr Date: Thu, 7 Sep 2017 16:05:36 +0100 Subject: [PATCH] Improve chart parameters and doc --- charts/mq-advancedserver/README.md | 15 +++++--- .../mq-advancedserver/templates/service.yaml | 4 +-- .../templates/stateful-set.yaml | 3 +- charts/mq-advancedserver/values.yaml | 4 ++- charts/mq-devserver/README.md | 27 +++++++-------- charts/mq-devserver/templates/NOTES.txt | 7 ++++ charts/mq-devserver/templates/secret-dev.yaml | 34 +++++++++++++++++++ charts/mq-devserver/templates/service.yaml | 6 ++-- .../mq-devserver/templates/stateful-set.yaml | 20 ++++++++--- charts/mq-devserver/values.yaml | 10 +++++- 10 files changed, 98 insertions(+), 32 deletions(-) create mode 100644 charts/mq-devserver/templates/secret-dev.yaml diff --git a/charts/mq-advancedserver/README.md b/charts/mq-advancedserver/README.md index d572611..cef3420 100644 --- a/charts/mq-advancedserver/README.md +++ b/charts/mq-advancedserver/README.md @@ -25,9 +25,6 @@ This command accepts the [IBM MQ Advanced license](LICENSE) and deploys an MQ Ad > **Tip**: See all the resources deployed by the chart using `kubectl get all -l release=foo` -## Verifying the Chart -See NOTES.txt associated with this chart for verification instructions - ## Uninstalling the Chart To uninstall/delete the `foo` release: @@ -57,7 +54,7 @@ The following table lists the configurable parameters of the `mq-advancedserver` | `data.persistence.size` | Size of data volume | `2Gi` | | `service.name` | Name of the Kubernetes service to create | `qmgr` | | `service.type` | Kubernetes service type exposing ports, e.g. `NodePort` | `ClusterIP` | -| `queuemanager.name` | MQ Queue Manager name | Helm release name | +| `queueManager.name` | MQ Queue Manager name | Helm release name | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. @@ -69,6 +66,16 @@ Alternatively, a YAML file that specifies the values for the parameters can be p The chart mounts a [Persistent Volume](http://kubernetes.io/docs/user-guide/persistent-volumes/). + +# Configuring MQ objects +You have two major options for configuring the MQ queue manager itself: + +1. Use existing tools, such as `runmqsc`, MQ Explorer or the MQ Command Server to configure your queue manager directly. +2. Create a new image with your configuration baked-in + +## Configuring MQ objects with a new image +You can create a new container image layer, on top of the IBM MQ Advanced base image. You can add MQSC files to define MQ objects such as queues and topics, and place these files into `/etc/mqm` in your image. When the MQ container starts, it will run any MQSC files found in this directory (in sorted order). + # Copyright © Copyright IBM Corporation 2017 \ No newline at end of file diff --git a/charts/mq-advancedserver/templates/service.yaml b/charts/mq-advancedserver/templates/service.yaml index 243db5c..2639a90 100644 --- a/charts/mq-advancedserver/templates/service.yaml +++ b/charts/mq-advancedserver/templates/service.yaml @@ -25,8 +25,6 @@ spec: type: {{ .Values.service.type }} ports: - port: 1414 - name: {{ .Values.service.name }}-1 - # - port: 9443 - #name: {{ .Values.service.name }}-2 + name: {{ .Values.service.name }}-server selector: app: {{ template "fullname" . }} diff --git a/charts/mq-advancedserver/templates/stateful-set.yaml b/charts/mq-advancedserver/templates/stateful-set.yaml index af284a1..f07b212 100644 --- a/charts/mq-advancedserver/templates/stateful-set.yaml +++ b/charts/mq-advancedserver/templates/stateful-set.yaml @@ -43,12 +43,11 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - containerPort: 1414 - #- containerPort: 9443 env: - name: LICENSE value: {{ .Values.license }} - name: MQ_QMGR_NAME - value: {{ .Values.queuemanager.name | default .Release.Name | replace "-" "" }} + value: {{ .Values.queueManager.name | default .Release.Name | replace "-" "" }} {{- if .Values.data.persistence.enabled }} volumeMounts: - mountPath: "/mnt/mqm" diff --git a/charts/mq-advancedserver/values.yaml b/charts/mq-advancedserver/values.yaml index d08fa97..95839aa 100644 --- a/charts/mq-advancedserver/values.yaml +++ b/charts/mq-advancedserver/values.yaml @@ -43,7 +43,9 @@ resources: requests: cpu: 1 memory: 1Gi -queuemanager: +# queueManager section specifies settings for the MQ Queue Manager +queueManager: + # name allows you to specify the name to use for the queue manager. Defaults to the Helm release name. name: # nameOverride can be set to partially override the name of the resources created by this chart nameOverride: \ No newline at end of file diff --git a/charts/mq-devserver/README.md b/charts/mq-devserver/README.md index 27b7e17..cbd9de9 100644 --- a/charts/mq-devserver/README.md +++ b/charts/mq-devserver/README.md @@ -25,9 +25,6 @@ This command accepts the [IBM MQ Advanced for Developers license](LICENSE) and d > **Tip**: See all the resources deployed by the chart using `kubectl get all -l release=foo` -## Verifying the Chart -See NOTES.txt associated with this chart for verification instructions - ## Uninstalling the Chart To uninstall/delete the `foo` release: @@ -47,17 +44,19 @@ The following table lists the configurable parameters of the `mq-advancedserver` | Parameter | Description | Default | | ---------------------------- | --------------------------------------------- | ---------------------------------------------------------- | -| `license` | Set to `accept` to accept the terms of the IBM license | `not accepted` | -| `image.name` | Image name | `ibmcom/mq` | -| `image.tag` | Image tag | `9` | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `image.pullSecret` | Image pull secret, if you are using a private Docker registry | `nil` | -| `data.persistence.enabled` | Use a PersistentVolume to persist MQ data (under `/var/mqm`) | `true` | -| `data.persistence.storageClass` | Storage class of backing Persistent Volume | `nil` | -| `data.persistence.size` | Size of data volume | `2Gi` | -| `service.name` | Name of the Kubernetes service to create | `qmgr` | -| `service.type` | Kubernetes service type exposing ports, e.g. `NodePort` | `ClusterIP` | -| `queuemanager.name` | MQ Queue Manager name | Helm release name | +| `license` | Set to `accept` to accept the terms of the IBM license | `not accepted` | +| `image.name` | Image name | `ibmcom/mq` | +| `image.tag` | Image tag | `9` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `image.pullSecret` | Image pull secret, if you are using a private Docker registry | `nil` | +| `data.persistence.enabled` | Use a PersistentVolume to persist MQ data (under `/var/mqm`) | `true` | +| `data.persistence.storageClass` | Storage class of backing Persistent Volume | `nil` | +| `data.persistence.size` | Size of data volume | `2Gi` | +| `service.name` | Name of the Kubernetes service to create | `qmgr` | +| `service.type` | Kubernetes service type exposing ports, e.g. `NodePort` | `ClusterIP` | +| `queueManager.name` | MQ Queue Manager name | Helm release name | +| `queueManager.dev.adminPassword` | Developer defaults - administrator password | Random generated string. See the notes that appear when you install for how to retrieve this. | +| `queueManager.dev.appPassword` | Developer defaults - app password | `nil` (no password required to connect an MQ client) | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. diff --git a/charts/mq-devserver/templates/NOTES.txt b/charts/mq-devserver/templates/NOTES.txt index 99b0fbf..6282913 100644 --- a/charts/mq-devserver/templates/NOTES.txt +++ b/charts/mq-devserver/templates/NOTES.txt @@ -1,3 +1,10 @@ MQ can be accessed via port 1414 on the following DNS name from within your cluster: {{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local +To get your admin password run: + + MQ_ADMIN_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.adminPassword}" | base64 --decode; echo) + +If you set an app password, you can retrieve it by running the following: + + MQ_APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.appPassword}" | base64 --decode; echo) diff --git a/charts/mq-devserver/templates/secret-dev.yaml b/charts/mq-devserver/templates/secret-dev.yaml new file mode 100644 index 0000000..2d98881 --- /dev/null +++ b/charts/mq-devserver/templates/secret-dev.yaml @@ -0,0 +1,34 @@ +# © Copyright IBM Corporation 2017 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "fullname" . }} + labels: + app: {{ template "fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +type: Opaque +data: + {{ if .Values.queueManager.dev.adminPassword }} + adminPassword: {{ .Values.queueManager.dev.adminPassword | b64enc | quote }} + {{ else }} + adminPassword: {{ randAlphaNum 10 | b64enc | quote }} + {{ end }} + + {{ if .Values.queueManager.dev.appPassword }} + appPassword: {{ .Values.queueManager.dev.appPassword | b64enc | quote }} + {{ end }} diff --git a/charts/mq-devserver/templates/service.yaml b/charts/mq-devserver/templates/service.yaml index 243db5c..6ff25d3 100644 --- a/charts/mq-devserver/templates/service.yaml +++ b/charts/mq-devserver/templates/service.yaml @@ -25,8 +25,8 @@ spec: type: {{ .Values.service.type }} ports: - port: 1414 - name: {{ .Values.service.name }}-1 - # - port: 9443 - #name: {{ .Values.service.name }}-2 + name: {{ .Values.service.name }}-server + - port: 9443 + name: {{ .Values.service.name }}-web selector: app: {{ template "fullname" . }} diff --git a/charts/mq-devserver/templates/stateful-set.yaml b/charts/mq-devserver/templates/stateful-set.yaml index 0f19003..fdb8dce 100644 --- a/charts/mq-devserver/templates/stateful-set.yaml +++ b/charts/mq-devserver/templates/stateful-set.yaml @@ -43,14 +43,26 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - containerPort: 1414 - #- containerPort: 9443 + - containerPort: 9443 env: - name: LICENSE value: {{ .Values.license }} - name: MQ_QMGR_NAME - value: {{ .Values.queuemanager.name | default .Release.Name | replace "-" "" }} - - name: MQ_DISABLE_WEB_CONSOLE - value: "true" + value: {{ .Values.queueManager.name | default .Release.Name | replace "-" "" }} + #- name: MQ_DISABLE_WEB_CONSOLE + # value: "true" + - name: MQ_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "fullname" . }} + key: adminPassword + {{- if .Values.queueManager.dev.appPassword }} + - name: MQ_APP_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "fullname" . }} + key: appPassword + {{- end }} {{- if .Values.data.persistence.enabled }} volumeMounts: - mountPath: "/mnt/mqm" diff --git a/charts/mq-devserver/values.yaml b/charts/mq-devserver/values.yaml index ebedd34..7dd02fd 100644 --- a/charts/mq-devserver/values.yaml +++ b/charts/mq-devserver/values.yaml @@ -43,7 +43,15 @@ resources: requests: cpu: 500m memory: 512Mi -queuemanager: +# queueManager section specifies settings for the MQ Queue Manager +queueManager: + # name allows you to specify the name to use for the queue manager. Defaults to the Helm release name. name: + # dev section specifies settings for the MQ developer defaults available in the MQ Advanced for Developers image. + dev: + # adminPassword sets the password of the admin user + adminPassword: + # appPassword sets the password of the app user + appPassword: # nameOverride can be set to partially override the name of the resources created by this chart nameOverride: \ No newline at end of file