Skip to main content

Getting Started

Welcome to the Kosko documentation! Before we start, make sure your computer meets the following system requirements.

  • Node.js 18 or later.

Automatic Setup

It's recommended to setup a Kosko project with create-kosko command, which sets up basic folder structure and installs everything you need automatically.

npm create kosko@latest example

After installation complete, the command will generate following files in example folder.

.
├── README.md
├── components
│   └── nginx.js
├── environments
│   └── dev
│   ├── index.js
│   └── nginx.js
├── kosko.toml
├── package-lock.json
└── package.json

Manual Setup

Install kosko, @kosko/env and kubernetes-models.

npm install kosko @kosko/env kubernetes-models

Create a new component with @kosko/template-deployed-service template.

npx @kosko/template-deployed-service --name nginx --image nginx

Generate YAML

Run kosko generate to print Kubernetes manifests in the console.

npx kosko generate

Pipe the output to kubectl to apply to a cluster.

npx kosko generate | kubectl apply -f -

If you don't want to print manifests to console, run kosko validate.

npx kosko validate