Kubernetes Command
August 26, 2021
Node, Pod, Label, Annotation
All labels can be applied not only to the pod
All annotations can be applied not only to pods
Pod and Node
View the node
$ kubectl get nodesSee the pod
$ kubectl get podsView pod by displaying label
$ kubectl get pods --show-labelsSearch for pods based on labels
$ kubectl get pods -l key Make a pod
$ kubectl create -f nama-file-pod.yamlCreate pods in certain namespaces
$ kubectl create -f nama-file-pod.yaml --namespace nama-namaspaceView the description of the pod
$ kubectl describe pod nama-podDelete pod
$ kubectl delete pod nama-podDelete all pods in the namespace
$ kubectl delete pod --all --namespace nama-namepaceNamespace
View the namescape
$ kubectl get namespacesOr likethis
$ kubectl get nsSee pods in certain namespaces
$ kubectl get pods -n nama-namespaceCreate namespace
$ kubectl creat -f nama-file-namespace.yamlDelete namespace
$ kubectl delete namespace nama-namespaceProbe
So there are 3 probes :
- livenessProbe Health check, if it’s not healthy then the pod will be restarted
- readinessProbe Health check, if the pod is not healthy the traffic will be turned off
- startupProbe Health check when pod runs (at startup)
There are many more commands for Kubernetes. The above commands are only a few.