diff --git a/clusters/homek8s/cert-manager.yaml b/clusters/homek8s/cert-manager.yaml new file mode 100644 index 0000000..e32ba2a --- /dev/null +++ b/clusters/homek8s/cert-manager.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: cert-manager + namespace: flux-system +spec: + interval: 10m0s + retryInterval: 1m + timeout: 5m + sourceRef: + kind: GitRepository + name: flux-system + path: ./infrastructure/controllers/cert-manager + # The HelmRelease owns the chart; pruning the Kustomization deletes the + # release object, and the chart's CRDs carry `helm.sh/resource-policy: keep` + # so they survive. Nothing here is a bare CRD in git, hence prune: true. + prune: true + wait: true diff --git a/infrastructure/controllers/cert-manager/kustomization.yaml b/infrastructure/controllers/cert-manager/kustomization.yaml new file mode 100644 index 0000000..77c66d9 --- /dev/null +++ b/infrastructure/controllers/cert-manager/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: cert-manager +resources: + - namespace.yaml + - repository.yaml + - release.yaml diff --git a/infrastructure/controllers/cert-manager/namespace.yaml b/infrastructure/controllers/cert-manager/namespace.yaml new file mode 100644 index 0000000..c90416f --- /dev/null +++ b/infrastructure/controllers/cert-manager/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: cert-manager diff --git a/infrastructure/controllers/cert-manager/release.yaml b/infrastructure/controllers/cert-manager/release.yaml new file mode 100644 index 0000000..a58ae37 --- /dev/null +++ b/infrastructure/controllers/cert-manager/release.yaml @@ -0,0 +1,64 @@ +# cert-manager — installed for one reason: the Barman Cloud CNPG-I plugin +# expects its operator/plugin mTLS pair as cert-manager `Certificate` objects +# (the upstream v0.16.0 manifest ships an Issuer + two Certificates and assumes +# cert-manager is present). CNPG-I *can* run on hand-made cert bundles, but that +# would put a CA private key in a hand-maintained Secret with no renewal; the +# chart is the supported path and is ~3 small pods. +# +# CRDs: `crds.enabled: true` is required — `Certificate`/`Issuer` do not exist +# otherwise. The chart annotates its CRDs with `helm.sh/resource-policy: keep`, +# so uninstalling the release does not delete issued certs' CRDs out from under +# the running plugin. Do not add `crds.keep: false`. +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: cert-manager + namespace: cert-manager +spec: + releaseName: cert-manager + interval: 15m + chart: + spec: + chart: cert-manager + version: "v1.21.3" + sourceRef: + kind: HelmRepository + name: jetstack + namespace: cert-manager + install: + crds: CreateReplace + remediation: + retries: 3 + upgrade: + crds: CreateReplace + remediation: + retries: 3 + values: + crds: + enabled: true + # Homelab sizing: upstream requests are already small, but the webhook and + # cainjector each get a memory ceiling so a runaway cannot evict the CNPG + # primary that shares this node. + resources: + requests: + cpu: 10m + memory: 64Mi + limits: + memory: 192Mi + webhook: + resources: + requests: + cpu: 10m + memory: 32Mi + limits: + memory: 128Mi + cainjector: + resources: + requests: + cpu: 10m + memory: 64Mi + limits: + memory: 192Mi + # No Prometheus Operator CRs here (ServiceMonitor is not installed). + prometheus: + enabled: false diff --git a/infrastructure/controllers/cert-manager/repository.yaml b/infrastructure/controllers/cert-manager/repository.yaml new file mode 100644 index 0000000..2fad310 --- /dev/null +++ b/infrastructure/controllers/cert-manager/repository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: jetstack + namespace: cert-manager +spec: + interval: 24h + url: https://charts.jetstack.io/