Cookie cutter templating tool for scaffolding K8s manifests
🍪✂️ Cookie cutter for Kubernetes resource manifests
(Pronounced as "cube cutter")
kubekutr
lets you quickly scaffold a bespoke configuration for Kubernetes resource manifests with an opinionated GitOps directory structure. kubekutr
is ideally meant to be used in combination with kustomize.
kustomize
is a great tool when it comes to declarative application management for manifests. There still exists a lot of manual scaffolding to create a base which defines your application state. kubekutr
aims to solve the issue of writing these manifests manually by providing a very simple Go template rendering engine.
Read the blog post for more information.
kubekutr
doesn't aim to provide all 1000s of options of templating yaml
files. More users mean every user will want to customise the yaml
in some way or the other and this is where kustomize
comes into picture. Users of kubekutr
are encourage to use kustomize
to create variants on top of bases
to apply any kind of customisation. kubekutr
's only goal is to create the base directory.
$ sudo snap install kubekutr
$ cd "$(mktemp -d)"
$ curl -sL "https://github.com/mr-karan/kubekutr/releases/download/0.8.2/kubekutr_0.8.2_$(uname)_amd64.tar.gz" | tar xz
$ mv kubekutr /usr/local/bin
# kubekutr should be available now in your $PATH
$ kubekutr --version
NAME:
kubekutr - Cookie cutter for Kubernetes resource manifests
USAGE:
kubekutr [global options] command [command options] [arguments...]
VERSION:
4175090 (2020-02-06 18:03:26 +0530)
AUTHOR:
Karan Sharma @mrkaran
COMMANDS:
scaffold, s Scaffold a new project with gitops structure
init, i Initialize a new project. Initializes git repo and a sample config file.
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--verbose Enable verbose logging
--config value, -c value path to one or more config files
--help, -h show help
--version, -v print the version
kubekutr init
kubekutr init --default
Either of these options create a config file kubekutr.yml
in your current working directory. You can edit this file further to suit your needs and scaffold a project using this.
kubekutr init -o <filename.yml>
Override the default config filename.
# create a new base
$ kubekutr --config kubekutr.yml scaffold -o myproject
# `myproject` is created with the GitOps structure
myproject
`-- base
|-- app
| |-- app-deployment.yml
| |-- app-ingress.yml
| |-- app-service.yml
|-- second-app
|-- db-statefulset.yml
If you'd like to generate a super simple, default kustomization.yml
in base
folder at the time of scaffolding, you can specify --kustomize
or -k
with scaffold
:
kubekutr --config kubekutr.yml scaffold -o myproject -k
resources:
- app/app-service.yml
- app/app-deployment.yml
- app/app-service.yml
- app/app-ingress.yml
- second-app/db-statefulset.yml
You can see a sample configuration file here.
name: Name of the workload. A workload represents the complete set of resources required to deploy an application
deployments
Pod
"app.kubernetes.io/tier: cache"
Service
manifest based on the port settings of container.statefulsets
services
ClusterIP
, NodePort
, LoadBalancer
ingresses
Give a ⭐️ if this project helped you!
This is still an alpha release. For a full list of things to improve, see unchecked items in TODO. Contributions welcome!