Add CI/CD pipeline, Dockerfiles, and k8s/ArgoCD manifests
- Gitea Actions workflow: build sor-host + sor-admin, push to Harbor, auto-update image tags in k8s manifests (GitOps — ArgoCD watches deploy/k8s/) - Dockerfile.host / Dockerfile.admin: multi-stage .NET 8 builds, non-root runtime - deploy/k8s/: configmap, deployments, services, nginx ingress - hub.aeternalisgames.com → sor-host (WebSocket gateway) - admin.aeternalisgames.com → sor-admin (Blazor admin portal) - hub-tls for hub, cert-manager auto-provisions admin-tls - deploy/secrets/: README + *.yaml.template files to populate (gitignored) - deploy/argo/application.yaml: ArgoCD Application (namespace stone-server) - Root .gitignore: excludes deploy/secrets/*.yaml (never commit populated secrets) Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
# SOR Kubernetes Secrets
|
||||
|
||||
These files are **NOT committed to git** (excluded via root `.gitignore`).
|
||||
The `*.yaml.template` files in this directory ARE committed — copy them, fill in
|
||||
real values, then apply to the cluster.
|
||||
|
||||
---
|
||||
|
||||
## Quick Setup
|
||||
|
||||
### 1. Harbor image pull secret
|
||||
```bash
|
||||
cp harbor-pull-secret.yaml.template harbor-pull-secret.yaml
|
||||
# edit harbor-pull-secret.yaml — fill in your Harbor username and password
|
||||
kubectl apply -f harbor-pull-secret.yaml
|
||||
```
|
||||
|
||||
### 2. Application secrets
|
||||
```bash
|
||||
cp sor-app-secrets.yaml.template sor-app-secrets.yaml
|
||||
# edit sor-app-secrets.yaml — fill in Postgres connection string and CDN credentials
|
||||
kubectl apply -f sor-app-secrets.yaml
|
||||
```
|
||||
|
||||
### 3. Gitea Actions repository secrets
|
||||
In your Gitea repository → Settings → Secrets, add:
|
||||
| Name | Value |
|
||||
|-------------------|--------------------------------|
|
||||
| HARBOR_USERNAME | Your Harbor robot account name |
|
||||
| HARBOR_PASSWORD | Your Harbor robot account token |
|
||||
|
||||
---
|
||||
|
||||
## Secrets Reference
|
||||
|
||||
| Secret Name | Key | Used By | Notes |
|
||||
|--------------------|----------------------------|-----------------|-------------------------------------------|
|
||||
| sor-app-secrets | ConnectionStrings__Default | host + admin | Postgres connection string |
|
||||
| sor-app-secrets | Cdn__PublicBaseUrl | host + admin | e.g. https://cdn.aeternalisgames.com |
|
||||
| sor-app-secrets | Cdn__UploadBaseUrl | host + admin | CDN upload endpoint |
|
||||
| sor-app-secrets | Cdn__ApiKey | host + admin | CDN API key |
|
||||
| redis-credentials | connection-string | host only | **Already exists** in stone-server ns |
|
||||
| harbor-credentials | .dockerconfigjson | both pods | Harbor image pull secret |
|
||||
|
||||
---
|
||||
|
||||
## Notes
|
||||
|
||||
- `redis-credentials` is assumed to already exist in the `stone-server` namespace.
|
||||
If the key name inside it is different from `connection-string`, update
|
||||
`deploy/k8s/deployment-host.yaml` to match.
|
||||
|
||||
- The Redis connection string format expected by StackExchange.Redis:
|
||||
`HOST:PORT,password=PASSWORD,ssl=true,abortConnect=false`
|
||||
|
||||
- The Postgres connection string format expected by Npgsql:
|
||||
`Host=HOST;Port=5432;Database=SOR;Username=USER;Password=PASSWORD;`
|
||||
|
||||
- For production, consider enabling SSL on the Postgres connection:
|
||||
`...;SSL Mode=Require;Trust Server Certificate=true`
|
||||
@@ -0,0 +1,28 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: harbor-credentials
|
||||
namespace: stone-server
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
stringData:
|
||||
# Base64-encoded Docker config JSON.
|
||||
# Easiest way to generate this — run locally then paste the output:
|
||||
#
|
||||
# kubectl create secret docker-registry harbor-credentials \
|
||||
# --docker-server=harbor.aeternalisgames.com \
|
||||
# --docker-username=HARBOR_USERNAME \
|
||||
# --docker-password=HARBOR_PASSWORD \
|
||||
# --namespace=stone-server \
|
||||
# --dry-run=client -o yaml
|
||||
#
|
||||
# TODO: replace with output from the command above.
|
||||
.dockerconfigjson: |
|
||||
{
|
||||
"auths": {
|
||||
"harbor.aeternalisgames.com": {
|
||||
"username": "CHANGEME",
|
||||
"password": "CHANGEME",
|
||||
"auth": "CHANGEME_BASE64_OF_USER:PASS"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: sor-app-secrets
|
||||
namespace: stone-server
|
||||
type: Opaque
|
||||
stringData:
|
||||
# Postgres connection string (shared by sor-host and sor-admin).
|
||||
# Format: Host=HOST;Port=5432;Database=SOR;Username=USER;Password=PASSWORD;
|
||||
ConnectionStrings__Default: "Host=172.10.1.127;Port=5432;Database=SOR;Username=SOR-DBA;Password=CHANGEME"
|
||||
|
||||
# CDN — public URL served to clients, upload endpoint, and API key.
|
||||
Cdn__PublicBaseUrl: "https://CHANGEME"
|
||||
Cdn__UploadBaseUrl: "https://CHANGEME"
|
||||
Cdn__ApiKey: "CHANGEME"
|
||||
Reference in New Issue
Block a user