Erlang Observer Over Kube

I recently ran into the problem where remote Erlang observer doesn't work properly if you're running remote, and :observer_cli only goes so far. The problem I had was that our Erlang services ran themselves as :"<SERVICE>@<KUBE_INTERNAL_IP>" such as :"[email protected]".You can port forward into the epmd on 4963 just fine, but it fails when trying to find a route to the internal Kube server. The solution on OS X was to use pfctl to forward it in, via:

echo "Enabling pcftl"
sudo pfctl -E || true
echo "Setting new rule on pfctl"
sudo ifconfig lo0 alias $POD_IP
echo "rdr pass on lo0 inet proto tcp from any to $POD_IP port 4369 -> 127.0.0.1" > ./tmp_pf_rule.conf
echo "rdr pass on lo0 inet proto tcp from any to $POD_IP port $OTP_PORT -> 127.0.0.1" >> ./tmp_pf_rule.conf

I posted the full script on https://gist.github.com/peixian/a26e733625baddd0be48648a69bf89a8.

Posted: 2023-04-18
Filed Under: computer