## Why The re-keyed internal `unkin.net` intermediate broke CA consumers (CNPG->RGW backups, subPath/startup-cached CA mounts) and needed manual pod restarts, because Reloader was deployed with `ignoreSecrets: true` and could not restart on the `vault-ca-cert` Secret. Enabling secret watching naively is unsafe: many workloads carry the generic `reloader.stakater.com/auto`, and the estate rotates numerous Secrets via Vault/VSO — those would restart on every rotation. This enables secret watching but scopes existing `auto` to ConfigMaps, making secret-reload opt-in per Secret. ## Changes - Set `reloader.ignoreSecrets: false` (au-syd1 reloader-system values) so Secrets are watched. - Convert every generic `reloader.stakater.com/auto: "true"` to the ConfigMap-only `configmap.reloader.stakater.com/auto: "true"` — 22 annotations across 19 files. Existing ConfigMap-reload behaviour is preserved; Vault/VSO Secret rotations no longer restart these workloads. - Add explicit `secret.reloader.stakater.com/reload: "vault-ca-cert"` to the CA consumers that mount the CA and carry a Reloader annotation: `artifactapi/api`, `cephrgw-operator`, `puppetserver-master`, `puppetserver-compiler`, `litellm`, `logarchiver`. - Add `secret.reloader.stakater.com/reload: "kanidm-tls"` so kanidm rolls when cert-manager renews its leaf. - Add `docs/ca-rotation.md` runbook (indexed in `docs/README.md`). ## Safety review (secret-only / CA workloads) `vault-ca-cert` is a plain reflected Secret that bootstraps Vault trust (not VSO-rotated; changes only on intermediate re-key). `kanidm-tls` is a cert-manager leaf. Everything else mounted (`environment`, `*-credentials`, `eyaml-keys`, `puppetboard-secrets`, `s3-credentials`, `nats-auth`, `clickhouse-credentials`, `woodpecker-*`) is VSO/CNPG Vault-rotated and deliberately excluded. - `cephrgw-operator` — mounts only Secrets (`cephrgw-credentials` VSO + `vault-ca-cert`), no ConfigMap. Its old comment said "restart when the credentials Secret rotates"; `cephrgw-credentials` is VSO so that is now excluded, and reload is scoped to `vault-ca-cert` only. Comment updated. - `nats` (logging) — old comment "Roll the StatefulSet when nats-auth changes"; `nats-auth` is VSO, so this is now ConfigMap-only (deliberately no roll on rotation). Comment updated. Same for the vector agent/aggregator/vm-ingest (VSO `nats-auth`/`clickhouse-credentials`). - `artifactapi/ui` — mounts neither a ConfigMap nor a Secret; its `auto` was already a no-op. Left as ConfigMap-only. - `puppetdb` / `puppetboard` — mount a ConfigMap plus VSO Secrets (postgres creds / puppetboard-secrets); ConfigMap-only is correct, no secret reload added. CA consumers that mount `vault-ca-cert` but have **no** Reloader annotation (CRD-managed or startup-cached) are documented in `docs/ca-rotation.md` for manual restart rather than annotated here: `grafana`, `observability/vmagent`, `paperclip`, `argocd-repo-server`, plus CNPG clusters (`kubectl cnpg restart`). ## Notes / coordination - Annotations left in their existing location (some sit on the pod template, e.g. `litellm`, `puppetdb`; Reloader reads controller-level metadata — placement unchanged from before, no regression). - Touches `apps/overlays/au-syd1/logging/values-vector-*.yaml`, which overlap open PR #320 (Tier-2 Vector pipelines) — only the one-line reloader annotation is changed here. ## Validation - `make kubeconform` — touched overlays (reloader-system, logging, woodpecker, authentik) valid; only the known-unrelated cattle-system rancher chart kubeVersion failure remains. - `uvx pre-commit run --all-files` — all hooks pass. Closes #326 --------- Co-authored-by: Ben Vincent <neotheo@gmail.com> Reviewed-on: #339 Co-authored-by: Ben Vincent <ben@unkin.net> Co-committed-by: Ben Vincent <ben@unkin.net>
This commit was merged in pull request #339.
This commit is contained in:
@@ -12,7 +12,7 @@ spec:
|
|||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
labels:
|
labels:
|
||||||
app: age-api
|
app: age-api
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ metadata:
|
|||||||
name: api
|
name: api
|
||||||
namespace: artifactapi
|
namespace: artifactapi
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
|
secret.reloader.stakater.com/reload: "vault-ca-cert"
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
name: ui
|
name: ui
|
||||||
namespace: artifactapi
|
namespace: artifactapi
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: cephrgw-operator
|
app.kubernetes.io/name: cephrgw-operator
|
||||||
annotations:
|
annotations:
|
||||||
# Restart the operator when the credentials Secret rotates.
|
# Restart on internal CA rotation only; cephrgw-credentials is Vault-rotated
|
||||||
reloader.stakater.com/auto: "true"
|
# (VSO) and deliberately excluded so routine key rotation causes no restart.
|
||||||
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
|
secret.reloader.stakater.com/reload: "vault-ca-cert"
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
name: encapi
|
name: encapi
|
||||||
namespace: encapi
|
namespace: encapi
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
spec:
|
spec:
|
||||||
replicas: 2
|
replicas: 2
|
||||||
selector:
|
selector:
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ metadata:
|
|||||||
name: kanidm
|
name: kanidm
|
||||||
namespace: kanidm
|
namespace: kanidm
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
|
secret.reloader.stakater.com/reload: "kanidm-tls"
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: kanidm
|
app.kubernetes.io/name: kanidm
|
||||||
app.kubernetes.io/instance: kanidm
|
app.kubernetes.io/instance: kanidm
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ spec:
|
|||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
|
secret.reloader.stakater.com/reload: "vault-ca-cert"
|
||||||
labels:
|
labels:
|
||||||
app: litellm
|
app: litellm
|
||||||
spec:
|
spec:
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ metadata:
|
|||||||
name: logarchiver
|
name: logarchiver
|
||||||
namespace: logging
|
namespace: logging
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
|
secret.reloader.stakater.com/reload: "vault-ca-cert"
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: logarchiver
|
app.kubernetes.io/name: logarchiver
|
||||||
app.kubernetes.io/component: archiver
|
app.kubernetes.io/component: archiver
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
name: pdbmux
|
name: pdbmux
|
||||||
namespace: pdbmux
|
namespace: pdbmux
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
spec:
|
spec:
|
||||||
replicas: 2
|
replicas: 2
|
||||||
selector:
|
selector:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ spec:
|
|||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: puppetboard
|
app.kubernetes.io/component: puppetboard
|
||||||
app.kubernetes.io/instance: puppetserver
|
app.kubernetes.io/instance: puppetserver
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ spec:
|
|||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: puppetdb
|
app.kubernetes.io/component: puppetdb
|
||||||
app.kubernetes.io/instance: puppetserver
|
app.kubernetes.io/instance: puppetserver
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ apiVersion: apps/v1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
|
secret.reloader.stakater.com/reload: "vault-ca-cert"
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: puppetserver-compilers
|
app.kubernetes.io/component: puppetserver-compilers
|
||||||
app.kubernetes.io/instance: puppetserver
|
app.kubernetes.io/instance: puppetserver
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ apiVersion: apps/v1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
|
secret.reloader.stakater.com/reload: "vault-ca-cert"
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: puppetserver
|
app.kubernetes.io/component: puppetserver
|
||||||
app.kubernetes.io/instance: puppetserver
|
app.kubernetes.io/instance: puppetserver
|
||||||
@@ -20,7 +21,7 @@ spec:
|
|||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: puppetserver
|
app.kubernetes.io/component: puppetserver
|
||||||
app.kubernetes.io/instance: puppetserver
|
app.kubernetes.io/instance: puppetserver
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ global:
|
|||||||
server:
|
server:
|
||||||
replicas: 3
|
replicas: 3
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
resources:
|
resources:
|
||||||
@@ -89,7 +89,7 @@ server:
|
|||||||
worker:
|
worker:
|
||||||
replicas: 2
|
replicas: 2
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: "2"
|
cpu: "2"
|
||||||
|
|||||||
@@ -86,12 +86,13 @@ container:
|
|||||||
cpu: "2"
|
cpu: "2"
|
||||||
memory: 4Gi
|
memory: 4Gi
|
||||||
|
|
||||||
# Roll the StatefulSet when nats-auth changes.
|
# Roll the StatefulSet on config changes only; nats-auth is Vault-rotated (VSO)
|
||||||
|
# so it is deliberately not watched here (no restart on routine key rotation).
|
||||||
podTemplate:
|
podTemplate:
|
||||||
merge:
|
merge:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
|
|
||||||
# Config-reloader sidecar image, also through artifactapi.
|
# Config-reloader sidecar image, also through artifactapi.
|
||||||
reloader:
|
reloader:
|
||||||
|
|||||||
@@ -50,4 +50,4 @@ existingConfigMaps:
|
|||||||
- vector-agent-config
|
- vector-agent-config
|
||||||
|
|
||||||
workloadResourceAnnotations:
|
workloadResourceAnnotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ autoscaling:
|
|||||||
targetCPUUtilizationPercentage: 70
|
targetCPUUtilizationPercentage: 70
|
||||||
|
|
||||||
workloadResourceAnnotations:
|
workloadResourceAnnotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
|
|
||||||
podLabels:
|
podLabels:
|
||||||
vector.dev/exclude: "true"
|
vector.dev/exclude: "true"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ image:
|
|||||||
tag: 0.57.0-distroless-libc
|
tag: 0.57.0-distroless-libc
|
||||||
|
|
||||||
workloadResourceAnnotations:
|
workloadResourceAnnotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
|
|
||||||
podLabels:
|
podLabels:
|
||||||
vector.dev/exclude: "true"
|
vector.dev/exclude: "true"
|
||||||
|
|||||||
@@ -2,7 +2,10 @@
|
|||||||
reloader:
|
reloader:
|
||||||
autoReloadAll: false
|
autoReloadAll: false
|
||||||
isArgoRollouts: true
|
isArgoRollouts: true
|
||||||
ignoreSecrets: true
|
# Watch Secrets so opt-in secret.reloader.stakater.com/reload works (issue
|
||||||
|
# #326). Workloads use configmap-only auto by default; Vault/VSO-rotated
|
||||||
|
# Secrets do NOT trigger restarts unless explicitly named.
|
||||||
|
ignoreSecrets: false
|
||||||
ignoreConfigMaps: false
|
ignoreConfigMaps: false
|
||||||
ignoreJobs: true
|
ignoreJobs: true
|
||||||
ignoreCronJobs: true
|
ignoreCronJobs: true
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ agent:
|
|||||||
persistence:
|
persistence:
|
||||||
storageClass: cephrbd-fast-delete
|
storageClass: cephrbd-fast-delete
|
||||||
podAnnotations:
|
podAnnotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 50m
|
||||||
@@ -40,7 +40,7 @@ server:
|
|||||||
persistentVolume:
|
persistentVolume:
|
||||||
storageClass: cephrbd-fast-delete
|
storageClass: cephrbd-fast-delete
|
||||||
podAnnotations:
|
podAnnotations:
|
||||||
reloader.stakater.com/auto: "true"
|
configmap.reloader.stakater.com/auto: "true"
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
annotations:
|
annotations:
|
||||||
|
|||||||
@@ -8,3 +8,4 @@ Operational notes for the manifests in this repo.
|
|||||||
| [cnpg-restore.md](cnpg-restore.md) | Restoring a CNPG cluster: full recovery, point-in-time recovery, cutover, and gotchas. |
|
| [cnpg-restore.md](cnpg-restore.md) | Restoring a CNPG cluster: full recovery, point-in-time recovery, cutover, and gotchas. |
|
||||||
| [authentik-rancher-sso.md](authentik-rancher-sso.md) | Manual runtime step to point Rancher's OIDC auth at the canonical `identity.unkin.net` issuer and trust the internal CA. |
|
| [authentik-rancher-sso.md](authentik-rancher-sso.md) | Manual runtime step to point Rancher's OIDC auth at the canonical `identity.unkin.net` issuer and trust the internal CA. |
|
||||||
| [gitea-migration.md](gitea-migration.md) | Staged cutover of the git.unkin.net forge from the Puppet VM to the `gitea` namespace. |
|
| [gitea-migration.md](gitea-migration.md) | Staged cutover of the git.unkin.net forge from the Puppet VM to the `gitea` namespace. |
|
||||||
|
| [ca-rotation.md](ca-rotation.md) | Rolling the internal `unkin.net` PKI CA (`vault-ca-cert`): what Reloader restarts automatically vs. manual/CNPG restarts. |
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
# Internal CA rotation runbook
|
||||||
|
|
||||||
|
How to roll the internal `unkin.net` PKI when the intermediate CA is re-keyed,
|
||||||
|
without turning it into an incident (issue #326).
|
||||||
|
|
||||||
|
Trust in the internal CA is bootstrapped by the plain `vault-ca-cert` Secret in
|
||||||
|
the `certificates` namespace (it cannot be Vault-sourced — it is what teaches
|
||||||
|
workloads to trust Vault in the first place). It is replicated into every
|
||||||
|
namespace by the emberstack reflector. Everything below keys off that Secret.
|
||||||
|
|
||||||
|
## Before you start
|
||||||
|
|
||||||
|
- `vault-ca-cert` MUST carry the **full current chain** (intermediate + root),
|
||||||
|
not a bare leaf. radosgw (Ceph RGW) serves a bare leaf, so CNPG->RGW backups
|
||||||
|
and any S3 client verifying against this bundle break if the chain is
|
||||||
|
incomplete. Update `apps/base/certificates/vault-ca-cert.yaml` with the full
|
||||||
|
chain and let Argo CD sync it before restarting consumers.
|
||||||
|
|
||||||
|
## What restarts automatically
|
||||||
|
|
||||||
|
Reloader watches Secrets (`ignoreSecrets: false`) but workloads use
|
||||||
|
`configmap.reloader.stakater.com/auto: "true"` — ConfigMap-only by default — so
|
||||||
|
Vault/VSO-rotated app Secrets do NOT cause restarts. CA reload is opt-in via an
|
||||||
|
explicit `secret.reloader.stakater.com/reload: "vault-ca-cert"` annotation.
|
||||||
|
|
||||||
|
These roll on their own when `vault-ca-cert` changes:
|
||||||
|
|
||||||
|
| Workload | Namespace | How it consumes the CA |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `api` (artifactapi) | `artifactapi` | init combines CA into trust bundle |
|
||||||
|
| `litellm` | `litellm` | init combines CA into trust bundle |
|
||||||
|
| `cephrgw-operator` | `cephrgw-system` | `CEPH_RGW_CA_FILE` subPath mount |
|
||||||
|
| `puppetserver-master` | `puppet` | subPath mount |
|
||||||
|
| `puppetserver-compiler` | `puppet` | subPath mount |
|
||||||
|
| `logarchiver` | `logging` | subPath mount |
|
||||||
|
|
||||||
|
## What needs a manual restart
|
||||||
|
|
||||||
|
These mount `vault-ca-cert` but are not Reloader-annotated (CRD-managed or
|
||||||
|
startup-cached), so restart them by hand after the Secret syncs:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
kubectl -n grafana rollout restart deployment/grafana # grafana-operator Grafana
|
||||||
|
kubectl -n observability rollout restart deployment/vmagent
|
||||||
|
kubectl -n paperclip rollout restart deployment/paperclip
|
||||||
|
kubectl -n argocd rollout restart deployment/argocd-repo-server # startup-cached
|
||||||
|
```
|
||||||
|
|
||||||
|
CNPG Postgres clusters cache the CA in the operator; roll each cluster that
|
||||||
|
trusts `vault-ca-cert` (artifactapi, authentik, encapi, gitea, grafana,
|
||||||
|
litellm, paperclip, woodpecker):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
kubectl cnpg restart <cluster> -n <namespace>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Verify
|
||||||
|
|
||||||
|
Confirm the in-pod bundle matches the new CA:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
kubectl -n <ns> exec deploy/<workload> -- \
|
||||||
|
sha256sum /path/to/ca.crt # compare against the new vault-ca-cert
|
||||||
|
```
|
||||||
|
|
||||||
|
For RGW-backed backups, confirm a fresh CNPG base backup completes after the
|
||||||
|
roll.
|
||||||
Reference in New Issue
Block a user