diff --git a/apps/base/bind-internal/authoritative/unkin-net/a/coroot.yaml b/apps/base/bind-internal/authoritative/unkin-net/a/coroot.yaml index 6c58bd6..8f71880 100644 --- a/apps/base/bind-internal/authoritative/unkin-net/a/coroot.yaml +++ b/apps/base/bind-internal/authoritative/unkin-net/a/coroot.yaml @@ -10,6 +10,5 @@ spec: type: A ttl: 600 values: - # traefik-EXTERNAL (DMZ) gateway VIP; the coroot-external Gateway serves the - # coroot.unkin.net front door (oauth2-proxy) there. + # traefik-external (DMZ) gateway VIP. - 198.18.199.0 diff --git a/apps/base/coroot/cnpg_backup.yaml b/apps/base/coroot/cnpg_backup.yaml index e63f0da..2feb355 100644 --- a/apps/base/coroot/cnpg_backup.yaml +++ b/apps/base/coroot/cnpg_backup.yaml @@ -1,8 +1,5 @@ --- -# Ceph RGW (S3) backup target for the coroot CNPG cluster, provisioned by the -# in-estate cephrgw-operator. One dedicated bucket + owner user per cluster: -# cephrgw CRs are namespace-scoped and CNPG reads its S3 credential Secret from -# its own namespace, so backups are per-database rather than one shared bucket. +# Per-cluster Ceph RGW bucket + owner user for CNPG backups, via cephrgw-operator. apiVersion: ceph.unkin.net/v1alpha1 kind: ObjectStoreUser metadata: @@ -13,11 +10,9 @@ spec: # RGW users are global; keep the uid namespace-qualified so it never collides. uid: cnpg-coroot-backup maxBuckets: 5 - # Operator writes AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY (+ RGW_UID, - # S3_ENDPOINT) into this Secret; the Cluster's barmanObjectStore consumes it. + # Operator writes the S3 keys here; the Cluster's barmanObjectStore consumes them. secretName: cnpg-coroot-backup-s3 - # Keep the RGW user (and thus the keys) if this CR is ever deleted, so an - # in-flight restore can still reach the archive. + # Keep the RGW user (and keys) on CR deletion so a restore can still reach the archive. retainOnDelete: true --- apiVersion: ceph.unkin.net/v1alpha1 @@ -28,8 +23,7 @@ metadata: spec: placementTarget: ec bucketName: cnpg-coroot - # The owner user has full control of its own bucket (read + write), which is - # all the backup/restore identity needs — no extra BucketAccess grant. + # The owner user has full read/write on its bucket; no extra BucketAccess grant. ownerRef: cnpg-coroot-backup versioning: false tags: @@ -38,10 +32,7 @@ spec: # Never drop the backups if the CR is removed; retire buckets by hand. retainOnDelete: true --- -# Nightly base backup. Continuous WAL archiving is always-on via the Cluster's -# spec.backup.barmanObjectStore; this schedules the periodic full backup that -# WAL is layered on top of. Schedules are staggered across clusters so the 8 -# base backups do not hit RGW at once (CNPG cron is 6-field, seconds first). +# Nightly base backup under always-on WAL archiving (CNPG cron is 6-field, seconds first). apiVersion: postgresql.cnpg.io/v1 kind: ScheduledBackup metadata: diff --git a/apps/base/coroot/cnpg_cluster.yaml b/apps/base/coroot/cnpg_cluster.yaml index 7ba46fa..de8bc3a 100644 --- a/apps/base/coroot/cnpg_cluster.yaml +++ b/apps/base/coroot/cnpg_cluster.yaml @@ -8,15 +8,11 @@ spec: affinity: podAntiAffinityType: preferred backup: - # 30-day retention (DEFAULT — adjust per cluster if needed). Enforced by CNPG - # against the object store on each successful base backup. retentionPolicy: 30d barmanObjectStore: - # Dedicated per-cluster Ceph RGW bucket (cephrgw-operator provisions it). destinationPath: s3://cnpg-coroot endpointURL: https://s3.ceph.unkin.net - # radosgw serves a Vault-PKI cert; trust the internal CA (reflected into - # every namespace as the vault-ca-cert Secret). + # radosgw serves a Vault-PKI cert. endpointCA: name: vault-ca-cert key: ca.crt @@ -42,8 +38,7 @@ spec: encoding: UTF8 localeCType: C localeCollate: C - # No secret ref: CNPG mints the owner credentials in the generated - # "postgres-app" Secret, which the Coroot CR reads. + # CNPG mints the owner credentials in the postgres-app Secret. owner: coroot enablePDB: true enableSuperuserAccess: false diff --git a/apps/base/coroot/coroot.yaml b/apps/base/coroot/coroot.yaml index 7c1da26..03b07b2 100644 --- a/apps/base/coroot/coroot.yaml +++ b/apps/base/coroot/coroot.yaml @@ -1,7 +1,5 @@ --- -# Coroot Community Edition, reconciled by coroot-operator (coroot-system). -# Community has no OIDC: oauth2-proxy (Authentik, akP-coroot-admin) is the only -# ingress path, so the UI trusts every request that reaches it as Admin. +# Community has no OIDC: oauth2-proxy is the only ingress path, so anonymous requests are Admin. apiVersion: coroot.com/v1 kind: Coroot metadata: diff --git a/apps/base/coroot/gateway.yaml b/apps/base/coroot/gateway.yaml index 4f64042..dd03633 100644 --- a/apps/base/coroot/gateway.yaml +++ b/apps/base/coroot/gateway.yaml @@ -1,11 +1,5 @@ --- -# External (DMZ) front for the Coroot UI on coroot.unkin.net via the -# external Traefik (LB VIP 198.18.199.0). TLS terminates with the real Let's -# Encrypt *.unkin.net wildcard (Certificate wildcard-unkin-net in cert-manager, -# reflected into this namespace as wildcard-unkin-net-tls by the emberstack -# reflector), so there is no cert-manager annotation here. The apex -# coroot.unkin.net A record lives in the bind-operator unkin.net zone, NOT -# external-dns, so no external-dns annotation either. oauth2-proxy fronts it. +# External (DMZ) Traefik front for coroot.unkin.net, TLS via the reflected LE *.unkin.net wildcard. apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: diff --git a/apps/base/coroot/kustomization.yaml b/apps/base/coroot/kustomization.yaml index efa176f..d145396 100644 --- a/apps/base/coroot/kustomization.yaml +++ b/apps/base/coroot/kustomization.yaml @@ -13,6 +13,7 @@ resources: - oauth2-proxy-configmap.yaml - oauth2-proxy-deployment.yaml - pdb.yaml + - networkpolicy.yaml - service.yaml - gateway.yaml - httproute.yaml diff --git a/apps/base/coroot/networkpolicy.yaml b/apps/base/coroot/networkpolicy.yaml new file mode 100644 index 0000000..02cf604 --- /dev/null +++ b/apps/base/coroot/networkpolicy.yaml @@ -0,0 +1,30 @@ +--- +# authAnonymousRole is Admin, so only oauth2-proxy and the coroot agents may reach the UI/API. +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: coroot-ingress + namespace: coroot +spec: + podSelector: + matchLabels: + app.kubernetes.io/part-of: coroot + app.kubernetes.io/component: coroot + policyTypes: + - Ingress + ingress: + - from: + - podSelector: + matchLabels: + app: coroot-oauth2 + - podSelector: + matchLabels: + app.kubernetes.io/part-of: coroot + app.kubernetes.io/component: coroot-node-agent + - podSelector: + matchLabels: + app.kubernetes.io/part-of: coroot + app.kubernetes.io/component: coroot-cluster-agent + ports: + - protocol: TCP + port: 8080 diff --git a/apps/base/coroot/oauth2-proxy-configmap.yaml b/apps/base/coroot/oauth2-proxy-configmap.yaml index a95756f..e045a38 100644 --- a/apps/base/coroot/oauth2-proxy-configmap.yaml +++ b/apps/base/coroot/oauth2-proxy-configmap.yaml @@ -16,8 +16,7 @@ data: OAUTH2_PROXY_ALLOWED_GROUPS: "akP-coroot-admin" OAUTH2_PROXY_PASS_USER_HEADERS: "true" OAUTH2_PROXY_EMAIL_DOMAINS: "*" - # Authentik hardcodes email_verified=false in the id_token; authorization is - # enforced via ak_groups, so accepting the unverified email is safe. + # Authentik hardcodes email_verified=false; authorization is enforced via ak_groups. OAUTH2_PROXY_INSECURE_OIDC_ALLOW_UNVERIFIED_EMAIL: "true" OAUTH2_PROXY_COOKIE_SECURE: "true" OAUTH2_PROXY_COOKIE_DOMAINS: "coroot.unkin.net" diff --git a/apps/base/coroot/oauth2-proxy-deployment.yaml b/apps/base/coroot/oauth2-proxy-deployment.yaml index c6110c9..707f8ab 100644 --- a/apps/base/coroot/oauth2-proxy-deployment.yaml +++ b/apps/base/coroot/oauth2-proxy-deployment.yaml @@ -38,8 +38,7 @@ spec: seccompProfile: type: RuntimeDefault initContainers: - # identity.unkin.net serves a Vault-PKI cert; combine the system roots - # with the internal CA so oauth2-proxy's OIDC HTTP client trusts it. + # identity.unkin.net serves a Vault-PKI cert; append the internal CA to the system roots. - name: combine-certs image: docker.io/library/alpine:3 imagePullPolicy: IfNotPresent diff --git a/apps/base/coroot/pdb.yaml b/apps/base/coroot/pdb.yaml index 7d79603..a846b5a 100644 --- a/apps/base/coroot/pdb.yaml +++ b/apps/base/coroot/pdb.yaml @@ -45,3 +45,14 @@ spec: selector: matchLabels: app: coroot-oauth2 +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: postgres-pooler-rw + namespace: coroot +spec: + minAvailable: 1 + selector: + matchLabels: + cnpg.io/poolerName: postgres-pooler-rw diff --git a/apps/base/coroot/service.yaml b/apps/base/coroot/service.yaml index ac85100..f726345 100644 --- a/apps/base/coroot/service.yaml +++ b/apps/base/coroot/service.yaml @@ -1,6 +1,5 @@ --- -# Front-door entry Service: the HTTPRoute for coroot.unkin.net targets this, so -# all traffic enters via oauth2-proxy. +# HTTPRoute target: all traffic enters via oauth2-proxy. apiVersion: v1 kind: Service metadata: diff --git a/apps/overlays/au-syd1/coroot-system/values.yaml b/apps/overlays/au-syd1/coroot-system/values.yaml index f1e3494..c95b9a0 100644 --- a/apps/overlays/au-syd1/coroot-system/values.yaml +++ b/apps/overlays/au-syd1/coroot-system/values.yaml @@ -1,5 +1,4 @@ -# Single replica: the operator has no leader election, so two would fight. -# Watches all namespaces; reconciles the Coroot CR in the `coroot` namespace. +# Single replica: the operator has no leader election. resources: requests: cpu: 100m