Skip to content

Instantly share code, notes, and snippets.

@ant31
Last active September 8, 2017 10:41
Show Gist options
  • Save ant31/43e82d9e6478ed3b197676125ac1c901 to your computer and use it in GitHub Desktop.
Save ant31/43e82d9e6478ed3b197676125ac1c901 to your computer and use it in GitHub Desktop.
Kpm Manfiests
# Manifest 'hand-written' by the user
# metadata: ~equivalent to Chart.yaml
package:
name: foo/bar
version: 0.0.1
# List resources to deploy
resources:
# can be a template
# jinja2
- template: deployment.yaml.j2
expander: jinja2
# jsonnet
- template: svc.jsonnet
expander: jsonnet
# can be a file-path to import
- file: ingress.yaml
# can be an inlined resource
- value: {apiVersion: 'v1', kind: 'ServiceAccount',
metadata: {name: 'app-sa'}}
# Could be a globing / recursive walk (No-implemented)
- file: resources/**/*.yaml
recursive: true
# Manifest generated to be consumed by the CLI / API
# Difference: resources are expanded and all included
package:
name: foo/bar
version: 0.0.1
# List resources to deploy
resources:
# the jinja2 resource
- {"kind": "Deployment",
"spec": {
"template": {
"spec": {
....
# the jsonnet resource
- {"kind": "Service",
"spec": {
"type": "ClusterIP",
"ports": [
{
"targetPort": 80,
"protocol": "TCP",
"port": 80
}
],}
# inlined resource
- {apiVersion: 'v1', kind: 'ServiceAccount',
metadata: {name: 'app-sa'}}
- ...
# Same than manifest.yaml, but using jsonnet
package: {
name: "foo/bar",
version: "0.0.1"},
resources: [
# can be a template
# jinja2
import("deployment.jsonnet"),
import("svc.jsonnet"),
import("...")
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment