Is this a BUG REPORT or FEATURE REQUEST? (choose one):
Bugreport
Version of Helm and Kubernetes:
v2.11.0
Which chart:
[stable/prometheus/operator] v0.1.16
What happened:
I followed the docs that allow to override service selectors, because the helm chart is STILL pointing to a very old k8s version (I suggest to use component instead of k8s-app asap):
# values.yaml:
kubeControllerManager:
service:
selector:
component: kube-controller-manager
coreDns:
service:
selector:
component: kube-dns
kubeEtcd:
service:
selector:
component: etcd-server
kubeScheduler:
service:
selector:
component: kube-scheduler
but they get merged in the services:
kubectl -n kube-system get svc prometheus-operator-kube-etcd -o yaml
you see:
selector:
component: etcd-server
k8s-app: etcd-server
What you expected to happen:
the old version was:
selector:
k8s-app: etcd-server
which should be looking like:
selector:
component: etcd-server
How to reproduce it (as minimally and precisely as possible):
Use the values as specified.
This is not a chart issue but a helm issue, which merges maps and overrides lists. This chart specifically provides an escape hatch around a helm bug (https://github.com/helm/helm/issues/3117) by allowing you to remove the defaults:
selector:
k8s-app: null
component: kube-controller-manager
Changing the defaults would be a breaking change but if they are definitely better than what is specified here then it's a good one. Could you point at the documentation for what these labels are?
I've spent a couple of hours trying to overwrite default k8s-app: kube-controller-manager to component: kube-controller-manager but always got both of them. Setting k8s-app: null is not obvious at all. I believe that this should be mentioned somewhere either in values.yaml or inside the particular template.
@vsliouniaev thanks for workaround :)
just to chime in with my experience related to this (also experiencing this issue)...
I'm overriding some defaults as follows:
coreDns:
service:
selector:
k8s-app: kube-dns
kubeEtcd:
service:
selector:
component: etcd
I'm curious to hear that this is an issue with helm itself and not the chart @vsliouniaev. I can confirm, with the above values.yaml, that my prometheus-operator-coredns service selector gets properly set to k8s-app=kube-dns while my prometheus-operator-kube-etcd service selector ends up component=etcd,k8s-app=etcd-server. If this is a Helm issue, wouldn't it fail to work consistently for both cordDns and kubeEtcd overrides?
Updated:
aaahhhh sorry - I need to read closer. For anyone else who comes after me, this is documented behavior in helm.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.
This issue is being automatically closed due to inactivity.
Most helpful comment
This is not a chart issue but a helm issue, which merges maps and overrides lists. This chart specifically provides an escape hatch around a helm bug (https://github.com/helm/helm/issues/3117) by allowing you to remove the defaults:
Changing the defaults would be a breaking change but if they are definitely better than what is specified here then it's a good one. Could you point at the documentation for what these labels are?