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?
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-proxySee https://istio.io/latest/docs/tasks/observability/logs/access-log/ for a demo walkthrough.