Helm
Config
- stack.cue
- builder.cue
package main
import (
"stakpak.dev/devx/v1"
"stakpak.dev/devx/v1/traits"
)
stack: v1.#Stack & {
components: {
cowsay: {
traits.#Helm
helm: {
k8s: version: minor: 19
url: "stakpak.dev"
chart: "guku"
version: "v1"
namespace: "somethingelse"
values: {
bla: 123
}
}
}
}
}
package main
import (
"stakpak.dev/devx/v2alpha1"
"stakpak.dev/devx/v1/transformers/argocd"
terraform "stakpak.dev/devx/v1/transformers/terraform/helm"
)
builders: v2alpha1.#Environments & {
dev: flows: "kubernetes/add-argoapp": pipeline: [
argocd.#AddHelmRelease & {
helm: namespace: string | *"default"
},
]
prod: flows: "terraform/add-helm-release": pipeline: [
terraform.#AddHelmRelease & {
helm: namespace: "somethingelse"
},
]
}
Build
devx build dev
devx build prod
Result
- Dev
- Prod
/build/dev/kubernetes/cowsay-application.yml
metadata:
name: cowsay
namespace: somethingelse
finalizers:
- resources-finalizer.argocd.argoproj.io
apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
source:
repoURL: stakpak.dev
targetRevision: v1
helm:
releaseName: cowsay
values: |
bla: 123
chart: guku
destination:
namespace: somethingelse
project: default
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
retry:
limit: 5
/build/prod/terraform/generated.tf.json
{
"resource": {
"helm_release": {
"cowsay": {
"name": "cowsay",
"namespace": "somethingelse",
"repository": "stakpak.dev",
"chart": "guku",
"version": "v1",
"create_namespace": true,
"values": [
"bla: 123\n"
]
}
}
}
}