I'm trying to deploy IBM-MQ chart to kubernetes (rancher). I'm using helmfile v.0.141.0 (helm 3, kubectl 1.22.2) to achieve this. What I want to achieve is programmatically create custom queues after deploy. I tried to use helmfile hooks to achieve this, but seems that they're not working (I think they're being executed too early). My helmfile:
repositories:
- name: ibm-stable-charts
url: https://raw.githubusercontent.com/IBM/charts/master/repo/stable
releases:
- name: ibm-mq
labels:
app: ibm-mq
namespace: user
chart: ibm-stable-charts/ibm-mqadvanced-server-dev
hooks:
- events: [ "cleanup" ]
showlogs: true
command: "./script.sh"
values:
- license: accept
image:
tag: latest
queueManager:
dev:
secret:
adminPasswordKey: secret
name: secret
You can read this guide if you want more details on how to recreate this situation. And my script.sh
looks like this:
#!/bin/bash
runmqsc QM1 <<EOF
define qlocal (TEST);
end;
EOF
And I see that it's getting executed after helmfile deploys IBM-MQ, but there's no output, even tho loggin is enabled, and if you check logs of the pod, you can see that IBM-MQ takes actually some time to start, and I'm assuming that script is being executed when ibm-mq didn't even start yet (if it's connecting at all, and of course if you check the queues new queues are not here). I tried to add this string to the beginning of the file which I'm using to connect to ibm-mq shell, but it didn' work out too.
#!/bin/bash
kubectl exec -i -t -n user ibm-mq-0 -c qmgr "--" sh -c "clear; (bash || ash || sh)"
runmqsc QM1 <<EOF ...
So, is there any way to create custom queues without creating new image, as described here?