I'm trying to deploy IBM-MQ to Kubernetes (Rancher) using helmfile. I was getting the same error as here.
It wasn't working with storage class "longhorn", but was working with storage class "local-path". I added security: initVolumeAsRoot: true
to my helmfile, now it looks like this:
....
- name: ibm-mq
...
chart: ibm-stable-charts/ibm-mqadvanced-server-dev
values:
- license: accept
security:
initVolumeAsRoot: true
resources:
limits:
cpu: 800m
memory: 800Mi
requests:
cpu: 500m
memory: 512Mi
image:
tag: latest
dataPVC:
storageClassName: "longhorn"
size: 500Mi
...
But in the Lens in the Stateful Sets I can see that it can't create a pod because of the error create Pod ibm-mq-0 in StatefulSet ibm-mq failed error: pods "ibm-mq-0" is forbidden: failed quota: default: must specify limits.cpu,limits.memory
.
But the same helmfile without security
worked fine, it didn't get an error because of limits, but got an error because there were problems with longhorn
(as in the question I linked). If I change it to local-path
(without security
) it works fine, but the problem is that with local-path
I need to delete manually volume after every restart, which is not what I want (for example, database works on longhorn without deleting volume after every restart). What's might be the problem here? I'm running it using helmfile -n namespace apply
UPD: I tried to place all the values in the order they're presented here, but it didn't work. I'm using helm 3, helmfile v.0.141.0, kubectl 1.22.2