Last active
May 10, 2022 11:41
-
-
Save lentzi90/965899addb3bf64cadd27a663b55b1ca to your computer and use it in GitHub Desktop.
Debugging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl -n test run test --image ubuntu -it --rm | |
# Inside pod | |
apt update | |
apt install -y curl iputils-ping dnsutils netcat-openbsd redis-tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl -n test create svc clusterip test --tcp=8888:8888 | |
kubectl -n test run test1 --image ubuntu -it --rm --port 8888 --labels="app=test" \ | |
--overrides='{"spec": {"nodeName": "name-of-node"}}' | |
# Inside pod | |
apt update | |
apt install -y curl dnsutils netcat-openbsd | |
# Listen for incoming connections using netcat | |
netcat -l 8888 | |
# Create another pod and connect to the first through the service | |
kubectl -n test run test2 --image ubuntu -it --rm --overrides='{"spec": {"nodeName": "name-of-node"}}' | |
# Inside pod | |
apt update | |
apt install -y curl dnsutils netcat-openbsd | |
# Curl the other pod through the service | |
curl test:8888 | |
# Or connect with netcat | |
netcat test.test.svc.cluster.local 8888 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# No host key checking, no know_hosts file | |
ssh -o ConnectTimeout=2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null user@a.b.c.d | |
# Additionally, use only the specified secret key | |
ssh -o ConnectTimeout=2 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -F /dev/null -i ~/.ssh/id_rsa user@a.b.c.d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment