modified: README.md
This commit is contained in:
95
README.md
95
README.md
@@ -27,8 +27,12 @@ Kubernetes is an open‑source platform that automates the deployment, scaling,
|
|||||||
- [Inline with heredoc and environment variables](#inline-with-heredoc-and-environment-variables)
|
- [Inline with heredoc and environment variables](#inline-with-heredoc-and-environment-variables)
|
||||||
- [substr](#substr)
|
- [substr](#substr)
|
||||||
- [nodes](#nodes)
|
- [nodes](#nodes)
|
||||||
- [taint nodes](#taint-nodes)
|
- [taints](#taints)
|
||||||
|
- [add taint](#add-taint)
|
||||||
|
- [remove taint](#remove-taint)
|
||||||
- [control plane - NoSchedule](#control-plane---noschedule)
|
- [control plane - NoSchedule](#control-plane---noschedule)
|
||||||
|
- [Official \*.kubernetes.io taints](#official-kubernetesio-taints)
|
||||||
|
- [cordon](#cordon)
|
||||||
- [statefulset](#statefulset)
|
- [statefulset](#statefulset)
|
||||||
- [statefulset - Set Replicas](#statefulset---set-replicas)
|
- [statefulset - Set Replicas](#statefulset---set-replicas)
|
||||||
- [Deployment](#deployment)
|
- [Deployment](#deployment)
|
||||||
@@ -431,27 +435,96 @@ envsubst < ./secret.yaml | kubectl apply -f -
|
|||||||
kubectl get nodes -o wide
|
kubectl get nodes -o wide
|
||||||
```
|
```
|
||||||
|
|
||||||
**get node taints:**
|
|
||||||
|
|
||||||
``` bash
|
|
||||||
kubectl describe node <NODE_NAME> | grep taint
|
|
||||||
```
|
|
||||||
|
|
||||||
**remove annotation:**
|
**remove annotation:**
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
kubectl annotate node <NODE_NAME> <ANNOTATION_NAME>-
|
kubectl annotate node <NODE_NAME> <ANNOTATION_NAME>-
|
||||||
```
|
```
|
||||||
|
|
||||||
### taint nodes
|
## taints
|
||||||
|
|
||||||
#### control plane - NoSchedule
|
**get node taints:**
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
MASTER_NODE_NAME="master-node-name"
|
kubectl describe node <NODE_NAME> | grep taint
|
||||||
kubectl taint nodes ${MASTER_NODE_NAME} node-role.kubernetes.io/control-plane=:NoSchedule
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### add taint
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
NODE="????"
|
||||||
|
TAINT="infra.mydomain.com/dedicated=role:NoSchedule"
|
||||||
|
kubectl taint nodes ${NODE} ${TAINT}
|
||||||
|
```
|
||||||
|
|
||||||
|
### remove taint
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
NODE="chimera-deepstate"
|
||||||
|
TAINT="infra.mydomain.com/dedicated=role:NoSchedule"
|
||||||
|
kubectl taint nodes ${NODE} ${TAINT}-
|
||||||
|
```
|
||||||
|
|
||||||
|
### control plane - NoSchedule
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
NODE="????"
|
||||||
|
kubectl taint nodes ${NODE} node-role.kubernetes.io/control-plane=:NoSchedule
|
||||||
|
```
|
||||||
|
|
||||||
|
### Official *.kubernetes.io taints
|
||||||
|
|
||||||
|
**Node condition taints (automatic):**
|
||||||
|
|
||||||
|
- node.kubernetes.io/not-ready - Node is NotReady
|
||||||
|
- node.kubernetes.io/unreachable - Node unreachable
|
||||||
|
- node.kubernetes.io/out-of-disk - Node out of disk
|
||||||
|
- node.kubernetes.io/memory-pressure - Memory pressure
|
||||||
|
- node.kubernetes.io/disk-pressure - Disk pressure
|
||||||
|
- node.kubernetes.io/network-unavailable- Network unavailable
|
||||||
|
- node.kubernetes.io/unschedulable - Node was cordoned
|
||||||
|
- node.kubernetes.io/ready - Node is ready (rarely used as taint)
|
||||||
|
|
||||||
|
**Eviction taints (used by kubelet):**
|
||||||
|
|
||||||
|
- node.kubernetes.io/pid-pressure - Too many processes
|
||||||
|
- node.kubernetes.io/unschedulable - Node cordoned
|
||||||
|
- node.kubernetes.io/taint-effect-no-execute - NoExecute taints
|
||||||
|
|
||||||
|
**Role taints (official, safe to use):**
|
||||||
|
|
||||||
|
- node-role.kubernetes.io/control-plane - Control-plane node
|
||||||
|
- node-role.kubernetes.io/master - Legacy control-plane
|
||||||
|
|
||||||
|
Everything else in *.kubernetes.io is reserved and should not be used.
|
||||||
|
|
||||||
|
### cordon
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
NODE="????"
|
||||||
|
kubectl cordon ${NODE}
|
||||||
|
```
|
||||||
|
|
||||||
|
Marks a node as unschedulable.
|
||||||
|
|
||||||
|
- No new pods will be scheduled on that node
|
||||||
|
- Existing pods are not affected
|
||||||
|
- Even after a reboot, existing pods return to the same node
|
||||||
|
- Used for temporary maintenance (updates, debugging, draining prep)
|
||||||
|
- Kubernetes automatically adds the taint:
|
||||||
|
`node.kubernetes.io/unschedulable:NoSchedule`
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
NODE="???"
|
||||||
|
kubectl uncordon ${NODE}
|
||||||
|
```
|
||||||
|
|
||||||
|
Reverses the cordon.
|
||||||
|
|
||||||
|
- The node becomes schedulable again
|
||||||
|
- New pods can land on it
|
||||||
|
- Existing pods remain untouched
|
||||||
|
|
||||||
## statefulset
|
## statefulset
|
||||||
|
|
||||||
### statefulset - Set Replicas
|
### statefulset - Set Replicas
|
||||||
|
|||||||
Reference in New Issue
Block a user