No description
Find a file
Vincent Ambo 7ac63613fb feat main: Add proper CLI support
Adds a basic CLI structure with a single "run" command that takes a --file (-f)
and --limit (-l) flag.

--limit can be used to only output certain resource sets.

Closes #4
2017-02-08 12:58:53 +01:00
context feat main: Add proper CLI support 2017-02-08 12:58:53 +01:00
example chore: Better example & gofmt 2017-02-08 11:55:59 +01:00
templater feat main: Add proper CLI support 2017-02-08 12:58:53 +01:00
.gitignore chore: Add .gitignore 2017-02-08 11:50:18 +01:00
main.go feat main: Add proper CLI support 2017-02-08 12:58:53 +01:00
README.md docs: Add initial WIP README 2017-02-08 11:50:26 +01:00

KonTemplate - A simple Kubernetes templater

I made this tool out of frustration with the available ways to template Kubernetes resource files. All I want out of such a tool is a way to specify lots of resources with placeholders that get filled in with specific values, based on which context (i.e. k8s cluster) is specified.

Overview

KonTemplate lets you describe resources as you normally would in a simple folder structure:

.
├── prod-cluster.json
└── some-api
    ├── deployment.yaml
    └── service.yaml

This example has all resources belonging to some-api (no file naming conventions enforced at all!) in the some-api folder and the configuration for the cluster prod-cluster in the corresponding file.

Lets take a short look at prod-cluster.json:

{
  "context": "k8s.prod.mydomain.com",
  "include": [
    {
      "name": "some-api",
      "values": {
        "importantFeature": true,
        "apiPort": 4567
      }
    }
  ]
}

Those values are then templated into the resource files of some-api.

Usage

You must have kubectl installed to use KonTemplate.