You are creating a Google Kubernetes Engine (GKE) cluster with a cluster autoscaler feature enabled.
You need to make sure that each node of the cluster will run a monitoring pod that sends container metrics to a third-party monitoring solution.
What should you do?
Click on the arrows to vote for the correct answer
A. B. C. D.B.
To ensure that each node in a Google Kubernetes Engine (GKE) cluster runs a monitoring pod that sends container metrics to a third-party monitoring solution, you should deploy the monitoring pod in a DaemonSet object.
A DaemonSet is a Kubernetes controller that ensures that all or some nodes in a cluster run a copy of a specific pod. The DaemonSet creates a replica of the pod on each node in the cluster, ensuring that the pod is running on every node.
Deploying the monitoring pod in a DaemonSet ensures that a copy of the pod runs on each node in the cluster. This is useful for monitoring container metrics, as it ensures that metrics are collected from every node in the cluster.
StatefulSet objects are used to manage stateful applications that require unique, persistent identities and stable network identifiers. Deploying the monitoring pod in a StatefulSet object is not appropriate for this use case.
Deployment objects are used to manage stateless applications that can be scaled up or down. While you could reference the monitoring pod in a Deployment object, it would not ensure that the pod runs on each node in the cluster.
Cluster initializers are used to perform additional configuration of a Kubernetes cluster before the objects are created. While it is possible to reference the monitoring pod in a cluster initializer at the GKE cluster creation time, it is not necessary for this use case.
Therefore, the correct answer is B. Deploy the monitoring pod in a DaemonSet object.