Added k8s pod notes to the knowledge base

This commit is contained in:
Michele Cereda
2022-04-21 10:07:23 +02:00
parent 118465fa82
commit 78fd6f4025

View File

@@ -0,0 +1,17 @@
# Check a Pod can connect to an external DB
## TL;DR
```shell
# access a test container
kubectl run --generator=run-pod/v1 --limits 'cpu=200m,memory=512Mi' --requests 'cpu=200m,memory=512Mi' --image alpine ${USER}-mysql-test -it -- sh
# install programs
apk --no-cache add mysql-client netcat-openbsd
# test plain connectivity
nc -vz -w3 10.0.2.15 3306
# test the client can connect
mysql --host 10.0.2.15 --port 3306 --user root
```