https://github.com/kubernauts/parameterizer
The babelfish of Kubernetes app lifecycle management
https://github.com/kubernauts/parameterizer
application crd helm installer ksonnet kubernetes operator
Last synced: 12 months ago
JSON representation
The babelfish of Kubernetes app lifecycle management
- Host: GitHub
- URL: https://github.com/kubernauts/parameterizer
- Owner: kubernauts
- License: apache-2.0
- Created: 2018-02-25T11:13:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-27T08:42:14.000Z (about 8 years ago)
- Last Synced: 2025-06-28T18:29:28.032Z (12 months ago)
- Topics: application, crd, helm, installer, ksonnet, kubernetes, operator
- Language: Go
- Homepage:
- Size: 388 KB
- Stars: 35
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Parameterizer
[](https://goreportcard.com/report/github.com/kubernauts/parameterizer)
[](https://godoc.org/github.com/kubernauts/parameterizer)
`Parameterizer` is a command line tool and Kubernetes operator for handling application lifecycle management, generically.
**Currently tested and works only with Kubernetes 1.9**
Just like `Ingress` allows to generically define how traffic is routed to Kubernetes services, with different backends (NGINX, HAProxy) providing the functionality, the `Parameterizer` resource defines a sequence of commands applied to an app definition input (directory or registry such as [Quay.io](https://quay.io/application/) or [Kubestack](https://www.kubestack.com/)), turning Kubernetes application definitions (e.g. expressed in [Helm templates](https://github.com/kubernetes/helm/blob/master/docs/chart_template_guide/functions_and_pipelines.md), [ksonnet](https://ksonnet.io/docs/concepts), [kapitan](https://github.com/deepmind/kapitan), etc.) along with user-defined parameters into a parameterized Kubernetes YAML manifest.
This parameterized YAML manifest defines the necessary deployments, services, etc. for the app and can, for example, be used in a `kubectl apply` command to create the resources or via Helms' [Tiller](https://docs.helm.sh/glossary/#tiller), [appr](https://github.com/app-registry/appr), or other installers/ALM tools.
The overall `Parameterizer` architecture is as follows:

## Install
For now we do not provide binaries so you'll need to have [Go](https://golang.org/dl/) installed to use the `krm` CLI tool. We've been testing it using `go1.9.2 darwin/amd64` and `go version go1.10 darwin/amd64`.
To build `krm` from source, do the following:
```
$ go get github.com/kubernauts/parameterizer/cli/krm
```
Note that if your `$GOPATH/bin` is in your `$PATH` then now you can use `krm` from everywhere. If not, you can 1) do a `cd $GOPATH/src/github.com/kubernauts/parameterizer/cmd` followed by a `go build` and use it from this directory, or 2) run it using `$GOPATH/bin/krm`.
## Use
In general, the workflow would be something like:
1. the application author creates the `Parametrizer` manifest along with its package such as a `helm-chart.yaml`.
1. the operator can then take the `Parametrizer` resource and deploy the application with the installer or deploy manager she wants (e.g. `kubectl`).
1. in addition to above, the operator can create a new `Parametrizer` resource to chain additional transformations and/or or compose dependencies.
For example, if you have the following `Parameterizer` resource in a file `kubeless.yaml` ([source](examples/kubeless.yaml)):
```yaml
kind: Parameterizer
apiVersion: kubernetes.sh/v1alpha1
metadata:
name: install-kubeless
spec:
resources:
- name: kubeless-jsonnet
source:
fetch:
urls:
- https://raw.githubusercontent.com/kubeless/kubeless/master/kubeless.jsonnet
- https://raw.githubusercontent.com/kubeless/kubeless/master/kubeless-non-rbac.jsonnet
dest: /resources
volumeMounts:
- name: kubeless-input
mountPath: /resources
volumes:
- name: kubeless-input
emptyDir: {medium: ""}
transformations:
- container:
name: ksonnet
image: quay.io/ant31/ksonnet
command:
- kubecfg
- show
- -o
- yaml
- /resources/kubeless.jsonnet
volumeMounts:
- name: kubeless-input
mountPath: /resources
```
You can apply the parameters and install the app like so:
```
$ krm expand kubeless.yaml | kubectl apply -f -
```
## Test
For now, just the simple unit-level test in Go (that is, no integration tests yet):
```
$ cd $GOPATH/src/github.com/kubernauts/parameterizer/pkg/parameterizer
$ go test
PASS
ok github.com/kubernauts/parameterizer/pkg/parameterizer 0.007s
```