Working with Kubernetes Using kubectl
Use kubectl to Check the Status of Worker Nodes in the Cluster
Use
kubectlto list all nodes in the clusterVerify the nodes are in the READY state
Get a List of Pods Running in the Cluster
Use
kubectlto list Pods in all namespacesVerify whether or not these Pods are all up and running
kubectl get pods --all-namespaces
Delete an Existing Pod
Delete the Pod named
web-frontend
kubectl delete pod web-frontend
kubectl get pods --all-namespaces
Create a New Pod
Create a new Pod called
web-frontendMake it run a container with the
nginximage
vi web-frontend.ymlweb-frontend.yml
apiVersion: v1
kind: Pod
metadata:
name: web-frontend
spec:
containers:
- name: nginx
image: nginx kubectl create -f web-frontend.yml
kubectl get pods --all-namespaces
Last updated