Kubernetes: Services, DNS & networking checks
6 Kubernetes commands: Services, DNS & networking checks. Click a command to see what each part does.
Kubernetes: Services, DNS & networking checksIndex
- Whole sheet137
- Basics: cluster, namespaces & resources17
- Get & list resources23
- Context & namespace3
- Find resources9
- Debug: describe, events, logs8
- Exec, port-forward, copy4
- Deploy, roll out, roll back, scale7
- Cleanup & nodes4
- Services, DNS & networking checks6
- Environment, config & secrets of workloads9
- Create, generate & apply YAML10
- Patch, label, annotate & scale9
- Delete & force delete6
- Nodes, scheduling & access control11
- Productivity: aliases, contexts & output11
Services, DNS & networking checks6
kubectl describe svc <service> -n <namespace>Describe a serviceWhat each part does
describe svctype, selector, ports, target ports, endpoints and events-n <namespace>in this namespace (default: the context's namespace; -A for all)
kubectl run dnstest --rm -it --restart=Never --image=busybox:1.36 -- nslookup <service>.<namespace>.svc.cluster.localTest DNS from inside the clusterWhat each part does
kubectl run dnstest --rm -it --restart=Neverthrowaway pod, removed when done--image=busybox:1.36small image with nslookup<service>.<namespace>.svc.cluster.locala service's full DNS name
kubectl run curltest --rm -it --restart=Never --image=curlimages/curl -- curl -sv http://<service>.<namespace>:<port>/Call a service from inside the clusterWhat each part does
--image=curlimages/curlimage with curlhttp://<service>.<namespace>:<port>/service DNS name and port: tests the path pods use
kubectl port-forward deploy/<deployment> <local-port>:<container-port> -n <namespace>Port-forward to a deployment or podWhat each part does
deploy/<deployment>picks one pod of the deployment (also pod/<pod>, svc/<service>)<local-port>:<container-port>localhost port : port in the pod-n <namespace>in this namespace (default: the context's namespace; -A for all)
kubectl proxy --port=8001Open a local proxy to the API serverWhat each part does
kubectl proxyauthenticated proxy: http://localhost:8001/api/... reaches the API, and services via /api/v1/namespaces/<ns>/services/<svc>/proxy/--port=8001local port
kubectl get --raw='/readyz?verbose'Check the API server healthWhat each part does
get --rawcall an API path directly/readyz?verboseeach readiness check with ok/failed (also /livez)
Nothing matches.
My DevOps Playbook by Angelo John Calleja