-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[metricbeat] Remove default kube static metrics host to avoid co… #289
Conversation
This default value is never used since the environment variable is always being set for the deployment. See #283 (comment) for more information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I don't understand wher are we retriving the value of $({{ .Release.Name | replace "-" "_" | upper }}_KUBE_STATE_METRICS_SERVICE_HOST):$({{ .Release.Name | replace "-" "_" | upper }}_KUBE_STATE_METRICS_SERVICE_PORT_HTTP)
in metricbeat/templates/deployment.yaml#L95
Kube state metrics is installed as a child chart (https://github.com/elastic/helm-charts/blob/master/metricbeat/requirements.yaml) which is used to scrape the Kubernetes API metrics for metricsbeat. Does that explain why you can't see where the kube state metrics service is defined? Or did you mean something else? |
Thanks I didn't check
Well as I understand the line However, I don't find in this Charts or in kube-state-metric Charts where Did I miss or misunderstood something? |
Ahh I get ya now. Kubernetes automatically creates these environment variables for all pods running in the namespace pointing to the service. So if there is a service called metricbeat-kube-state-metrics there will be an environment variable inside all pods in that namespace called The reason that we use the environment variable instead of the service name in the config is that the service name is hardcoded in the default values. I think we could add go templating logic in values.yaml but this felt like the cleaner option because it means that all users can just refer to |
OK now I understand, I forgot that Kubernetes was automatically setting these environment variables. |
Hi, Is there a way to use metrics-server instead of kube-state-metrics. thanks |
Not that I know of. As far as I can tell Metricbeat only supports collecting the state_* metricsets from kube-state-metrics: https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html https://www.elastic.co/guide/en/beats/metricbeat/current/running-on-kubernetes.html If you would like this to be possible it would need to be a feature requests in https://github.com/elastic/beats. Since this repository is just the Helm chart installing Metricbeat. |
@Crazybus Thanks. I am asking this becuase kubernetes installations are coming with metrics-server by default ( at least the one i installed using RKE ). So it will make sense if they support the one with default instead of adding another one just for metricbeat. |
This default value is never used since the environment variable is
always being set for the deployment. See
#283 (comment)
for more information.
${CHART}/tests/*.py
${CHART}/examples/*/test/goss.yaml