Rework RabbitMQ credential configuration

PTP Notification deploys two separate rabbitmq instances: registration
and notification-broker, with a default user/password of admin/admin.

This commit enables PTP notification to function with an user-defined
name, password and also AMQP port for both instances.

TEST PLAN:
PASS: PTP pull/push notifications with default notification/registration
      user/password/port (without helm override for these)

PASS: PTP pull/push notifications with changing notification/registration
      user/password/port (with helm overide for these)
      system helm-override-update ptp-notification ptp-notification \
      notification --values ~/notification-override.yaml
      registration:
        endpoint:
          port: 5673
          user: admin-reg
          pass: Registration1234

     notification:
        endpoint:
          port: 5674
          user: admin-noti
          pass: Notification1234

Story: 2011332
Task: 51620

Signed-off-by: Tara Nath Subedi <tara.subedi@windriver.com>
Change-Id: Id98c2ae68a1adb5b17f1a336ac609cd57fe3a026
This commit is contained in:
Tara Nath Subedi 2024-12-19 13:21:51 -05:00 committed by Tara Subedi
parent a5bb2dc260
commit 19841dd96f
4 changed files with 26 additions and 26 deletions

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2021-2024 Wind River Systems, Inc.
# Copyright (c) 2021-2025 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -54,11 +54,11 @@ spec:
- name: THIS_NAMESPACE
value: {{ .Values.global.namespace }}
- name: RABBITMQ_DEFAULT_USER
value: "admin"
value: "{{ .Values.notification.endpoint.user }}"
- name: RABBITMQ_DEFAULT_PASS
value: "admin"
- name: RABBITMQ_DEFAULT_PORT
value: "5672"
value: "{{ .Values.notification.endpoint.pass }}"
- name: RABBITMQ_NODE_PORT
value: "{{ .Values.notification.endpoint.port }}"
- name: {{ .Chart.Name }}-location
image: "{{ .Values.location.image.repository }}:{{ .Values.location.image.tag }}"
imagePullPolicy: {{ .Values.location.image.pullPolicy }}
@ -141,17 +141,17 @@ spec:
- name: OVERALL_HOLDOVER_SECONDS
value: "{{ .Values.ptptrackingv2.overall.holdover_seconds }}"
- name: NOTIFICATIONSERVICE_USER
value: "admin"
value: "{{ .Values.notification.endpoint.user }}"
- name: NOTIFICATIONSERVICE_PASS
value: "admin"
value: "{{ .Values.notification.endpoint.pass }}"
- name: NOTIFICATIONSERVICE_PORT
value: "5672"
value: "{{ .Values.notification.endpoint.port }}"
- name: REGISTRATION_USER
value: "admin"
value: "{{ .Values.registration.endpoint.user }}"
- name: REGISTRATION_PASS
value: "admin"
value: "{{ .Values.registration.endpoint.pass }}"
- name: REGISTRATION_PORT
value: "5672"
value: "{{ .Values.registration.endpoint.port }}"
- name: REGISTRATION_HOST
value: "registration.{{.Values.global.namespace}}.svc.cluster.local"
- name: HEALTH_API_HOST
@ -250,17 +250,17 @@ spec:
- name: PTP_POLL_FREQ_SECONDS
value: "{{ .Values.ptptracking.device.poll_freq_seconds }}"
- name: NOTIFICATIONSERVICE_USER
value: "admin"
value: "{{ .Values.notification.endpoint.user }}"
- name: NOTIFICATIONSERVICE_PASS
value: "admin"
value: "{{ .Values.notification.endpoint.pass }}"
- name: NOTIFICATIONSERVICE_PORT
value: "5672"
value: "{{ .Values.notification.endpoint.port }}"
- name: REGISTRATION_USER
value: "admin"
value: "{{ .Values.registration.endpoint.user }}"
- name: REGISTRATION_PASS
value: "admin"
value: "{{ .Values.registration.endpoint.pass }}"
- name: REGISTRATION_PORT
value: "5672"
value: "{{ .Values.registration.endpoint.port }}"
- name: REGISTRATION_HOST
value: "registration.{{.Values.global.namespace}}.svc.cluster.local"
- name: HEALTH_API_HOST

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2021 Wind River Systems, Inc.
# Copyright (c) 2021-2025 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -43,9 +43,9 @@ spec:
image: "{{ .Values.registration.image.repository }}:{{ .Values.registration.image.tag }}"
env:
- name: RABBITMQ_DEFAULT_USER
value: "admin"
value: "{{ .Values.registration.endpoint.user }}"
- name: RABBITMQ_DEFAULT_PASS
value: "admin"
- name: RABBITMQ_DEFAULT_PORT
value: "5672"
value: "{{ .Values.registration.endpoint.pass }}"
- name: RABBITMQ_NODE_PORT
value: "{{ .Values.registration.endpoint.port }}"
---

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2021 Wind River Systems, Inc.
# Copyright (c) 2021,2024-2025 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -13,7 +13,7 @@ spec:
#clusterIP: None
ports:
- name: rabbitmq
port: 5672
port: {{ .Values.registration.endpoint.port }}
protocol: TCP
selector:
app: rabbitmq