Add automated Kubernetes deployment to CI/CD pipeline#6
Conversation
Replace Azure Key Vault secrets fetching in deploy.sh with environment variables (K8S_CONFIG, HOSTNAME, API_CLIENT_ID) sourced from GitHub Actions secrets. Add deploy job to pipeline that runs after image publishing, using official Twingate action to connect to homelab K8s cluster before executing Helm deployments. https://claude.ai/code/session_01PfV6sZGpFXbZd4VDzF7hMi
|
PR Review: Add automated Kubernetes deployment to CI/CD pipeline. Good overall direction - moving secrets from Key Vault lookups to GitHub Actions secrets simplifies CI/CD integration. Issues: (1) HOSTNAME is a reserved bash variable - automatically set by bash to the system hostname, so the validation check in deploy.sh silently passes locally. Rename to DEPLOY_HOSTNAME or APP_HOSTNAME. (2) Deploy job runs even when no new images were published - it always runs after publish jobs complete regardless of whether hasNextVersion was true. Expose job outputs and condition the deploy job on them. (3) Docker Hub tag fetching introduces a race condition - fetching the latest tag dynamically rather than using the version just published risks deploying a stale version. Pass published versions as job outputs instead. (4) Missing set -o pipefail - deploy.sh uses set -e but piped curl commands can fail silently since jq succeeds on empty input. (5) Unquoted variables in helm --set flags risk word-splitting. (6) twingate/github-action@v1 uses a mutable tag - pin to a commit SHA. (7) Minor: AZURE_KEYVAULT_ENDPOINT is hardcoded - add an inline comment noting it is static infrastructure. |
Summary
This PR adds an automated deployment job to the CI/CD pipeline that deploys both server and client applications to Kubernetes after successful image publication. It also refactors the deployment script to use GitHub Actions secrets instead of Azure Key Vault for configuration management.
Key Changes
New
deployjob in pipeline: Added a new deployment stage that runs after both server and client images are published, but only on pushes to the main branchRefactored
scripts/deploy.sh: Migrated from Azure Key Vault to environment variables for better CI/CD integrationK8S_CONFIG,HOSTNAME, andAPI_CLIENT_IDas environment variables with validationNotable Implementation Details
/dev/shm) for enhanced securityhttps://claude.ai/code/session_01PfV6sZGpFXbZd4VDzF7hMi