Operator now generates validatingwebhookconfiguration for Helm deployment#656
Conversation
cb2bb64 to
7b9b3b6
Compare
…ment. Signed-off-by: Aryan <gorwadearyan@gmail.com>
abf9c6e to
14cdda5
Compare
|
In deployment.yaml, this is how TLS_CA is expected to be provided in values with an indent so it looks neat. Should that be removed or kept for aesthetic reasons: |
|
Thanks for the change @aryangorwade! |
|
@varunrsekar It will most likely not used in production or enterprise customers, but would help with individual customers to avoid having to generate certs and create an additional secret with them. @shivamerla is looking into its use case |
Thanks. To add to the usecase to have an init-container, we can also use it to validate the input cert when using a SECRET |
Helm
The operator now generates validatingwebhookconfiguration in the operator code itself (in cmd/main.go). Also detects orchestrator type in main.go. validatingwebhookconfiguration removed from Helm charts.
internal/webhook/apps/v1alpha1/configuration.gocontains this generation.New environment variables introduced: TLS_MODE, TLS_CA, TLS_SECRET, OPERATOR_NAMESPACE, OPERATOR_NAME_PREFIX.
Additionally implemented webhook signing configuration in a similar manner to DRA driver:
This change introduces a new Helm chart value to supply a CA bundle (e.g., from ca.crt) directly into the ValidatingWebhookConfiguration when cert-manager is not used. Secret must be created with tls.key and tls.crt.
This allows clusters without automated CA injection to configure the webhook manually and ensure proper TLS verification.
Note: in deployment.yaml, this is how TLS_CA is expected to be provided in values with an indent. Should that be removed or kept for aesthetic reasons:
OLM
Validatingwebhookconfiguration (called webhookdefinitions in OLM) removed from CSV and moved to the operator code (same as above). The non-Helm specific changes (changes not in
deploymentsare common to OLM as well (including new ENV variables).To work around this:
service.beta.openshift.io/inject-cabundle": "true"bundle/manifests/k8s-nim-operator.webhookservice.yamlwith an OpenShift Service annotation:service.beta.openshift.io/serving-cert-secret-name: k8s-nim-operator-webhook-server-cert