Creating deployment in Kubernetes and setting hostname

Im trying to make a deployment of RabbitMQ into our on-premise Kubernetes.
Here I need to specify the hostname of the pod, since RabbitMQ is creating their files named after the hostname.

How do I specify the hostname in the deployment, under the spec declaration?

Im using Octopus Deploy v2019.6.8 LTS


There is no way to specify the hostname field of the spec using the Deploy Kubernetes Containers step.
If you want full control over the k8s YAML, you can use the Deploy Raw Kubernetes YAML step, which allows you to supply the exact YAML.

Unfortunately we don’t have experience hosting RabbitMQ in Kubernetes, so we can’t provide any specific advice on how to configure this. I do wonder if there is a way to achieve it without directly specifying the pod hostname? I’m assuming that approach won’t work if you want multiple pods in a RabbitMQ cluster?

If there’s any help we can provide, don’t hesitate to ask.


Hi Michael

Thanks for the reply.

Unfortunately it doesn’t seem to be possible to change the hostname another way.

Is there any way I can modify the Deploy Kubernetes Containers step myself and add the HostName field.
The Deploy Raw Kubernetes YAML step is missing a lot of the functionality, like selecting the image, that the Deploy Kubernetes Containers step have.

Best regards