Kubectl: bash into postgres runnig inside a container
Aug 2, 2023
kubectl -n <my namespace> exec -it <pod name> -c <container name> -- sh -c "PGPASSWORD=<pg password> psql -U <postgresadminUser> postgresql://<postgreshost>:5432/<postresdb>"
kubectl -n <my namespace> exec -it <pod name> -c <container name> -- sh -c "PGPASSWORD=<pg password> psql -U <postgresadminUser> postgresql://<postgreshost>:5432/<postresdb>"
Software Contractor — Java, Spring, k8s, AWS, Javascript @ London - hire me at https://elvisciotti.github.io/