📚 / Documentation / Tutorials / Writing applications


Sample pipeline

Considering the following vars.yml:

---
packages:
  - name: foobar
    kind: application

klifter will expect a folder applications/foobar to exist, containing all the Kubernetes resources that are part of the application to be deployed.

Generate applications

Applications can be generated with ytt or helm template.

For example, write the following YAML to vars.yml:

---
tools:
 - vault
 - helm

packages:
 - name: generate-foobar
   kind: bundle
 - name: foobar
   kind: applications

environment:
 - VAULT_TOKEN

And create the following tree:

|-- charts/
|   |-- foobar-chart/
|       |-- ...
|-- bundles/
|   |-- generate-foobar/
|       |-- 10-helm-template.sh
|-- applications/
|   |-- foobar/
|       |-- .gitkeep
|-- vars.yml

Write to the bundles/generate-foobar/10-helm-template.sh script the following:

#!/bin/bash

set -eux

VAULT="vault read secret/foobar-values -format yaml"
HELM="helm template foobar ./charts/foobar-chart -n foobar-system -f -"

$VAULT | $HELM > ./applications/foobar/manifest.yml

What’s next?

Learn more about kapp or read the Tools reference.