Skip to content

Commit dc69448

Browse files
committed
helm: add cert-manager as dependency
Webhook requires cert-manager and is enabled by default. But users can disable installation if have them already installed. Signed-off-by: Beraldo Leal <[email protected]>
1 parent 768b4d2 commit dc69448

File tree

5 files changed

+48
-5
lines changed

5 files changed

+48
-5
lines changed

src/cloud-api-adaptor/install/charts/peerpods/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ Before installing this chart, ensure you have:
2222
> (`--set webhook.enabled=false`) is only recommended for development or when
2323
> worker nodes have sufficient resources.
2424
25+
> [!WARNING]
26+
> The webhook is enabled by default and requires cert-manager for TLS certificates.
27+
> By default, cert-manager will be installed automatically (`webhook.certManager.install=true`).
28+
> If cert-manager is already installed in your cluster, set `--set webhook.certManager.install=false`.
29+
>
30+
> Disabling the webhook (`--set webhook.enabled=false`) is only recommended for
31+
> development or when worker nodes have sufficient resources.
32+
2533
## Quick Start
2634

2735
### Option A: Development/Testing (secrets.mode: create)

src/webhook/chart/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ sources:
1818
maintainers:
1919
- name: Confidential Containers Community
2020
url: https://github.com/confidential-containers
21+
22+
dependencies:
23+
- name: cert-manager
24+
version: "v1.16.2"
25+
repository: "oci://quay.io/jetstack/charts"
26+
condition: certManager.enabled,certManager.install

src/webhook/chart/README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,34 @@ Before installing this chart, ensure you have:
1010
- **Helm** v3.x or v4.x installed ([installation guide](https://helm.sh/docs/intro/install/))
1111
- **Kubernetes cluster** with appropriate access
1212
- **kubeconfig** configured to access your cluster
13-
- **cert-manager** installed in the cluster ([installation guide](https://cert-manager.io/docs/installation/))
1413

15-
> **Note**: The webhook requires TLS certificates to operate. This chart uses cert-manager
14+
> [!WARNING]
15+
> The webhook requires TLS certificates to operate. This chart uses cert-manager
1616
> to automatically generate and manage these certificates.
17+
>
18+
> By default, cert-manager will be installed automatically (`certManager.install=true`).
19+
> If cert-manager is already installed in your cluster, set `--set certManager.install=false`.
20+
>
21+
> To disable cert-manager integration entirely and provide certificates manually,
22+
> set `--set certManager.enabled=false`.
1723
1824
## Quick Start
1925

2026
### Standalone Installation
2127

28+
**With automatic cert-manager installation (default):**
29+
2230
```bash
23-
# Install cert-manager if not already installed
24-
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.15.3/cert-manager.yaml
31+
helm install peerpods-webhook ./chart \
32+
-n confidential-containers-system \
33+
--create-namespace
34+
```
35+
36+
**If cert-manager is already installed:**
2537

26-
# Install the webhook chart
38+
```bash
2739
helm install peerpods-webhook ./chart \
40+
--set certManager.install=false \
2841
-n confidential-containers-system \
2942
--create-namespace
3043
```

src/webhook/chart/templates/certmanager.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
{{- if .Values.certManager.enabled }}
2+
# Use post-install hooks to ensure cert-manager webhook is ready before creating CRs.
3+
# When cert-manager is installed as a dependency, its CRDs are created but the webhook
4+
# pods may not be running yet. These hooks run after --wait confirms all pods are ready.
25
apiVersion: cert-manager.io/v1
36
kind: Issuer
47
metadata:
58
name: {{ .Values.namePrefix }}selfsigned-issuer
69
namespace: {{ .Values.namespace }}
10+
annotations:
11+
helm.sh/hook: post-install,post-upgrade
12+
helm.sh/hook-weight: "1"
713
spec:
814
selfSigned: {}
915
---
@@ -12,6 +18,9 @@ kind: Certificate
1218
metadata:
1319
name: {{ .Values.namePrefix }}serving-cert
1420
namespace: {{ .Values.namespace }}
21+
annotations:
22+
helm.sh/hook: post-install,post-upgrade
23+
helm.sh/hook-weight: "2"
1524
spec:
1625
dnsNames:
1726
- {{ .Values.namePrefix }}webhook-service.{{ .Values.namespace }}.svc

src/webhook/chart/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,11 @@ authProxy:
5050
# cert-manager automates certificate generation, rotation, and trust configuration
5151
# Without this, you would need to manually create and manage webhook certificates
5252
certManager:
53+
# Use cert-manager to generate webhook TLS certificates
54+
# Creates Certificate and Issuer custom resources
55+
# Set to false only if you are providing certificates through another method
5356
enabled: true
57+
58+
# Install cert-manager as a chart dependency
59+
# Set to false if cert-manager is already installed in your cluster
60+
install: true

0 commit comments

Comments
 (0)