Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Kubernetes debugging
kubectl -n test run test --image ubuntu -it --rm
# Inside pod
apt update
apt install -y curl iputils-ping dnsutils netcat-openbsd redis-tools
kubectl -n test create svc clusterip test --tcp=8888:8888
kubectl -n test run test --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 test --image ubuntu -it --rm
# Inside pod
apt update
apt install -y curl dnsutils netcat-openbsd
# Curl the other pod through the service
curl test:8888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment