Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f8c816235 | |||
| 2706632f54 |
@@ -1,29 +0,0 @@
|
|||||||
when:
|
|
||||||
- event: pull_request
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: vector-test
|
|
||||||
image: artifactapi.k8s.syd1.au.unkin.net/dockerhub/timberio/vector:0.57.0-debian
|
|
||||||
commands:
|
|
||||||
# Dummy creds + writable dirs so the full topologies build; the unit tests
|
|
||||||
# only exercise the transforms (sources are not started).
|
|
||||||
- export CLICKHOUSE_USER=ci CLICKHOUSE_PASSWORD=ci
|
|
||||||
- export NATS_PRODUCER_PASSWORD=ci NATS_CONSUMER_PASSWORD=ci
|
|
||||||
- mkdir -p /vector-data-dir /etc/vault-ca
|
|
||||||
- cp /etc/ssl/certs/ca-certificates.crt /etc/vault-ca/ca.crt
|
|
||||||
# Transform tier + VM ingest: unit-tested transforms.
|
|
||||||
- vector test apps/base/logging/vector/aggregator.yaml apps/base/logging/vector/aggregator-tests.yaml
|
|
||||||
- vector test apps/base/logging/vector/vm-ingest.yaml apps/base/logging/vector/vm-ingest-tests.yaml
|
|
||||||
# Agent has no transforms to unit-test; validate it builds. (The archiver
|
|
||||||
# leg is now the logarchiver service, not a Vector pipeline.)
|
|
||||||
- vector validate --no-environment apps/base/logging/vector/agent.yaml
|
|
||||||
backend_options:
|
|
||||||
kubernetes:
|
|
||||||
serviceAccountName: default
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
memory: 256Mi
|
|
||||||
cpu: 250m
|
|
||||||
limits:
|
|
||||||
memory: 1Gi
|
|
||||||
cpu: 1
|
|
||||||
@@ -12,13 +12,13 @@ spec:
|
|||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
configmap.reloader.stakater.com/auto: "true"
|
reloader.stakater.com/auto: "true"
|
||||||
labels:
|
labels:
|
||||||
app: age-api
|
app: age-api
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: age-api
|
- name: age-api
|
||||||
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/age-api:v0.1.0
|
image: git.unkin.net/unkin/age-api:v0.1.0
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ resources:
|
|||||||
- httproute.yaml
|
- httproute.yaml
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
- vpa.yaml
|
|
||||||
|
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
- name: age-api-config
|
- name: age-api-config
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: autoscaling.k8s.io/v1
|
|
||||||
kind: VerticalPodAutoscaler
|
|
||||||
metadata:
|
|
||||||
name: age-api-vpa
|
|
||||||
namespace: age-api
|
|
||||||
spec:
|
|
||||||
targetRef:
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
name: age-api
|
|
||||||
updatePolicy:
|
|
||||||
updateMode: "Off"
|
|
||||||
@@ -5,8 +5,7 @@ metadata:
|
|||||||
name: api
|
name: api
|
||||||
namespace: artifactapi
|
namespace: artifactapi
|
||||||
annotations:
|
annotations:
|
||||||
configmap.reloader.stakater.com/auto: "true"
|
reloader.stakater.com/auto: "true"
|
||||||
secret.reloader.stakater.com/reload: "vault-ca-cert"
|
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
@@ -36,7 +35,7 @@ spec:
|
|||||||
mountPath: /combined-certs
|
mountPath: /combined-certs
|
||||||
containers:
|
containers:
|
||||||
- name: api
|
- name: api
|
||||||
image: git.unkin.net/unkin/artifactapi:v3.7.7
|
image: git.unkin.net/unkin/artifactapi:v3.7.6
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8000
|
- containerPort: 8000
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
---
|
|
||||||
# Ceph RGW (S3) backup target for the artifactapi 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.
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: ObjectStoreUser
|
|
||||||
metadata:
|
|
||||||
name: cnpg-artifactapi-backup
|
|
||||||
namespace: artifactapi
|
|
||||||
spec:
|
|
||||||
displayName: "CNPG backup owner (artifactapi)"
|
|
||||||
# RGW users are global; keep the uid namespace-qualified so it never collides.
|
|
||||||
uid: cnpg-artifactapi-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.
|
|
||||||
secretName: cnpg-artifactapi-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.
|
|
||||||
retainOnDelete: true
|
|
||||||
---
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: Bucket
|
|
||||||
metadata:
|
|
||||||
name: cnpg-artifactapi
|
|
||||||
namespace: artifactapi
|
|
||||||
spec:
|
|
||||||
placementTarget: ec
|
|
||||||
bucketName: cnpg-artifactapi
|
|
||||||
# The owner user has full control of its own bucket (read + write), which is
|
|
||||||
# all the backup/restore identity needs — no extra BucketAccess grant.
|
|
||||||
ownerRef: cnpg-artifactapi-backup
|
|
||||||
versioning: false
|
|
||||||
tags:
|
|
||||||
app: artifactapi
|
|
||||||
purpose: cnpg-backup
|
|
||||||
# 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).
|
|
||||||
apiVersion: postgresql.cnpg.io/v1
|
|
||||||
kind: ScheduledBackup
|
|
||||||
metadata:
|
|
||||||
name: cnpg-artifactapi-nightly
|
|
||||||
namespace: artifactapi
|
|
||||||
spec:
|
|
||||||
schedule: "0 40 1 * * *"
|
|
||||||
immediate: false
|
|
||||||
backupOwnerReference: self
|
|
||||||
method: barmanObjectStore
|
|
||||||
cluster:
|
|
||||||
name: postgres
|
|
||||||
@@ -7,35 +7,6 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
affinity:
|
affinity:
|
||||||
podAntiAffinityType: preferred
|
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-artifactapi
|
|
||||||
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).
|
|
||||||
endpointCA:
|
|
||||||
name: vault-ca-cert
|
|
||||||
key: ca.crt
|
|
||||||
# Keys minted by the ObjectStoreUser in cnpg_backup.yaml; never hardcoded.
|
|
||||||
s3Credentials:
|
|
||||||
accessKeyId:
|
|
||||||
name: cnpg-artifactapi-backup-s3
|
|
||||||
key: AWS_ACCESS_KEY_ID
|
|
||||||
secretAccessKey:
|
|
||||||
name: cnpg-artifactapi-backup-s3
|
|
||||||
key: AWS_SECRET_ACCESS_KEY
|
|
||||||
# Path prefix within the bucket; keep stable across restores (see docs).
|
|
||||||
serverName: artifactapi
|
|
||||||
data:
|
|
||||||
compression: bzip2
|
|
||||||
jobs: 2
|
|
||||||
wal:
|
|
||||||
compression: zstd
|
|
||||||
maxParallel: 2
|
|
||||||
bootstrap:
|
bootstrap:
|
||||||
initdb:
|
initdb:
|
||||||
database: artifacts
|
database: artifacts
|
||||||
|
|||||||
@@ -1,6 +1,30 @@
|
|||||||
---
|
---
|
||||||
apiVersion: gateway.networking.k8s.io/v1
|
apiVersion: gateway.networking.k8s.io/v1
|
||||||
kind: HTTPRoute
|
kind: HTTPRoute
|
||||||
|
metadata:
|
||||||
|
name: http-redirect
|
||||||
|
namespace: artifactapi
|
||||||
|
spec:
|
||||||
|
hostnames:
|
||||||
|
- artifactapi.k8s.syd1.au.unkin.net
|
||||||
|
parentRefs:
|
||||||
|
- group: gateway.networking.k8s.io
|
||||||
|
kind: Gateway
|
||||||
|
name: artifactapi
|
||||||
|
sectionName: http
|
||||||
|
rules:
|
||||||
|
- filters:
|
||||||
|
- type: RequestRedirect
|
||||||
|
requestRedirect:
|
||||||
|
scheme: https
|
||||||
|
statusCode: 301
|
||||||
|
matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /
|
||||||
|
---
|
||||||
|
apiVersion: gateway.networking.k8s.io/v1
|
||||||
|
kind: HTTPRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: api-route
|
name: api-route
|
||||||
namespace: artifactapi
|
namespace: artifactapi
|
||||||
@@ -8,12 +32,6 @@ spec:
|
|||||||
hostnames:
|
hostnames:
|
||||||
- artifactapi.k8s.syd1.au.unkin.net
|
- artifactapi.k8s.syd1.au.unkin.net
|
||||||
parentRefs:
|
parentRefs:
|
||||||
# Early-boot clients (anaconda/kickstart, yum in %post, PXE) need plain HTTP
|
|
||||||
# for the rpm repos; serve the app directly on port 80 instead of redirecting.
|
|
||||||
- group: gateway.networking.k8s.io
|
|
||||||
kind: Gateway
|
|
||||||
name: artifactapi
|
|
||||||
sectionName: http
|
|
||||||
- group: gateway.networking.k8s.io
|
- group: gateway.networking.k8s.io
|
||||||
kind: Gateway
|
kind: Gateway
|
||||||
name: artifactapi
|
name: artifactapi
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ resources:
|
|||||||
- api-hpa.yaml
|
- api-hpa.yaml
|
||||||
- configmap.yaml
|
- configmap.yaml
|
||||||
- cnpg_cluster.yaml
|
- cnpg_cluster.yaml
|
||||||
- cnpg_backup.yaml
|
|
||||||
- cnpg_pooler.yaml
|
- cnpg_pooler.yaml
|
||||||
- gateway.yaml
|
- gateway.yaml
|
||||||
- httproute.yaml
|
- httproute.yaml
|
||||||
@@ -18,4 +17,3 @@ resources:
|
|||||||
- ui-hpa.yaml
|
- ui-hpa.yaml
|
||||||
- vaultauth.yaml
|
- vaultauth.yaml
|
||||||
- vaultstaticsecret.yaml
|
- vaultstaticsecret.yaml
|
||||||
- vpa.yaml
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
name: ui
|
name: ui
|
||||||
namespace: artifactapi
|
namespace: artifactapi
|
||||||
annotations:
|
annotations:
|
||||||
configmap.reloader.stakater.com/auto: "true"
|
reloader.stakater.com/auto: "true"
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
@@ -22,7 +22,7 @@ spec:
|
|||||||
automountServiceAccountToken: true
|
automountServiceAccountToken: true
|
||||||
containers:
|
containers:
|
||||||
- name: ui
|
- name: ui
|
||||||
image: git.unkin.net/unkin/artifactapi-ui:v3.7.7
|
image: git.unkin.net/unkin/artifactapi-ui:v3.7.6
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: autoscaling.k8s.io/v1
|
|
||||||
kind: VerticalPodAutoscaler
|
|
||||||
metadata:
|
|
||||||
name: api-vpa
|
|
||||||
namespace: artifactapi
|
|
||||||
# NOTE: this workload also has an HPA. updateMode Off is recommendation-only
|
|
||||||
# and does not act, so there is no HPA/VPA conflict today. Do not flip to Auto/
|
|
||||||
# Initial without first moving the HPA off CPU/memory (VPA owns those under Auto).
|
|
||||||
spec:
|
|
||||||
targetRef:
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
name: api
|
|
||||||
updatePolicy:
|
|
||||||
updateMode: "Off"
|
|
||||||
---
|
|
||||||
apiVersion: autoscaling.k8s.io/v1
|
|
||||||
kind: VerticalPodAutoscaler
|
|
||||||
metadata:
|
|
||||||
name: redis-vpa
|
|
||||||
namespace: artifactapi
|
|
||||||
spec:
|
|
||||||
targetRef:
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
name: redis
|
|
||||||
updatePolicy:
|
|
||||||
updateMode: "Off"
|
|
||||||
---
|
|
||||||
apiVersion: autoscaling.k8s.io/v1
|
|
||||||
kind: VerticalPodAutoscaler
|
|
||||||
metadata:
|
|
||||||
name: ui-vpa
|
|
||||||
namespace: artifactapi
|
|
||||||
# NOTE: this workload also has an HPA. updateMode Off is recommendation-only
|
|
||||||
# and does not act, so there is no HPA/VPA conflict today. Do not flip to Auto/
|
|
||||||
# Initial without first moving the HPA off CPU/memory (VPA owns those under Auto).
|
|
||||||
spec:
|
|
||||||
targetRef:
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
name: ui
|
|
||||||
updatePolicy:
|
|
||||||
updateMode: "Off"
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
---
|
|
||||||
# Ceph RGW (S3) backup target for the authentik 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.
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: ObjectStoreUser
|
|
||||||
metadata:
|
|
||||||
name: cnpg-authentik-backup
|
|
||||||
namespace: authentik
|
|
||||||
spec:
|
|
||||||
displayName: "CNPG backup owner (authentik)"
|
|
||||||
# RGW users are global; keep the uid namespace-qualified so it never collides.
|
|
||||||
uid: cnpg-authentik-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.
|
|
||||||
secretName: cnpg-authentik-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.
|
|
||||||
retainOnDelete: true
|
|
||||||
---
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: Bucket
|
|
||||||
metadata:
|
|
||||||
name: cnpg-authentik
|
|
||||||
namespace: authentik
|
|
||||||
spec:
|
|
||||||
placementTarget: ec
|
|
||||||
bucketName: cnpg-authentik
|
|
||||||
# The owner user has full control of its own bucket (read + write), which is
|
|
||||||
# all the backup/restore identity needs — no extra BucketAccess grant.
|
|
||||||
ownerRef: cnpg-authentik-backup
|
|
||||||
versioning: false
|
|
||||||
tags:
|
|
||||||
app: authentik
|
|
||||||
purpose: cnpg-backup
|
|
||||||
# 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).
|
|
||||||
apiVersion: postgresql.cnpg.io/v1
|
|
||||||
kind: ScheduledBackup
|
|
||||||
metadata:
|
|
||||||
name: cnpg-authentik-nightly
|
|
||||||
namespace: authentik
|
|
||||||
spec:
|
|
||||||
schedule: "0 0 1 * * *"
|
|
||||||
immediate: false
|
|
||||||
backupOwnerReference: self
|
|
||||||
method: barmanObjectStore
|
|
||||||
cluster:
|
|
||||||
name: postgres
|
|
||||||
@@ -7,35 +7,6 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
affinity:
|
affinity:
|
||||||
podAntiAffinityType: preferred
|
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-authentik
|
|
||||||
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).
|
|
||||||
endpointCA:
|
|
||||||
name: vault-ca-cert
|
|
||||||
key: ca.crt
|
|
||||||
# Keys minted by the ObjectStoreUser in cnpg_backup.yaml; never hardcoded.
|
|
||||||
s3Credentials:
|
|
||||||
accessKeyId:
|
|
||||||
name: cnpg-authentik-backup-s3
|
|
||||||
key: AWS_ACCESS_KEY_ID
|
|
||||||
secretAccessKey:
|
|
||||||
name: cnpg-authentik-backup-s3
|
|
||||||
key: AWS_SECRET_ACCESS_KEY
|
|
||||||
# Path prefix within the bucket; keep stable across restores (see docs).
|
|
||||||
serverName: authentik
|
|
||||||
data:
|
|
||||||
compression: bzip2
|
|
||||||
jobs: 2
|
|
||||||
wal:
|
|
||||||
compression: zstd
|
|
||||||
maxParallel: 2
|
|
||||||
bootstrap:
|
bootstrap:
|
||||||
initdb:
|
initdb:
|
||||||
database: authentik
|
database: authentik
|
||||||
@@ -106,12 +77,10 @@ spec:
|
|||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: 500m
|
cpu: 500m
|
||||||
# 512Mi OOMKilled replicas under load (shared_buffers 128MB +
|
memory: 512Mi
|
||||||
# max_connections 200 leave no headroom) — see incident 2026-07-28.
|
|
||||||
memory: 1Gi
|
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 50m
|
||||||
memory: 512Mi
|
memory: 256Mi
|
||||||
smartShutdownTimeout: 180
|
smartShutdownTimeout: 180
|
||||||
startDelay: 3600
|
startDelay: 3600
|
||||||
stopDelay: 1800
|
stopDelay: 1800
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ kind: Kustomization
|
|||||||
|
|
||||||
resources:
|
resources:
|
||||||
- cnpg_cluster.yaml
|
- cnpg_cluster.yaml
|
||||||
- cnpg_backup.yaml
|
|
||||||
- cnpg_pooler.yaml
|
- cnpg_pooler.yaml
|
||||||
- gateway.yaml
|
- gateway.yaml
|
||||||
- httproute.yaml
|
- httproute.yaml
|
||||||
@@ -18,4 +17,3 @@ resources:
|
|||||||
- redis-service.yaml
|
- redis-service.yaml
|
||||||
- vaultauth.yaml
|
- vaultauth.yaml
|
||||||
- vaultstaticsecret.yaml
|
- vaultstaticsecret.yaml
|
||||||
- vpa.yaml
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: autoscaling.k8s.io/v1
|
|
||||||
kind: VerticalPodAutoscaler
|
|
||||||
metadata:
|
|
||||||
name: redis-vpa
|
|
||||||
namespace: authentik
|
|
||||||
spec:
|
|
||||||
targetRef:
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
name: redis
|
|
||||||
updatePolicy:
|
|
||||||
updateMode: "Off"
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
# Confines the agent-dns service account (in bind-system) to the agent-dns
|
|
||||||
# ClusterRole within this namespace.
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: RoleBinding
|
|
||||||
metadata:
|
|
||||||
name: agent-dns
|
|
||||||
namespace: bind-external
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name: agent-dns
|
|
||||||
namespace: bind-system
|
|
||||||
roleRef:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
kind: ClusterRole
|
|
||||||
name: agent-dns
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
---
|
|
||||||
# Externally-reachable authoritative BIND for zones we delegate to ourselves.
|
|
||||||
# First tenant: acme.unkin.net, the DNS-01 challenge zone Let's Encrypt validates
|
|
||||||
# via a one-time _acme-challenge.unkin.net CNAME. Authoritative-only, recursion
|
|
||||||
# off, no forwarding, no open transfers -- the primaryService is the single
|
|
||||||
# dmz-pinned LoadBalancer that public NAT targets and that cert-manager writes to.
|
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
|
||||||
kind: BindCluster
|
|
||||||
metadata:
|
|
||||||
name: bind-external
|
|
||||||
namespace: bind-external
|
|
||||||
spec:
|
|
||||||
mode: authoritative
|
|
||||||
recursion: false
|
|
||||||
replicas: 2
|
|
||||||
storageClassName: cephrbd-fast-delete
|
|
||||||
storageSize: 1Gi
|
|
||||||
# Public server: answer queries from anywhere (Let's Encrypt validates over the
|
|
||||||
# internet), deny recursion and open zone transfers. localhost + pod net are
|
|
||||||
# implied by "any" and cover in-pod nsupdate and secondary SOA refresh; per-zone
|
|
||||||
# allow-transfer (catalog + acme zone) still permits key-authenticated AXFR.
|
|
||||||
extraOptions:
|
|
||||||
- "allow-query { any; }"
|
|
||||||
- "allow-transfer { none; }"
|
|
||||||
service:
|
|
||||||
type: ClusterIP
|
|
||||||
primaryService:
|
|
||||||
type: LoadBalancer
|
|
||||||
externalTrafficPolicy: Local
|
|
||||||
annotations:
|
|
||||||
purelb.io/service-group: dmz
|
|
||||||
purelb.io/addresses: 198.18.199.53
|
|
||||||
external-dns.alpha.kubernetes.io/hostname: bind-external-primary.k8s.syd1.au.unkin.net
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 20m
|
|
||||||
memory: 128Mi
|
|
||||||
limits:
|
|
||||||
cpu: "1"
|
|
||||||
memory: 512Mi
|
|
||||||
---
|
|
||||||
# Catalog zone so the acme zone replicates onto the secondary (AXFR/IXFR keyed
|
|
||||||
# with the certmanager TSIG key, reused here as the transfer key).
|
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
|
||||||
kind: BindCatalogZone
|
|
||||||
metadata:
|
|
||||||
name: bind-external-catalog
|
|
||||||
namespace: bind-external
|
|
||||||
spec:
|
|
||||||
clusterRef: bind-external
|
|
||||||
zoneName: catalog.external
|
|
||||||
transferKeyRef: certmanager
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
|
|
||||||
resources:
|
|
||||||
- namespace.yaml
|
|
||||||
- cluster.yaml
|
|
||||||
- tsigkey.yaml
|
|
||||||
- zones.yaml
|
|
||||||
- agent-dns-rolebinding.yaml
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: bind-external
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
# TSIG key cert-manager uses to send RFC2136 dynamic updates (the DNS-01 TXT
|
|
||||||
# records) to the primary, and that the secondary reuses for AXFR. The operator
|
|
||||||
# generates the material into Secret certmanager-tsig in this namespace;
|
|
||||||
# secretTemplate stamps emberstack reflector hints so the Secret is mirrored into
|
|
||||||
# the cert-manager namespace, where the rfc2136 solver reads its "secret" key.
|
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
|
||||||
kind: BindTSIGKey
|
|
||||||
metadata:
|
|
||||||
name: certmanager
|
|
||||||
namespace: bind-external
|
|
||||||
spec:
|
|
||||||
clusterRef: bind-external
|
|
||||||
algorithm: hmac-sha256
|
|
||||||
secretTemplate:
|
|
||||||
annotations:
|
|
||||||
reflector.v1.k8s.emberstack.com/reflection-allowed: "true"
|
|
||||||
reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: "cert-manager"
|
|
||||||
reflector.v1.k8s.emberstack.com/reflection-auto-enabled: "true"
|
|
||||||
reflector.v1.k8s.emberstack.com/reflection-auto-namespaces: "cert-manager"
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
# Self-delegated ACME challenge zone. Google Cloud DNS holds a one-time
|
|
||||||
# _acme-challenge.unkin.net CNAME -> _acme-challenge.acme.unkin.net and an
|
|
||||||
# acme.unkin.net NS delegation pointing here; cert-manager writes the challenge
|
|
||||||
# TXT records via RFC2136 authenticated with the certmanager key.
|
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
|
||||||
kind: BindZone
|
|
||||||
metadata:
|
|
||||||
name: acme-unkin-net
|
|
||||||
namespace: bind-external
|
|
||||||
spec:
|
|
||||||
clusterRef: bind-external
|
|
||||||
zoneName: acme.unkin.net
|
|
||||||
type: primary
|
|
||||||
defaultTTL: 60
|
|
||||||
dynamicUpdate: true
|
|
||||||
updateKeyRef: certmanager
|
|
||||||
allowTransfer:
|
|
||||||
- key certmanager
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
# Confines the agent-dns service account (in bind-system) to the agent-dns
|
|
||||||
# ClusterRole within this namespace.
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: RoleBinding
|
|
||||||
metadata:
|
|
||||||
name: agent-dns
|
|
||||||
namespace: bind-internal
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name: agent-dns
|
|
||||||
namespace: bind-system
|
|
||||||
roleRef:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
kind: ClusterRole
|
|
||||||
name: agent-dns
|
|
||||||
@@ -24,6 +24,3 @@ spec:
|
|||||||
- 198.18.27.0/24
|
- 198.18.27.0/24
|
||||||
- 198.18.28.0/24
|
- 198.18.28.0/24
|
||||||
- 198.18.29.0/24
|
- 198.18.29.0/24
|
||||||
# Admin/management access (individual hosts, not whole subnets)
|
|
||||||
- 10.10.12.200/32 # benvin workstation (wireguard)
|
|
||||||
- 198.18.21.160/32 # benvin router
|
|
||||||
|
|||||||
@@ -13,14 +13,9 @@ spec:
|
|||||||
storageSize: 2Gi
|
storageSize: 2Gi
|
||||||
# Restrict queries to internal networks (puppet acl-main.unkin.net).
|
# Restrict queries to internal networks (puppet acl-main.unkin.net).
|
||||||
# 10.42.0.0/16 (pod net) is required so secondaries can SOA-refresh
|
# 10.42.0.0/16 (pod net) is required so secondaries can SOA-refresh
|
||||||
# from the primary during catalog replication. localhost is required so the
|
# from the primary during catalog replication.
|
||||||
# operator's in-pod `nsupdate` (sent to 127.0.0.1) passes query-authorization;
|
|
||||||
# without it every dynamic update is "denied due to allow-query".
|
|
||||||
extraOptions:
|
extraOptions:
|
||||||
- "allow-query { localhost; auth-acl-main; 10.42.0.0/16; }"
|
- "allow-query { auth-acl-main; 10.42.0.0/16; }"
|
||||||
# Enable query logging for the Tier-2 vector bind_query pipeline (see the
|
|
||||||
# resolvers cluster for the routing rationale).
|
|
||||||
- "querylog yes"
|
|
||||||
service:
|
service:
|
||||||
type: LoadBalancer
|
type: LoadBalancer
|
||||||
externalTrafficPolicy: Local
|
externalTrafficPolicy: Local
|
||||||
|
|||||||
@@ -6,5 +6,4 @@ resources:
|
|||||||
- cluster.yaml
|
- cluster.yaml
|
||||||
- tsigkey.yaml
|
- tsigkey.yaml
|
||||||
- zones.yaml
|
- zones.yaml
|
||||||
- records.yaml
|
|
||||||
- acls.yaml
|
- acls.yaml
|
||||||
|
|||||||
@@ -1,90 +0,0 @@
|
|||||||
# Individually-managed authoritative records for the unkin.net zone.
|
|
||||||
# DNSRecords must live in the same namespace as their BindZone (the operator
|
|
||||||
# resolves zoneRef/clusterRef/updateKeyRef within the record's namespace), so
|
|
||||||
# these sit alongside the zone in bind-internal, not in the app namespace.
|
|
||||||
---
|
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
|
||||||
kind: DNSRecord
|
|
||||||
metadata:
|
|
||||||
# "internal" in the name distinguishes this from the external DNS that
|
|
||||||
# Authentik will manage its own records from later.
|
|
||||||
name: identity-dns-internal
|
|
||||||
namespace: bind-internal
|
|
||||||
spec:
|
|
||||||
zoneRef: unkin-net
|
|
||||||
name: identity
|
|
||||||
type: A
|
|
||||||
ttl: 600
|
|
||||||
values:
|
|
||||||
# traefik-internal gateway VIP; the authentik Gateway serves the
|
|
||||||
# identity.unkin.net hostname there.
|
|
||||||
- 198.18.200.4
|
|
||||||
---
|
|
||||||
# PRODUCTION CUTOVER RECORD — intentionally commented out.
|
|
||||||
# git.unkin.net currently resolves to the LIVE VM forge (HAProxy VRRP VIP
|
|
||||||
# 198.18.19.17), which holds every repo the estate depends on. Uncommenting this
|
|
||||||
# repoints the whole org's git.unkin.net at the new k8s Gitea gateway VIP, so it
|
|
||||||
# is the FINAL step of the forge migration — gated on the data migration (gitea
|
|
||||||
# dump/restore + SECRET_KEY copy) in argocd-apps docs/gitea-migration.md.
|
|
||||||
# NOTE: the live git.unkin.net answer is served by the puppet DNS master today
|
|
||||||
# (profiles::dns::master, records from PuppetDB); this k8s apex zone holds only
|
|
||||||
# SOA+NS + a few DNSRecords so far. Confirm the k8s bind cluster is the live
|
|
||||||
# authority for unkin.net (or update the puppet record instead) before relying
|
|
||||||
# on this CR at cutover.
|
|
||||||
# ---
|
|
||||||
# apiVersion: bind.unkin.net/v1alpha1
|
|
||||||
# kind: DNSRecord
|
|
||||||
# metadata:
|
|
||||||
# name: git-dns-internal
|
|
||||||
# namespace: bind-internal
|
|
||||||
# spec:
|
|
||||||
# zoneRef: unkin-net
|
|
||||||
# name: git
|
|
||||||
# type: A
|
|
||||||
# ttl: 600
|
|
||||||
# values:
|
|
||||||
# # traefik-internal gateway VIP; the gitea Gateway serves git.unkin.net there.
|
|
||||||
# - 198.18.200.4
|
|
||||||
---
|
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
|
||||||
kind: DNSRecord
|
|
||||||
metadata:
|
|
||||||
name: s3-ceph-cname
|
|
||||||
namespace: bind-internal
|
|
||||||
spec:
|
|
||||||
zoneRef: ceph-unkin-net
|
|
||||||
name: s3
|
|
||||||
type: CNAME
|
|
||||||
ttl: 600
|
|
||||||
values:
|
|
||||||
# radosgw S3 endpoint. Points at the Consul service for now; the real
|
|
||||||
# target will be changed later.
|
|
||||||
- radosgw.service.consul.
|
|
||||||
---
|
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
|
||||||
kind: DNSRecord
|
|
||||||
metadata:
|
|
||||||
name: dashboard-ceph-cname
|
|
||||||
namespace: bind-internal
|
|
||||||
spec:
|
|
||||||
zoneRef: ceph-unkin-net
|
|
||||||
name: dashboard
|
|
||||||
type: CNAME
|
|
||||||
ttl: 600
|
|
||||||
values:
|
|
||||||
# Ceph mgr dashboard, reached via lb1. Lets in-cluster clients (the
|
|
||||||
# cephrgw-operator) resolve dashboard.ceph.unkin.net.
|
|
||||||
- lb1.unkin.net.
|
|
||||||
---
|
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
|
||||||
kind: DNSRecord
|
|
||||||
metadata:
|
|
||||||
name: lb1-unkin-net
|
|
||||||
namespace: bind-internal
|
|
||||||
spec:
|
|
||||||
zoneRef: unkin-net
|
|
||||||
name: lb1
|
|
||||||
type: A
|
|
||||||
ttl: 600
|
|
||||||
values:
|
|
||||||
- 103.216.191.185
|
|
||||||
@@ -31,22 +31,6 @@ spec:
|
|||||||
dynamicUpdate: true
|
dynamicUpdate: true
|
||||||
updateKeyRef: client-update
|
updateKeyRef: client-update
|
||||||
---
|
---
|
||||||
# ceph.unkin.net: the ceph host (ausyd1nxvm2069/halb) publishes
|
|
||||||
# dashboard.ceph.unkin.net via nsupdate; puppet targets a dedicated
|
|
||||||
# `zone ceph.unkin.net.`, so it must exist here or the update gets NOTZONE.
|
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
|
||||||
kind: BindZone
|
|
||||||
metadata:
|
|
||||||
name: ceph-unkin-net
|
|
||||||
namespace: bind-internal
|
|
||||||
spec:
|
|
||||||
clusterRef: bind-authoritative
|
|
||||||
zoneName: ceph.unkin.net
|
|
||||||
type: primary
|
|
||||||
defaultTTL: 600
|
|
||||||
dynamicUpdate: true
|
|
||||||
updateKeyRef: client-update
|
|
||||||
---
|
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
apiVersion: bind.unkin.net/v1alpha1
|
||||||
kind: BindZone
|
kind: BindZone
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
---
|
---
|
||||||
# Key that external-dns (and DNSRecord objects) use to send RFC2136 dynamic
|
# Key that external-dns (and DNSRecord objects) use to send RFC2136 dynamic
|
||||||
# updates to the primary. The operator generates the material into a Secret
|
# updates to the primary. The operator generates the material into a Secret.
|
||||||
# (externaldns-key-tsig) in this namespace. secretTemplate stamps emberstack
|
|
||||||
# reflector hints onto that Secret so it is mirrored into the externaldns
|
|
||||||
# namespace, where the external-dns controller reads it -- guaranteeing
|
|
||||||
# external-dns presents exactly the key the primary's allow-update accepts.
|
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
apiVersion: bind.unkin.net/v1alpha1
|
||||||
kind: BindTSIGKey
|
kind: BindTSIGKey
|
||||||
metadata:
|
metadata:
|
||||||
@@ -13,9 +9,3 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
clusterRef: bind-externaldns
|
clusterRef: bind-externaldns
|
||||||
algorithm: hmac-sha256
|
algorithm: hmac-sha256
|
||||||
secretTemplate:
|
|
||||||
annotations:
|
|
||||||
reflector.v1.k8s.emberstack.com/reflection-allowed: "true"
|
|
||||||
reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: "externaldns"
|
|
||||||
reflector.v1.k8s.emberstack.com/reflection-auto-enabled: "true"
|
|
||||||
reflector.v1.k8s.emberstack.com/reflection-auto-namespaces: "externaldns"
|
|
||||||
|
|||||||
@@ -8,4 +8,3 @@ resources:
|
|||||||
- resolvers
|
- resolvers
|
||||||
- externaldns
|
- externaldns
|
||||||
- tsig-api
|
- tsig-api
|
||||||
- agent-dns-rolebinding.yaml
|
|
||||||
|
|||||||
@@ -8,15 +8,11 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
clusterRef: bind-resolvers
|
clusterRef: bind-resolvers
|
||||||
entries:
|
entries:
|
||||||
- 10.42.0.0/16 # k8s pod network (kube-proxy masquerades node-originated LB queries)
|
|
||||||
- 198.18.1.10/32
|
- 198.18.1.10/32
|
||||||
- 198.18.2.160/27
|
- 198.18.2.160/27
|
||||||
- 198.18.21.160/27
|
- 198.18.21.160/27
|
||||||
- 198.18.2.192/27
|
- 198.18.2.192/27
|
||||||
- 198.18.21.192/27
|
- 198.18.21.192/27
|
||||||
# Admin/management access
|
|
||||||
- 10.10.12.200/32 # benvin workstation (wireguard)
|
|
||||||
- 198.18.21.160/32 # benvin router (also within 198.18.21.160/27 above)
|
|
||||||
- 198.18.13.0/24
|
- 198.18.13.0/24
|
||||||
- 198.18.14.0/24
|
- 198.18.14.0/24
|
||||||
- 198.18.15.0/24
|
- 198.18.15.0/24
|
||||||
|
|||||||
@@ -30,11 +30,6 @@ spec:
|
|||||||
# (incl. k8s.syd1.au.unkin.net); 18.198.in-addr.arpa covers every reverse zone.
|
# (incl. k8s.syd1.au.unkin.net); 18.198.in-addr.arpa covers every reverse zone.
|
||||||
extraOptions:
|
extraOptions:
|
||||||
- "validate-except { unkin.net; 18.198.in-addr.arpa; consul; }"
|
- "validate-except { unkin.net; 18.198.in-addr.arpa; consul; }"
|
||||||
# Enable query logging so the Tier-2 vector bind_query pipeline can parse
|
|
||||||
# client/qname/qtype. Routes to the `queries` category which, with no explicit
|
|
||||||
# logging{} clause, follows the default category to the named foreground
|
|
||||||
# stderr channel -> pod stdout -> vector (subject logs.k8s.bind-internal.*).
|
|
||||||
- "querylog yes"
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 20m
|
cpu: 20m
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
# Conditional forward zones, from the puppet openforwarder view.
|
# Conditional forward zones, from the puppet openforwarder view.
|
||||||
# Upstreams: unkin authoritative 198.18.200.6, consul 198.18.19.14,
|
# Upstreams: unkin authoritative 198.18.200.6, consul 198.18.19.14, k8s 198.18.200.8.
|
||||||
# k8s 198.18.200.8 (in-cluster bind-externaldns VIP).
|
# k8s -> in-cluster bind-externaldns 198.18.200.8.
|
||||||
# k8s -> in-cluster bind-externaldns 198.18.200.8 for both the forward zone
|
|
||||||
# k8s.syd1.au.unkin.net and the reverse zone 200.18.198.in-addr.arpa, which
|
|
||||||
# external-dns now publishes to (see the external-dns migration PRs).
|
|
||||||
# (Zones that forwarded to 10.10.16.x were dropped; consul left as-is.)
|
# (Zones that forwarded to 10.10.16.x were dropped; consul left as-is.)
|
||||||
---
|
---
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
apiVersion: bind.unkin.net/v1alpha1
|
||||||
@@ -64,22 +61,6 @@ spec:
|
|||||||
---
|
---
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
apiVersion: bind.unkin.net/v1alpha1
|
||||||
kind: BindZone
|
kind: BindZone
|
||||||
metadata:
|
|
||||||
name: fwd-200-18-198-in-addr-arpa
|
|
||||||
namespace: bind-internal
|
|
||||||
spec:
|
|
||||||
clusterRef: bind-resolvers
|
|
||||||
viewRef: openforwarder
|
|
||||||
zoneName: 200.18.198.in-addr.arpa
|
|
||||||
type: forward
|
|
||||||
catalog: false
|
|
||||||
forwarders:
|
|
||||||
# Reverse zone for the k8s LB range, published by external-dns to the
|
|
||||||
# in-cluster bind-externaldns alongside k8s.syd1.au.unkin.net.
|
|
||||||
- 198.18.200.8
|
|
||||||
---
|
|
||||||
apiVersion: bind.unkin.net/v1alpha1
|
|
||||||
kind: BindZone
|
|
||||||
metadata:
|
metadata:
|
||||||
name: fwd-13-18-198-in-addr-arpa
|
name: fwd-13-18-198-in-addr-arpa
|
||||||
namespace: bind-internal
|
namespace: bind-internal
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ metadata:
|
|||||||
name: bind-tsig-api
|
name: bind-tsig-api
|
||||||
namespace: bind-internal
|
namespace: bind-internal
|
||||||
spec:
|
spec:
|
||||||
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/bind-tsig-api:v0.2.3
|
image: git.unkin.net/unkin/bind-tsig-api:v0.2.1
|
||||||
replicas: 1
|
replicas: 1
|
||||||
port: 8443
|
port: 8443
|
||||||
# targetNamespace defaults to this resource's namespace (bind-internal), where
|
# targetNamespace defaults to this resource's namespace (bind-internal), where
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
---
|
|
||||||
# Static service account that Vault's kubernetes secret engine mints scoped
|
|
||||||
# tokens for (agent-dns role). RBAC is confined to the bind namespaces via the
|
|
||||||
# per-namespace RoleBindings below, not a ClusterRoleBinding.
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: agent-dns
|
|
||||||
namespace: bind-system
|
|
||||||
---
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: ClusterRole
|
|
||||||
metadata:
|
|
||||||
name: agent-dns
|
|
||||||
rules:
|
|
||||||
- apiGroups: ["bind.unkin.net"]
|
|
||||||
resources: ["*"]
|
|
||||||
verbs: ["*"]
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["pods", "services", "configmaps", "events"]
|
|
||||||
verbs: ["get", "list", "watch"]
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["pods/log"]
|
|
||||||
verbs: ["get"]
|
|
||||||
---
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: RoleBinding
|
|
||||||
metadata:
|
|
||||||
name: agent-dns
|
|
||||||
namespace: bind-system
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name: agent-dns
|
|
||||||
namespace: bind-system
|
|
||||||
roleRef:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
kind: ClusterRole
|
|
||||||
name: agent-dns
|
|
||||||
@@ -21,7 +21,7 @@ spec:
|
|||||||
runAsNonRoot: true
|
runAsNonRoot: true
|
||||||
containers:
|
containers:
|
||||||
- name: operator
|
- name: operator
|
||||||
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/bind-operator:v0.2.6
|
image: git.unkin.net/unkin/bind-operator:v0.2.1
|
||||||
args:
|
args:
|
||||||
- --metrics-bind-address=:8080
|
- --metrics-bind-address=:8080
|
||||||
- --health-probe-bind-address=:8081
|
- --health-probe-bind-address=:8081
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ resources:
|
|||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
# CRDs are pulled from the bind-operator repo at the matching tag rather than
|
# CRDs are pulled from the bind-operator repo at the matching tag rather than
|
||||||
# vendored here, so they never drift from the operator.
|
# vendored here, so they never drift from the operator.
|
||||||
- https://git.unkin.net/unkin/bind-operator/raw/tag/v0.2.6/config/crd/install.yaml
|
- https://git.unkin.net/unkin/bind-operator/raw/tag/v0.2.1/config/crd/install.yaml
|
||||||
- rbac.yaml
|
- rbac.yaml
|
||||||
- agent-dns-rbac.yaml
|
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
- vpa.yaml
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: autoscaling.k8s.io/v1
|
|
||||||
kind: VerticalPodAutoscaler
|
|
||||||
metadata:
|
|
||||||
name: bind-operator-vpa
|
|
||||||
namespace: bind-system
|
|
||||||
spec:
|
|
||||||
targetRef:
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
name: bind-operator
|
|
||||||
updatePolicy:
|
|
||||||
updateMode: "Off"
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: cephrgw-operator
|
|
||||||
namespace: cephrgw-system
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: cephrgw-operator
|
|
||||||
annotations:
|
|
||||||
# Restart on internal CA rotation only; cephrgw-credentials is Vault-rotated
|
|
||||||
# (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:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/name: cephrgw-operator
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: cephrgw-operator
|
|
||||||
spec:
|
|
||||||
serviceAccountName: cephrgw-operator
|
|
||||||
securityContext:
|
|
||||||
runAsNonRoot: true
|
|
||||||
containers:
|
|
||||||
- name: operator
|
|
||||||
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/cephrgw-operator:v0.4.0
|
|
||||||
args:
|
|
||||||
- --metrics-bind-address=:8080
|
|
||||||
- --health-probe-bind-address=:8081
|
|
||||||
- --leader-elect
|
|
||||||
envFrom:
|
|
||||||
# Provides CEPH_RGW_ACCESS_KEY/SECRET_KEY and the endpoints
|
|
||||||
# (CEPH_RGW_ENDPOINT / CEPH_RGW_ADMIN_ENDPOINT), plus optional
|
|
||||||
# CEPH_RGW_REGION / CEPH_RGW_CA / CEPH_RGW_INSECURE. Rendered from
|
|
||||||
# Vault per docs/ceph-setup.md; not managed in GitOps.
|
|
||||||
- secretRef:
|
|
||||||
name: cephrgw-credentials
|
|
||||||
env:
|
|
||||||
# Trust the internal unkin.net (Vault PKI) CA so the operator can
|
|
||||||
# verify radosgw's TLS cert. vault-ca-cert is reflected into every
|
|
||||||
# namespace from the certificates namespace.
|
|
||||||
- name: CEPH_RGW_CA_FILE
|
|
||||||
value: /etc/vault-ca/ca.crt
|
|
||||||
volumeMounts:
|
|
||||||
- name: vault-ca-cert
|
|
||||||
mountPath: /etc/vault-ca/ca.crt
|
|
||||||
subPath: ca.crt
|
|
||||||
readOnly: true
|
|
||||||
ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
name: metrics
|
|
||||||
- containerPort: 8081
|
|
||||||
name: health
|
|
||||||
readinessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /readyz
|
|
||||||
port: 8081
|
|
||||||
initialDelaySeconds: 5
|
|
||||||
periodSeconds: 10
|
|
||||||
livenessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /healthz
|
|
||||||
port: 8081
|
|
||||||
initialDelaySeconds: 15
|
|
||||||
periodSeconds: 20
|
|
||||||
securityContext:
|
|
||||||
allowPrivilegeEscalation: false
|
|
||||||
readOnlyRootFilesystem: true
|
|
||||||
capabilities:
|
|
||||||
drop: ["ALL"]
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 64Mi
|
|
||||||
limits:
|
|
||||||
cpu: 500m
|
|
||||||
memory: 256Mi
|
|
||||||
volumes:
|
|
||||||
- name: vault-ca-cert
|
|
||||||
secret:
|
|
||||||
secretName: vault-ca-cert
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
|
|
||||||
resources:
|
|
||||||
- namespace.yaml
|
|
||||||
# CRDs are pulled from the cephrgw-operator repo at the matching tag rather
|
|
||||||
# than vendored here, so they never drift from the operator.
|
|
||||||
- https://git.unkin.net/unkin/cephrgw-operator/raw/tag/v0.4.0/config/crd/install.yaml
|
|
||||||
- rbac.yaml
|
|
||||||
- deployment.yaml
|
|
||||||
- vaultauth.yaml
|
|
||||||
- vaultstaticsecret.yaml
|
|
||||||
- vpa.yaml
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: cephrgw-system
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: cephrgw-operator
|
|
||||||
namespace: cephrgw-system
|
|
||||||
---
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: ClusterRole
|
|
||||||
metadata:
|
|
||||||
name: cephrgw-operator
|
|
||||||
rules:
|
|
||||||
- apiGroups: ["ceph.unkin.net"]
|
|
||||||
resources: ["*"]
|
|
||||||
verbs: ["*"]
|
|
||||||
# The operator delivers RGW access/secret keys into Secrets.
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["secrets"]
|
|
||||||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["events"]
|
|
||||||
verbs: ["create", "patch"]
|
|
||||||
- apiGroups: ["coordination.k8s.io"]
|
|
||||||
resources: ["leases"]
|
|
||||||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
||||||
# v0.3.1 startup check reads its own CRDs to warn if they are stale/missing.
|
|
||||||
- apiGroups: ["apiextensions.k8s.io"]
|
|
||||||
resources: ["customresourcedefinitions"]
|
|
||||||
verbs: ["get", "list"]
|
|
||||||
---
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: ClusterRoleBinding
|
|
||||||
metadata:
|
|
||||||
name: cephrgw-operator
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name: cephrgw-operator
|
|
||||||
namespace: cephrgw-system
|
|
||||||
roleRef:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
kind: ClusterRole
|
|
||||||
name: cephrgw-operator
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: secrets.hashicorp.com/v1beta1
|
|
||||||
kind: VaultAuth
|
|
||||||
metadata:
|
|
||||||
name: default
|
|
||||||
namespace: cephrgw-system
|
|
||||||
spec:
|
|
||||||
method: kubernetes
|
|
||||||
mount: k8s/au/syd1
|
|
||||||
vaultConnectionRef: vso-system/default
|
|
||||||
allowedNamespaces:
|
|
||||||
- cephrgw-system
|
|
||||||
kubernetes:
|
|
||||||
# Shared "default" role: binds the namespace's default ServiceAccount and
|
|
||||||
# grants the templated kv/kubernetes/namespace/<ns>/<sa>/* read policy, so
|
|
||||||
# no per-app terraform-vault change is needed.
|
|
||||||
role: default
|
|
||||||
serviceAccount: default
|
|
||||||
audiences:
|
|
||||||
- vault
|
|
||||||
tokenExpirationSeconds: 600
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
---
|
|
||||||
# Renders the radosgw credentials from Vault into the cephrgw-credentials
|
|
||||||
# Secret the operator Deployment consumes via envFrom. The KV secret's keys
|
|
||||||
# (CEPH_RGW_ACCESS_KEY/SECRET_KEY, CEPH_RGW_ENDPOINT, optional
|
|
||||||
# CEPH_RGW_ADMIN_ENDPOINT/REGION/CA) are copied verbatim, so they land as the
|
|
||||||
# matching env vars.
|
|
||||||
#
|
|
||||||
# The path sits under the templated default policy
|
|
||||||
# (kv/data/kubernetes/namespace/<ns>/<sa>/*), so it needs no dedicated Vault
|
|
||||||
# role or policy. Seed the values with:
|
|
||||||
# vault kv put kv/kubernetes/namespace/cephrgw-system/default/cephrgw-credentials \
|
|
||||||
# CEPH_RGW_ENDPOINT=https://s3.ceph.unkin.net \
|
|
||||||
# CEPH_RGW_ADMIN_ENDPOINT=https://radosgw.service.consul:443 \
|
|
||||||
# CEPH_RGW_ACCESS_KEY=... CEPH_RGW_SECRET_KEY=...
|
|
||||||
apiVersion: secrets.hashicorp.com/v1beta1
|
|
||||||
kind: VaultStaticSecret
|
|
||||||
metadata:
|
|
||||||
name: cephrgw-credentials
|
|
||||||
namespace: cephrgw-system
|
|
||||||
spec:
|
|
||||||
vaultAuthRef: default
|
|
||||||
mount: kv
|
|
||||||
type: kv-v2
|
|
||||||
path: kubernetes/namespace/cephrgw-system/default/cephrgw-credentials
|
|
||||||
refreshAfter: 5m
|
|
||||||
hmacSecretData: true
|
|
||||||
destination:
|
|
||||||
name: cephrgw-credentials
|
|
||||||
create: true
|
|
||||||
overwrite: true
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: autoscaling.k8s.io/v1
|
|
||||||
kind: VerticalPodAutoscaler
|
|
||||||
metadata:
|
|
||||||
name: cephrgw-operator-vpa
|
|
||||||
namespace: cephrgw-system
|
|
||||||
spec:
|
|
||||||
targetRef:
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
name: cephrgw-operator
|
|
||||||
updatePolicy:
|
|
||||||
updateMode: "Off"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: cert-manager.io/v1
|
|
||||||
kind: ClusterIssuer
|
|
||||||
metadata:
|
|
||||||
name: letsencrypt-staging
|
|
||||||
spec:
|
|
||||||
acme:
|
|
||||||
server: https://acme-staging-v02.api.letsencrypt.org/directory
|
|
||||||
email: admin@unkin.net
|
|
||||||
privateKeySecretRef:
|
|
||||||
name: letsencrypt-staging-account-key
|
|
||||||
solvers:
|
|
||||||
- dns01:
|
|
||||||
cnameStrategy: Follow
|
|
||||||
rfc2136:
|
|
||||||
nameserver: "198.18.199.53:53"
|
|
||||||
tsigKeyName: certmanager
|
|
||||||
tsigAlgorithm: HMACSHA256
|
|
||||||
tsigSecretSecretRef:
|
|
||||||
name: certmanager-tsig
|
|
||||||
key: secret
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: cert-manager.io/v1
|
|
||||||
kind: ClusterIssuer
|
|
||||||
metadata:
|
|
||||||
name: letsencrypt
|
|
||||||
spec:
|
|
||||||
acme:
|
|
||||||
server: https://acme-v02.api.letsencrypt.org/directory
|
|
||||||
email: admin@unkin.net
|
|
||||||
privateKeySecretRef:
|
|
||||||
name: letsencrypt-account-key
|
|
||||||
solvers:
|
|
||||||
- dns01:
|
|
||||||
cnameStrategy: Follow
|
|
||||||
rfc2136:
|
|
||||||
nameserver: "198.18.199.53:53"
|
|
||||||
tsigKeyName: certmanager
|
|
||||||
tsigAlgorithm: HMACSHA256
|
|
||||||
tsigSecretSecretRef:
|
|
||||||
name: certmanager-tsig
|
|
||||||
key: secret
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: cert-manager.io/v1
|
|
||||||
kind: ClusterIssuer
|
|
||||||
metadata:
|
|
||||||
name: vault-issuer
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/instance: cert-manager-config
|
|
||||||
app.kubernetes.io/managed-by: Helm
|
|
||||||
app.kubernetes.io/name: cert-manager-config
|
|
||||||
annotations:
|
|
||||||
meta.helm.sh/release-name: cert-manager-clusterissuer
|
|
||||||
meta.helm.sh/release-namespace: cert-manager
|
|
||||||
spec:
|
|
||||||
vault:
|
|
||||||
server: https://vault.service.consul:8200
|
|
||||||
path: pki_int/sign/servers_default
|
|
||||||
caBundleSecretRef:
|
|
||||||
key: ca.crt
|
|
||||||
name: vault-ca-cert
|
|
||||||
auth:
|
|
||||||
kubernetes:
|
|
||||||
mountPath: /v1/auth/k8s/au/syd1
|
|
||||||
role: cert_manager_issuer
|
|
||||||
serviceAccountRef:
|
|
||||||
name: cert-manager-vault-issuer
|
|
||||||
audiences:
|
|
||||||
- vault
|
|
||||||
@@ -7,7 +7,4 @@ resources:
|
|||||||
- serviceaccount.yaml
|
- serviceaccount.yaml
|
||||||
- clusterrole.yaml
|
- clusterrole.yaml
|
||||||
- clusterrolebinding.yaml
|
- clusterrolebinding.yaml
|
||||||
- clusterissuer_vault-issuer.yaml
|
|
||||||
- vmservicescrape.yaml
|
- vmservicescrape.yaml
|
||||||
- clusterissuer_letsencrypt.yaml
|
|
||||||
- clusterissuer_letsencrypt-staging.yaml
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
---
|
---
|
||||||
# pre-commit: allow-plain-secret -- public CA bundle; this secret bootstraps
|
|
||||||
# trust in Vault itself and therefore cannot be Vault-sourced.
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -30,7 +28,7 @@ stringData:
|
|||||||
mitItX+RAgMBAAGjgewwgekwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMB
|
mitItX+RAgMBAAGjgewwgekwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMB
|
||||||
Af8wHQYDVR0OBBYEFEp/+grAdVqRSeb9xJjSeZYNW32MMB8GA1UdIwQYMBaAFBqc
|
Af8wHQYDVR0OBBYEFEp/+grAdVqRSeb9xJjSeZYNW32MMB8GA1UdIwQYMBaAFBqc
|
||||||
v6Y+hfHt4EjgKa/uoQGEHTknMEcGCCsGAQUFBwEBBDswOTA3BggrBgEFBQcwAoYr
|
v6Y+hfHt4EjgKa/uoQGEHTknMEcGCCsGAQUFBwEBBDswOTA3BggrBgEFBQcwAoYr
|
||||||
aHR0cHM6Ly92YXVsdC5zZXJ2dWNlLmNvbnN1bC92MS9wa2lfcm9vdC9jYTA9BgNV
|
aHR0cHM6Ly92YXVsdC5zZXJ2aWNlLmNvbnN1bC92MS9wa2lfcm9vdC9jYTA9BgNV
|
||||||
HR8ENjA0MDKgMKAuhixodHRwczovL3ZhdWx0LnNlcnZpY2UuY29uc3VsL3YxL3Br
|
HR8ENjA0MDKgMKAuhixodHRwczovL3ZhdWx0LnNlcnZpY2UuY29uc3VsL3YxL3Br
|
||||||
aV9yb290L2NybDANBgkqhkiG9w0BAQsFAAOCAQEAM0FS8tscZe7yly/gM7jO6lx5
|
aV9yb290L2NybDANBgkqhkiG9w0BAQsFAAOCAQEAM0FS8tscZe7yly/gM7jO6lx5
|
||||||
muMFusifjUIrcQGnZBkoECeuUVPNTs3e/Th+XaxjCnmSpqSNT3z9Irr6Hhxf7n03
|
muMFusifjUIrcQGnZBkoECeuUVPNTs3e/Th+XaxjCnmSpqSNT3z9Irr6Hhxf7n03
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
|
|
||||||
resources:
|
|
||||||
- namespace.yaml
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: clickhouse-system
|
|
||||||
name: clickhouse-system
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
# consul (k8s)
|
|
||||||
|
|
||||||
Consul server cluster (DC `au-syd1`), deployed via the HashiCorp helm chart with
|
|
||||||
ACLs enabled (`default_policy: deny`, parity with the VM cluster).
|
|
||||||
|
|
||||||
## API access (ACL auth)
|
|
||||||
|
|
||||||
The HTTP API and UI are served on port 8500 behind the gateway at
|
|
||||||
`https://consul.k8s.syd1.au.unkin.net` (and `https://consul.service.consul`).
|
|
||||||
With ACLs enabled, requests beyond the anonymous policy require a token:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# management (bootstrap) token — seeded from Vault, synced by VSO into the
|
|
||||||
# consul-bootstrap-acl-token secret; same value as the VM cluster's
|
|
||||||
# initial_management token:
|
|
||||||
CONSUL_HTTP_TOKEN=$(vault kv get -field=token kv/kubernetes/namespace/consul/default/bootstrap-acl-token)
|
|
||||||
|
|
||||||
curl -H "X-Consul-Token: $CONSUL_HTTP_TOKEN" https://consul.k8s.syd1.au.unkin.net/v1/status/leader
|
|
||||||
|
|
||||||
# consul CLI:
|
|
||||||
CONSUL_HTTP_ADDR=https://consul.k8s.syd1.au.unkin.net CONSUL_HTTP_TOKEN=$CONSUL_HTTP_TOKEN consul members
|
|
||||||
```
|
|
||||||
|
|
||||||
The UI at the same hostname exposes an ACL login (top right) — paste a token.
|
|
||||||
Anonymous requests get the anonymous-token policy only (reads for DNS/service
|
|
||||||
discovery; no writes, no ACL/token APIs).
|
|
||||||
|
|
||||||
Prefer short-lived tokens minted by Vault's consul secrets engine over the
|
|
||||||
management token for day-to-day use; the terraform-* CI roles already work this
|
|
||||||
way.
|
|
||||||
@@ -46,8 +46,8 @@ spec:
|
|||||||
- backendRefs:
|
- backendRefs:
|
||||||
- group: ""
|
- group: ""
|
||||||
kind: Service
|
kind: Service
|
||||||
name: consul-http
|
name: consul-ui
|
||||||
port: 8500
|
port: 80
|
||||||
weight: 1
|
weight: 1
|
||||||
matches:
|
matches:
|
||||||
- path:
|
- path:
|
||||||
@@ -74,8 +74,8 @@ spec:
|
|||||||
- backendRefs:
|
- backendRefs:
|
||||||
- group: ""
|
- group: ""
|
||||||
kind: Service
|
kind: Service
|
||||||
name: consul-http
|
name: consul-ui
|
||||||
port: 8500
|
port: 80
|
||||||
weight: 1
|
weight: 1
|
||||||
matches:
|
matches:
|
||||||
- path:
|
- path:
|
||||||
|
|||||||
@@ -6,6 +6,3 @@ resources:
|
|||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
- gateway.yaml
|
- gateway.yaml
|
||||||
- httproute.yaml
|
- httproute.yaml
|
||||||
- service.yaml
|
|
||||||
- vaultauth.yaml
|
|
||||||
- vaultstaticsecret.yaml
|
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
# ClusterIP service targeting the consul server pods' HTTP API (8500).
|
|
||||||
# The HashiCorp chart only ships consul-ui (also 8500 via the server pods)
|
|
||||||
# and the headless consul-server; this named service gives the Gateway a
|
|
||||||
# stable API backend. Consul serves both the HTTP API and the UI (at /ui/)
|
|
||||||
# on this same port, so routing the API hostname here preserves the UI too.
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: consul-http
|
|
||||||
namespace: consul
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: consul
|
|
||||||
app.kubernetes.io/instance: consul
|
|
||||||
spec:
|
|
||||||
type: ClusterIP
|
|
||||||
selector:
|
|
||||||
app: consul
|
|
||||||
component: server
|
|
||||||
release: consul
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
port: 8500
|
|
||||||
protocol: TCP
|
|
||||||
targetPort: 8500
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: secrets.hashicorp.com/v1beta1
|
|
||||||
kind: VaultAuth
|
|
||||||
metadata:
|
|
||||||
name: default
|
|
||||||
namespace: consul
|
|
||||||
spec:
|
|
||||||
allowedNamespaces:
|
|
||||||
- consul
|
|
||||||
kubernetes:
|
|
||||||
audiences:
|
|
||||||
- vault
|
|
||||||
role: default
|
|
||||||
serviceAccount: default
|
|
||||||
tokenExpirationSeconds: 600
|
|
||||||
method: kubernetes
|
|
||||||
mount: k8s/au/syd1
|
|
||||||
vaultConnectionRef: vso-system/default
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: secrets.hashicorp.com/v1beta1
|
|
||||||
kind: VaultStaticSecret
|
|
||||||
metadata:
|
|
||||||
name: bootstrap-acl-token
|
|
||||||
namespace: consul
|
|
||||||
spec:
|
|
||||||
destination:
|
|
||||||
create: true
|
|
||||||
name: consul-bootstrap-acl-token
|
|
||||||
overwrite: true
|
|
||||||
hmacSecretData: true
|
|
||||||
mount: kv
|
|
||||||
path: kubernetes/namespace/consul/default/bootstrap-acl-token
|
|
||||||
refreshAfter: 5m
|
|
||||||
type: kv-v2
|
|
||||||
vaultAuthRef: default
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
# Terraform-friendly REST API for KeaSubnet/KeaClientClass CRUD. The bearer
|
|
||||||
# token Secret is generated by the operator when absent (no plain Secret is
|
|
||||||
# committed here); it can later be pre-seeded from Vault under the same name.
|
|
||||||
apiVersion: kea.unkin.net/v1alpha1
|
|
||||||
kind: KeaAPI
|
|
||||||
metadata:
|
|
||||||
name: kea-api
|
|
||||||
namespace: dhcp-system
|
|
||||||
annotations:
|
|
||||||
argocd.argoproj.io/sync-wave: "1"
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
image: git.unkin.net/unkin/kea-api:v0.1.2
|
|
||||||
tokenSecretName: kea-api-token
|
|
||||||
service:
|
|
||||||
type: ClusterIP
|
|
||||||
port: 8080
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 64Mi
|
|
||||||
limits:
|
|
||||||
cpu: "1"
|
|
||||||
memory: 256Mi
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
# PXE boot classes matching client architecture (option 93), replacing the
|
|
||||||
# legacy dhcpd "Legacy" and "UEFI-64" classes. Object names are lowercased to
|
|
||||||
# satisfy RFC1123 (the operator renders the kea class name from metadata.name).
|
|
||||||
---
|
|
||||||
apiVersion: kea.unkin.net/v1alpha1
|
|
||||||
kind: KeaClientClass
|
|
||||||
metadata:
|
|
||||||
name: legacy
|
|
||||||
namespace: dhcp-system
|
|
||||||
annotations:
|
|
||||||
argocd.argoproj.io/sync-wave: "1"
|
|
||||||
spec:
|
|
||||||
clusterRef: kea
|
|
||||||
archHex: ["0x0000"]
|
|
||||||
bootFileName: /undionly.kpxe
|
|
||||||
---
|
|
||||||
apiVersion: kea.unkin.net/v1alpha1
|
|
||||||
kind: KeaClientClass
|
|
||||||
metadata:
|
|
||||||
name: uefi-64
|
|
||||||
namespace: dhcp-system
|
|
||||||
annotations:
|
|
||||||
argocd.argoproj.io/sync-wave: "1"
|
|
||||||
spec:
|
|
||||||
clusterRef: kea
|
|
||||||
archHex: ["0x0007", "0x0009"]
|
|
||||||
bootFileName: /ipxe.efi
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
# HA pair fronted by a PureLB anycast Service on a NEW, unused common-pool IP
|
|
||||||
# (198.18.200.10). This is intentionally NOT the current isc-dhcpd anycast
|
|
||||||
# address (198.18.19.18) -- the production cutover is a separate later task.
|
|
||||||
apiVersion: kea.unkin.net/v1alpha1
|
|
||||||
kind: KeaCluster
|
|
||||||
metadata:
|
|
||||||
name: kea
|
|
||||||
namespace: dhcp-system
|
|
||||||
annotations:
|
|
||||||
argocd.argoproj.io/sync-wave: "1"
|
|
||||||
spec:
|
|
||||||
replicas: 2
|
|
||||||
image: git.unkin.net/unkin/kea:v0.1.2
|
|
||||||
domainName: main.unkin.net
|
|
||||||
defaultLeaseTime: 1200
|
|
||||||
maxLeaseTime: 86400
|
|
||||||
# No ntpServers: DHCP option 42 (ntp-servers) carries IPv4 addresses only, so
|
|
||||||
# the rotating AU pool.ntp.org hostnames cannot be delivered this way (kea
|
|
||||||
# rejects them at config load). Add concrete NTP server IPs here if needed.
|
|
||||||
ha:
|
|
||||||
mode: hot-standby
|
|
||||||
service:
|
|
||||||
type: LoadBalancer
|
|
||||||
ipAddressPool: common
|
|
||||||
loadBalancerIP: 198.18.200.10
|
|
||||||
annotations:
|
|
||||||
purelb.io/addresses: 198.18.200.10
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 128Mi
|
|
||||||
limits:
|
|
||||||
cpu: "1"
|
|
||||||
memory: 512Mi
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
# Translation of the legacy ISC dhcpd pools (puppet
|
|
||||||
# roles/infra/dhcp/server.yaml): 198.18.13-17.0/24, each a .200-.220 pool,
|
|
||||||
# next-server 198.18.19.19. Gateways per the original config:
|
|
||||||
# .13/.14/.15/.16 -> .254, .17 -> .1. DNS points at the in-cluster
|
|
||||||
# bind-resolvers PureLB IP (198.18.200.7), not the legacy 198.18.19.15.
|
|
||||||
---
|
|
||||||
apiVersion: kea.unkin.net/v1alpha1
|
|
||||||
kind: KeaSubnet
|
|
||||||
metadata:
|
|
||||||
name: net-198-18-13
|
|
||||||
namespace: dhcp-system
|
|
||||||
annotations:
|
|
||||||
argocd.argoproj.io/sync-wave: "1"
|
|
||||||
spec:
|
|
||||||
clusterRef: kea
|
|
||||||
subnet: 198.18.13.0/24
|
|
||||||
pools:
|
|
||||||
- 198.18.13.200 - 198.18.13.220
|
|
||||||
routers: [198.18.13.254]
|
|
||||||
dnsServers: [198.18.200.7]
|
|
||||||
domainName: main.unkin.net
|
|
||||||
nextServer: 198.18.19.19
|
|
||||||
---
|
|
||||||
apiVersion: kea.unkin.net/v1alpha1
|
|
||||||
kind: KeaSubnet
|
|
||||||
metadata:
|
|
||||||
name: net-198-18-14
|
|
||||||
namespace: dhcp-system
|
|
||||||
annotations:
|
|
||||||
argocd.argoproj.io/sync-wave: "1"
|
|
||||||
spec:
|
|
||||||
clusterRef: kea
|
|
||||||
subnet: 198.18.14.0/24
|
|
||||||
pools:
|
|
||||||
- 198.18.14.200 - 198.18.14.220
|
|
||||||
routers: [198.18.14.254]
|
|
||||||
dnsServers: [198.18.200.7]
|
|
||||||
domainName: main.unkin.net
|
|
||||||
nextServer: 198.18.19.19
|
|
||||||
---
|
|
||||||
apiVersion: kea.unkin.net/v1alpha1
|
|
||||||
kind: KeaSubnet
|
|
||||||
metadata:
|
|
||||||
name: net-198-18-15
|
|
||||||
namespace: dhcp-system
|
|
||||||
annotations:
|
|
||||||
argocd.argoproj.io/sync-wave: "1"
|
|
||||||
spec:
|
|
||||||
clusterRef: kea
|
|
||||||
subnet: 198.18.15.0/24
|
|
||||||
pools:
|
|
||||||
- 198.18.15.200 - 198.18.15.220
|
|
||||||
routers: [198.18.15.254]
|
|
||||||
dnsServers: [198.18.200.7]
|
|
||||||
domainName: main.unkin.net
|
|
||||||
nextServer: 198.18.19.19
|
|
||||||
---
|
|
||||||
apiVersion: kea.unkin.net/v1alpha1
|
|
||||||
kind: KeaSubnet
|
|
||||||
metadata:
|
|
||||||
name: net-198-18-16
|
|
||||||
namespace: dhcp-system
|
|
||||||
annotations:
|
|
||||||
argocd.argoproj.io/sync-wave: "1"
|
|
||||||
spec:
|
|
||||||
clusterRef: kea
|
|
||||||
subnet: 198.18.16.0/24
|
|
||||||
pools:
|
|
||||||
- 198.18.16.200 - 198.18.16.220
|
|
||||||
routers: [198.18.16.254]
|
|
||||||
dnsServers: [198.18.200.7]
|
|
||||||
domainName: main.unkin.net
|
|
||||||
nextServer: 198.18.19.19
|
|
||||||
---
|
|
||||||
apiVersion: kea.unkin.net/v1alpha1
|
|
||||||
kind: KeaSubnet
|
|
||||||
metadata:
|
|
||||||
name: net-198-18-17
|
|
||||||
namespace: dhcp-system
|
|
||||||
annotations:
|
|
||||||
argocd.argoproj.io/sync-wave: "1"
|
|
||||||
spec:
|
|
||||||
clusterRef: kea
|
|
||||||
subnet: 198.18.17.0/24
|
|
||||||
pools:
|
|
||||||
- 198.18.17.200 - 198.18.17.220
|
|
||||||
routers: [198.18.17.1]
|
|
||||||
dnsServers: [198.18.200.7]
|
|
||||||
domainName: main.unkin.net
|
|
||||||
nextServer: 198.18.19.19
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: kea-operator
|
|
||||||
namespace: dhcp-system
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: kea-operator
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/name: kea-operator
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: kea-operator
|
|
||||||
spec:
|
|
||||||
serviceAccountName: kea-operator
|
|
||||||
securityContext:
|
|
||||||
runAsNonRoot: true
|
|
||||||
containers:
|
|
||||||
- name: operator
|
|
||||||
image: git.unkin.net/unkin/kea-operator:v0.1.2
|
|
||||||
args:
|
|
||||||
- --metrics-bind-address=:8080
|
|
||||||
- --health-probe-bind-address=:8081
|
|
||||||
ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
name: metrics
|
|
||||||
- containerPort: 8081
|
|
||||||
name: health
|
|
||||||
readinessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /readyz
|
|
||||||
port: 8081
|
|
||||||
initialDelaySeconds: 5
|
|
||||||
periodSeconds: 10
|
|
||||||
livenessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /healthz
|
|
||||||
port: 8081
|
|
||||||
initialDelaySeconds: 15
|
|
||||||
periodSeconds: 20
|
|
||||||
securityContext:
|
|
||||||
allowPrivilegeEscalation: false
|
|
||||||
readOnlyRootFilesystem: true
|
|
||||||
capabilities:
|
|
||||||
drop: ["ALL"]
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 64Mi
|
|
||||||
limits:
|
|
||||||
cpu: 500m
|
|
||||||
memory: 256Mi
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
|
|
||||||
resources:
|
|
||||||
- namespace.yaml
|
|
||||||
# CRDs are pulled from the kea-operator repo at the matching tag rather than
|
|
||||||
# vendored here, so they never drift from the operator.
|
|
||||||
- https://git.unkin.net/unkin/kea-operator/raw/tag/v0.1.0/config/crd/install.yaml
|
|
||||||
- rbac.yaml
|
|
||||||
- deployment.yaml
|
|
||||||
- vpa.yaml
|
|
||||||
# CRs (sync-wave 1) reconcile after the operator + CRDs are established.
|
|
||||||
- cr/keacluster.yaml
|
|
||||||
- cr/keasubnets.yaml
|
|
||||||
- cr/keaclientclasses.yaml
|
|
||||||
- cr/keaapi.yaml
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: dhcp-system
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name: kea-operator
|
|
||||||
namespace: dhcp-system
|
|
||||||
---
|
|
||||||
# Sourced from the kea-operator repo config/rbac/role.yaml (v0.1.0). Leader
|
|
||||||
# election is disabled so no coordination.k8s.io/leases grant is needed.
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: ClusterRole
|
|
||||||
metadata:
|
|
||||||
name: kea-operator
|
|
||||||
rules:
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["configmaps", "secrets", "serviceaccounts", "services"]
|
|
||||||
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["pods"]
|
|
||||||
verbs: ["get", "list", "watch"]
|
|
||||||
- apiGroups: ["apps"]
|
|
||||||
resources: ["deployments", "statefulsets"]
|
|
||||||
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
|
|
||||||
- apiGroups: ["kea.unkin.net"]
|
|
||||||
resources: ["keaapis", "keaclientclasses", "keaclusters", "keasubnets"]
|
|
||||||
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
|
|
||||||
- apiGroups: ["kea.unkin.net"]
|
|
||||||
resources:
|
|
||||||
["keaapis/status", "keaclientclasses/status", "keaclusters/status", "keasubnets/status"]
|
|
||||||
verbs: ["get", "patch", "update"]
|
|
||||||
- apiGroups: ["rbac.authorization.k8s.io"]
|
|
||||||
resources: ["rolebindings", "roles"]
|
|
||||||
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
|
|
||||||
---
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: ClusterRoleBinding
|
|
||||||
metadata:
|
|
||||||
name: kea-operator
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name: kea-operator
|
|
||||||
namespace: dhcp-system
|
|
||||||
roleRef:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
kind: ClusterRole
|
|
||||||
name: kea-operator
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: autoscaling.k8s.io/v1
|
|
||||||
kind: VerticalPodAutoscaler
|
|
||||||
metadata:
|
|
||||||
name: kea-operator-vpa
|
|
||||||
namespace: dhcp-system
|
|
||||||
spec:
|
|
||||||
targetRef:
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
name: kea-operator
|
|
||||||
updatePolicy:
|
|
||||||
updateMode: "Off"
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
---
|
|
||||||
# Ceph RGW (S3) backup target for the encapi 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.
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: ObjectStoreUser
|
|
||||||
metadata:
|
|
||||||
name: cnpg-encapi-backup
|
|
||||||
namespace: encapi
|
|
||||||
spec:
|
|
||||||
displayName: "CNPG backup owner (encapi)"
|
|
||||||
# RGW users are global; keep the uid namespace-qualified so it never collides.
|
|
||||||
uid: cnpg-encapi-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.
|
|
||||||
secretName: cnpg-encapi-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.
|
|
||||||
retainOnDelete: true
|
|
||||||
---
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: Bucket
|
|
||||||
metadata:
|
|
||||||
name: cnpg-encapi
|
|
||||||
namespace: encapi
|
|
||||||
spec:
|
|
||||||
placementTarget: ec
|
|
||||||
bucketName: cnpg-encapi
|
|
||||||
# The owner user has full control of its own bucket (read + write), which is
|
|
||||||
# all the backup/restore identity needs — no extra BucketAccess grant.
|
|
||||||
ownerRef: cnpg-encapi-backup
|
|
||||||
versioning: false
|
|
||||||
tags:
|
|
||||||
app: encapi
|
|
||||||
purpose: cnpg-backup
|
|
||||||
# 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).
|
|
||||||
apiVersion: postgresql.cnpg.io/v1
|
|
||||||
kind: ScheduledBackup
|
|
||||||
metadata:
|
|
||||||
name: cnpg-encapi-nightly
|
|
||||||
namespace: encapi
|
|
||||||
spec:
|
|
||||||
schedule: "0 40 2 * * *"
|
|
||||||
immediate: false
|
|
||||||
backupOwnerReference: self
|
|
||||||
method: barmanObjectStore
|
|
||||||
cluster:
|
|
||||||
name: postgres
|
|
||||||
@@ -7,35 +7,6 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
affinity:
|
affinity:
|
||||||
podAntiAffinityType: preferred
|
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-encapi
|
|
||||||
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).
|
|
||||||
endpointCA:
|
|
||||||
name: vault-ca-cert
|
|
||||||
key: ca.crt
|
|
||||||
# Keys minted by the ObjectStoreUser in cnpg_backup.yaml; never hardcoded.
|
|
||||||
s3Credentials:
|
|
||||||
accessKeyId:
|
|
||||||
name: cnpg-encapi-backup-s3
|
|
||||||
key: AWS_ACCESS_KEY_ID
|
|
||||||
secretAccessKey:
|
|
||||||
name: cnpg-encapi-backup-s3
|
|
||||||
key: AWS_SECRET_ACCESS_KEY
|
|
||||||
# Path prefix within the bucket; keep stable across restores (see docs).
|
|
||||||
serverName: encapi
|
|
||||||
data:
|
|
||||||
compression: bzip2
|
|
||||||
jobs: 2
|
|
||||||
wal:
|
|
||||||
compression: zstd
|
|
||||||
maxParallel: 2
|
|
||||||
bootstrap:
|
bootstrap:
|
||||||
initdb:
|
initdb:
|
||||||
database: encapi
|
database: encapi
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
name: encapi
|
name: encapi
|
||||||
namespace: encapi
|
namespace: encapi
|
||||||
annotations:
|
annotations:
|
||||||
configmap.reloader.stakater.com/auto: "true"
|
reloader.stakater.com/auto: "true"
|
||||||
spec:
|
spec:
|
||||||
replicas: 2
|
replicas: 2
|
||||||
selector:
|
selector:
|
||||||
@@ -23,7 +23,7 @@ spec:
|
|||||||
automountServiceAccountToken: true
|
automountServiceAccountToken: true
|
||||||
containers:
|
containers:
|
||||||
- name: encapi
|
- name: encapi
|
||||||
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/encapi:v0.1.1
|
image: git.unkin.net/unkin/encapi:v0.1.1
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8000
|
- containerPort: 8000
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ resources:
|
|||||||
- gateway.yaml
|
- gateway.yaml
|
||||||
- httproute.yaml
|
- httproute.yaml
|
||||||
- cnpg_cluster.yaml
|
- cnpg_cluster.yaml
|
||||||
- cnpg_backup.yaml
|
|
||||||
- cnpg_pooler.yaml
|
- cnpg_pooler.yaml
|
||||||
- vaultauth.yaml
|
- vaultauth.yaml
|
||||||
- vaultstaticsecret.yaml
|
- vaultstaticsecret.yaml
|
||||||
- vpa.yaml
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: autoscaling.k8s.io/v1
|
|
||||||
kind: VerticalPodAutoscaler
|
|
||||||
metadata:
|
|
||||||
name: encapi-vpa
|
|
||||||
namespace: encapi
|
|
||||||
spec:
|
|
||||||
targetRef:
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
name: encapi
|
|
||||||
updatePolicy:
|
|
||||||
updateMode: "Off"
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
# Confines the agent-dns service account (in bind-system) to the agent-dns
|
|
||||||
# ClusterRole within this namespace.
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: RoleBinding
|
|
||||||
metadata:
|
|
||||||
name: agent-dns
|
|
||||||
namespace: externaldns
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name: agent-dns
|
|
||||||
namespace: bind-system
|
|
||||||
roleRef:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
kind: ClusterRole
|
|
||||||
name: agent-dns
|
|
||||||
@@ -6,4 +6,3 @@ resources:
|
|||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
- vaultauth.yaml
|
- vaultauth.yaml
|
||||||
- vaultstaticsecret.yaml
|
- vaultstaticsecret.yaml
|
||||||
- agent-dns-rolebinding.yaml
|
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
---
|
|
||||||
# Ceph RGW (S3) backup target for the gitea CNPG cluster, provisioned by the
|
|
||||||
# in-estate cephrgw-operator. One dedicated bucket + owner user per cluster.
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: ObjectStoreUser
|
|
||||||
metadata:
|
|
||||||
name: cnpg-gitea-backup
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
displayName: "CNPG backup owner (gitea)"
|
|
||||||
# RGW users are global; keep the uid namespace-qualified so it never collides.
|
|
||||||
uid: cnpg-gitea-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.
|
|
||||||
secretName: cnpg-gitea-backup-s3
|
|
||||||
retainOnDelete: true
|
|
||||||
---
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: Bucket
|
|
||||||
metadata:
|
|
||||||
name: cnpg-gitea
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
bucketName: cnpg-gitea
|
|
||||||
ownerRef: cnpg-gitea-backup
|
|
||||||
versioning: false
|
|
||||||
tags:
|
|
||||||
app: gitea
|
|
||||||
purpose: cnpg-backup
|
|
||||||
retainOnDelete: true
|
|
||||||
---
|
|
||||||
apiVersion: postgresql.cnpg.io/v1
|
|
||||||
kind: ScheduledBackup
|
|
||||||
metadata:
|
|
||||||
name: cnpg-gitea-nightly
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
# 6-field CNPG cron (seconds first). 04:00 — next free slot after netbox
|
|
||||||
# (03:40), keeping the estate's 20-minute stagger.
|
|
||||||
schedule: "0 0 4 * * *"
|
|
||||||
immediate: false
|
|
||||||
backupOwnerReference: self
|
|
||||||
method: barmanObjectStore
|
|
||||||
cluster:
|
|
||||||
name: gitea-postgres
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
---
|
|
||||||
# Postgres for the k8s Gitea (replaces the Patroni-shared DB the VM uses). Gitea
|
|
||||||
# already runs on Postgres, so cutover is a plain pg dump/restore (no engine
|
|
||||||
# conversion). App-user creds come from the postgres-credentials Vault secret.
|
|
||||||
apiVersion: postgresql.cnpg.io/v1
|
|
||||||
kind: Cluster
|
|
||||||
metadata:
|
|
||||||
name: gitea-postgres
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
affinity:
|
|
||||||
podAntiAffinityType: preferred
|
|
||||||
backup:
|
|
||||||
# 30-day retention. 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-gitea
|
|
||||||
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).
|
|
||||||
endpointCA:
|
|
||||||
name: vault-ca-cert
|
|
||||||
key: ca.crt
|
|
||||||
# Keys minted by the ObjectStoreUser in cnpg_backup.yaml; never hardcoded.
|
|
||||||
s3Credentials:
|
|
||||||
accessKeyId:
|
|
||||||
name: cnpg-gitea-backup-s3
|
|
||||||
key: AWS_ACCESS_KEY_ID
|
|
||||||
secretAccessKey:
|
|
||||||
name: cnpg-gitea-backup-s3
|
|
||||||
key: AWS_SECRET_ACCESS_KEY
|
|
||||||
# Path prefix within the bucket; keep stable across restores (see docs).
|
|
||||||
serverName: gitea
|
|
||||||
data:
|
|
||||||
compression: bzip2
|
|
||||||
jobs: 2
|
|
||||||
wal:
|
|
||||||
compression: zstd
|
|
||||||
maxParallel: 2
|
|
||||||
bootstrap:
|
|
||||||
initdb:
|
|
||||||
database: gitea
|
|
||||||
encoding: UTF8
|
|
||||||
localeCType: C
|
|
||||||
localeCollate: C
|
|
||||||
owner: gitea
|
|
||||||
secret:
|
|
||||||
name: postgres-credentials
|
|
||||||
enablePDB: true
|
|
||||||
enableSuperuserAccess: false
|
|
||||||
failoverDelay: 0
|
|
||||||
imageName: ghcr.io/cloudnative-pg/postgresql:18.1-system-trixie
|
|
||||||
instances: 2
|
|
||||||
logLevel: info
|
|
||||||
monitoring:
|
|
||||||
customQueriesConfigMap:
|
|
||||||
- key: queries
|
|
||||||
name: cnpg-default-monitoring
|
|
||||||
disableDefaultQueries: false
|
|
||||||
enablePodMonitor: false
|
|
||||||
postgresql:
|
|
||||||
parameters:
|
|
||||||
max_connections: "200"
|
|
||||||
shared_buffers: 256MB
|
|
||||||
primaryUpdateMethod: restart
|
|
||||||
primaryUpdateStrategy: unsupervised
|
|
||||||
replicationSlots:
|
|
||||||
highAvailability:
|
|
||||||
enabled: true
|
|
||||||
slotPrefix: _cnpg_
|
|
||||||
synchronizeReplicas:
|
|
||||||
enabled: true
|
|
||||||
updateInterval: 30
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: "2"
|
|
||||||
memory: 2Gi
|
|
||||||
requests:
|
|
||||||
cpu: 250m
|
|
||||||
memory: 512Mi
|
|
||||||
smartShutdownTimeout: 180
|
|
||||||
startDelay: 3600
|
|
||||||
stopDelay: 1800
|
|
||||||
storage:
|
|
||||||
resizeInUseVolumes: true
|
|
||||||
size: 20Gi
|
|
||||||
storageClass: cephrbd-fast-delete
|
|
||||||
switchoverDelay: 3600
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
---
|
|
||||||
# pgbouncer in front of the primary. Gitea opens a connection per request and
|
|
||||||
# benefits from pooling under multiple app replicas. Session mode keeps Gitea's
|
|
||||||
# occasional session-scoped state (advisory locks, LISTEN/NOTIFY) working.
|
|
||||||
apiVersion: postgresql.cnpg.io/v1
|
|
||||||
kind: Pooler
|
|
||||||
metadata:
|
|
||||||
name: gitea-postgres-pooler-rw
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
cluster:
|
|
||||||
name: gitea-postgres
|
|
||||||
instances: 2
|
|
||||||
pgbouncer:
|
|
||||||
parameters:
|
|
||||||
default_pool_size: "50"
|
|
||||||
max_client_conn: "200"
|
|
||||||
paused: false
|
|
||||||
poolMode: session
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: pooler-rw
|
|
||||||
spec:
|
|
||||||
affinity:
|
|
||||||
podAntiAffinity:
|
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
- labelSelector:
|
|
||||||
matchExpressions:
|
|
||||||
- key: app
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
- pooler-rw
|
|
||||||
topologyKey: kubernetes.io/hostname
|
|
||||||
containers: []
|
|
||||||
type: rw
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
---
|
|
||||||
# HTTPS front for the k8s Gitea, served on two names:
|
|
||||||
# git.unkin.net — canonical/production (apex, bind-operator zone;
|
|
||||||
# DNS flip is the gated cutover step, see the doc)
|
|
||||||
# git.k8s.syd1.au.unkin.net — admin/backup route (external-dns k8s.syd1 zone),
|
|
||||||
# same dual-name pattern as identity.unkin.net.
|
|
||||||
# The cert-manager Certificate (vault-issuer) takes CN git.unkin.net and gets a
|
|
||||||
# DNS SAN for each TLS listener hostname automatically.
|
|
||||||
apiVersion: gateway.networking.k8s.io/v1
|
|
||||||
kind: Gateway
|
|
||||||
metadata:
|
|
||||||
name: gitea
|
|
||||||
namespace: gitea
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: gitea
|
|
||||||
app.kubernetes.io/instance: gitea
|
|
||||||
traefik.io/instance: internal
|
|
||||||
annotations:
|
|
||||||
cert-manager.io/cluster-issuer: vault-issuer
|
|
||||||
cert-manager.io/common-name: git.unkin.net
|
|
||||||
cert-manager.io/private-key-size: "4096"
|
|
||||||
# Only the k8s admin route is published by external-dns (it owns just the
|
|
||||||
# k8s.syd1.au.unkin.net zone). git.unkin.net lives in the apex zone and is
|
|
||||||
# flipped at cutover — NOT managed here.
|
|
||||||
external-dns.alpha.kubernetes.io/hostname: git.k8s.syd1.au.unkin.net
|
|
||||||
external-dns.alpha.kubernetes.io/target: 198.18.200.4
|
|
||||||
spec:
|
|
||||||
gatewayClassName: traefik-internal
|
|
||||||
listeners:
|
|
||||||
- name: http-primary
|
|
||||||
port: 80
|
|
||||||
protocol: HTTP
|
|
||||||
hostname: git.unkin.net
|
|
||||||
allowedRoutes:
|
|
||||||
namespaces:
|
|
||||||
from: Same
|
|
||||||
- name: https-primary
|
|
||||||
port: 443
|
|
||||||
protocol: HTTPS
|
|
||||||
hostname: git.unkin.net
|
|
||||||
allowedRoutes:
|
|
||||||
namespaces:
|
|
||||||
from: Same
|
|
||||||
tls:
|
|
||||||
mode: Terminate
|
|
||||||
certificateRefs:
|
|
||||||
- group: ""
|
|
||||||
kind: Secret
|
|
||||||
name: gitea-tls
|
|
||||||
- name: http-admin
|
|
||||||
port: 80
|
|
||||||
protocol: HTTP
|
|
||||||
hostname: git.k8s.syd1.au.unkin.net
|
|
||||||
allowedRoutes:
|
|
||||||
namespaces:
|
|
||||||
from: Same
|
|
||||||
- name: https-admin
|
|
||||||
port: 443
|
|
||||||
protocol: HTTPS
|
|
||||||
hostname: git.k8s.syd1.au.unkin.net
|
|
||||||
allowedRoutes:
|
|
||||||
namespaces:
|
|
||||||
from: Same
|
|
||||||
tls:
|
|
||||||
mode: Terminate
|
|
||||||
certificateRefs:
|
|
||||||
- group: ""
|
|
||||||
kind: Secret
|
|
||||||
name: gitea-tls
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: gateway.networking.k8s.io/v1
|
|
||||||
kind: HTTPRoute
|
|
||||||
metadata:
|
|
||||||
name: gitea-http-redirect
|
|
||||||
namespace: gitea
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: gitea
|
|
||||||
app.kubernetes.io/instance: gitea
|
|
||||||
spec:
|
|
||||||
hostnames:
|
|
||||||
- git.unkin.net
|
|
||||||
- git.k8s.syd1.au.unkin.net
|
|
||||||
parentRefs:
|
|
||||||
- group: gateway.networking.k8s.io
|
|
||||||
kind: Gateway
|
|
||||||
name: gitea
|
|
||||||
sectionName: http-primary
|
|
||||||
- group: gateway.networking.k8s.io
|
|
||||||
kind: Gateway
|
|
||||||
name: gitea
|
|
||||||
sectionName: http-admin
|
|
||||||
rules:
|
|
||||||
- filters:
|
|
||||||
- type: RequestRedirect
|
|
||||||
requestRedirect:
|
|
||||||
scheme: https
|
|
||||||
statusCode: 301
|
|
||||||
matches:
|
|
||||||
- path:
|
|
||||||
type: PathPrefix
|
|
||||||
value: /
|
|
||||||
---
|
|
||||||
apiVersion: gateway.networking.k8s.io/v1
|
|
||||||
kind: HTTPRoute
|
|
||||||
metadata:
|
|
||||||
name: gitea
|
|
||||||
namespace: gitea
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: gitea
|
|
||||||
app.kubernetes.io/instance: gitea
|
|
||||||
spec:
|
|
||||||
hostnames:
|
|
||||||
- git.unkin.net
|
|
||||||
- git.k8s.syd1.au.unkin.net
|
|
||||||
parentRefs:
|
|
||||||
- group: gateway.networking.k8s.io
|
|
||||||
kind: Gateway
|
|
||||||
name: gitea
|
|
||||||
sectionName: https-primary
|
|
||||||
- group: gateway.networking.k8s.io
|
|
||||||
kind: Gateway
|
|
||||||
name: gitea
|
|
||||||
sectionName: https-admin
|
|
||||||
rules:
|
|
||||||
- backendRefs:
|
|
||||||
- group: ""
|
|
||||||
kind: Service
|
|
||||||
name: gitea-http
|
|
||||||
port: 3000
|
|
||||||
weight: 1
|
|
||||||
matches:
|
|
||||||
- path:
|
|
||||||
type: PathPrefix
|
|
||||||
value: /
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
|
|
||||||
resources:
|
|
||||||
- namespace.yaml
|
|
||||||
- cnpg_cluster.yaml
|
|
||||||
- cnpg_backup.yaml
|
|
||||||
- cnpg_pooler.yaml
|
|
||||||
- valkey-deployment.yaml
|
|
||||||
- valkey-pvc.yaml
|
|
||||||
- valkey-service.yaml
|
|
||||||
- vaultauth.yaml
|
|
||||||
- vaultstaticsecret.yaml
|
|
||||||
- gateway.yaml
|
|
||||||
- httproute.yaml
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: gitea
|
|
||||||
name: gitea
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
---
|
|
||||||
# Standalone Valkey (Redis-compatible) for Gitea's session store, cache and
|
|
||||||
# queue. The Gitea chart bundles a redis-cluster subchart, but we run our own
|
|
||||||
# standalone Valkey here: it keeps image control in-estate (valkey/valkey,
|
|
||||||
# already allowlisted through the artifactapi dockerhub mirror) and matches the
|
|
||||||
# standalone-cache pattern used by litellm/netbox. One instance serves three
|
|
||||||
# logical DBs: DB 0 = session, DB 1 = cache, DB 2 = queue. AOF persistence is
|
|
||||||
# enabled so queued actions/webhook deliveries survive a restart.
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: gitea-valkey
|
|
||||||
namespace: gitea
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: gitea
|
|
||||||
app.kubernetes.io/component: valkey
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: gitea-valkey
|
|
||||||
strategy:
|
|
||||||
type: Recreate
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: gitea-valkey
|
|
||||||
app.kubernetes.io/name: gitea
|
|
||||||
app.kubernetes.io/component: valkey
|
|
||||||
spec:
|
|
||||||
securityContext:
|
|
||||||
fsGroup: 999
|
|
||||||
containers:
|
|
||||||
- name: valkey
|
|
||||||
image: valkey/valkey:8-alpine
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
command:
|
|
||||||
- valkey-server
|
|
||||||
- --appendonly
|
|
||||||
- "yes"
|
|
||||||
- --save
|
|
||||||
- "60"
|
|
||||||
- "1"
|
|
||||||
ports:
|
|
||||||
- containerPort: 6379
|
|
||||||
name: valkey
|
|
||||||
protocol: TCP
|
|
||||||
securityContext:
|
|
||||||
allowPrivilegeEscalation: false
|
|
||||||
runAsNonRoot: true
|
|
||||||
runAsUser: 999
|
|
||||||
capabilities:
|
|
||||||
drop:
|
|
||||||
- ALL
|
|
||||||
livenessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- valkey-cli
|
|
||||||
- ping
|
|
||||||
failureThreshold: 3
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 30
|
|
||||||
successThreshold: 1
|
|
||||||
timeoutSeconds: 5
|
|
||||||
readinessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- valkey-cli
|
|
||||||
- ping
|
|
||||||
failureThreshold: 3
|
|
||||||
initialDelaySeconds: 5
|
|
||||||
periodSeconds: 10
|
|
||||||
successThreshold: 1
|
|
||||||
timeoutSeconds: 5
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: 500m
|
|
||||||
memory: 512Mi
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 128Mi
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /data
|
|
||||||
name: data
|
|
||||||
restartPolicy: Always
|
|
||||||
volumes:
|
|
||||||
- name: data
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: gitea-valkey-data
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
metadata:
|
|
||||||
name: gitea-valkey-data
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 5Gi
|
|
||||||
storageClassName: cephrbd-fast-delete
|
|
||||||
volumeMode: Filesystem
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: gitea-valkey
|
|
||||||
namespace: gitea
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: gitea
|
|
||||||
app.kubernetes.io/component: valkey
|
|
||||||
spec:
|
|
||||||
internalTrafficPolicy: Cluster
|
|
||||||
ports:
|
|
||||||
- name: valkey
|
|
||||||
port: 6379
|
|
||||||
protocol: TCP
|
|
||||||
targetPort: valkey
|
|
||||||
selector:
|
|
||||||
app: gitea-valkey
|
|
||||||
sessionAffinity: None
|
|
||||||
type: ClusterIP
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: secrets.hashicorp.com/v1beta1
|
|
||||||
kind: VaultAuth
|
|
||||||
metadata:
|
|
||||||
name: default
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
allowedNamespaces:
|
|
||||||
- gitea
|
|
||||||
kubernetes:
|
|
||||||
audiences:
|
|
||||||
- vault
|
|
||||||
role: default
|
|
||||||
serviceAccount: default
|
|
||||||
tokenExpirationSeconds: 600
|
|
||||||
method: kubernetes
|
|
||||||
mount: k8s/au/syd1
|
|
||||||
vaultConnectionRef: vso-system/default
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
---
|
|
||||||
# CNPG app-user credentials (keys: username, password). Consumed by the Cluster
|
|
||||||
# bootstrap (initdb.secret) AND by Gitea (gitea.config.database.PASSWD via the
|
|
||||||
# chart's existingSecret wiring). One-time Vault seed — see the PR description.
|
|
||||||
apiVersion: secrets.hashicorp.com/v1beta1
|
|
||||||
kind: VaultStaticSecret
|
|
||||||
metadata:
|
|
||||||
name: postgres-credentials
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
destination:
|
|
||||||
create: true
|
|
||||||
name: postgres-credentials
|
|
||||||
overwrite: true
|
|
||||||
hmacSecretData: true
|
|
||||||
mount: kv
|
|
||||||
path: kubernetes/namespace/gitea/default/postgres-credentials
|
|
||||||
refreshAfter: 5m
|
|
||||||
type: kv-v2
|
|
||||||
vaultAuthRef: default
|
|
||||||
---
|
|
||||||
# Initial Gitea admin (keys: username, password, email). Applied by the chart's
|
|
||||||
# init job on first boot (gitea.admin.existingSecret). Local fallback account
|
|
||||||
# that survives the Authentik OIDC cutover. One-time Vault seed.
|
|
||||||
apiVersion: secrets.hashicorp.com/v1beta1
|
|
||||||
kind: VaultStaticSecret
|
|
||||||
metadata:
|
|
||||||
name: gitea-admin
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
destination:
|
|
||||||
create: true
|
|
||||||
name: gitea-admin
|
|
||||||
overwrite: true
|
|
||||||
hmacSecretData: true
|
|
||||||
mount: kv
|
|
||||||
path: kubernetes/namespace/gitea/default/gitea-admin
|
|
||||||
refreshAfter: 5m
|
|
||||||
type: kv-v2
|
|
||||||
vaultAuthRef: default
|
|
||||||
---
|
|
||||||
# Gitea internal secrets (keys: SECRET_KEY, INTERNAL_TOKEN). Pinned here rather
|
|
||||||
# than chart-generated so all replicas share identical values AND so the data
|
|
||||||
# cutover can replace them with the VM's app.ini values (SECRET_KEY encrypts
|
|
||||||
# 2FA/mirror/oauth secrets in the DB — it MUST match the restored database).
|
|
||||||
# One-time Vault seed.
|
|
||||||
apiVersion: secrets.hashicorp.com/v1beta1
|
|
||||||
kind: VaultStaticSecret
|
|
||||||
metadata:
|
|
||||||
name: gitea-inner
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
destination:
|
|
||||||
create: true
|
|
||||||
name: gitea-inner
|
|
||||||
overwrite: true
|
|
||||||
hmacSecretData: true
|
|
||||||
mount: kv
|
|
||||||
path: kubernetes/namespace/gitea/default/gitea-inner
|
|
||||||
refreshAfter: 5m
|
|
||||||
type: kv-v2
|
|
||||||
vaultAuthRef: default
|
|
||||||
---
|
|
||||||
# Authentik OIDC client secret (key: client_secret). Read by the
|
|
||||||
# terraform-authentik provider runner (policy already grants
|
|
||||||
# kv/.../namespace/+/default/oauth-credentials) AND mounted into Gitea to
|
|
||||||
# register the OIDC login source. One-time Vault seed.
|
|
||||||
apiVersion: secrets.hashicorp.com/v1beta1
|
|
||||||
kind: VaultStaticSecret
|
|
||||||
metadata:
|
|
||||||
name: oauth-credentials
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
destination:
|
|
||||||
create: true
|
|
||||||
name: oauth-credentials
|
|
||||||
overwrite: true
|
|
||||||
hmacSecretData: true
|
|
||||||
mount: kv
|
|
||||||
path: kubernetes/namespace/gitea/default/oauth-credentials
|
|
||||||
refreshAfter: 5m
|
|
||||||
type: kv-v2
|
|
||||||
vaultAuthRef: default
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
---
|
|
||||||
# Ceph RGW (S3) backup target for the grafana 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.
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: ObjectStoreUser
|
|
||||||
metadata:
|
|
||||||
name: cnpg-grafana-backup
|
|
||||||
namespace: grafana
|
|
||||||
spec:
|
|
||||||
displayName: "CNPG backup owner (grafana)"
|
|
||||||
# RGW users are global; keep the uid namespace-qualified so it never collides.
|
|
||||||
uid: cnpg-grafana-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.
|
|
||||||
secretName: cnpg-grafana-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.
|
|
||||||
retainOnDelete: true
|
|
||||||
---
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: Bucket
|
|
||||||
metadata:
|
|
||||||
name: cnpg-grafana
|
|
||||||
namespace: grafana
|
|
||||||
spec:
|
|
||||||
placementTarget: ec
|
|
||||||
bucketName: cnpg-grafana
|
|
||||||
# The owner user has full control of its own bucket (read + write), which is
|
|
||||||
# all the backup/restore identity needs — no extra BucketAccess grant.
|
|
||||||
ownerRef: cnpg-grafana-backup
|
|
||||||
versioning: false
|
|
||||||
tags:
|
|
||||||
app: grafana
|
|
||||||
purpose: cnpg-backup
|
|
||||||
# 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).
|
|
||||||
apiVersion: postgresql.cnpg.io/v1
|
|
||||||
kind: ScheduledBackup
|
|
||||||
metadata:
|
|
||||||
name: cnpg-grafana-nightly
|
|
||||||
namespace: grafana
|
|
||||||
spec:
|
|
||||||
schedule: "0 20 3 * * *"
|
|
||||||
immediate: false
|
|
||||||
backupOwnerReference: self
|
|
||||||
method: barmanObjectStore
|
|
||||||
cluster:
|
|
||||||
name: postgres
|
|
||||||
@@ -7,35 +7,6 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
affinity:
|
affinity:
|
||||||
podAntiAffinityType: preferred
|
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-grafana
|
|
||||||
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).
|
|
||||||
endpointCA:
|
|
||||||
name: vault-ca-cert
|
|
||||||
key: ca.crt
|
|
||||||
# Keys minted by the ObjectStoreUser in cnpg_backup.yaml; never hardcoded.
|
|
||||||
s3Credentials:
|
|
||||||
accessKeyId:
|
|
||||||
name: cnpg-grafana-backup-s3
|
|
||||||
key: AWS_ACCESS_KEY_ID
|
|
||||||
secretAccessKey:
|
|
||||||
name: cnpg-grafana-backup-s3
|
|
||||||
key: AWS_SECRET_ACCESS_KEY
|
|
||||||
# Path prefix within the bucket; keep stable across restores (see docs).
|
|
||||||
serverName: grafana
|
|
||||||
data:
|
|
||||||
compression: bzip2
|
|
||||||
jobs: 2
|
|
||||||
wal:
|
|
||||||
compression: zstd
|
|
||||||
maxParallel: 2
|
|
||||||
bootstrap:
|
bootstrap:
|
||||||
initdb:
|
initdb:
|
||||||
database: grafana
|
database: grafana
|
||||||
|
|||||||
@@ -26,13 +26,6 @@ spec:
|
|||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: oauth-credentials
|
name: oauth-credentials
|
||||||
key: client_secret
|
key: client_secret
|
||||||
# identity.unkin.net is served by the internal unkin.net CA, which
|
|
||||||
# the stock Grafana image doesn't trust. Mount the reflected
|
|
||||||
# vault-ca-cert and point generic_oauth's tls_client_ca at it.
|
|
||||||
volumeMounts:
|
|
||||||
- name: vault-ca-cert
|
|
||||||
mountPath: /etc/grafana/vault-ca
|
|
||||||
readOnly: true
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
@@ -40,13 +33,6 @@ spec:
|
|||||||
limits:
|
limits:
|
||||||
cpu: "1"
|
cpu: "1"
|
||||||
memory: 1Gi
|
memory: 1Gi
|
||||||
volumes:
|
|
||||||
- name: vault-ca-cert
|
|
||||||
secret:
|
|
||||||
secretName: vault-ca-cert
|
|
||||||
items:
|
|
||||||
- key: ca.crt
|
|
||||||
path: ca.crt
|
|
||||||
config:
|
config:
|
||||||
server:
|
server:
|
||||||
root_url: "https://grafana.k8s.syd1.au.unkin.net"
|
root_url: "https://grafana.k8s.syd1.au.unkin.net"
|
||||||
@@ -65,16 +51,10 @@ spec:
|
|||||||
allow_sign_up: "true"
|
allow_sign_up: "true"
|
||||||
use_pkce: "true"
|
use_pkce: "true"
|
||||||
client_id: "grafana"
|
client_id: "grafana"
|
||||||
# ak_groups = hierarchical group claim from terraform-authentik (carries
|
scopes: "openid email profile"
|
||||||
# permission groups inherited via role groups).
|
|
||||||
scopes: "openid email profile ak_groups"
|
|
||||||
auth_url: "https://identity.unkin.net/application/o/authorize/"
|
auth_url: "https://identity.unkin.net/application/o/authorize/"
|
||||||
token_url: "https://identity.unkin.net/application/o/token/"
|
token_url: "https://identity.unkin.net/application/o/token/"
|
||||||
api_url: "https://identity.unkin.net/application/o/userinfo/"
|
api_url: "https://identity.unkin.net/application/o/userinfo/"
|
||||||
# Trust the internal unkin.net CA that signs identity.unkin.net's cert
|
# Authentik groups -> Grafana roles (adjust group name as needed).
|
||||||
# (mounted from the reflected vault-ca-cert Secret).
|
role_attribute_path: "contains(groups[*], 'grafana-admins') && 'Admin' || 'Viewer'"
|
||||||
tls_client_ca: "/etc/grafana/vault-ca/ca.crt"
|
|
||||||
# Authentik permission groups -> Grafana roles. akP-grafana-admin is granted
|
|
||||||
# to akR-global-admin members (and direct members) via terraform-authentik.
|
|
||||||
role_attribute_path: "contains(ak_groups[*], 'akP-grafana-admin') && 'Admin' || 'Viewer'"
|
|
||||||
role_attribute_strict: "false"
|
role_attribute_strict: "false"
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
- cnpg_cluster.yaml
|
- cnpg_cluster.yaml
|
||||||
- cnpg_backup.yaml
|
|
||||||
- cnpg_pooler.yaml
|
- cnpg_pooler.yaml
|
||||||
- vaultauth.yaml
|
- vaultauth.yaml
|
||||||
- vaultstaticsecret.yaml
|
- vaultstaticsecret.yaml
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ resources:
|
|||||||
- gateway.yaml
|
- gateway.yaml
|
||||||
- httproute.yaml
|
- httproute.yaml
|
||||||
- tlsroute.yaml
|
- tlsroute.yaml
|
||||||
- vpa.yaml
|
|
||||||
|
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
- name: kanidm-config
|
- name: kanidm-config
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ metadata:
|
|||||||
name: kanidm
|
name: kanidm
|
||||||
namespace: kanidm
|
namespace: kanidm
|
||||||
annotations:
|
annotations:
|
||||||
configmap.reloader.stakater.com/auto: "true"
|
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
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: autoscaling.k8s.io/v1
|
|
||||||
kind: VerticalPodAutoscaler
|
|
||||||
metadata:
|
|
||||||
name: kanidm-vpa
|
|
||||||
namespace: kanidm
|
|
||||||
spec:
|
|
||||||
targetRef:
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: StatefulSet
|
|
||||||
name: kanidm
|
|
||||||
updatePolicy:
|
|
||||||
updateMode: "Off"
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
---
|
|
||||||
# Ceph RGW (S3) backup target for the litellm 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.
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: ObjectStoreUser
|
|
||||||
metadata:
|
|
||||||
name: cnpg-litellm-backup
|
|
||||||
namespace: litellm
|
|
||||||
spec:
|
|
||||||
displayName: "CNPG backup owner (litellm)"
|
|
||||||
# RGW users are global; keep the uid namespace-qualified so it never collides.
|
|
||||||
uid: cnpg-litellm-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.
|
|
||||||
secretName: cnpg-litellm-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.
|
|
||||||
retainOnDelete: true
|
|
||||||
---
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: Bucket
|
|
||||||
metadata:
|
|
||||||
name: cnpg-litellm
|
|
||||||
namespace: litellm
|
|
||||||
spec:
|
|
||||||
placementTarget: ec
|
|
||||||
bucketName: cnpg-litellm
|
|
||||||
# The owner user has full control of its own bucket (read + write), which is
|
|
||||||
# all the backup/restore identity needs — no extra BucketAccess grant.
|
|
||||||
ownerRef: cnpg-litellm-backup
|
|
||||||
versioning: false
|
|
||||||
tags:
|
|
||||||
app: litellm
|
|
||||||
purpose: cnpg-backup
|
|
||||||
# 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).
|
|
||||||
apiVersion: postgresql.cnpg.io/v1
|
|
||||||
kind: ScheduledBackup
|
|
||||||
metadata:
|
|
||||||
name: cnpg-litellm-nightly
|
|
||||||
namespace: litellm
|
|
||||||
spec:
|
|
||||||
schedule: "0 20 1 * * *"
|
|
||||||
immediate: false
|
|
||||||
backupOwnerReference: self
|
|
||||||
method: barmanObjectStore
|
|
||||||
cluster:
|
|
||||||
name: litellm-postgres
|
|
||||||
@@ -7,35 +7,6 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
affinity:
|
affinity:
|
||||||
podAntiAffinityType: preferred
|
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-litellm
|
|
||||||
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).
|
|
||||||
endpointCA:
|
|
||||||
name: vault-ca-cert
|
|
||||||
key: ca.crt
|
|
||||||
# Keys minted by the ObjectStoreUser in cnpg_backup.yaml; never hardcoded.
|
|
||||||
s3Credentials:
|
|
||||||
accessKeyId:
|
|
||||||
name: cnpg-litellm-backup-s3
|
|
||||||
key: AWS_ACCESS_KEY_ID
|
|
||||||
secretAccessKey:
|
|
||||||
name: cnpg-litellm-backup-s3
|
|
||||||
key: AWS_SECRET_ACCESS_KEY
|
|
||||||
# Path prefix within the bucket; keep stable across restores (see docs).
|
|
||||||
serverName: litellm
|
|
||||||
data:
|
|
||||||
compression: bzip2
|
|
||||||
jobs: 2
|
|
||||||
wal:
|
|
||||||
compression: zstd
|
|
||||||
maxParallel: 2
|
|
||||||
bootstrap:
|
bootstrap:
|
||||||
initdb:
|
initdb:
|
||||||
database: litellm
|
database: litellm
|
||||||
@@ -48,7 +19,7 @@ spec:
|
|||||||
enablePDB: true
|
enablePDB: true
|
||||||
enableSuperuserAccess: false
|
enableSuperuserAccess: false
|
||||||
failoverDelay: 0
|
failoverDelay: 0
|
||||||
imageName: ghcr.io/cloudnative-pg/postgresql:17-system-trixie
|
imageName: ghcr.io/cloudnative-pg/postgresql:17-minimal-trixie
|
||||||
instances: 3
|
instances: 3
|
||||||
logLevel: info
|
logLevel: info
|
||||||
maxSyncReplicas: 0
|
maxSyncReplicas: 0
|
||||||
|
|||||||
@@ -11,28 +11,10 @@ spec:
|
|||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
configmap.reloader.stakater.com/auto: "true"
|
reloader.stakater.com/auto: "true"
|
||||||
secret.reloader.stakater.com/reload: "vault-ca-cert"
|
|
||||||
labels:
|
labels:
|
||||||
app: litellm
|
app: litellm
|
||||||
spec:
|
spec:
|
||||||
# LiteLLM's SSO client reaches identity.unkin.net, whose cert is signed by
|
|
||||||
# the internal unkin.net CA. Combine the image's public roots with the
|
|
||||||
# reflected vault-ca-cert into one bundle (SSL_CERT_FILE/REQUESTS_CA_BUNDLE
|
|
||||||
# in litellm-env point at it) so internal OIDC and public HTTPS both work.
|
|
||||||
initContainers:
|
|
||||||
- name: combine-certs
|
|
||||||
image: alpine:3
|
|
||||||
command:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
- cat /etc/ssl/certs/ca-certificates.crt /custom-ca/ca.crt > /combined-certs/ca-certificates.crt
|
|
||||||
volumeMounts:
|
|
||||||
- name: vault-ca-cert
|
|
||||||
mountPath: /custom-ca
|
|
||||||
readOnly: true
|
|
||||||
- name: combined-certs
|
|
||||||
mountPath: /combined-certs
|
|
||||||
containers:
|
containers:
|
||||||
- name: litellm
|
- name: litellm
|
||||||
image: docker.litellm.ai/berriai/litellm-database:main-stable
|
image: docker.litellm.ai/berriai/litellm-database:main-stable
|
||||||
@@ -48,14 +30,6 @@ spec:
|
|||||||
- containerPort: 4000
|
- containerPort: 4000
|
||||||
name: http
|
name: http
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
env:
|
|
||||||
# Authentik OIDC client secret (SSO); non-secret SSO config is in the
|
|
||||||
# litellm-env ConfigMap.
|
|
||||||
- name: GENERIC_CLIENT_SECRET
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: oauth-credentials
|
|
||||||
key: client_secret
|
|
||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: litellm-credentials
|
name: litellm-credentials
|
||||||
@@ -90,19 +64,8 @@ spec:
|
|||||||
- mountPath: /app/config.yaml
|
- mountPath: /app/config.yaml
|
||||||
name: config
|
name: config
|
||||||
subPath: config.yaml
|
subPath: config.yaml
|
||||||
- name: combined-certs
|
|
||||||
mountPath: /etc/ssl/combined
|
|
||||||
readOnly: true
|
|
||||||
restartPolicy: Always
|
restartPolicy: Always
|
||||||
volumes:
|
volumes:
|
||||||
- name: config
|
- name: config
|
||||||
configMap:
|
configMap:
|
||||||
name: litellm-config
|
name: litellm-config
|
||||||
- name: vault-ca-cert
|
|
||||||
secret:
|
|
||||||
secretName: vault-ca-cert
|
|
||||||
items:
|
|
||||||
- key: ca.crt
|
|
||||||
path: ca.crt
|
|
||||||
- name: combined-certs
|
|
||||||
emptyDir: {}
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ kind: Kustomization
|
|||||||
|
|
||||||
resources:
|
resources:
|
||||||
- cnpg_cluster.yaml
|
- cnpg_cluster.yaml
|
||||||
- cnpg_backup.yaml
|
|
||||||
- cnpg_pooler.yaml
|
- cnpg_pooler.yaml
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
- hpa.yaml
|
- hpa.yaml
|
||||||
@@ -16,7 +15,6 @@ resources:
|
|||||||
- services.yaml
|
- services.yaml
|
||||||
- vaultauth.yaml
|
- vaultauth.yaml
|
||||||
- vaultstaticsecret.yaml
|
- vaultstaticsecret.yaml
|
||||||
- vpa.yaml
|
|
||||||
|
|
||||||
configMapGenerator:
|
configMapGenerator:
|
||||||
- name: litellm-config
|
- name: litellm-config
|
||||||
@@ -27,24 +25,5 @@ configMapGenerator:
|
|||||||
- name: litellm-env
|
- name: litellm-env
|
||||||
literals:
|
literals:
|
||||||
- STORE_MODEL_IN_DB=True
|
- STORE_MODEL_IN_DB=True
|
||||||
# Emit structured JSON logs so the Tier-2 vector litellm pipeline can parse
|
|
||||||
# model/tokens/latency/key/status (logs.k8s.litellm.*).
|
|
||||||
- JSON_LOGS=True
|
|
||||||
# Authentik OIDC SSO (generic). Client secret is injected from the
|
|
||||||
# oauth-credentials Secret in the Deployment; endpoints match the other
|
|
||||||
# apps (identity.unkin.net). PROXY_BASE_URL is required for SSO.
|
|
||||||
- GENERIC_CLIENT_ID=litellm
|
|
||||||
- GENERIC_AUTHORIZATION_ENDPOINT=https://identity.unkin.net/application/o/authorize/
|
|
||||||
- GENERIC_TOKEN_ENDPOINT=https://identity.unkin.net/application/o/token/
|
|
||||||
- GENERIC_USERINFO_ENDPOINT=https://identity.unkin.net/application/o/userinfo/
|
|
||||||
# litellm_role scope carries the Authentik-computed role claim; LiteLLM
|
|
||||||
# reads it via GENERIC_USER_ROLE_ATTRIBUTE and maps to proxy_admin/etc.
|
|
||||||
- GENERIC_SCOPE=openid email profile litellm_role
|
|
||||||
- GENERIC_USER_ROLE_ATTRIBUTE=litellm_role
|
|
||||||
- PROXY_BASE_URL=https://litellm.k8s.syd1.au.unkin.net
|
|
||||||
# Trust the internal unkin.net CA (identity.unkin.net) via the combined
|
|
||||||
# bundle assembled by the combine-certs init container.
|
|
||||||
- SSL_CERT_FILE=/etc/ssl/combined/ca-certificates.crt
|
|
||||||
- REQUESTS_CA_BUNDLE=/etc/ssl/combined/ca-certificates.crt
|
|
||||||
options:
|
options:
|
||||||
disableNameSuffixHash: true
|
disableNameSuffixHash: true
|
||||||
|
|||||||
@@ -18,24 +18,6 @@ spec:
|
|||||||
---
|
---
|
||||||
apiVersion: secrets.hashicorp.com/v1beta1
|
apiVersion: secrets.hashicorp.com/v1beta1
|
||||||
kind: VaultStaticSecret
|
kind: VaultStaticSecret
|
||||||
metadata:
|
|
||||||
name: oauth-credentials
|
|
||||||
namespace: litellm
|
|
||||||
spec:
|
|
||||||
destination:
|
|
||||||
create: true
|
|
||||||
name: oauth-credentials
|
|
||||||
overwrite: true
|
|
||||||
hmacSecretData: true
|
|
||||||
mount: kv
|
|
||||||
# Same secret Authentik sets on the litellm OAuth2 provider (key: client_secret).
|
|
||||||
path: kubernetes/namespace/litellm/default/oauth-credentials
|
|
||||||
refreshAfter: 5m
|
|
||||||
type: kv-v2
|
|
||||||
vaultAuthRef: default
|
|
||||||
---
|
|
||||||
apiVersion: secrets.hashicorp.com/v1beta1
|
|
||||||
kind: VaultStaticSecret
|
|
||||||
metadata:
|
metadata:
|
||||||
name: litellm-credentials
|
name: litellm-credentials
|
||||||
namespace: litellm
|
namespace: litellm
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: autoscaling.k8s.io/v1
|
|
||||||
kind: VerticalPodAutoscaler
|
|
||||||
metadata:
|
|
||||||
name: litellm-vpa
|
|
||||||
namespace: litellm
|
|
||||||
# NOTE: this workload also has an HPA. updateMode Off is recommendation-only
|
|
||||||
# and does not act, so there is no HPA/VPA conflict today. Do not flip to Auto/
|
|
||||||
# Initial without first moving the HPA off CPU/memory (VPA owns those under Auto).
|
|
||||||
spec:
|
|
||||||
targetRef:
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
name: litellm
|
|
||||||
updatePolicy:
|
|
||||||
updateMode: "Off"
|
|
||||||
---
|
|
||||||
apiVersion: autoscaling.k8s.io/v1
|
|
||||||
kind: VerticalPodAutoscaler
|
|
||||||
metadata:
|
|
||||||
name: redis-vpa
|
|
||||||
namespace: litellm
|
|
||||||
spec:
|
|
||||||
targetRef:
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
name: redis
|
|
||||||
updatePolicy:
|
|
||||||
updateMode: "Off"
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
---
|
|
||||||
# S3 bucket (Ceph RGW) for the long-term raw-log archive, provisioned by the
|
|
||||||
# in-estate cephrgw-operator. The archiver Vector deployment writes here.
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: ObjectStoreUser
|
|
||||||
metadata:
|
|
||||||
name: logs-archive-owner
|
|
||||||
namespace: logging
|
|
||||||
spec:
|
|
||||||
displayName: "Logging raw-archive bucket owner"
|
|
||||||
maxBuckets: 5
|
|
||||||
quota:
|
|
||||||
enabled: true
|
|
||||||
# 5 TiB soft cap; real retention is enforced RGW-side by a bucket lifecycle
|
|
||||||
# policy (see PR notes) — the operator does not manage lifecycle.
|
|
||||||
maxSizeBytes: 5497558138880
|
|
||||||
---
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: Bucket
|
|
||||||
metadata:
|
|
||||||
name: logs-archive
|
|
||||||
namespace: logging
|
|
||||||
spec:
|
|
||||||
bucketName: logs-archive
|
|
||||||
ownerRef: logs-archive-owner
|
|
||||||
versioning: false
|
|
||||||
tags:
|
|
||||||
app: logging
|
|
||||||
purpose: raw-log-archive
|
|
||||||
# Keep the bucket (and its objects) if this CR is ever deleted.
|
|
||||||
retainOnDelete: true
|
|
||||||
---
|
|
||||||
apiVersion: ceph.unkin.net/v1alpha1
|
|
||||||
kind: BucketAccess
|
|
||||||
metadata:
|
|
||||||
name: logs-archive-writer
|
|
||||||
namespace: logging
|
|
||||||
spec:
|
|
||||||
bucketRef: logs-archive
|
|
||||||
level: read-write
|
|
||||||
# Operator writes AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY (+ RGW_UID,
|
|
||||||
# S3_ENDPOINT, BUCKET_NAME) into this Secret; the archiver consumes it.
|
|
||||||
secretName: logs-archive-s3
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: clickhouse.altinity.com/v1
|
|
||||||
kind: ClickHouseInstallation
|
|
||||||
metadata:
|
|
||||||
name: logs
|
|
||||||
namespace: logging
|
|
||||||
spec:
|
|
||||||
defaults:
|
|
||||||
templates:
|
|
||||||
dataVolumeClaimTemplate: data-volume
|
|
||||||
serviceTemplate: chi-service
|
|
||||||
podTemplate: clickhouse
|
|
||||||
configuration:
|
|
||||||
users:
|
|
||||||
# Password hash is sourced from the Vault-synced clickhouse-credentials
|
|
||||||
# Secret; the plaintext never lands in git or the ClickHouse config.
|
|
||||||
vector/password_sha256_hex:
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: clickhouse-credentials
|
|
||||||
key: password_sha256_hex
|
|
||||||
vector/networks/ip:
|
|
||||||
- "::/0"
|
|
||||||
vector/profile: default
|
|
||||||
vector/quota: default
|
|
||||||
# Allow the vector user to create the logs database/table (bootstrap Job)
|
|
||||||
# and to INSERT. Restrict the built-in default user to loopback only.
|
|
||||||
vector/access_management: "1"
|
|
||||||
default/networks/ip:
|
|
||||||
- "127.0.0.1"
|
|
||||||
- "::1"
|
|
||||||
profiles:
|
|
||||||
default/max_memory_usage: "10000000000"
|
|
||||||
default/max_execution_time: "120"
|
|
||||||
clusters:
|
|
||||||
- name: logs
|
|
||||||
layout:
|
|
||||||
shardsCount: 1
|
|
||||||
replicasCount: 1
|
|
||||||
templates:
|
|
||||||
volumeClaimTemplates:
|
|
||||||
- name: data-volume
|
|
||||||
spec:
|
|
||||||
storageClassName: cephrbd-fast-delete
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
# 3d TTL on logs.raw. At ~130 GiB/day raw, ClickHouse LZ4/ZSTD
|
|
||||||
# (~6x on log text) stores ~20-25 GiB/day => ~60-75 GiB/3d, plus
|
|
||||||
# merge headroom (~2x peak). logs.raw is the only table. 150Gi
|
|
||||||
# gives comfortable headroom; long-term data lives in S3, not here.
|
|
||||||
storage: 150Gi
|
|
||||||
serviceTemplates:
|
|
||||||
- name: chi-service
|
|
||||||
generateName: "clickhouse-{chi}"
|
|
||||||
spec:
|
|
||||||
type: ClusterIP
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
port: 8123
|
|
||||||
- name: tcp
|
|
||||||
port: 9000
|
|
||||||
podTemplates:
|
|
||||||
- name: clickhouse
|
|
||||||
spec:
|
|
||||||
securityContext:
|
|
||||||
fsGroup: 101
|
|
||||||
runAsUser: 101
|
|
||||||
runAsGroup: 101
|
|
||||||
containers:
|
|
||||||
- name: clickhouse
|
|
||||||
image: artifactapi.k8s.syd1.au.unkin.net/dockerhub/clickhouse/clickhouse-server:24.8
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 500m
|
|
||||||
memory: 2Gi
|
|
||||||
limits:
|
|
||||||
cpu: "2"
|
|
||||||
memory: 8Gi
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user