Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(helm): add NodePort services for debugging (#812) #812

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

jlemesh
Copy link
Contributor

@jlemesh jlemesh commented Jul 26, 2024

Current port mapping from Kubernetes service to localhosts for RabbitMQ debugging does not work (RabbitMQ has a nice UI that allows inspecting queues and messages). The reason is that reana-message-broker uses ClusterIP service instead of NodePort, which does not allow access from outside of the cluster (reana-mail uses NodePort and works fine). I can think of two ways of fixing it - either delete broken code from cluster.py and use kubectl port-forward, or add additional debug NodePort service to Helm chart (we already have debug.enabled flag). This PR implements the latter, as it simplifies running REANA cluster in debugging mode.

Also adding debug service for PostgreSQL which would allow connecting to it via PostgreSQL client on host machine.

Kubernetes services before:

$ kubectl get svc                      
NAME                        TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                           AGE
kubernetes                  ClusterIP   10.96.0.1       <none>        443/TCP                           4m39s
reana-cache                 ClusterIP   10.96.5.244     <none>        6379/TCP                          12s
reana-db                    ClusterIP   10.96.7.93      <none>        5432/TCP                          12s
reana-mail                  NodePort    10.96.96.82     <none>        30025:30025/TCP,32580:32580/TCP   12s
reana-message-broker        ClusterIP   10.96.99.186    <none>        5672/TCP,31672/TCP                12s <-- no mapping
reana-server                ClusterIP   10.96.89.209    <none>        80/TCP                            12s
reana-traefik               NodePort    10.96.249.50    <none>        80:30080/TCP,443:30443/TCP        12s
reana-ui                    ClusterIP   10.96.242.48    <none>        80/TCP                            12s
reana-wdb                   NodePort    10.96.148.252   <none>        19840:32376/TCP,1984:31984/TCP    12s
reana-workflow-controller   ClusterIP   10.96.45.226    <none>        80/TCP

Kubernetes services after:

$ kubectl get svc 
NAME                         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                           AGE
kubernetes                   ClusterIP   10.96.0.1       <none>        443/TCP                           3m35s
reana-cache                  ClusterIP   10.96.99.130    <none>        6379/TCP                          17s
reana-db                     ClusterIP   10.96.166.11    <none>        5432/TCP                          17s
reana-db-debug               NodePort    10.96.199.69    <none>        5432:30432/TCP                    17s <-- mapping
reana-mail                   NodePort    10.96.123.33    <none>        30025:30025/TCP,32580:32580/TCP   17s
reana-message-broker         ClusterIP   10.96.82.13     <none>        5672/TCP,15672/TCP                17s
reana-message-broker-debug   NodePort    10.96.154.13    <none>        15672:31672/TCP                   17s <-- mapping
reana-server                 ClusterIP   10.96.78.78     <none>        80/TCP                            17s
reana-traefik                NodePort    10.96.222.115   <none>        80:30080/TCP,443:30443/TCP        17s
reana-ui                     ClusterIP   10.96.92.124    <none>        80/TCP                            17s
reana-wdb                    NodePort    10.96.146.200   <none>        19840:31633/TCP,1984:31984/TCP    17s
reana-workflow-controller    ClusterIP   10.96.169.253   <none>        80/TCP                            17s

@jlemesh jlemesh changed the title fix(helm): add NodePort services for rabbitmq and postgresql debugging (#812) fix(helm): add NodePort services for debugging (#812) Jul 26, 2024
jlemesh added a commit to jlemesh/reana that referenced this pull request Jul 26, 2024
@jlemesh jlemesh force-pushed the fix_helm_map_db_rabbitmq_ports branch from 8292679 to 6336b59 Compare July 26, 2024 11:54
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 18.15%. Comparing base (9112171) to head (9698c63).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #812   +/-   ##
=======================================
  Coverage   18.15%   18.15%           
=======================================
  Files          26       26           
  Lines        2478     2478           
=======================================
  Hits          450      450           
  Misses       2028     2028           
Files Coverage Δ
reana/reana_dev/cluster.py 0.00% <ø> (ø)

Copy link
Member

@mdonadoni mdonadoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well and looks good to me! Services were all NodePort in the past, but they were then changed to ClusterIP in #675, and we didn't update the reana-dev scripts properly. I have tested that I can access rabbitmq's UI and the database.

Just one thing left, could you add your ORCID to AUTHORS.md (in alphabetical order) ?

jlemesh added a commit to jlemesh/reana that referenced this pull request Jul 29, 2024
@jlemesh jlemesh force-pushed the fix_helm_map_db_rabbitmq_ports branch from aa0677a to 29d1fcd Compare July 29, 2024 10:26
@jlemesh

This comment was marked as outdated.

@jlemesh jlemesh force-pushed the fix_helm_map_db_rabbitmq_ports branch from 29d1fcd to 9698c63 Compare July 31, 2024 09:07
@jlemesh jlemesh requested a review from mdonadoni July 31, 2024 09:10
Copy link
Member

@mdonadoni mdonadoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mdonadoni mdonadoni merged commit 9698c63 into reanahub:master Jul 31, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants