How can you run a pod on each node of Kubernetes and make sure that it is running only once on on each node?
Experience Level: Medior
Tags: Kubernetes
Answer
Option 1:
Create a deamonset.
Option 2:
Create a deployment that has pods with antiaffinity that allows only one pod to run on a node. Make sure the count of replicas is the same or higher than the number of nodes.
Related Kubernetes job interview questions
How do you create pod pod1 of image nginx in namespace ns1 that will have the container name c1?
Kubernetes MediorHow do you get a list of endpoints that are available for service service1?
Kubernetes MediorHow do you find all pods that run on a master node?
Kubernetes MediorUsing kubectl, how do you convert yaml manifest of a specific pod pod1 to JSON format?
Kubernetes MediorYou are looking for IP address details of your Kubernetes nodes, but you are not sure what is a structure of node manifests. How can you find this details and learn more about the structure?
Kubernetes Medior