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
Add kustomization manifests to CRDs and controller components #606
Conversation
Welcome @itspngu! |
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 Once the patch is verified, the new status will be reflected by the 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. |
/assign @yuxiangqian |
/ok-to-test |
/test pull-kubernetes-csi-external-snapshotter-1-22-on-kubernetes-master |
/test pull-kubernetes-csi-external-snapshotter-alpha-1-21-on-kubernetes-1-21 |
/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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
/lgtm |
[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 |
@itspngu Can you backport this to release-5.0 branch? |
Okay, will do so later today in a separate PR. |
Backport #606 to release-5.0
What type of PR is this?
/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?: