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

Feature: Inherit annotation from label (or the other way around) #2627

Open
ePaul opened this issue May 7, 2024 · 0 comments
Open

Feature: Inherit annotation from label (or the other way around) #2627

ePaul opened this issue May 7, 2024 · 0 comments

Comments

@ePaul
Copy link
Member

ePaul commented May 7, 2024

Please, answer some short questions which should help us to understand your problem / question better?

  • Which image of the operator are you using? no idea
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? AWS K8s
  • Are you running Postgres Operator in production? yes
  • Type of issue? feature request

Status quo

The Postgres Operator configuration already has options inherited_annotations and inherited_labels, which both work in a similar way: An annotation or label on the Postgresql resource gets copied to a same-named annotation/label on the child resources which it creates (e.g. statefulsets and pods).

At Zalando, we are using inherited labels component,environment,team-id, and inherited annotation zalando.org/owning-application (instead of inheriting the application label, that instead is set to a fixed value).
So users are currently asked to set both the application label and the zalando.org/owning-application annotation on their Postgresql resource to the same value, where one of them should be enough.

Feature request

There should be a way of defining an inheritance of an annotation from a label (and the other way around, for completeness).

Potential configuration syntax:

   kubernetes:
      inherited_annotations:
        - "zalando.org/owning-application"
      inherited_labels:
        - component
        - environment
      inherited_annotations_from_labels:
        - annotation: "zalando.org/owning-application"
          from_label: "application"
          conflict_priority: -1
      inherited_labels_from_annotations:
        - label: "example"
          from_annotation: "example.org/example-label"
          conflict_priority: 3

The conflict priority would be used in case there are multiple sources for one label/annotation (with the ones coming from inherited_annotations/labels having priority 0).
Of course we could also just say that it's an error if there are conflicting sources for the same annotation/label, might be simpler.

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

1 participant