This commit is contained in:
dingo
2026-09-06 08:14:24 -04:00
8 changed files with 148 additions and 4 deletions
+9 -4
View File
@@ -2,11 +2,12 @@ name: Verify, publish, and promote
on:
push:
branches: [master, main]
paths-ignore: [deploy/values-srs.yaml]
pull_request:
jobs:
verify:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:17-alpine
@@ -36,12 +37,16 @@ jobs:
- run: npx playwright install --with-deps chromium
- run: npm run test:e2e
- uses: azure/setup-helm@v4.3.0
- run: helm lint deploy/chart && helm template aeternalis deploy/chart > /tmp/aeternalis.yaml
- run: |
helm lint deploy/chart
helm template aeternalis deploy/chart > /tmp/aeternalis.yaml
helm lint deploy/chart -f deploy/values-srs.yaml
helm template aeternalis deploy/chart -f deploy/values-srs.yaml > /tmp/aeternalis-srs.yaml
publish:
if: gitea.event_name == 'push'
needs: verify
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
digest: ${{ steps.build.outputs.digest }}
steps:
@@ -64,7 +69,7 @@ jobs:
promote:
if: gitea.event_name == 'push' && vars.GITOPS_REPOSITORY != ''
needs: publish
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
+38
View File
@@ -0,0 +1,38 @@
# SRS deployment
Argo CD application: `argocd/aeternalis`, namespace `aeternalis`.
Endpoint: `https://srs.aeternalisgames.com` (NGINX HTTPS/443).
The chart uses `letsencrypt-godaddy`, matching SOR, and the `srs-tls`
certificate secret. One initial world is configured at the requested hostname.
Production configuration is `deploy/values-srs.yaml`. CI publishes a SHA-tagged
image to `registry.aeternalisgames.com/aeternalis/aeternalis`, then promotes its
immutable digest into that values file. Values-only promotion commits do not
start another build. Argo CD uses the chart and values from this repository.
Do not sync the bootstrap image; wait for successful publication and promotion.
External prerequisites (not stored in Git):
- `aeternalis-runtime`: DATABASE_URL, OIDC_ISSUER, OIDC_CLIENT_ID,
OIDC_CLIENT_SECRET. PostgreSQL uses database `aeternalis`, dedicated login
`aeternalis_app`, and `sslmode=verify-full`.
- `postgres-ca` ConfigMap: `ca.crt`, mounted at `/etc/postgres-ca/ca.crt`.
It trusts the database certificate, whose DNS identity is `pg-forge-01`.
A selectorless Service and EndpointSlice resolve that name to the existing
PostgreSQL host. Review/update this trust bundle when its certificate rotates.
- `harbor-pull`: registry credential for pulling this project's images.
- Argo CD repository access: a Kubernetes repository Secret, not CI kubeconfig.
OIDC uses the existing `aeternalis` realm and dedicated confidential client
`aeternalis-web`, authorization-code flow with PKCE S256, and exact callback
`https://srs.aeternalisgames.com/auth/callback`. Existing realm users and policy
are preserved. No user passwords or admin credentials are added to the app.
NetworkPolicy permits DNS, PostgreSQL at `172.10.1.127:5432`, and the internal
NGINX address `172.10.1.160:443` used by the identity provider. Update the explicit
allowlists if infrastructure addresses change; do not disable production TLS.
Validate with Helm lint/template for both defaults and SRS values, Kubernetes
server-side dry-run, CI tests, registry digest readback, Argo CD Synced/Healthy,
HTTPS `/readyz`, certificate hostname/chain validation, and OIDC redirect checks.
A complete interactive login/playtest still requires a real realm user.
+22
View File
@@ -0,0 +1,22 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: aeternalis
namespace: argocd
spec:
project: default
source:
repoURL: https://git.aeternalisgames.com/Stone/aeternalis.git
targetRevision: master
path: deploy/chart
helm:
releaseName: aeternalis
valueFiles: [../values-srs.yaml]
destination:
server: https://kubernetes.default.svc
namespace: aeternalis
syncPolicy:
automated:
prune: false
selfHeal: true
syncOptions: [CreateNamespace=true, ServerSideApply=true]
@@ -0,0 +1,21 @@
{{- if .Values.externalDatabase.address }}
# Preserve the certificate's DNS identity while routing to the external database.
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.externalDatabase.name | quote }}
spec:
ports: [{ name: postgres, port: 5432, targetPort: 5432 }]
---
apiVersion: discovery.k8s.io/v1
kind: EndpointSlice
metadata:
name: {{ .Values.externalDatabase.name | quote }}
labels:
kubernetes.io/service-name: {{ .Values.externalDatabase.name | quote }}
addressType: IPv4
ports: [{ name: postgres, protocol: TCP, port: 5432 }]
endpoints:
- addresses: [{{ .Values.externalDatabase.address | quote }}]
conditions: { ready: true }
{{- end }}
@@ -11,6 +11,9 @@ spec:
- from:
- namespaceSelector:
matchLabels: { kubernetes.io/metadata.name: {{ .Values.networkPolicy.ingressNamespace | quote }} }
{{- range .Values.networkPolicy.ingressCIDRs }}
- ipBlock: { cidr: {{ . | quote }} }
{{- end }}
ports: [{ protocol: TCP, port: 8080 }]
egress:
- to:
+15
View File
@@ -23,6 +23,12 @@ spec:
automountServiceAccountToken: false
terminationGracePeriodSeconds: 30
imagePullSecrets: {{ $root.Values.imagePullSecrets | toJson }}
{{- if $root.Values.databaseCA.configMap }}
volumes:
- name: postgres-ca
configMap:
name: {{ $root.Values.databaseCA.configMap | quote }}
{{- end }}
securityContext:
runAsNonRoot: true
runAsUser: 65532
@@ -32,6 +38,12 @@ spec:
- name: world
image: {{ if $root.Values.image.digest }}{{ printf "%s@%s" $root.Values.image.repository $root.Values.image.digest | quote }}{{ else }}{{ printf "%s:%s" $root.Values.image.repository $root.Values.image.tag | quote }}{{ end }}
imagePullPolicy: IfNotPresent
{{- if $root.Values.databaseCA.configMap }}
volumeMounts:
- name: postgres-ca
mountPath: /etc/postgres-ca
readOnly: true
{{- end }}
ports: [{ name: http, containerPort: 8080 }]
securityContext:
readOnlyRootFilesystem: true
@@ -64,6 +76,9 @@ kind: Ingress
metadata:
name: {{ $root.Release.Name }}-{{ .id }}
annotations:
{{- if $root.Values.ingress.clusterIssuer }}
cert-manager.io/cluster-issuer: {{ $root.Values.ingress.clusterIssuer | quote }}
{{- end }}
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-body-size: "8k"
+8
View File
@@ -5,9 +5,15 @@ image:
imagePullSecrets:
- name: harbor-pull
existingSecret: aeternalis-runtime
databaseCA:
configMap: ""
externalDatabase:
name: pg-forge-01
address: ""
ingress:
className: nginx
tlsSecret: aeternalis-tls
clusterIssuer: ""
worlds:
- id: world-001
seed: "734291"
@@ -30,6 +36,8 @@ resources:
networkPolicy:
enabled: true
ingressNamespace: ingress-nginx
# Node addresses for ingress controllers using host networking.
ingressCIDRs: []
# Explicitly set actual database and OIDC provider IP ranges before deployment.
databaseCIDRs: []
identityCIDRs: []
+32
View File
@@ -0,0 +1,32 @@
# Runtime credentials and PostgreSQL CA are provisioned outside Git.
image:
repository: registry.aeternalisgames.com/aeternalis/aeternalis
tag: bootstrap
digest: ""
imagePullSecrets:
- name: harbor-pull
existingSecret: aeternalis-runtime
databaseCA:
configMap: postgres-ca
externalDatabase:
name: pg-forge-01
address: 172.10.1.127
ingress:
className: nginx
clusterIssuer: letsencrypt-godaddy
tlsSecret: srs-tls
worlds:
- id: world-001
seed: "734291"
host: srs.aeternalisgames.com
networkPolicy:
enabled: true
ingressNamespace: kube-system
ingressCIDRs:
- 172.10.1.135/32
- 172.10.1.146/32
- 172.10.1.160/32
- 172.10.1.196/32
databaseCIDRs: [172.10.1.127/32]
identityCIDRs: [172.10.1.160/32]
dnsNamespace: kube-system