In some advanced cases, you will have to modify the rabbitmq.conf. On Xray that was deployed with Helm, we will have to do the following:
- Create a ConfigMap (Or secret) containing the configuration. (The chart will create the configmap, if we use the following method)
- Create a custom volume, to mount the ConfigMap to.
- Delete the default rabbitmq.conf file, and then move the one that we mounted.
common: configMaps: | rabbitmq.conf: | loopback_users.guest = false listeners.tcp.default = 5672 hipe_compile = false management.listener.port = 15672 management.listener.ssl = false cluster_partition_handling = autoheal default_user = guest
Second, we will specify customVolumeMount:
common: customVolumeMounts: | - name: xray-configmaps mountPath: /tmp/rabbitmq.conf subPath: rabbitmq.conf
Finally, we will use the preStartCommand, to add a small shell script, which will remove the default file, and copy the one we need to its place:
server: preStartCommand: "rm $JF_PRODUCT_HOME/app/bin/rabbitmq/rabbitmq.conf && cp -fv /tmp/rabbitmq.conf $JF_PRODUCT_HOME/app/bin/rabbitmq/rabbitmq.conf"
In the end, this is how this section of your values.yaml should look like:
common: configMaps: | rabbitmq.conf: | loopback_users.guest = false listeners.tcp.default = 5672 # I have updated this conf hipe_compile = false management.listener.port = 15672 management.listener.ssl = false cluster_partition_handling = autoheal default_user = guest customVolumeMounts: | - name: xray-configmaps mountPath: /tmp/rabbitmq.conf subPath: rabbitmq.conf server: preStartCommand: "rm $JF_PRODUCT_HOME/app/bin/rabbitmq/rabbitmq.conf && cp -fv /tmp/rabbitmq.conf $JF_PRODUCT_HOME/app/bin/rabbitmq/rabbitmq.conf"
Once you finish, redeploy Xray using the following command:
helm upgrade --install xray jfrog/xray -n your-namespace -f values.yaml