From 8292679b2ad291621398ccd1106aef84e83b538a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelizaveta=20Leme=C5=A1eva?= Date: Fri, 26 Jul 2024 11:15:00 +0200 Subject: [PATCH] fix(helm): add NodePort services for rabbitmq and postgresql debugging (#812) --- helm/reana/templates/reana-db.yaml | 17 +++++++++++++ .../reana/templates/reana-message-broker.yaml | 25 +++++++++++++------ reana/reana_dev/cluster.py | 5 ++++ 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/helm/reana/templates/reana-db.yaml b/helm/reana/templates/reana-db.yaml index 84ad8b4e..90121d72 100644 --- a/helm/reana/templates/reana-db.yaml +++ b/helm/reana/templates/reana-db.yaml @@ -13,6 +13,23 @@ spec: - port: 5432 targetPort: 5432 protocol: TCP +{{- if .Values.debug.enabled }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "reana.prefix" . }}-db-debug + namespace: {{ .Release.Namespace }} +spec: + type: "NodePort" + selector: + app: {{ include "reana.prefix" . }}-db + ports: + - port: 5432 + targetPort: 5432 + nodePort: 30432 + protocol: TCP +{{- end }} --- apiVersion: apps/v1 kind: Deployment diff --git a/helm/reana/templates/reana-message-broker.yaml b/helm/reana/templates/reana-message-broker.yaml index 60ad1791..4008fe38 100644 --- a/helm/reana/templates/reana-message-broker.yaml +++ b/helm/reana/templates/reana-message-broker.yaml @@ -11,19 +11,30 @@ spec: targetPort: 5672 name: "tcp" protocol: TCP - {{- if .Values.debug.enabled }} - - port: 31672 - targetPort: 15672 - name: "management" - protocol: TCP - {{- else }} - port: 15672 targetPort: 15672 name: "management" protocol: TCP - {{- end }} selector: app: {{ include "reana.prefix" . }}-message-broker +{{- if .Values.debug.enabled }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "reana.prefix" . }}-message-broker-debug + namespace: {{ .Release.Namespace }} +spec: + type: "NodePort" + selector: + app: {{ include "reana.prefix" . }}-message-broker + ports: + - port: 15672 + targetPort: 15672 + nodePort: 31672 + name: "management" + protocol: TCP +{{- end }} --- apiVersion: apps/v1 kind: StatefulSet diff --git a/reana/reana_dev/cluster.py b/reana/reana_dev/cluster.py index 98bd8c81..f2dc7682 100644 --- a/reana/reana_dev/cluster.py +++ b/reana/reana_dev/cluster.py @@ -124,6 +124,11 @@ def add_volume_mounts(node): "hostPort": 31672, "protocol": "TCP", }, # rabbitmq + { + "containerPort": 30432, + "hostPort": 30432, + "protocol": "TCP", + }, # postgresql ] )