[Question] Should commonLabels be patchable? I ran into kind of a show stopper #4831
Labels
needs-kind
Indicates a PR lacks a `kind/foo` label and requires one.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
Imagine a typical set up by having this in 1 overlay directory with a kustomization.yaml file that inherits from a base:
If you wanted to add a common
app.kubernetes.io/name: "hello-app"
label to all of these this is no problem, you can usecommonLabels
and you're good to go.Then you can patch things as needed to do whatever else you need to do in your overlays.
But now let's say you want to introduce a "Background worker deployment". It would be essentially a duplicate of the web app deployment except with a different name. You'd also likely add a patch to override the image's command and a replace patch for the health checks. It would use the same config map and secrets as the web app deployment.
If you're using something like the AWS load balancer controller, it'll try to attach a load balancer readiness gate to the background worker because one criteria it uses is to attach it to pods whose name label matches a service. That will cause the background worker to fail and never become healthy because it's not a web service.
A solution for this would be to ensure the background worker has a different
name
label but how can we do that ifcommonLabels
can't be removed or patched?The text was updated successfully, but these errors were encountered: