Problem
Not all Kubernetes metrics are present in StackState.
Cause
The StackState Agent uses two different sources to retrieve metrics from a Kubernetes cluster:
- The Kubelet API
- A kube-state-metrics pod
If an existing kube-state-metrics deployment is used, it is possible that this will not be auto-discovered by the StackState Agent. The auto-discovery mechanism used by the Agent relies on the image name used by the Pod. If this is not named kube-state-metrics
, the Pod will not be auto-discovered and a number of metrics will be missing in StackState.
Solution
The image name used by the kube-state-metrics Pod should be manually added to the values.yaml
file used for your Helm deployment. This will override the default identifier used by the StackState Agent to auto-discover the kube-state-metrics Pod.
Add the following custom values to the values.yaml
file used for your Helm deployment:
agent: config: override: - name: auto_conf.yaml path: /etc/stackstate-agent/conf.d/kubernetes_state.d data: | ad_identifiers: - my-custom-kubestatemetrics-image init_config: instances: - kube_state_url: http://%%host%%:8080/metrics
In this case, the Pod is using an image called my-custom-kubestatemetrics-image
and will be auto-discovered correctly after deployment of the StackState Agent Helm chart.
Comments
0 comments
Article is closed for comments.