-
Notifications
You must be signed in to change notification settings - Fork 26
Manage external cert #233
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
base: main
Are you sure you want to change the base?
Manage external cert #233
Conversation
| // If set to false, you must provide your own certificates via Secret. | ||
| // Default: true | ||
| // +optional | ||
| AutoProvision *bool `json:"autoProvision,omitempty"` |
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.
Hmm... maybe just default to auto provision in the code if SecretName isn't set, then the user doesn't have to remember to disable and we don't need to track this variable.
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.
You're right. It seems that we can detect secretName or certFilesPath user want to mount to decide whether to auto provision
gflarity
left a comment
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.
As discussed, let's simplify the logic by enabling automatic certs when the secretName isn't provided.
faba093 to
fc4f28a
Compare
|
a0bb706 to
53ca78c
Compare
gflarity
left a comment
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.
Thanks, left an example that I implemented a while ago (running in production for some time now). The only difference is we need to enable auto provision. Otherwise you can just follow this.
Signed-off-by: kangclzjc <[email protected]>
Signed-off-by: kangclzjc <[email protected]>
0cc29d4 to
4c83e1b
Compare
Signed-off-by: kangclzjc <[email protected]>
Signed-off-by: kangclzjc <[email protected]>
|
Sorry for the delay, planning to review this today. |
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.
Thanks @kangclzjc, gave it a quick review today. Looks good, I'll do a slower review tomorrow morning first thing. In the mean time:
One thing we'll need is a simple E2E test to verifying everything works using cert manager. Please take a look at the current E2E tests, all it really needs to do is install cert manager, then update the helm values to use it. If you start a simple grove deployment successfully, it means the webhooks are still working with this change.
There is code in the cluster setup utilities for installing a helm chart (cert manager). You should be able to reuse some of that logic to install cert manager for this specific test. Please let me know if you have any questions.
Thanks @gflarity , let me check the E2E test first. And then do a simple E2E test to verifying everything works using cert manager. |
gflarity
left a comment
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 a couple small things, otherwise looks good. Just need the E2E test(s).
| | `secretName` _string_ | SecretName is the name of the Kubernetes Secret containing webhook certificates.<br />The Secret must contain tls.crt, tls.key, and ca.crt. | | | | ||
| | `autoProvision` _boolean_ | AutoProvision enables automatic certificate generation and management via cert-controller.<br />When true: cert-controller automatically generates self-signed certificates and stores them in the Secret.<br />When false: certificates are expected to be provided externally (e.g., by cert-manager, cluster admin).<br />Default: true (auto-generate certificates for easy setup) | | | |
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.
There's a default column, let's fill it in.
| | `secretName` _string_ | SecretName is the name of the Kubernetes Secret containing webhook certificates.<br />The Secret must contain tls.crt, tls.key, and ca.crt. | | | | |
| | `autoProvision` _boolean_ | AutoProvision enables automatic certificate generation and management via cert-controller.<br />When true: cert-controller automatically generates self-signed certificates and stores them in the Secret.<br />When false: certificates are expected to be provided externally (e.g., by cert-manager, cluster admin).<br />Default: true (auto-generate certificates for easy setup) | | | | |
| | `secretName` _string_ | SecretName is the name of the Kubernetes Secret containing webhook certificates.<br />The Secret must contain tls.crt, tls.key, and ca.crt. | grove-webhook-server-cert | | | |
| | `autoProvision` _boolean_ | AutoProvision enables automatic certificate generation and management via cert-controller.<br />When true: cert-controller automatically generates self-signed certificates and stores them in the Secret.<br />When false: certificates are expected to be provided externally (e.g., by cert-manager, cluster admin).| true | | |
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.
OK~
| serverCertDir: /etc/grove-operator/webhook-certs | ||
| # secretName is the name of the Kubernetes Secret containing webhook certificates. | ||
| # The Secret must contain tls.crt, tls.key, and ca.crt. | ||
| # Default: "" |
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.
Set this to "grove-webhook-server-cert" to match the default in the code? That way anyone reading the values knows where to look in Kubernetes.
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.
Yes, no problem
What type of PR is this?
Currently we do the certificate generation ourselves. If they already have certificate in their system, we should manage external existing certificate by mounting them
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a API change?
Additional documentation e.g., enhancement proposals, usage docs, etc.: