jitender chand:
2. Second question is, I put two pod directly under controlplane node by creating yaml file with kind: Pod. But when I used kubectl drain controlplane
I have to use --force
and after it, I am not able to see those pod in other nodes.
Matthew Robinson:
If you want Kubernetes to manage the restarting (including migration to other nodes) you will have to create a deployment or daemonset. Creating just a Pod doesn’t give Kubernetes any information about what to do if the Pod disappears.
jitender chand:
Got it thanks, I have a. followup question. can we ask kubelet
to manage static pod that has been created by us?
Let’s assume I don’t to create a deployment n all, I want to keep some pods static
jitender chand:
I want the same behaviour like how kubelet
not draining controlplane pods, I want kubelet
to not to drain my static pod, if it is doing it so it should start them again as well
Matthew Robinson:
kubelet looks for YAML configuration in a specific directory on each node for the static pods. You can create your own static pods but it is unusual to need to do this. If you want a Pod to run on a specific node there are other ways to achieve this using the API server. Have a look at https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/
jitender chand:
It is clear to me now
jitender chand:
@Matthew Robinson :alphabet-yellow-t: :alphabet-yellow-h: :alphabet-yellow-a: :alphabet-yellow-n: :alphabet-yellow-k: :alphabet-yellow-s:
unnivkn:
Hi @jitender chand the purpose of static pod is not to run your application loads. fyr:
https://stackoverflow.com/questions/59612514/whats-the-difference-between-pods-and-static-pods-in-kubernetes-and-when-to