Kubernetes
Nanokit can deploy the same nanokit.yml to managed Kubernetes — EKS,
GKE, AKS, or DOKS — as a first-class compute target, with no manifests
to hand-write. There are two distinct paths, and choosing the right one is the
whole story:
| Live deploy | Offline export | |
|---|---|---|
| Command | nkapp up / nkapp deploy | nkapp export k8s |
| Trigger | infra.target: kubernetes in nanokit.yml | any project |
| Cluster required | Yes | No |
| What it does | Nanokit applies and reconciles workloads on the cluster | Writes plain K8s manifests to a file |
| Engine | KubernetesExecutionEngine | @nkapp/runtime-k8s translation layer |
| Use when | You want Nanokit to own the rollout | You run your own GitOps / Helm / kubectl pipeline |
Live deploy (infra.target: kubernetes)
Set the compute target on the environment’s infra block and deploy with the
standard lifecycle commands — Nanokit routes through the dedicated
KubernetesExecutionEngine instead of the Docker engine:
infra:
provider: aws # cloud whose managed K8s you use (aws | gcp | azure | digitalocean)
target: kubernetes # opt into the Kubernetes execution pathnkapp up -e production # or: nkapp deploy -e productionEach cloud maps to its managed offering:
infra.provider | Managed Kubernetes |
|---|---|
aws | EKS |
gcp | GKE |
azure | AKS |
digitalocean | DOKS |
Nanokit translates your services, hosts, env blocks, and scaling settings into
the cluster’s native objects (Deployment, Service, Ingress, ConfigMap,
HorizontalPodAutoscaler) and reconciles them inside its own
nk-<project>-<env> namespace.
[!NOTE] The Kubernetes path bypasses the Docker-only gateway. Routing is handled by the cluster’s
Ingress, not the local Caddy gateway, so the docker-specificensureGatewaystep does not apply.
Offline export (nkapp export k8s)
When you’d rather manage the cluster yourself, generate manifests and feed them to your own tooling — no cluster or cloud credentials needed:
# Write production manifests to .nanokit/k8s/production.yaml
nkapp export k8s -e production
# Pipe straight into kubectl
nkapp export k8s -e production --stdout | kubectl apply -f -The output is standard YAML you can kubectl apply, wrap in a Helm chart, or
commit to a GitOps repo (Argo CD, Flux). See the
nkapp export reference for all flags.
Choosing a path
- Let Nanokit drive → set
infra.target: kubernetesand usenkapp up/deploy. Nanokit owns provisioning, rollout, scaling, and teardown. - Own your pipeline → use
nkapp export k8s. Nanokit only produces manifests; everything after that is your GitOps/Helm/kubectl workflow.
[!TIP] Both paths share the same translation layer, so the workloads Nanokit applies live match the manifests
export k8semits — you can preview a live deploy by exporting first.