新增learn-kubernetes(https://github.com/yyong-brs/learn-kubernetes)相关文件
This commit is contained in:
41
learn/learn-kubernetes-master/kiamol/ch18/lab/README.md
Normal file
41
learn/learn-kubernetes-master/kiamol/ch18/lab/README.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# ch18 lab
|
||||
|
||||
## Setup
|
||||
|
||||
Connect to the control plane node:
|
||||
|
||||
```
|
||||
vagrant ssh kiamol-control
|
||||
```
|
||||
|
||||
## Sample Solution
|
||||
|
||||
You take a node out of service by draining it, which reschedules the Pods - you need the DaemonSet flag so the system components are ignored:
|
||||
|
||||
```
|
||||
kubectl drain kiamol-node --ignore-daemonsets
|
||||
```
|
||||
|
||||
There is also the `kubectl cordon` command which marks the node so it won't have any new Pods scheduled, but that doesn't remove the existing Pods.
|
||||
|
||||
When you're done working on the node you can bring it back into service by uncordoning it:
|
||||
|
||||
```
|
||||
kubectl uncordon kiamol-node
|
||||
```
|
||||
|
||||
That marks the node as available for work, but Kubernetes doesn't automatically reschedule existing workloads so the node won't start any application Pods.
|
||||
|
||||
You can rebalance the API Pods by restarting the rollout:
|
||||
|
||||
```
|
||||
kubectl rollout restart deploy apod-api
|
||||
```
|
||||
|
||||
## Teardown
|
||||
|
||||
You can delete all of the Vagrant VMs with:
|
||||
|
||||
```
|
||||
vagrant destroy
|
||||
```
|
||||
Reference in New Issue
Block a user