make-deploy/k8s.mk

38 lines
788 B
Makefile
Raw Normal View History

2022-11-18 14:25:23 +00:00
# k8s
#
# deploys k8s
2022-12-20 14:26:27 +00:00
MANDATORY-k8s = K8S_CONTEXT
start-k8s: SHELL:=/bin/bash
2022-11-18 14:25:23 +00:00
start-k8s:
@- echo "### starting deployment with k8s"
@- echo "### setting kubernetes context to $(K8S_CONTEXT)"
#@ kubectl config use-context $(K8S_CONTEXT)
2022-11-18 14:25:23 +00:00
@- echo "### run kubectl apply -f kubernetes.yaml and secrets.yaml"
@- cat kubernetes.yaml secrets.yaml >_manifest.yaml
ifdef K8S_MANIFESTS
@- echo "\n%%%DEBUG1"
@- echo $(K8S_MANIFESTS)
@- for file in $(K8S_MANIFESTS); do \
if [[ $$file == http* ]] ; \
then \
curl -o _tmpfile.yaml $$file; \
else \
cp $$file _tmpfile.yaml; \
fi; \
cat _tmpfile.yaml >>_manifest.yaml; \
rm _tmpfile.yaml; \
done
endif
@- echo "\n%%%DEBUG22"
@ cat _manifest.yaml | envsubst | kubectl apply -f -
@- rm _manifest.yaml
2022-11-18 14:25:23 +00:00
pull-k8s:
# nop