Skip to content

Latest commit

 

History

History
32 lines (19 loc) · 4.1 KB

README.md

File metadata and controls

32 lines (19 loc) · 4.1 KB

Author

Build status GitHub License GitHub last commit GitHub tag (with filter)

postgres-nc Container

Purpose

I have created this container to have a working version of Netcat inside a Postgresql container. The main purpose is to test various network policies against this container.

Docker

$ docker run -it --rm -p 5432:5432 ghcr.io/michaeltrip/postgres-nc:latest

Podman

$ podman run -it --rm -p 5432:5432 ghcr.io/michaeltrip/postgres-nc:latest

Kubernetes

I have created two seperate deployments, a postgres 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.