[rabbitmq] Use short rabbitmq node name

The patch switches rabbitmq to use short node names, this will
allow to do not care about internal domain name as it is can't
be get from k8s API.

Change-Id: I6d80bc4db4e497f7485fb5416818e0b61f821741
Related-Prod: PRODX-3456
This commit is contained in:
Vasyl Saienko 2020-04-07 11:09:34 +03:00
parent 5d086878a2
commit bb7580944a
5 changed files with 7 additions and 6 deletions

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v3.12.0 appVersion: v3.12.0
description: OpenStack-Helm RabbitMQ description: OpenStack-Helm RabbitMQ
name: rabbitmq name: rabbitmq
version: 0.1.40 version: 0.1.41
home: https://github.com/rabbitmq/rabbitmq-server home: https://github.com/rabbitmq/rabbitmq-server
... ...

View File

@ -82,7 +82,7 @@ if ! [ "${POD_INCREMENT}" -eq "0" ] && ! [ -d "/var/lib/rabbitmq/mnesia" ] ; the
# Wait for server to join cluster, reset if it does not # Wait for server to join cluster, reset if it does not
POD_INCREMENT=$(echo "${MY_POD_NAME}" | awk -F '-' '{print $NF}') POD_INCREMENT=$(echo "${MY_POD_NAME}" | awk -F '-' '{print $NF}')
END=$(($(date +%s) + 180)) END=$(($(date +%s) + 180))
while ! rabbitmqctl -l --node $(get_node_name 0) -q cluster_status | grep -q "$(get_node_name ${POD_INCREMENT})"; do while ! rabbitmqctl --node $(get_node_name 0) -q cluster_status | grep -q "$(get_node_name ${POD_INCREMENT})"; do
sleep 5 sleep 5
NOW=$(date +%s) NOW=$(date +%s)
[ $NOW -gt $END ] && reset_rabbit [ $NOW -gt $END ] && reset_rabbit

View File

@ -79,7 +79,7 @@ spec:
- name: RABBIT_TIMEOUT - name: RABBIT_TIMEOUT
value: "{{ .Values.conf.rabbitmq_exporter.rabbit_timeout }}" value: "{{ .Values.conf.rabbitmq_exporter.rabbit_timeout }}"
- name: RABBIT_URL - name: RABBIT_URL
value: {{ printf "%s" $protocol }}://{{ tuple "oslo_messaging" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}:{{ tuple "oslo_messaging" "internal" $protocol . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} value: {{ printf "%s" $protocol }}://{{ tuple "oslo_messaging" "internal" . | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }}:{{ tuple "oslo_messaging" "internal" $protocol . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
- name: RABBIT_USER - name: RABBIT_USER
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:

View File

@ -245,13 +245,13 @@ spec:
fieldRef: fieldRef:
fieldPath: status.podIP fieldPath: status.podIP
- name: RABBITMQ_USE_LONGNAME - name: RABBITMQ_USE_LONGNAME
value: "true" value: "false"
- name: RABBITMQ_NODENAME - name: RABBITMQ_NODENAME
value: "rabbit@$(MY_POD_NAME).{{ tuple "oslo_messaging" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}" value: "rabbit@$(MY_POD_NAME)"
- name: K8S_SERVICE_NAME - name: K8S_SERVICE_NAME
value: {{ tuple "oslo_messaging" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }} value: {{ tuple "oslo_messaging" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
- name: K8S_HOSTNAME_SUFFIX - name: K8S_HOSTNAME_SUFFIX
value: ".{{ tuple "oslo_messaging" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}" value: ".{{ tuple "oslo_messaging" "internal" . | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }}"
- name: RABBITMQ_ERLANG_COOKIE - name: RABBITMQ_ERLANG_COOKIE
value: "{{ $envAll.Values.endpoints.oslo_messaging.auth.erlang_cookie }}" value: "{{ $envAll.Values.endpoints.oslo_messaging.auth.erlang_cookie }}"
- name: PORT_HTTP - name: PORT_HTTP

View File

@ -40,4 +40,5 @@ rabbitmq:
- 0.1.38 Do not use hardcoded username in rabbitmq chown container - 0.1.38 Do not use hardcoded username in rabbitmq chown container
- 0.1.39 Allow to bootstrap rabbitmq with initial config - 0.1.39 Allow to bootstrap rabbitmq with initial config
- 0.1.40 Set password for guest user rabbitmq - 0.1.40 Set password for guest user rabbitmq
- 0.1.41 Use short rabbitmq node name
... ...