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

Support updating primary labels/annotations after first time rollout #1032

Closed
kh34 opened this issue Oct 12, 2021 · 0 comments · Fixed by #1092
Closed

Support updating primary labels/annotations after first time rollout #1032

kh34 opened this issue Oct 12, 2021 · 0 comments · Fixed by #1092

Comments

@kh34
Copy link
Contributor

kh34 commented Oct 12, 2021

Describe the feature

Hi, I was wondering if the ability to set primary labels/annotations as per this comment was implemented, and if not, would you accept a PR to add it?

I see it’s possible to set labels/annotations on the primary Service kinds but I don’t see a way to do this on a primary Deployment.metatdata.labels/annotations or HorizontalPodAutoscaler.metatdata.labels/annotations

This is a problem because we have governance rules for Kube object metadata, and it doesn't seem possible currently to update labels/annotations on the primary deployment/hpa if they change after the first successful canary rollout. They are correctly copied during first time deployment, but they remain static for any subsequent rollout.

Proposed solution

I want flagger to allow annotations and labels override on the primary deployment and hpa. This would be a change to the Canary Spec in a form similar to how service overrides work today:

  service:
    primary:
      annotations:
        key1: value1
      labels:
        key1: value1

For example:

  deployment:
    primary:
      annotations:
        key1: value1
      labels:
        key1: value1

  autoscaler:
    primary:
      annotations:
        key1: value1
      labels:
        key1: value1

Then it would be the responsibility of the consumer to pass along the updated map of labels/annotations to the Canary.

Any alternatives you've considered?

It would be possible to update the Promote function from e.g.

func (c *DeploymentController) Promote(cd *flaggerv1.Canary) error {
to copy the labels and annotations maps from the canary counterparts. Care might need to be taken to respect the include-label-prefix filter for labels. Currently this function only seems to copy the Pod Spec labels/annotations.

This is probably easiest from a consumer point of view since it doesn't require any changes.

Is there another way to solve this problem that isn't as good a solution?

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 a pull request may close this issue.

1 participant