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

add cmdline args to enable group snapshot webhooks #922

Conversation

Rakshith-R
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

VolumeGroupSnapshots are still in alpha.
This commit adds cmdline args to enable group snapshot webhooks while keeping it disbaled by default.

Which issue(s) this PR fixes:

Fixes #921

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

yes,

Webhooks for group snapshot CRs will be disabled by default. Command line argument `enable-volume-group-snapshot-webhook` needs to be added to enable these webhooks.

/cc @xing-yang

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 13, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @Rakshith-R. Thanks for your PR.

I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 13, 2023
@Rakshith-R
Copy link
Contributor Author

I've tested this locally, the error mentioned in #921 is no longer seen in absence of volumegroup snapshot CRDs.

@xing-yang
Copy link
Collaborator

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 13, 2023
@xing-yang
Copy link
Collaborator

xing-yang commented Oct 13, 2023

Can you also test if the CRDs are installed but the new RBAC's are not installed? See this comment: #921 (comment)

@Rakshith-R
Copy link
Contributor Author

Can you also test if the CRDs are installed but the new RBAC's are not installed? See this comment: #921 (comment)

With default configurations, the webhook is disabled and we don't get any errors.

If cmdline arg to enable group snapshot webhook is set: The following error is seen.

^Crakshithr4:external-snapshotter$ k logs snapshot-validation-deployment-84fbf47fbc-tm6vv snapshot-validation 
I1016 11:00:25.948533       1 certwatcher.go:129] Updated current TLS certificate
W1016 11:00:25.955254       1 reflector.go:535] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: failed to list *v1alpha1.VolumeGroupSnapshotClass: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io is forbidden: User "system:serviceaccount:default:snapshot-webhook" cannot list resource "volumegroupsnapshotclasses" in API group "groupsnapshot.storage.k8s.io" at the cluster scope
E1016 11:00:25.955276       1 reflector.go:147] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: Failed to watch *v1alpha1.VolumeGroupSnapshotClass: failed to list *v1alpha1.VolumeGroupSnapshotClass: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io is forbidden: User "system:serviceaccount:default:snapshot-webhook" cannot list resource "volumegroupsnapshotclasses" in API group "groupsnapshot.storage.k8s.io" at the cluster scope
W1016 11:00:27.494232       1 reflector.go:535] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: failed to list *v1alpha1.VolumeGroupSnapshotClass: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io is forbidden: User "system:serviceaccount:default:snapshot-webhook" cannot list resource "volumegroupsnapshotclasses" in API group "groupsnapshot.storage.k8s.io" at the cluster scope
E1016 11:00:27.494410       1 reflector.go:147] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: Failed to watch *v1alpha1.VolumeGroupSnapshotClass: failed to list *v1alpha1.VolumeGroupSnapshotClass: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io is forbidden: User "system:serviceaccount:default:snapshot-webhook" cannot list resource "volumegroupsnapshotclasses" in API group "groupsnapshot.storage.k8s.io" at the cluster scope
W1016 11:00:30.536292       1 reflector.go:535] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: failed to list *v1alpha1.VolumeGroupSnapshotClass: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io is forbidden: User "system:serviceaccount:default:snapshot-webhook" cannot list resource "volumegroupsnapshotclasses" in API group "groupsnapshot.storage.k8s.io" at the cluster scope
E1016 11:00:30.536323       1 reflector.go:147] github.com/kubernetes-csi/external-snapshotter/client/v6/informers/externalversions/factory.go:133: Failed to watch *v1alpha1.VolumeGroupSnapshotClass: failed to list *v1alpha1.VolumeGroupSnapshotClass: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io is forbidden: User "system:serviceaccount:default:snapshot-webhook" cannot list resource "volumegroupsnapshotclasses" in API group "groupsnapshot.storage.k8s.io" at the cluster scope

I don't think the failures seen in the ci is related to this pr

rerunning the tests:

/test pull-kubernetes-csi-external-snapshotter-1-27-on-kubernetes-1-27

/test pull-kubernetes-csi-external-snapshotter-1-28-on-kubernetes-1-28

@xing-yang
Copy link
Collaborator

Were you able to reproduce the problem seeing in #921 (comment) without your changes?

@xing-yang
Copy link
Collaborator

/retest

@xing-yang
Copy link
Collaborator

Please rebase to get around the Trivy error.

VolumeGroupSnapshots are still in alpha.
This commit adds cmdline args to enable group snapshot
webhooks while keeping it disbaled by default.

Signed-off-by: Rakshith R <rakshith.r.0001@gmail.com>
@Rakshith-R Rakshith-R force-pushed the args-to-enable-groupsnapshot-webhook branch from c161b0c to aafc456 Compare October 17, 2023 10:21
@Rakshith-R
Copy link
Contributor Author

Were you able to reproduce the problem seeing in #921 (comment) without your changes?

First, without CRDs it fails to find CRDs, errors is similar to the one reported in #921 description

I think the output from #921 (comment) is after the user installed only vgsclass CRDs. vgs and vgsc is still missing.

After CRDs are installed, it should fail with RBAC issues.

@xing-yang
Copy link
Collaborator

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 19, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Rakshith-R, xing-yang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 19, 2023
@k8s-ci-robot k8s-ci-robot merged commit 1d06149 into kubernetes-csi:master Oct 19, 2023
8 checks passed
@sunnylovestiramisu
Copy link
Contributor

/cherry-pick release-6.3

@k8s-infra-cherrypick-robot

@sunnylovestiramisu: new pull request created: #940

In response to this:

/cherry-pick release-6.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6.3.0 seems to break support for clusters < 1.28
5 participants