I have created this container to have a working version of Netcat inside a NGINX container. The main purpose is to test various network policies against this container.
$ docker run -it --rm -p 8080:80 ghcr.io/michaeltrip/nginx-nc:latest
$ podman run -it --rm -p 8080:80 ghcr.io/michaeltrip/nginx-nc:latest
I have created two seperate deployments, a nginx
deployment with a service
object running on port 8080
and a "pretending to be" postgresql
container with this image with a service object running on 5432
. This to simulate a network connection between those two.
After that, i can execute a shell into the nginx
container and test the network connectitivy with the nc
command: nc -zv postgresql.postgresql 5432
, or with the curl command: curl http://postgresql.postgresql:5432
.