diff --git a/images/oc-build-deploy-dind/openshift-templates/rabbitmq-cluster/statefulset.yml b/images/oc-build-deploy-dind/openshift-templates/rabbitmq-cluster/statefulset.yml index 9840910421..76caef51ba 100644 --- a/images/oc-build-deploy-dind/openshift-templates/rabbitmq-cluster/statefulset.yml +++ b/images/oc-build-deploy-dind/openshift-templates/rabbitmq-cluster/statefulset.yml @@ -61,7 +61,7 @@ objects: metadata: name: ${SERVICE_NAME} spec: - serviceName: ${SERVICE_NAME} + serviceName: ${SERVICE_NAME}-headless replicas: 3 selector: matchLabels: diff --git a/images/rabbitmq-cluster/cluster-rabbit.sh b/images/rabbitmq-cluster/cluster-rabbit.sh index dbe0022ead..31c488ef1e 100644 --- a/images/rabbitmq-cluster/cluster-rabbit.sh +++ b/images/rabbitmq-cluster/cluster-rabbit.sh @@ -9,8 +9,8 @@ if [ -z "$POD_NAMESPACE" ]; then fi # clustering uses full hostnames, generate those -echo NODENAME=rabbit@${HOSTNAME}.${SERVICE_NAME}.${POD_NAMESPACE}.svc.cluster.local > /etc/rabbitmq/rabbitmq-env.conf -echo cluster_formation.k8s.hostname_suffix=.${SERVICE_NAME}.${POD_NAMESPACE}.svc.cluster.local >> /etc/rabbitmq/rabbitmq.conf +echo NODENAME=rabbit@${HOSTNAME}.${SERVICE_NAME}-headless.${POD_NAMESPACE}.svc.cluster.local > /etc/rabbitmq/rabbitmq-env.conf +echo cluster_formation.k8s.hostname_suffix=.${SERVICE_NAME}-headless.${POD_NAMESPACE}.svc.cluster.local >> /etc/rabbitmq/rabbitmq.conf echo cluster_formation.k8s.service_name=${SERVICE_NAME}-headless >> /etc/rabbitmq/rabbitmq.conf # start the server