Kubernetes: ConfigMap for leader election should be in the namespace datadog-agent is deployed into
The configmap namespace has been hardcoded to the default namespace.
https://github.com/DataDog/datadog-agent/blob/9374c070b6fb2d5c529614ba36af19b2bc27a49b/pkg/util/kubernetes/apiserver/leaderelection/leaderelection.go#L122-L126
This is a regression compared to Agent 5 which creates the configmap in the namespace datadog-agent is deployed into.
@sylr you're right. Thank you for this observation.
We should fix this soon ! cc @CharlyF
Thanks for opening this ! It's not a regression per se as the CMs are not the same (the A6 is not meant to use the CM from the A5). I do understand the request however and will implement this.
Yeah we need this fixed too :( :( This is, while not a official regression, a step backwards :(
Thank you for letting us know @mshutt. I'm adding a card in our sprint that I will personally tackle - Thank you for your patience.
Thank you! In the meanwhile, I'll see if I can give permissions to the serviceaccount in the datadog-agent namespace to manage configmaps in the default namespace without too many extra rights. It ought to be fairly straight forward.
Hey folks, I have merged a PR to solve this: https://github.com/DataDog/datadog-agent/pull/1619.
It will be in 6.2 that we are planning on releasing in 2 weeks.