Implement app deployment improvements

This commit is contained in:
2026-05-22 22:25:40 +02:00
parent 60a9e37a86
commit 934770cb68
15 changed files with 552 additions and 25 deletions

View File

@@ -14,6 +14,27 @@ VERGABE_CHART ?= charts/vergabe-teilnahme
VERGABE_VALUES ?= helm/vergabe-teilnahme-values.yaml
VERGABE_INGRESS ?= manifests/vergabe-teilnahme-ingress.yaml
VERGABE_DB_SECRET ?= vergabe-app-credentials
VERGABE_ENV_SECRET ?= vergabe-teilnahme-env
VERGABE_DB_USER ?= vergabe
VERGABE_DB_HOST ?= apps-pg-rw.databases
VERGABE_DB_PORT ?= 5432
VERGABE_DB_NAME ?= vergabe_db
SOPS_SENTINEL ?= $(GITEA_VALUES)
DRY_RUN_CREATE_NAMESPACES ?= false
##@ Operator checks
check-tools: ## Check required operator tools and warn about optional diagnostics
tools/check-tools.sh
check-sops: ## Verify the local SOPS age key can decrypt the configured sentinel
SOPS_SENTINEL=$(SOPS_SENTINEL) tools/check-sops.sh
k8s-server-dry-run: ## Server-side dry-run rendered Helm and committed manifests
DRY_RUN_CREATE_NAMESPACES=$(DRY_RUN_CREATE_NAMESPACES) tools/k8s-server-dry-run.sh
##@ Gitea
gitea-deploy: ## Deploy / upgrade Gitea (S5 workload)
@@ -29,7 +50,22 @@ gitea-status: ## Check Gitea health
kubectl get pods -n $(GITEA_NAMESPACE) -l app.kubernetes.io/instance=$(GITEA_RELEASE)
kubectl get svc -n $(GITEA_NAMESPACE) $(GITEA_RELEASE)
kubectl get ingress -n $(GITEA_NAMESPACE) $(GITEA_RELEASE) --ignore-not-found
kubectl cnpg status gitea-db -n databases
@if kubectl cnpg status gitea-db -n databases >/dev/null 2>&1; then \
kubectl cnpg status gitea-db -n databases; \
else \
echo "kubectl cnpg plugin not available; falling back to cnpg resources"; \
kubectl get cluster gitea-db -n databases; \
kubectl get pods -n databases -l cnpg.io/cluster=gitea-db; \
fi
apps-pg-status: ## Check the shared apps-pg cnpg cluster
@if kubectl cnpg status apps-pg -n databases >/dev/null 2>&1; then \
kubectl cnpg status apps-pg -n databases; \
else \
echo "kubectl cnpg plugin not available; falling back to cnpg resources"; \
kubectl get cluster apps-pg -n databases; \
kubectl get pods -n databases -l cnpg.io/cluster=apps-pg; \
fi
##@ Vergabe Teilnahme
@@ -61,11 +97,21 @@ vergabe-superuser: ## Open an interactive shell for createsuperuser
vergabe-logs: ## Tail vergabe-teilnahme app logs
kubectl logs -n $(VERGABE_NAMESPACE) -l app.kubernetes.io/instance=$(VERGABE_RELEASE) -f --tail=50
vergabe-db-url-secret: ## Rebuild DATABASE_URL with a URL-encoded cnpg password
APP_NAMESPACE=$(VERGABE_NAMESPACE) \
APP_ENV_SECRET=$(VERGABE_ENV_SECRET) \
APP_DB_SECRET=$(VERGABE_DB_SECRET) \
APP_DB_USER=$(VERGABE_DB_USER) \
APP_DB_HOST=$(VERGABE_DB_HOST) \
APP_DB_PORT=$(VERGABE_DB_PORT) \
APP_DB_NAME=$(VERGABE_DB_NAME) \
tools/build-database-url-secret.sh
##@ Help
help: ## Show this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} \
/^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } \
/^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } \
/^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) }' $(MAKEFILE_LIST)
.PHONY: gitea-deploy gitea-ingress-deploy gitea-status vergabe-dry-run vergabe-deploy vergabe-ingress-deploy vergabe-status vergabe-migrate vergabe-seed vergabe-superuser vergabe-logs help
.PHONY: check-tools check-sops k8s-server-dry-run gitea-deploy gitea-ingress-deploy gitea-status apps-pg-status vergabe-dry-run vergabe-deploy vergabe-ingress-deploy vergabe-status vergabe-migrate vergabe-seed vergabe-superuser vergabe-logs vergabe-db-url-secret help