Kubernetes
Kubernetes

🔗 #

Basic kubectl commands #

Command
kubectl get podsList all pods in the current namespace
kubectl get pods --all-namespacesList all pods in all namespaces
kubectl get pods -n trust-managerList all pods in the namespace trust-manager
kubectl get pods -o wideList all pods with more details
kubectl get pods -o wide -n trust-managerList all pods in the namespace trust-manager
kubectl describe pod trust-managerDescribe a pod with the name trust-manager
kubectl get events --field-selector involvedObject.name=<pod-name> -n <namespace>Get events for a specific pod
kubectl get events -n <namespace>Get events for a specific namespace
kubectl get events --all-namespacesGet events for all namespaces

Namespaces #

Command
kubectl create namespace trust-managerCreate a new namespace with the name trust-manager
kubectl delete namespace trust-managerDelete a namespace with its resources altogether
kubectl get namespacesList all namespaces

Config maps #

Command
kubectl get configmaps --all-namespacesList all config maps in all namespaces
kubectl delete configmap custom-ca-bundleDelete a config map with the name custom-ca-bundle