How to tell if an elixir app is running from outside of the system?

I’m in the process of deploying an Elixir app to a kube cluster. For those who haven’t played with kube, it has the concept of a liveness and readiness probe which it uses to monitor service state and start/restart/backoff as necessary.

This is easy to setup for a Phoenix app because I access routes over HTTP, but the app I’m now deploying is a simple worker with a simple supervisor, no server, etc,.

I’ve looked at pid_file hex package which seems to be the way to go, but just wondering if anyone has experience with this and if it is reliable, or if there other suggestions for how I might go about this?

Found here:

Shouldn’t it be automatic if you use releases with docker? The app dies, the docker container stops, the pod is restarted, etc.

1 Like

Confirmed. If Erlang crashes it brings the container down which will then adhere to its restart policy. Couldn’t bring down the main process (pid 1) from within container, but did manage to kill erl_child_setup. Cheers :+1:

1 Like

How can I crash the beam? I think I need to find out.

If the top supervisor stops (the application stops), the vm should stop as well, I think.

If there are several applications in a release, I don’t quite remember.

1 Like