27

Kosko – Write Kubernetes Manifests in JavaScript

 5 years ago
source link: https://www.tuicool.com/articles/hit/NfeIRbN
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

kosko

Write Kubernetes manifests in JavaScript.

kosko is inspired by ksonnet but use JavaScript instead of jsonnet . Unlike ksonnet , kosko neither touchs Kubernetes clusters nor supports Helm . It's focus on building and organizing Kubernetes manifests in JavaScript.

Features

  • Use JavaScript or any languages compiled to JavaScript. (e.g. TypeScript )
  • Manage multiple environments.
  • Validate against Kubernetes OpenAPI definitions.
  • Reuse variables and functions across components.

Installation

Install kosko globally with npm.

npm install -g kosko

Getting Started

Setup

First, run kosko init to set up a new kosko directory and npm install to install dependencies.

kosko init example
cd example
npm install

Create a Component

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

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

This template creates a new file named nginx.js in components folder.

Generate Kubernetes Manifests

Run kosko generate to print Kubernetes manifests in the console.

kosko generate

Pipe the output to kubectl to apply to a cluster.

kosko generate | kubectl apply -f -

Documentation

Examples

Packages

Core

Templates

Related

License

MIT


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK