Skip to content

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

Open
santinoncs wants to merge 1 commit intomasterfrom
feat/multiple-annotations-depending-on-labels
Open

Be able to configure multiple annotations to add to a pod depending on pod labels#3
santinoncs wants to merge 1 commit intomasterfrom
feat/multiple-annotations-depending-on-labels

Conversation

@santinoncs
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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