Pods are run by the kubelet service that runs inside each node. There are three ways to instruct kubelet to run a Pod:
- By directly passing it the Pod configuration file (or a directory container configuration files) using kubelet --config <path-to-pod-config>. kubelet will poll this directory every 20 seconds for changes, and will start new containers or terminate containers based on any changes to the configuration file(s).
- By specifying an HTTP endpoint which returns with the Pod configuration files. Like the file option, kubelet polls the endpoint every 20 seconds.
- By using the Kubernetes API server to send any new pod manifests to kubelet.
The first two options are not ideal because:
- It relies on polling, which means that the nodes cannot react quickly to changes
- The Kubernetes API server is not aware of these pods, and thus cannot manage them
Instead, we should use kubelet to communicate our intentions to the Kubernetes API server, and let it coordinate how to deploy our Pod.