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
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-deployment
It starts with two copies.
k8s-node1
和 k8s-node2
Each run a copy on. Now modify nginx.yml to have 5 copies.
Performed againkubectl apply
:
Three new replicas are created and scheduled tok8s-node1
和 k8s-node2
On.
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
The original link