$ k apply -f redis-ds.yml daemonset.apps/redis-ds created
$ k get ds -owide NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE CONTAINERS IMAGES SELECTOR redis-ds 1 1 1 1 1 <none> 48s redis redis:5-alpine name=redis-ds
$ k get po -owide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES redis-ds-l5rhj 1/1 Running 0 68s 10.10.1.38 mac-worker <none> <none>
$ k describe no mac-master Name: mac-master Roles: control-plane,master ... Taints: node-role.kubernetes.io/master:NoSchedule ...
$ k describe no mac-worker Name: mac-worker Roles: <none> ... Taints: <none> ...
$ k describe po redis-ds-l5rhj ... Tolerations: node.kubernetes.io/disk-pressure:NoSchedule op=Exists node.kubernetes.io/memory-pressure:NoSchedule op=Exists node.kubernetes.io/not-ready:NoExecute op=Exists node.kubernetes.io/pid-pressure:NoSchedule op=Exists node.kubernetes.io/unreachable:NoExecute op=Exists node.kubernetes.io/unschedulable:NoSchedule op=Exists ...
移除 Master 的 Taint
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
$ k taint node mac-master node-role.kubernetes.io/master:NoSchedule- node/mac-master untainted
$ k describe no mac-master Name: mac-master Roles: control-plane,master ... Taints: <none> ...
$ k get ds -owide NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE CONTAINERS IMAGES SELECTOR redis-ds 2 2 2 2 2 <none> 16m redis redis:5-alpine name=redis-ds
$ k get po -owide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES redis-ds-ctj4l 1/1 Running 0 113s 10.10.0.4 mac-master <none> <none> redis-ds-l5rhj 1/1 Running 0 16m 10.10.1.38 mac-worker <none> <none>
$ k taint node mac-master node-role.kubernetes.io/master:NoSchedule node/mac-master tainted
$ k describe no mac-master Name: mac-master Roles: control-plane,master ... Taints: node-role.kubernetes.io/master:NoSchedule ...
$ k get ds -owide NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE CONTAINERS IMAGES SELECTOR redis-ds 1 1 1 1 1 <none> 18m redis redis:5-alpine name=redis-ds
$ k get po -owide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES redis-ds-ctj4l 1/1 Running 0 4m20s 10.10.0.4 mac-master <none> <none> redis-ds-l5rhj 1/1 Running 0 19m 10.10.1.38 mac-worker <none> <none>
$ k delete po redis-ds-ctj4l pod "redis-ds-ctj4l" deleted
$ k apply -f redis-ds.yml daemonset.apps/redis-ds configured
$ k get ds -owide NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE CONTAINERS IMAGES SELECTOR redis-ds 2 2 2 2 2 <none> 49m redis redis:5-alpine name=redis-ds
$ k get po -owide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES redis-ds-58spk 1/1 Running 0 41s 10.10.1.39 mac-worker <none> <none> redis-ds-ct9sq 1/1 Running 0 43s 10.10.0.5 mac-master <none> <none>
Static Pod
Static Pod 不受 Kubernetes 管控,不与 apiserver、scheduler 发生关系,只受 kubelet 管控