How to Scale Up/Down Deployment? – Play Docker container technology for 5 minutes a day (126)

Cloudman6 2018-01-31 06:27:15 查 看 29 comment 0

Secure Docker configuration container Node OpenStack HTML

Abstract:

This section discusses how to increase and decrease the number of Pod copies online.

Scaling Up/Down refers to increasing or decreasing the number of Pod copies online.

Deployment nginx-deploymentIt starts with two copies.

k8s-node1k8s-node2Each run a copy on. Now modify nginx.yml to have 5 copies.

Performed againkubectl apply:

Three new replicas are created and scheduled tok8s-node1k8s-node2On.

For security reasons, Kubernetes does not schedule pods to Master nodes by default. To use k8S-master as a Node, run the following command:

kubectl taint node k8s-master node-role.kubernetes.io/master-Copy the code

To restore the Master Only state, run the following command:

kubectl taint node k8s-master node-role.kubernetes.io/master="":NoScheduleCopy the code

Then modify the configuration file, reduce the number of copies to 3, and run againkubectl apply:

You can see that two copies are deleted and three copies remain.

In the next section we learn about Deployment Failover.

Books:

1. Docker Container Technology in 5 Minutes a day

https://item.jd.com/16936307278.html



2. Play OpenStack in 5 Minutes a Day

https://item.jd.com/12086376.html

Copyright Notice: The content of this article is contributed by Internet users, copyright belongs to the author, the community does not have the ownership, also do not assume the relevant legal responsibility. If you find any content suspected of plagiarism in our community, you are welcome to send an email to [email protected] to report and provide relevant evidence. Once verified, our community will immediately delete the content suspected of infringement.

The original link