This repo has some kubernetes config files use to study for the Kubernetes Certified Application Developer (CKAD)
Get all the pods, services, statefulsets, etc.
kubectl get all
Get all the namespaces:
kubectl get ns
Create a namespace:
kubectl create ns <namespace-name>
Apply/Create a K8s manifest:
kubectl -n <namespace-name> apply -f <file>
kubectl apply -f <file>
kubectl create -f <file>
Describe a resource:
kubectl -n <namespace-name> describe <kind> <name>
Show pod logs:
kubectl -n <namespace-name> logs <pod-name>
Exec a pod sh:
kubectl -n <namespace-name> exec -it <pod-name> -- sh
Delete a resource:
kubectl -n <namespace-name> delete <kind> <name>
kubectl delete <kind> <name>
kubectl delete -f <file>
Get nodes ip:
kubectl get nodes -o wide
Apply kustomization.yaml:
kubectl apply -k .
or
kustomize build . | kubectl apply -f -