Skip to content

feat: migrate from Docker Compose to k3s - #39

Draft
dddictionary wants to merge 1 commit into
mainfrom
feat/k3s-migration
Draft

feat: migrate from Docker Compose to k3s#39
dddictionary wants to merge 1 commit into
mainfrom
feat/k3s-migration

Conversation

@dddictionary

Copy link
Copy Markdown
Owner

Summary

  • Add /healthz endpoint (DB health check) for k8s readiness/liveness probes
  • Add k8s manifests: backend (2 replicas, rolling update), MariaDB (StatefulSet), Traefik ingress with cert-manager TLS, full monitoring stack (Prometheus, Grafana, node-exporter)
  • Rewrite deploy workflow to build images in CI → push to GHCR → rolling update via kubectl set image, eliminating downtime from on-server Rust compilation

Test plan

  • cargo check passes (verified locally)
  • kubectl apply --dry-run=server -R -f k8s/ on VPS after k3s install
  • Push to main → GitHub Actions builds image → deploys via rolling update
  • curl -I https://4brar.me returns 200
  • curl -I https://observe.4brar.me returns 200
  • Zero-downtime: no non-200 responses during a deploy

VPS prerequisites

  1. Install k3s: curl -sfL https://get.k3s.io | sh -
  2. Install cert-manager: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml

- Add /healthz endpoint for k8s readiness/liveness probes
- Add GHCR image label to Dockerfile
- Add k8s manifests (backend, mariadb, ingress, monitoring)
- Rewrite deploy workflow: build in CI, push to GHCR, rolling update via kubectl
@dddictionary
dddictionary marked this pull request as draft March 10, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant