K8s experimental pod deletion and expansion

Write a yml, set the number of rep variables to 2, and pull a helloworld app

image

kubectl create -f helloworld-repl-controller.yml

image

Look at the 2 pods already started

image

kubectl describe pod helloworld-controller-28nk9

Isn't the assignment successful?

image

Because Mao is so slow

watch kubectl get pod

image

5 minutes later, finally running, the magical Chinese network

image

Manually delete a pod, you can see after the pod is killed. The new pod will automatically be up

kubectl delete pod helloworld-controller-28nk9

image

kubectl scale --replicas=4 -f helloworld-repl-controller.yml

image

You can see that 2 pods have been expanded to 4

image

kubectl get rc

image

Change rep to 1, pod automatically kills itself 3

image

kubectl delete rc/helloworld-controller

Empty rc

image

Guess you like

Origin blog.51cto.com/433266/2536362