Restart of node (Perform this activity in Master node)
root@k8-pr-master:~# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8-pr-master Ready master 20h v1.18.1
k8-pr-woker1 Ready 19h v1.18.1
kb-pr-worker2 Ready 36m v1.18.1
root@k8-pr-master:~# kubectl drain --ignore-daemonsets --force --delete-local-data kb-pr-worker2
Flag --delete-local-data has been deprecated, This option is deprecated and will be deleted. Use --delete-emptydir-data.
node/kb-pr-worker2 cordoned
WARNING: ignoring DaemonSet-managed Pods: kube-system/calico-node-4hrtp, kube-system/kube-proxy-kdfhc
evicting pod default/nginx-deployment-d46f5678b-js8tl
evicting pod default/nginx-deployment-d46f5678b-hntfv
pod/nginx-deployment-d46f5678b-hntfv evicted
pod/nginx-deployment-d46f5678b-js8tl evicted
node/kb-pr-worker2 evicted
kubectl delete pod -n= --grace-period=0 --force
root@k8-pr-master:~# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8-pr-master Ready master 20h v1.18.1
k8-pr-woker1 Ready 19h v1.18.1
kb-pr-worker2 Ready,SchedulingDisabled 37m v1.18.1
root@k8-pr-master:~# kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
nginx-deployment-d46f5678b-k4xp8 1/1 Running 0 31s 10.10.240.198 k8-pr-woker1
nginx-deployment-d46f5678b-kt8qg 1/1 Running 0 31s 10.10.240.197 k8-pr-woker1
nginx-deployment-d46f5678b-l5p8n 1/1 Running 1 19h 10.10.240.195 k8-pr-woker1
nginx-deployment-d46f5678b-q65pj 1/1 Running 1 19h 10.10.240.196 k8-pr-woker1
root@k8-pr-master:~# kubectl get pods -o wide --all-namespaces --field-selector=spec.nodeName==kb-pr-worker2
NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
kube-system calico-node-4hrtp 1/1 Running 0 38m 192.168.10.8 kb-pr-worker2
kube-system kube-proxy-kdfhc 1/1 Running 0 38m 192.168.10.8 kb-pr-worker2
root@k8-pr-master:~# kubectl uncordon kb-pr-worker2 node/kb-pr-worker2 uncondoned
#Pod is ready root@k8-pr-master:~# kubectl get nodes NAME STATUS ROLES AGE VERSION k8-pr-master Ready master 20h v1.18.1 k8-pr-woker1 Ready 19h v1.18.1 kb-pr-worker2 Ready 38m v1.18.1
root@k8-pr-master:~# kubectl get pods -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES nginx-deployment-d46f5678b-8jw8r 0/1 ContainerCreating 0 5s kb-pr-worker2 nginx-deployment-d46f5678b-jfrps 0/1 ContainerCreating 0 5s kb-pr-worker2 nginx-deployment-d46f5678b-k4xp8 1/1 Running 0 4m31s 10.10.240.198 k8-pr-woker1 nginx-deployment-d46f5678b-kt8qg 1/1 Running 0 4m31s 10.10.240.197 k8-pr-woker1 nginx-deployment-d46f5678b-l5p8n 1/1 Running 1 19h 10.10.240.195 k8-pr-woker1 nginx-deployment-d46f5678b-q65pj 1/1 Running 1 19h 10.10.240.196 k8-pr-woker1