12 Commits

Author SHA1 Message Date
Dear XoR
42cb7ac5bf feat: zero trust SOPS key isolation (deploy-k3s#32)
- Add test-key (age1wtzdf8...) for shared test environment
- Enable mac_only_encrypted: true in .sops.yaml (SOPS >= 3.9.0)
  Allows adding new YAML fields without decryption key
- Re-encrypt all 10 files with mac_only_encrypted metadata
- Strict isolation: dev-key ↔ *.dev.enc.yaml, prod-key ↔ *.prod.enc.yaml
- test-key can only decrypt *.test.enc.yaml (not dev/prod)
- Add dev/verify-sops-isolation.sh — 33-point verification script
- Keep dev/prod files with admin+dev / admin+prod only (no test-key)

Verified: 33/33 isolation checks passed

Co-authored-by: XoR <xor@benadis.ru>
2026-03-12 17:11:29 +03:00
XoR
bea103a280 fix(test-env): replace Job with initContainer for runner registration
Problem: Job ran on every ArgoCD sync, creating duplicate runners in Gitea.
Solution:
- initContainer gets token + saves to PVC (/data/.registration-token)
- Runner container registers once, persists .runner file in PVC
- Subsequent restarts skip registration (idempotent)
- PVC runner-data (1Gi) persists registration across pod restarts
- Removed register-job.yaml, moved RBAC to rbac.yaml
- Runner waits for DinD before starting
- Stable runner name: test-env-runner
- Labels: edt + ubuntu-latest
2026-03-12 13:29:36 +03:00
XoR
8e06e8a78d fix(test-env): make PG entrypoint idempotent for PVC reuse
Image entrypoint uses set -e + CREATE USER without IF NOT EXISTS.
On PVC reuse the role already exists → entrypoint exits with code 1.
Patch: sed replaces CREATE USER with IF NOT EXISTS variant at startup.
2026-03-12 13:19:23 +03:00
XoR
77d400a562 fix(test-env): remove namespace from kustomization (ArgoCD conflict)
Namespace test-env is shared between test-env and kargo-test-env-pipeline apps.
Having namespace.yaml in both causes ArgoCD OutOfSync conflict.
ArgoCD creates the namespace via syncOptions.CreateNamespace.
2026-03-12 12:37:49 +03:00
Dear XoR
efb2427586 feat(test-env): add 1C test environment (#11)
* feat(test-env): add 1C test environment manifests (#11)

- PostgreSQL 18.x-2.1C StatefulSet with ru_RU.UTF-8 locale init
- 1C server (ragent+crserver+ras) StatefulSet with stable hostname
- Gitea runner Deployment with edt label for apk-ci-ng
- NodePort services for external 1C access (31540-31545)
- Deploy/verify script: dev/deploy-test-env.sh
- config.yaml for ApplicationSet integration
- test-env only in dev cluster (not in prod AppSet)

* fix(test-env): use initContainer for PG data + remove custom entrypoint

PVC mount on /var/lib/postgresql wipes the image's pre-built cluster.
Solution: initContainer copies cluster data from image to PVC on first run.
Removed custom pg-entrypoint.sh ConfigMap — image has its own.

* feat(test-env): DinD sidecar for runner + auto-registration Job

- Add Docker-in-Docker sidecar to gitea-runner Deployment
- Add register-job.yaml: Job that obtains Gitea runner token via API,
  creates Secret, and scales runner to 1
- RBAC: ServiceAccount + Role/ClusterRole for cross-namespace secret access
- Runner labels: edt (for apk-ci-ng), ubuntu-latest

---------

Co-authored-by: XoR <xor@benadis.ru>
2026-03-12 12:33:50 +03:00
XoR
01623cb260 fix: rename traefik-dashboard → traefik-dashboard-https
Avoids race condition with k3s built-in Traefik Helm chart which
creates its own 'traefik-dashboard' IngressRoute. Both charts tried
to own the same resource name, causing Helm install failure when
ArgoCD created it first.
v0.1.0
2026-03-11 20:16:01 +03:00
XoR
4d8ebf96df Revert "fix: remove traefik-dashboard IngressRoute (conflicts with k3s built-in Traefik Helm chart)"
This reverts commit a2d0682168.
2026-03-11 20:10:08 +03:00
XoR
a2d0682168 fix: remove traefik-dashboard IngressRoute (conflicts with k3s built-in Traefik Helm chart)
The built-in k3s Traefik Helm chart creates its own traefik-dashboard
IngressRoute. Our ArgoCD-managed copy blocked Helm install because
Helm requires ownership labels (app.kubernetes.io/managed-by=Helm).

Removing our copy lets the built-in chart manage the dashboard route.
2026-03-11 20:04:55 +03:00
deploy-k3s
77831d73a9 fix: traefik-routes path after bootstrap move
Path was still infra/traefik-routes/manifests, but files moved to
bootstrap/traefik-routes/manifests in the restructuring.
2026-03-11 15:47:35 +03:00
deploy-k3s
f640de781d refactor: bootstrap/infra/ci separation (#27)
- Create bootstrap/ dir: cert-manager, traefik-routes, argo-rollouts,
  kargo, kargo-*-pipeline (not managed by Kargo promotion)
- infra/ now only: gitea, gitea-custom (promoted by Kargo)
- ci/ unchanged: gitea-runner (promoted by Kargo)
- Split kargo/credentials/ into dev/ and prod/ with separate ksops generators
- Remove kargo-credentials from AppSet (managed by Pulumi Go code)
- Update infra Warehouse: only gitea (was also argo-rollouts, cert-manager)
- Update infra Stage dev: only yaml-update for gitea version
- Fix test-env warehouse: valid subscription instead of empty array
- Update step numbers: bootstrap 1-5, infra 1-2
2026-03-11 13:18:22 +03:00
XoR
4dd68859d8 feat: SOPS + age encrypted secrets structure
- .sops.yaml with 3 age keys (admin, dev, prod)
- infra/gitea/values/*.enc.yaml — per-env encrypted Helm values
- infra/kargo/values/*.enc.yaml — per-env encrypted Kargo admin secrets
- kargo/credentials/*.enc.yaml — per-env encrypted git credentials (ksops)
- infra/kargo-credentials/ — ArgoCD app for deploying Kargo creds via ksops
- All repoURLs point to deploy-app-kargo-private

Structure from deploy-app-kargo (reference), adapted for SOPS workflow
2026-03-11 10:01:26 +03:00
Dear XoR
720748be50 Initial commit 2026-03-11 09:29:39 +03:00