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 kustomization manifests to CRDs and controller components #606

Merged
merged 2 commits into from Nov 29, 2021
Merged

Add kustomization manifests to CRDs and controller components #606

merged 2 commits into from Nov 29, 2021

Conversation

itspngu
Copy link
Contributor

@itspngu itspngu commented Nov 8, 2021

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

/kind design

What this PR does / why we need it:

The changes introduced with this PR allow for better integration of the controller components and, in particular, the CRDs (which other projects rely on) into a GitOps workflow by providing a means to reference versioned manifests via kustomize.

Which issue(s) this PR fixes:

Fixes #605

Special notes for your reviewer:

none

Does this PR introduce a user-facing change?:

Added kustomization manifests to CRDs and controller components

@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/design Categorizes issue or PR as related to design. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 8, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @itspngu!

It looks like this is your first PR to kubernetes-csi/external-snapshotter 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-csi/external-snapshotter has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @itspngu. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 8, 2021
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 8, 2021
@itspngu
Copy link
Contributor Author

itspngu commented Nov 8, 2021

/assign @yuxiangqian

@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 Nov 11, 2021
@xing-yang xing-yang self-assigned this Nov 11, 2021
@xing-yang
Copy link
Collaborator

/test pull-kubernetes-csi-external-snapshotter-1-22-on-kubernetes-master

@xing-yang
Copy link
Collaborator

/test pull-kubernetes-csi-external-snapshotter-alpha-1-21-on-kubernetes-1-21

@xing-yang
Copy link
Collaborator

/test pull-kubernetes-csi-external-snapshotter-1-21-on-kubernetes-master

resources:
- snapshot.storage.k8s.io_volumesnapshotclasses.yaml
- snapshot.storage.k8s.io_volumesnapshotcontents.yaml
- snapshot.storage.k8s.io_volumesnapshots.yaml
Copy link
Collaborator

@xing-yang xing-yang Nov 17, 2021

Choose a reason for hiding this comment

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

@pohly Do you see any issue with this change? We install snapshot CRDs from client/config/crd folder:
https://github.com/kubernetes-csi/csi-release-tools/blob/master/prow.sh#L742

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding the kustomization.yaml makes sense to me, I can imagine that some users may want to use the directory as their base.

But what does that have to do with prow.sh? Our usage of the files will simply ignore the additional kustomization.yaml.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just want to double check. It should be fine.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@itspngu Can you update the "Install Snapshot CRDs:" section from "kubectl create -f client/config/crd" to install individual CRDs? I want to avoid confusion for folks who are new to this.
https://github.com/kubernetes-csi/external-snapshotter/blob/master/README.md#usage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

install individual CRDs

Good catch! Are you sure you want all the individual files though? That'd be rather verbose. Part of the beauty of kustomize is that you can easily do something like this:

$ kubectl kustomize client/config/crd | kubectl create -f - --dry-run=server
Error from server (AlreadyExists): error when creating "STDIN": customresourcedefinitions.apiextensions.k8s.io "volumesnapshotclasses.snapshot.storage.k8s.io" already exists
Error from server (AlreadyExists): error when creating "STDIN": customresourcedefinitions.apiextensions.k8s.io "volumesnapshotcontents.snapshot.storage.k8s.io" already exists
Error from server (AlreadyExists): error when creating "STDIN": customresourcedefinitions.apiextensions.k8s.io "volumesnapshots.snapshot.storage.k8s.io" already exists

As such, I'd update the readme with something similar to the above where needed, unless you prefer the explicit way using individual files.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That should be fine. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I pushed an update to the readme. Let me know if there's anything else to change.

@@ -118,4 +118,4 @@ spec:
mountPath: /csi
volumes:
- name: socket-dir
emptyDir:
emptyDir: {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

VSCode was complaining about it (Incorrect type. Expected "object".) when I went through the files and I must have impulsively... "fixed" it.

To be on the safe side, I just ran kubeval on it. It doesn't mind either version (with or without empty object). I can remove that bit if you'd prefer to keep it as is to avoid complications in automation, sorry for not noticing myself when opening the PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's keep it. I was just wondering because it seemed unrelated to the stated purpose of the PR.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 22, 2021

CLA Signed

The committers are authorized under a signed CLA.

@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 Nov 29, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: itspngu, 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 Nov 29, 2021
@xing-yang
Copy link
Collaborator

@itspngu Can you backport this to release-5.0 branch?

@k8s-ci-robot k8s-ci-robot merged commit fead845 into kubernetes-csi:master Nov 29, 2021
@itspngu
Copy link
Contributor Author

itspngu commented Nov 30, 2021

@itspngu Can you backport this to release-5.0 branch?

Okay, will do so later today in a separate PR.

k8s-ci-robot added a commit that referenced this pull request Dec 3, 2021
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/design Categorizes issue or PR as related to design. 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kustomize manifests for CRDs and snapshot controller?
5 participants