-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
The Helm chart currently requires cert-manager to be installed even when webhook.certManager.createSelfSignedIssuer is set to true. This creates confusion for users who expect that enabling createSelfSignedIssuer would allow the chart to work without cert-manager.
Current Behavior
-
Default
values.yamlhas:webhook: certManager: enabled: false createSelfSignedIssuer: true
-
The
templates/certificate.yamltemplate is wrapped with:{{- if .Values.webhook.certManager.enabled }} -
When deployed with defaults, the deployment fails with:
MountVolume.SetUp failed for volume "webhook-certs" : secret "contextforge-webhook-certs" not found
Root Cause
- The entire certificate generation logic (including self-signed issuer creation) is gated behind
certManager.enabled - The
selfSigned.validityDaysvalue in values.yaml is never used in any template - There's no fallback mechanism to create certificates without cert-manager
Expected Behavior
When certManager.enabled: false but self-signed certificates are needed, the chart should:
- Generate self-signed certificates automatically (using a Kubernetes Job)
- Create the
webhook-certssecret without requiring cert-manager - Make the deployment succeed out-of-the-box
Proposed Solution
Add a Kubernetes Job template that:
- Runs when
certManager.enabled: falseandselfSigned.enabled: true - Uses an initContainer approach with OpenSSL to generate certificates
- Creates the
contextforge-webhook-certssecret with proper SANs:{name}-webhook.{namespace}.svc{name}-webhook.{namespace}.svc.cluster.local
- Uses the existing
selfSigned.validityDaysconfiguration - Includes proper RBAC for secret creation
This would allow users to:
- Use cert-manager if they have it (preferred for production)
- Use auto-generated self-signed certs for testing/development
- Manually provide certificates if needed
Testing Requirements
The implementation should include:
-
Helm Chart Tests (new):
- Test certificate secret creation with
certManager.enabled: false - Test certificate secret creation with
certManager.enabled: true - Validate certificate SANs and expiry
- Test RBAC permissions for Job
- Test certificate secret creation with
-
E2E Test Coverage:
- Webhook functionality already tested by
tests/e2e/keepalive_isolation_test.go - Ensure webhook works with both cert-manager and self-signed certificates
- Validate certificate rotation scenario (cert-manager only)
- Webhook functionality already tested by
-
Integration Testing:
- Deploy with default values and verify webhook is functional
- Test webhook certificate expiry handling
- Verify proper cleanup of Job resources
Impact
This affects new users trying to deploy the chart with default values, as the deployment currently fails without cert-manager installed. This is a barrier to adoption for users wanting to quickly test the operator.
Related Files
deploy/helm/contextforge/values.yaml(lines 73-99)deploy/helm/contextforge/templates/certificate.yamldeploy/helm/contextforge/templates/deployment.yaml(lines 74-81)deploy/helm/contextforge/templates/webhook.yamltests/e2e/keepalive_isolation_test.go(webhook functionality tests)