How-to guide / Start and inspect a Kix project
Deploy to kind
These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.
Use kind to run a Kubernetes cluster in Docker for local Kix development. The
kix-examples repository includes a single-node kind configuration and clusters
that are safe to deploy together.
This guide assumes Docker, kind, kubectl, and Kix are installed.
Create the cluster
Section titled “Create the cluster”From the kix-examples repository, create the configured cluster:
❱ kind create cluster --config kind-config.yaml The configuration names the cluster kix-demo. Kind creates the kubectl
context kind-kix-demo and selects it as the current context.
Confirm that kubectl can reach the API server:
❱ kubectl cluster-info
Kubernetes control plane is running at https://127.0.0.1:39863
CoreDNS is running at https://127.0.0.1:39863/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. If another context is current, select the kind context explicitly:
❱ kubectl config use-context kind-kix-demo Check the cluster definition
Section titled “Check the cluster definition”Validate the example before connecting Kix to Kubernetes:
❱ kix check how-to-application
TOOL RESULT DETAILS
eval pass 15 manifests evaluated
scorecard pass 0 errors, 11 warnings, 2 info
governance.hasOwner (warning), 2:
how-to-app/preview: package 'preview' has no meta.owner
how-to-app/production: package 'production' has no meta.owner
reliability.boundedResources (warning), 2:
how-to-app/preview/preview: container 'nginx' is missing resource settings: limits.cpu. Set CPU and memory requests and limits.
how-to-app/production/production: container 'nginx' is missing resource settings: limits.cpu. Set CPU and memory requests and limits.
reliability.hasProbes (warning), 2:
how-to-app/preview/preview: container 'nginx' has no livenessProbe
how-to-app/production/production: container 'nginx' has no livenessProbe
security.hasNetworkPolicy (warning), 1:
how-to-app: namespace 'how-to-app' has workloads but no network policy
security.nonRoot (warning), 2:
how-to-app/preview/preview: container 'nginx' may run as root: neither it nor the pod sets securityContext.runAsNonRoot, and no non-zero runAsUser resolves for it
how-to-app/production/production: container 'nginx' may run as root: neither it nor the pod sets securityContext.runAsNonRoot, and no non-zero runAsUser resolves for it
security.readOnlyRootfs (warning), 2:
how-to-app/preview/preview: container 'nginx' does not set readOnlyRootFilesystem
how-to-app/production/production: container 'nginx' does not set readOnlyRootFilesystem
2 info finding(s) not listed; run with -v to list them. This evaluates the cluster and runs its configured validation without applying resources.
Deploy the application
Section titled “Deploy the application”Deploy the cluster and accept the plan:
❱ kix deploy how-to-application -y Show outputHide output · 76 lines
Building cluster 'how-to-application'...
Cluster how-to-application: 15 manifests
Connecting to context kind-kix-docs (https://127.0.0.1:41673)...
No previous deployment record on the cluster. First deploy.
Note: Cluster 'how-to-application' does not set `cluster.kubernetes.uid`, so Kix continues without checking that context kind-kix-docs (https://127.0.0.1:41673) is the right Kubernetes cluster.
If this is the right cluster, set `cluster.kubernetes.uid = "a5616cf1-7239-4ec7-aeef-10744af12935";` in the 'how-to-application' cluster definition. Once set, Kix refuses to deploy 'how-to-application' to any other cluster. See https://kix.run/docs/how-to/operate-a-cluster/bind-a-cluster-definition-to-its-kubernetes-cluster/.
_cluster
~ cluster-level resources (1 changed, 1 added)
how-to-app
+ preview 1.0.0 (3 resources)
+ production 1.0.0 (5 resources)
kube-system
+ platform-dns (0 resources)
+ platform-storage (0 resources)
Plan: 4 added, plus cluster-level changes
Resources: 2 changed in content, 0 tracking annotation only (no spec change or restart)
Not checked by the dry run (13); their changes come from comparing builds:
? 5 uses a Kix CustomResourceDefinition that Kix installs when the deploy starts:
Activation.kix.run/how-to-application-6n94gibgl7zv
PackageInstance.kix.run/platform-dns@kube-system
PackageInstance.kix.run/platform-storage@kube-system
PackageInstance.kix.run/preview@how-to-app
PackageInstance.kix.run/production@how-to-app
? 8 is in a Namespace created by this deploy:
ConfigMap/preview@how-to-app
ConfigMap/production-health-script@how-to-app
ConfigMap/production@how-to-app
Deployment.apps/preview@how-to-app
Deployment.apps/production@how-to-app
and 3 more (-o json lists them)
Not checked by any preview: whether Pods start, pull their images, and pass their readiness probes.
Objects: 15 to write, 0 to delete (sha256:07cee0a29c16dacc33ca673983cd67849f9543557982765268e4d34ac9e9f630)
plan: 15 nodes
~ Namespace/kube-system configured
✔ Namespace/kube-system ready
+ Namespace/how-to-app created
✔ Namespace/how-to-app ready
+ ConfigMap/preview@how-to-app created
✔ ConfigMap/preview@how-to-app ready
+ ConfigMap/production-health-script@how-to-app created
✔ ConfigMap/production-health-script@how-to-app ready
+ ConfigMap/production@how-to-app created
✔ ConfigMap/production@how-to-app ready
+ Deployment.apps/preview@how-to-app created
+ PackageInstance.kix.run/platform-storage@kube-system created
+ PackageInstance.kix.run/platform-dns@kube-system created
+ Deployment.apps/production@how-to-app created
✔ PackageInstance.kix.run/platform-storage@kube-system ready
… Deployment.apps/preview@how-to-app waiting: Deployment/preview: 0/1 updated pods ready; pod preview-689b78858d-vhfzn cannot be scheduled: 0/1 nodes are available: 1 node(s) had untolerated taint(s). no new claims to deallocate, preemption: 0/1 nodes are available: 1 Preemption is not helpful for scheduling. (idle 10s) (14s of 180s); 3 objects wait for it: Service/preview@how-to-app and 2 more
… PackageInstance.kix.run/platform-dns@kube-system waiting: Service exists, waiting for ready endpoints (14s of 180s); 3 objects wait for it: Activation.kix.run/how-to-application-6n94gibgl7zv, Job.batch/production-health@how-to-app, and 1 more
… Deployment.apps/production@how-to-app waiting: Deployment/production: 0/2 updated pods ready; pod production-85577f7474-bbvch cannot be scheduled: 0/1 nodes are available: 1 node(s) had untolerated taint(s). no new claims to deallocate, preemption: 0/1 nodes are available: 1 Preemption is not helpful for scheduling. (idle 10s) (14s of 180s); 4 objects wait for it: Service/production@how-to-app and 3 more
✔ PackageInstance.kix.run/platform-dns@kube-system ready
… Deployment.apps/preview@how-to-app waiting: Deployment/preview: 0/1 updated pods ready; pod preview-689b78858d-vhfzn/nginx is waiting: ContainerCreating (idle 18s) (34s of 180s); 3 objects wait for it: Service/preview@how-to-app and 2 more
… Deployment.apps/production@how-to-app waiting: Deployment/production: 1/2 updated pods ready; pod production-85577f7474-h8s47/nginx is waiting: ContainerCreating (idle 0s) (34s of 180s); 4 objects wait for it: Service/production@how-to-app and 3 more
✔ Deployment.apps/preview@how-to-app ready
+ Service/preview@how-to-app created
✔ Service/preview@how-to-app ready
+ PackageInstance.kix.run/preview@how-to-app created
✔ PackageInstance.kix.run/preview@how-to-app ready
✔ Deployment.apps/production@how-to-app ready
+ Service/production@how-to-app created
✔ Service/production@how-to-app ready
+ recreate Job.batch/production-health@how-to-app created
✔ Job.batch/production-health@how-to-app ready
+ PackageInstance.kix.run/production@how-to-app created
✔ PackageInstance.kix.run/production@how-to-app ready
~ Activation.kix.run/how-to-application-6n94gibgl7zv configured
✔ Activation.kix.run/how-to-application-6n94gibgl7zv ready
• activation 'how-to-application-6n94gibgl7zv' → Active
Deploy complete: 13 created, 2 configured, 0 unchanged, 0 failed Kix builds the manifests, compares them with the current activation, applies resources in dependency order, waits for readiness, runs the production health check, and records the new activation.
The captured deployment ends with the activation becoming Active. A failed
resource or post-deploy check prevents that transition.
Inspect the result
Section titled “Inspect the result”Check the namespaces and workloads with kubectl:
❱ kubectl get namespaces
NAME STATUS AGE
default Active 76s
how-to-app Active 67s
kube-node-lease Active 76s
kube-public Active 76s
kube-system Active 76s
local-path-storage Active 71s ❱ kubectl get deployments,services,jobs -n how-to-app
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/preview 1/1 1 1 67s
deployment.apps/production 2/2 2 2 67s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/preview ClusterIP 10.96.142.186 <none> 80/TCP 41s
service/production ClusterIP 10.96.185.92 <none> 80/TCP 27s
NAME STATUS COMPLETIONS DURATION AGE
job.batch/production-health Complete 1/1 12s 27s Use Kix to check that every object of the deploy is on the cluster, unchanged, and ready:
❱ kix status how-to-application 1Cluster how-to-application on Kubernetes v1.35.0 (context kind-kix-demo)2Last deploy: how-to-application-6rhi3wpk9iml Active 2m ago3
4 how-to-app/preview 4 resources ok5 how-to-app/production 6 resources ok6 kube-system/platform-dns 1 resource ok7 kube-system/platform-storage 1 resource ok8 (cluster-level) 4 resources ok9
1016 resources: 16 ok.Remove the local cluster
Section titled “Remove the local cluster”When you no longer need it, delete the kind cluster:
❱ kind delete cluster --name kix-demo This removes the local Kubernetes cluster and everything deployed into it. It
does not change the files in kix-examples.