init kube
nexler init kube
local only
Adds k8s/deployment.yaml to an existing app: a Secret (every real value from .env), a Deployment (references the Secret via envFrom, TCP readiness/liveness probes on the app's port, conservative default resource requests/limits), and a ClusterIP Service — three ----separated documents in one file. Unlike init ci's workflows (which resolve an image reference at workflow-run time via GitHub's own context variables), this file is applied directly by kubectl, so it needs a concrete image reference baked in at scaffold time: -image sets it directly, or -registry github derives ghcr.io/<owner>/<repo>:latest straight from go.mod's module path (erroring if it isn't github.com/<owner>/<repo>-shaped — nexler never shells out to git to guess an owner), or -registry dockerhub prompts for your Docker Hub username and derives <user>/<repo>:latest.
-namespace is left out of every resource by default (kubectl's -n/current context decides) unless set explicitly; -replicas defaults to 1. k8s/deployment.yaml is added to .gitignore — unlike docker-compose.yml (which only references .env by path at container runtime), the Secret document here embeds .env's actual values, since Kubernetes has no equivalent way to read a local file at deploy time. Refuses if k8s/deployment.yaml already exists.
nexler init kube -dir ./myapp -registry github nexler init kube -dir ./myapp -image ghcr.io/me/myapp:latest -replicas 3