Home

Awesome

Kubectl KCL Plugin

Go Report Card GoDoc License

KCL is a constraint-based record & functional domain language. Full documents of KCL can be found here.

This project is a kubectl plugin to generate, mutate and validate Kubernetes manifests using the KCL programming language.

Installation

Use this as a kubectl plugin.

From Krew Index

Add to krew index and install with:

kubectl krew index add kubectl-kcl https://github.com/kcl-lang/kubectl-kcl
kubectl krew install kubectl-kcl/kcl

From GitHub Releases

Download the binary from GitHub releases, then copy the kubectl-kcl binary to your PATH. If not, you can also use the binary standalone.

Usage

kubectl kcl run -f ./examples/kcl-run.yaml

Developing

Prerequisites

git clone https://github.com/kcl-lang/kubectl-kcl.git
cd kubectl-kcl
go run main.go

Test

Unit Test

go test ./...

Integration Test

go run main.go run -f ./examples/kcl-run.yaml

Guides for Developing KCL

Here's what you can do in the KCL script:

Full documents of KCL can be found here.