olxbr / metrics-server-exporter

Metrics Server Exporter
MIT License
67 stars 24 forks source link

Fix helm namespace reference in templates and add annotations #35

Closed brodul closed 4 years ago

brodul commented 4 years ago

This is some work on #34 . With this changes I can use the project in our/mine platform.

I changed how metadata namespace is handled. HELM saves some data in the cluster in the namespace provided by -n flag or --namespace. Before this PR if you run helm install ms-exporter-testing helm the helm state will be install into default namespace and the objects into kube-system. If you run helm install --namespace prometheus ms-exporter-testing helm the objects will be installed in kube-system and the state into prometheus. You have to read the implementation to deploy to a namespace you want to. With the change the state and the objects are deployed in the same namespace you provide with the -n flag.

I have added annotations that can be used with the official prometheus helm chart. https://github.com/helm/charts/blob/master/stable/prometheus/values.yaml#L1470 With the annotations the Prometheus will pick up a pod/service without defining an explicit job.