Last active
June 18, 2020 08:57
-
-
Save yujunz/e9556c9bbbd388760b8a7c3626539771 to your computer and use it in GitHub Desktop.
k14s boilerplate code
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
apiVersion: kustomize.config.k8s.io/v1beta1 | |
kind: Kustomization | |
resources: | |
- build/helm/out.yaml | |
- build/ytt/out.yaml | |
secretGenerator: | |
- envs: | |
- secret.env | |
name: secret |
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
APP := sloop | |
NAMESPACE := kapp | |
FLAGS := --namespace $(NAMESPACE) --app $(APP) --diff-changes | |
SHELL := /bin/bash | |
deploy: build/helm/out.yaml | |
kapp deploy $(FLAGS) -f <(kustomize build) | |
delete: | |
kapp delete $(FLAGS) | |
build/helm/out.yaml: helm/**/*.yaml | |
mkdir -p $(shell dirname $@) | |
helm template $(APP) helm > $@ |
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
APP := fio | |
NAMESPACE := kapp | |
FLAGS := --namespace $(NAMESPACE) --app $(APP) --diff-changes | |
SHELL := /bin/bash | |
deploy: build/ytt/out.yaml | |
kapp deploy $(FLAGS) -f <(kustomize build) | |
delete: | |
kapp delete $(FLAGS) | |
build/ytt/out.yaml: ytt/*.yaml | |
mkdir -p $(shell dirname $@) | |
ytt -f $< > $@ |
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
APP := pvc | |
NAMESPACE := kapp | |
FLAGS := --namespace $(NAMESPACE) --app $(APP) --diff-changes | |
SHELL := /bin/bash | |
deploy: *.yaml | |
kapp deploy $(FLAGS) -f <(kustomize build) | |
delete: | |
kapp delete $(FLAGS) |
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
APP := app | |
NAMESPACE := kapp | |
FLAGS := --namespace $(NAMESPACE) --app $(APP) --diff-changes | |
SHELL := /bin/bash | |
deploy: *.yaml | |
kapp deploy $(FLAGS) -f . | |
delete: | |
kapp delete $(FLAGS) |
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
deploy: | |
summary: deploy | |
exec: kapp deploy --namespace {{.kapp.namespace}} --app {{.kapp.app}} --diff-changes --file main.yaml | |
delete: | |
summary: delete | |
exec: kapp delete --namespace {{.kapp.namespace}} --app {{.kapp.app}} --diff-changes | |
variables: | |
kapp: | |
namespace: kapp | |
app: app |
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
APPS:=app1 app2 | |
$(APPS): | |
make -C $@ | |
.PHONY: $(APPS) |
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
APP := app | |
NAMESPACE := kapp | |
FLAGS := --namespace $(NAMESPACE) --app $(APP) --diff-changes | |
SHELL := /bin/bash | |
deploy: ytt/*.yaml | |
kapp deploy $(FLAGS) -f <(ytt -f ytt) | |
delete: | |
kapp delete $(FLAGS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment