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

PWX-30291: Removing sts and deployments from stork webhook #1373

Merged
merged 3 commits into from
Apr 26, 2023

Conversation

pp511
Copy link
Contributor

@pp511 pp511 commented Apr 21, 2023

What type of PR is this?

bug

What this PR does / why we need it:
Remove Stork as the scheduler from Statefulsets and Deployments.

Currently we are not able to set Stork as the scheduler for Statefulsets because we rely on the PVC to be owned by Portworx. STS uses volumeClaimTemplates where PVC is not created when the webhook admission request comes to stork and schedulerName is not updated. Later when webhook admission request arrives for Pods, Stork does update the Schedulername and it works.

I believe there is no reason to update Stork as the scheduler for StatefulSets and Deployments when we have the webhook enabled for Pods. This PR is removing these webhook for Deployments and Statefulsets.

Please note that any annotation set on the Deployment or STS is not passed onto the Pods. To be able to specify stork.libopenstorage.org/disable-admission-controller that disables webhook for the specific STS /Deployment, we need to update it on spec.templace.metadata.annotations.

Does this PR change a user-facing CRD or CLI?:
no

Is a release note needed?:

Issue: Webhook errors observed when trying to mutate statefulsets to update Stork as the scheduler.
User Impact: Customers can not understand this error and gets the impression that Stork webhook is not working
Resolution: Removing wtbhookd for statefulsets and deployments as Stork already has a webhook for Pods that manages setting Stork as the default scheduler.

Does this change need to be cherry-picked to a release branch?:
yes 23.5

Signed-off-by: Priyanshu Pandey <ppandey@purestorage.com>
@cnbu-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

Copy link
Contributor

@adityadani adityadani left a comment

Choose a reason for hiding this comment

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

looks good - make sure to test upgrades

pkg/webhookadmission/webhook.go Outdated Show resolved Hide resolved
Signed-off-by: Priyanshu Pandey <ppandey@purestorage.com>
@pp511
Copy link
Contributor Author

pp511 commented Apr 26, 2023

MutatingWebhookConfiguration does get updated with the new config with this change. Will make sure to ask system test teams to test Stork upgrades as well.

@pp511 pp511 merged commit 5972223 into master Apr 26, 2023
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.

4 participants