Created
August 20, 2024 18:58
-
-
Save jamcole/52c643f00540b1a7861fb80c3fff9916 to your computer and use it in GitHub Desktop.
Simple kustomize / kapp / kubectl Taskfile example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
env: | |
KAPP_FQ_CONFIGMAP_NAMES: true | |
vars: | |
KAPP_NAMESPACE: vaultwarden | |
KAPP_NAME: vaultwarden | |
KAPP_ARGS: '--app-changes-max-to-keep=5' | |
# KAPP_ARGS: '--app-changes-max-to-keep=5 --apply-default-update-strategy fallback-on-replace' | |
tasks: | |
namespace: | |
cmds: | |
- cmd: kubectl create namespace {{.KAPP_NAMESPACE}} --dry-run=client -o yaml | kubectl apply -f - | |
deploy: | |
cmds: | |
- cmd: kapp deploy {{.KAPP_ARGS}} --app-namespace {{.KAPP_NAMESPACE}} -a {{.KAPP_NAME}} -f <(kustomize build --enable-helm .) | |
deploy-diff: | |
cmds: | |
- task: deploy | |
vars: | |
KAPP_ARGS: '{{.KAPP_ARGS}} --diff-changes' | |
update-image: | |
cmds: | |
- cmd: kustomize edit set image docker.io/vaultwarden/server:$(skopeo inspect docker://docker.io/vaultwarden/server|jq -r '.RepoTags[]|select(test("^[0-9]+\\.[0-9]+\\.[0-9]+$"))'|sort -V|tail -n 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment