← ClaudeAtlas

deploying-cloud-k8slisted

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.
aiskillstore/marketplace · ★ 329 · DevOps & Infrastructure · score 79
Install: claude install-skill aiskillstore/marketplace
# Deploying Cloud K8s ## Quick Start 1. Check cluster architecture: `kubectl get nodes -o jsonpath='{.items[*].status.nodeInfo.architecture}'` 2. Match build platform to cluster (arm64 vs amd64) 3. Set up GitHub Actions with path filters 4. Deploy with Helm, passing secrets via `--set` ## Critical: Build-Time vs Runtime Variables ### The Problem Next.js `NEXT_PUBLIC_*` variables are **embedded at build time**, not runtime: ```dockerfile # WRONG: Runtime ENV does nothing for NEXT_PUBLIC_* ENV NEXT_PUBLIC_API_URL=https://api.example.com # RIGHT: Must be build ARG ARG NEXT_PUBLIC_API_URL=https://api.example.com ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL ``` ### Build-Time (Next.js) | Variable | Purpose | |----------|---------| | `NEXT_PUBLIC_SSO_URL` | SSO endpoint for browser OAuth | | `NEXT_PUBLIC_API_URL` | API endpoint for browser fetch | | `NEXT_PUBLIC_APP_URL` | App URL for redirects | ### Runtime (ConfigMaps/Secrets) | Variable | Source | |----------|--------| | `DATABASE_URL` | Secret (Neon/managed DB) | | `SSO_URL` | ConfigMap (internal K8s: `http://sso:3001`) | | `BETTER_AUTH_SECRET` | Secret | ## Architecture Matching **BEFORE ANY DEPLOYMENT**, check architecture: ```bash kubectl get nodes -o jsonpath='{.items[*].status.nodeInfo.architecture}' # Output: arm64 arm64 OR amd64 amd64 ``` ### Docker Build ```yaml - uses: docker/build-push-action@v5 with: platforms: linux/arm64 # MATCH YOUR