Running an observer for a remote erlang node: simplification

I have a cluster of kubernetes.

I can easily connect to the remote container and start the node shell connecting to the current erlang node product:

$ kubectl exec myapp-2431125679-cwqvt -i -t -- iex --name debugging@127.0.0.1 --remsh myliveapp@127.0.0.1 --cookie my_secret_cookie Erlang/OTP 18 [erts-7.3.1] [source] [64-bit] [smp:2:2] [async-threads:10] [kernel-poll:false] Interactive Elixir (1.3.4) - press Ctrl+C to exit (type h() ENTER for help) iex( myliveapp@127.0.0.1 )1> 

I need, however, to be able to run :observer for erlang node remote live production .

I can do this too:

  • kill local epmd process:

     killall epmd 
  • redirect remote remote ports to the local computer:

     kubectl port-forward myapp-2431125679-cwqvt 35609 4369 

    I know that my application runs on port 35609 on a remote container, and 4369 - this epmd port works by default, which corresponds to my remote container.

  • mileage:

     iex --name debugging@127.0.0.1 --cookie marketplace -e ':observer.start()' 
  • select the application that interests me from the top menu in :observer .

My questions:

  • can this be done easier ?
  • is there anything i need to know about kubernetes to create a single line interface that will connect to the remote node and do what i want?

Ultimately, can I make this process a single layer or turn it into a shell script?

Killing epmd right now looks really dirty, I wish it could be avoided.

+5
source share

Source: https://habr.com/ru/post/1263720/


All Articles