Skip to Content
InfrastructureKubernetes

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 deployOffline export
Commandnkapp up / nkapp deploynkapp export k8s
Triggerinfra.target: kubernetes in nanokit.ymlany project
Cluster requiredYesNo
What it doesNanokit applies and reconciles workloads on the clusterWrites plain K8s manifests to a file
EngineKubernetesExecutionEngine@nkapp/runtime-k8s translation layer
Use whenYou want Nanokit to own the rolloutYou 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 path
nkapp up -e production # or: nkapp deploy -e production

Each cloud maps to its managed offering:

infra.providerManaged Kubernetes
awsEKS
gcpGKE
azureAKS
digitaloceanDOKS

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-specific ensureGateway step 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: kubernetes and use nkapp 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 k8s emits — you can preview a live deploy by exporting first.