Find out the connections of a Kubernetes pod

721 Views Asked by At

I need to create the most restrictive Network Policy for a Kubernetes pod. I do not know anything about the pod or the deployment other than the fact, that the pod does communicate with other pods, IP's and services, it is also accessible from the Internet.

How do I find out all the connections the pod needs in order to work?

1

There are 1 best solutions below

0
Stand__Sure On

if Istio is available, you can get this from the logs from the proxy. The snippet below assumes your app has a label that can be used for selecting the relevant pods...

kubectl get logs -l app=MY_APP -c istio-proxy

See https://istio.io/latest/docs/tasks/observability/logs/access-log/ for a demo walkthrough.