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

Be able to configure multiple annotations to add to a pod depending on pod labels #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

santinoncs
Copy link
Member

@santinoncs santinoncs commented Apr 17, 2023

Old config:

  config: |
    metadata:
      annotations:
        cluster-autoscaler.kubernetes.io/safe-to-evict: "true"

new config:

config:
  default:
    metadata:
      annotations:
        cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
  some-label-value:
    metadata:
      annotations:
        example.com/some-annotation: "true"

It will apply the example.com/some-annotation: "true" annotation to pods with the annotation-type label set to some-label-value.

@santinoncs santinoncs changed the title convert podTemplate in an map Be able to configure multiple annotations to add to a pod depending on pod labels Apr 17, 2023
@santinoncs santinoncs requested a review from joskfg April 17, 2023 13:30
@bvis
Copy link
Member

bvis commented Apr 17, 2023

Could you explain why do we need this?

@santinoncs santinoncs requested a review from bvis April 18, 2023 10:57
@santinoncs
Copy link
Member Author

Could you explain why do we need this?

Maybe in some cases we want to include another annotation depending on the labels.
For instance redis cluster leader-0 needs this annotation

cluster-autoscaler.kubernetes.io/safe-to-evict: "false"

as we don't want the cluster autoscaler to evict it.

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

Successfully merging this pull request may close these issues.

2 participants