reanahub / reana

REANA: Reusable research data analysis platform
https://docs.reana.io
MIT License
123 stars 54 forks source link

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

Closed jlemesh closed 1 month ago

jlemesh commented 1 month ago

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
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/reanahub/reana/pull/812/graphs/tree.svg?width=650&height=150&src=pr&token=NmV0ZCmqfN&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub)](https://app.codecov.io/gh/reanahub/reana/pull/812?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub) ```diff @@ Coverage Diff @@ ## master #812 +/- ## ======================================= Coverage 18.15% 18.15% ======================================= Files 26 26 Lines 2478 2478 ======================================= Hits 450 450 Misses 2028 2028 ``` | [Files](https://app.codecov.io/gh/reanahub/reana/pull/812?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub) | Coverage Δ | | |---|---|---| | [reana/reana\_dev/cluster.py](https://app.codecov.io/gh/reanahub/reana/pull/812?src=pr&el=tree&filepath=reana%2Freana_dev%2Fcluster.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=reanahub#diff-cmVhbmEvcmVhbmFfZGV2L2NsdXN0ZXIucHk=) | `0.00% <ø> (ø)` | |
jlemesh commented 1 month ago

CI fails due to https://github.com/pypa/setuptools/issues/931