Kubernetes Networking, Storage, and Config Cheat Sheet

Services, ingress, EndpointSlices, network policies, PVCs, PVs, storage classes, ConfigMaps, Secrets, and nodes.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Services and Ingress

Discover and expose network paths to workloads.

List services

Show services across namespaces.

bashANYserviceget
bash
kubectl get services -A
Notes

Show services across namespaces.

Describe service

Inspect selectors, endpoints, ports, and type.

bashANYservicedescribe
bash
kubectl describe service web -n payments
Notes

Inspect selectors, endpoints, ports, and type.

List endpoints

Show service endpoint IPs.

bashANYendpointsservice
bash
kubectl get endpoints -n payments
Notes

Show service endpoint IPs.

List EndpointSlices

Inspect EndpointSlice objects used for service discovery.

bashANYendpointsliceservice
bash
kubectl get endpointslices -n payments
Notes

Inspect EndpointSlice objects used for service discovery.

List ingresses

Show ingress resources across namespaces.

bashANYingressget
bash
kubectl get ingress -A
Notes

Show ingress resources across namespaces.

Describe ingress

Inspect rules, backends, and events.

bashANYingressdescribe
bash
kubectl describe ingress web -n payments
Notes

Inspect rules, backends, and events.

Port-forward deployment

Forward to a selected pod from a deployment.

bashANYport-forwarddeployment
bash
kubectl port-forward deployment/web 8080:8080 -n payments
Notes

Forward to a selected pod from a deployment.

Expose pod as service

Create a service from an existing pod.

bashANYserviceexpose
bash
kubectl expose pod debug-shell --port=8080 --target-port=8080 --name=debug-shell-svc -n tools
Notes

Create a service from an existing pod.

Network Policy

Control pod-to-pod traffic flow.

List network policies

Show NetworkPolicy resources.

bashANYnetworkpolicyget
bash
kubectl get networkpolicies -A
Notes

Show NetworkPolicy resources.

Describe network policy

Inspect ingress and egress rules.

bashANYnetworkpolicydescribe
bash
kubectl describe networkpolicy default-deny -n payments
Notes

Inspect ingress and egress rules.

Apply network policy

Create or update a NetworkPolicy manifest.

bashANYnetworkpolicyapply
bash
kubectl apply -f networkpolicy.yaml
Notes

Create or update a NetworkPolicy manifest.

Delete network policy

Remove a NetworkPolicy.

bashANYnetworkpolicydelete
bash
kubectl delete networkpolicy allow-metrics -n observability
Notes

Remove a NetworkPolicy.

Persistent Storage

Inspect and manage PVCs, PVs, and StorageClasses.

List PVCs

Show PersistentVolumeClaims across namespaces.

bashANYpvcget
bash
kubectl get pvc -A
Notes

Show PersistentVolumeClaims across namespaces.

Describe PVC

Inspect requested storage, status, and bound PV.

bashANYpvcdescribe
bash
kubectl describe pvc data-postgres-0 -n data
Notes

Inspect requested storage, status, and bound PV.

List PVs

Show cluster-wide PersistentVolumes.

bashANYpvget
bash
kubectl get pv
Notes

Show cluster-wide PersistentVolumes.

Describe PV

Inspect reclaim policy, claim ref, and backing class.

bashANYpvdescribe
bash
kubectl describe pv pvc-12345678
Notes

Inspect reclaim policy, claim ref, and backing class.

List storage classes

Show available StorageClasses.

bashANYstorageclassget
bash
kubectl get storageclass
Notes

Show available StorageClasses.

Describe storage class

Inspect provisioner and mount options.

bashANYstorageclassdescribe
bash
kubectl describe storageclass gp3
Notes

Inspect provisioner and mount options.

Expand PVC size

Request a larger PVC size when the class supports expansion.

bashANYpvcresize
bash
kubectl patch pvc data-postgres-0 -n data -p '{"spec":{"resources":{"requests":{"storage":"200Gi"}}}}'
Notes

Request a larger PVC size when the class supports expansion.

Delete PVC

Remove a PVC; PV behavior depends on reclaim policy.

bashANYpvcdelete
bash
kubectl delete pvc cache-data -n payments
Notes

Remove a PVC; PV behavior depends on reclaim policy.

ConfigMaps and Secrets

Manage runtime configuration and credentials.

List configmaps

Show ConfigMaps across namespaces.

bashANYconfigmapget
bash
kubectl get configmaps -A
Notes

Show ConfigMaps across namespaces.

Describe configmap

Inspect key-value data and metadata.

bashANYconfigmapdescribe
bash
kubectl describe configmap app-config -n payments
Notes

Inspect key-value data and metadata.

Edit configmap

Update a ConfigMap live.

bashANYconfigmapedit
bash
kubectl edit configmap app-config -n payments
Notes

Update a ConfigMap live.

List secrets

Show Secrets across namespaces.

bashANYsecretget
bash
kubectl get secrets -A
Notes

Show Secrets across namespaces.

Describe secret

Inspect secret type and key names without dumping values.

bashANYsecretdescribe
bash
kubectl describe secret app-secret -n payments
Notes

Inspect secret type and key names without dumping values.

Get secret key (base64)

Print a base64-encoded secret value.

bashANYsecretjsonpath
bash
kubectl get secret app-secret -n payments -o jsonpath='{.data.API_KEY}'
Notes

Print a base64-encoded secret value.

Get decoded secret key

Print a decoded secret value locally.

bashANYsecretjsonpathdecode
bash
kubectl get secret app-secret -n payments -o jsonpath='{.data.API_KEY}' | base64 --decode
Notes

Print a decoded secret value locally.

Create secret from env file

Create a secret from an env file.

bashANYsecretcreate
bash
kubectl create secret generic app-env --from-env-file=.env.production -n payments
Notes

Create a secret from an env file.

Nodes, Taints, and Scheduling Controls

Inspect cluster nodes and scheduling signals.

List nodes

Show node roles, versions, and internal IPs.

bashANYnodeget
bash
kubectl get nodes -o wide
Notes

Show node roles, versions, and internal IPs.

Describe node

Inspect capacity, allocatable, taints, and conditions.

bashANYnodedescribe
bash
kubectl describe node worker-02
Notes

Inspect capacity, allocatable, taints, and conditions.

Add taint to node

Add a taint to influence scheduling.

bashANYnodetaint
bash
kubectl taint nodes worker-02 dedicated=ml:NoSchedule
Notes

Add a taint to influence scheduling.

Remove taint from node

Remove a taint from a node.

bashANYnodetaintremove
bash
kubectl taint nodes worker-02 dedicated=ml:NoSchedule-
Notes

Remove a taint from a node.

Label node

Apply a scheduling label to a node.

bashANYnodelabel
bash
kubectl label node worker-02 nodepool=general --overwrite
Notes

Apply a scheduling label to a node.

List pods on node

See what is scheduled on a node.

bashANYnodepods
bash
kubectl get pods -A --field-selector spec.nodeName=worker-02 -o wide
Notes

See what is scheduled on a node.