Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding labels to spec.service #1821

Open
ln-ro opened this issue Feb 17, 2025 · 2 comments
Open

Adding labels to spec.service #1821

ln-ro opened this issue Feb 17, 2025 · 2 comments

Comments

@ln-ro
Copy link

ln-ro commented Feb 17, 2025

Is your feature request related to a problem? Please describe.
I need to attach labels to my service for cilium to do it's job. Because there is only a spec.service.annotations i have to set this via spec.override.service.metadata.labels

Describe the solution you'd like
I'd like to be able to set labels the same way we do it for annotations via spec.service.labels

Describe alternatives you've considered
There's the workaround with the override function, but this isn't the most beautiful solution, if annotations and labels cannot be defined in the same place

Additional context
I know that there was an issue with pods and labels: #442
Please correct me, but this shouldn't be an issue here, right?

@mkuratczyk
Copy link
Collaborator

There's one more way to set the service labels, which technically allows you to keep labels and annotations together:

apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
  annotations:
    foo: bar
  labels:
    bar: baz
  name: rmq

A cluster deployed like that will set the foo: bar annotation and bar: baz label on the service. However, it'll also set these annotations/labels on the StatefulSet. Most likely it won't be a problem - I guess no tool will look for your Cilium label on the StatefulSet, so it'll be redundant, but harmless.

I'm not against adding .spec.service.labels though. I think it should be a pretty simple change and I don't expect any issues with it. Is this something you could contribute?

@ln-ro
Copy link
Author

ln-ro commented Feb 20, 2025

Oh yeah. As you said - redundant, but harmless.

I think I could contribute this feature. I'll have a look at this in the next few weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants