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

[rollout-operator] Add support for webhooks #2785

Closed
wants to merge 17 commits into from

Conversation

m1rp
Copy link

@m1rp m1rp commented Nov 14, 2023

  • updated deployment and service to expose correct ports
  • added role, clusterroles and associated bindings (needed for CA creation)
  • added webhooks needed for downscale/no-downscale
  • updated readme

@CLAassistant
Copy link

CLAassistant commented Nov 14, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@56quarters 56quarters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me but I'd like some input from @andyasp who has done a lot of work with the rollout operator and @colega who implemented the no-downscale hook.

- apiGroups: [apps]
apiVersions: [v1]
operations: [UPDATE]
resources:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should only need statefulsets and statefulsets/scale (that's how we have it configured internally).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 this part was mostly a copy/paste job from the docs
if this PR needs updating then the docs are potentially slightly off.

namespace: {{.Release.Namespace}}
path: /admission/prepare-downscale
port: 443
failurePolicy: Fail
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may create a deadlock when applying it. If this webhook is created but rollout-operator isn't updated yet, then the rollout operator won't have the https endpoint and will always fail, rejecting any operation like trying to update the rollout operator.

It should be deployed with Ignore strategy first, and then with Fail. Note that Ignore only ignores failed calls, it doesn't ignore explicit rejections.

Copy link
Author

@m1rp m1rp Jan 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this only true for the mutatingwebhookconfiguration.yaml or does this also apply to the validatingwebhookconfiguration.yaml?

is something like this:

 {{- if eq((lookup "v1" "MutatingWebhookConfiguration" "{{.Release.Namespace}}" ) "" ) }}
  failurePolicy: Ignore
  {{- else }}
  failurePolicy: Fail
  {{- end }}

what you had in mind?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applies to both webhooks.

I don't understand the condition of your diff (not saying it's wrong, I'm just not familiar with Helm), but I could imagine this as an extra setting, something to be disabled by default, and to be enabled after rolling out for more robustness (so it wouldn't allow everything if rollout-operator is just crashing).

Also, your diff says Ignore in both branches :D

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the update/clarification, i think i get what you're saying.

m1rp added 13 commits January 10, 2024 11:45
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
m1rp added 2 commits January 10, 2024 12:31
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
Comment on lines +19 to +20
{{- $failpol := (lookup "v1" "ValidatingWebhookConfiguration" "{{.Release.Namespace}}" "no-downscale-{{.Release.Namespace}}") -}}
{{- if empty $failpol }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be nice to have an explicit switch that would disable the failurePolicy, just in case something goes wrong here (like: the webhook is created, but the rollout-operator isn't updated so it's not updating its TLS certs)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by disable, do you mean set failurePolicy: Ignore?
sorry i'm a bit out of the loop honestly this PR has been going on for a while 😄

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also should the same switch apply to validatingwebhookconfiguration.yaml and mutatingwebhookconfiguration.yaml ?

Co-authored-by: Cem Deniz Kabakci <cem.kabakci@springer.com>
Signed-off-by: sam clulow <sam.clulow@springernature.com>
@m1rp
Copy link
Author

m1rp commented May 29, 2024

could i get an update on this?
unfortunately i don't have as much time as is used to to spend on this so updates on my end are really slow

Signed-off-by: sam clulow <m1rp@users.noreply.github.com>
@zanhsieh zanhsieh closed this Dec 19, 2024
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.

5 participants