From 9ffe07b9a9c6065583ba4c9685fd30409bc6ed9d Mon Sep 17 00:00:00 2001 From: William Valentin Date: Wed, 5 Nov 2025 12:50:49 -0800 Subject: [PATCH] feat(k8s): integrate registry secret into deployment workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add deploy/k8s/registry-secret.yaml with Gitea registry credentials - Make registry-secret namespace-agnostic (removed hardcoded 'tools' namespace) - Update k8s-deploy target to automatically apply registry secret - Simplify deployment workflow - no longer requires manual k8s-secret-create step - Update help documentation to reflect streamlined deployment process The registry secret is now automatically deployed to the target namespace, making the deployment workflow more convenient and consistent across all environments (dev, staging, prod). 🤖 Generated with OpenCode Co-Authored-By: OpenCode --- Makefile | 8 +++----- deploy/k8s/registry-secret.yaml | 7 +++++++ 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 deploy/k8s/registry-secret.yaml diff --git a/Makefile b/Makefile index 1441727..12162d9 100644 --- a/Makefile +++ b/Makefile @@ -52,8 +52,7 @@ help: @echo "" @echo "Kubernetes Deployment:" @echo " k8s-namespace-create Create namespace (K8S_NAMESPACE=name)" - @echo " k8s-secret-create Create image pull secrets (requires GITEA_PASSWORD)" - @echo " k8s-deploy Deploy all manifests to namespace" + @echo " k8s-deploy Deploy all manifests to namespace (includes registry secret)" @echo " k8s-deploy-dev Deploy to adopt-a-street-dev" @echo " k8s-deploy-staging Deploy to adopt-a-street-staging" @echo " k8s-deploy-prod Deploy to adopt-a-street-prod" @@ -247,8 +246,7 @@ k8s-test-deploy-dev: @echo "Running manifest validation..." @$(MAKE) K8S_NAMESPACE=adopt-a-street-dev k8s-test-manifests @echo "" - @echo "Note: Run 'make k8s-secret-create K8S_NAMESPACE=adopt-a-street-dev GITEA_PASSWORD=xxx' before deploying" - @echo "Note: Run 'make k8s-deploy-dev' to actually deploy" + @echo "Note: Run 'make k8s-deploy-dev' to deploy (includes registry secret)" # ==================== Kubernetes Deployment ==================== @@ -274,7 +272,7 @@ endif k8s-deploy: k8s-namespace-create @echo "Deploying to namespace: $(K8S_NAMESPACE)..." - @echo "Note: Ensure you've created secrets with 'make k8s-secret-create'" + @kubectl apply -f deploy/k8s/registry-secret.yaml -n $(K8S_NAMESPACE) @kubectl apply -f deploy/k8s/configmap.yaml -n $(K8S_NAMESPACE) @kubectl apply -f deploy/k8s/secrets.yaml -n $(K8S_NAMESPACE) 2>/dev/null || echo "Warning: secrets.yaml not found or already exists" @kubectl apply -f deploy/k8s/couchdb-configmap.yaml -n $(K8S_NAMESPACE) diff --git a/deploy/k8s/registry-secret.yaml b/deploy/k8s/registry-secret.yaml new file mode 100644 index 0000000..6b8af2e --- /dev/null +++ b/deploy/k8s/registry-secret.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +data: + .dockerconfigjson: eyJhdXRocyI6eyJnaXRlYS1odHRwLnRhaWxkYjM0OTQudHMubmV0Ijp7InVzZXJuYW1lIjoid2lsbCIsInBhc3N3b3JkIjoiZnJhY2s2NjYiLCJlbWFpbCI6IndpbGxAd2lsbHMtcG9ydGFsLmNvbSIsImF1dGgiOiJkMmxzYkRwbWNtRmphelkyTmc9PSJ9fX0= +kind: Secret +metadata: + name: regcred +type: kubernetes.io/dockerconfigjson