Skip to content

Make webhook example compatible with TLS secrets#793

Merged
k8s-ci-robot merged 1 commit intokubernetes-csi:masterfrom
haslersn:patch-1
Dec 5, 2022
Merged

Make webhook example compatible with TLS secrets#793
k8s-ci-robot merged 1 commit intokubernetes-csi:masterfrom
haslersn:patch-1

Conversation

@haslersn
Copy link
Contributor

@haslersn haslersn commented Nov 27, 2022

Kubernetes has a builtin Secret type kubernetes.io/tls which uses the keys tls.crt and tls.key.

With this change, when you download the example webhook.yaml, it's immediately compatible with secrets created e.g. by cert-manager. The downloaded file can be integrated into kustomize projects without further modification or patches.

/kind documentation

Change webhook example to be compatible with TLS-type secrets.

Kubernetes has a builtin Secret type `kubernetes.io/tls` which uses the keys `tls.crt` and `tls.key`.
@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 27, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @haslersn!

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 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 27, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @haslersn. 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.

Details

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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 27, 2022
@xing-yang
Copy link
Collaborator

/assign @deepakkinni

@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 27, 2022
@deepakkinni
Copy link
Member

/approve

@Kartik494
Copy link

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 30, 2022
@xing-yang
Copy link
Collaborator

@haslersn Please add a release note.

@xing-yang
Copy link
Collaborator

/assign

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Dec 3, 2022
@haslersn
Copy link
Contributor Author

haslersn commented Dec 3, 2022

Please add a release note.

Should be done now.

@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 Dec 5, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deepakkinni, haslersn, xing-yang

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

The pull request process is described here

Details 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 Dec 5, 2022
@k8s-ci-robot k8s-ci-robot merged commit d2a15ce into kubernetes-csi:master Dec 5, 2022
@deepakkinni
Copy link
Member

I was trying out deploying the webhook as per the docs and i see a CLBO

root@localhost [ ~/csi-snapshot-guest-installation ]# kubectl logs snapshot-validation-deployment-58b598bcc7-m62fk -n kube-system
F1206 07:49:47.336713       1 webhook.go:230] failed to initialize new cert watcher: open /etc/snapshot-validation-webhook/certs/tls.crt: no such file or directory
goroutine 1 [running]:
k8s.io/klog/v2.stacks(0x1)
	/workspace/vendor/k8s.io/klog/v2/klog.go:860 +0x8a
k8s.io/klog/v2.(*loggingT).output(0x1fec080, 0x3, 0x0, 0xc000424850, 0x1, {0x1910556?, 0x1?}, 0x1feca40?, 0x0)
	/workspace/vendor/k8s.io/klog/v2/klog.go:825 +0x686
k8s.io/klog/v2.(*loggingT).printfDepth(0x1fec080, 0x0?, 0x0, {0x0, 0x0}, 0xc0000b1d98?, {0x1492f28, 0x29}, {0xc000418db0, 0x1, ...})
	/workspace/vendor/k8s.io/klog/v2/klog.go:630 +0x1f2
k8s.io/klog/v2.(*loggingT).printf(...)
	/workspace/vendor/k8s.io/klog/v2/klog.go:612
k8s.io/klog/v2.Fatalf(...)
	/workspace/vendor/k8s.io/klog/v2/klog.go:1516
github.com/kubernetes-csi/external-snapshotter/v6/pkg/validation-webhook.main(0x1fd8d80?, {0xc000421120?, 0x2?, 0x2?})
	/workspace/pkg/validation-webhook/webhook.go:230 +0x154
github.com/spf13/cobra.(*Command).execute(0x1fd8d80, {0xc00003a190, 0x2, 0x2})
	/workspace/vendor/github.com/spf13/cobra/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x1fd8d80)
	/workspace/vendor/github.com/spf13/cobra/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
	/workspace/vendor/github.com/spf13/cobra/command.go:902
main.main()
	/workspace/cmd/snapshot-validation-webhook/main.go:32 +0x5a

I suppose there are changes needed in https://github.com/kubernetes-csi/external-snapshotter/blob/master/deploy/kubernetes/webhook-example/create-cert.sh as well

@haslersn
Copy link
Contributor Author

haslersn commented Dec 6, 2022

That sounds right, the script should also follow the format of TLS-type secrets.

@haslersn haslersn deleted the patch-1 branch December 6, 2022 17:16
@haslersn
Copy link
Contributor Author

haslersn commented Dec 6, 2022

@deepakkinni does #796 fix your problem?

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. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants