simple-kubernetes-webhook
simple-kubernetes-webhook copied to clipboard
Generate self-sign cert with SHA256
Summary
When apply a pod, I faced this error.
$ kubectl -n $ns apply -f dev/manifests/pods/bad-name.pod.yaml
Error from server (InternalError): error when creating "dev/manifests/pods/bad-name.pod.yaml": Internal error occurred: failed calling webhook "simple-kubernetes-webhook.acme.com": failed to call webhook: Post "https://simple-kubernetes-webhook.default.svc:443/mutate-pods?timeout=2s": x509: certificate signed by unknown authority (possibly because of "x509: cannot verify signature: insecure algorithm SHA1-RSA (temporarily override with GODEBUG=x509sha1=1)" while trying to verify candidate authority certificate "simple-kubernetes-webhook")
The cert used the insecure algorithm SHA1-RSA. That will be blocked by crypto/x509. https://github.com/golang/go/issues/41682
Requirements (place an x in each [ ])
- [ ] I've read and understood the Contributing Guidelines and have done my best effort to follow them.
- [x] I've read and agree to the Code of Conduct.
The following point can be removed after setting up CI (such as Travis) with coverage reports (such as Codecov)
- [ ] I've written tests to cover the new code and functionality included in this PR.
The following point can be removed after setting up a CLA reporting tool such as cla-assistant.io
- [x] I've read, agree to, and signed the Contributor License Agreement (CLA).