2022-11-18 14:25:23 +00:00
|
|
|
# k8s
|
|
|
|
#
|
|
|
|
# deploys k8s
|
|
|
|
|
2022-12-20 14:26:27 +00:00
|
|
|
MANDATORY-k8s = K8S_CONTEXT
|
|
|
|
|
2023-09-20 12:11:20 +00:00
|
|
|
start-k8s: SHELL:=/bin/bash
|
2022-11-18 14:25:23 +00:00
|
|
|
start-k8s:
|
2023-09-20 12:11:20 +00:00
|
|
|
@- 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
|
|
|
|
2023-09-20 12:11:20 +00:00
|
|
|
@- echo "### run kubectl apply -f kubernetes.yaml and secrets.yaml"
|
2023-09-20 08:57:44 +00:00
|
|
|
@- cat kubernetes.yaml secrets.yaml >_manifest.yaml
|
|
|
|
|
|
|
|
ifdef K8S_MANIFESTS
|
2023-09-20 12:11:20 +00:00
|
|
|
@- 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; \
|
2023-09-20 08:57:44 +00:00
|
|
|
cat _tmpfile.yaml >>_manifest.yaml; \
|
|
|
|
rm _tmpfile.yaml; \
|
2023-09-20 12:11:20 +00:00
|
|
|
done
|
2023-09-20 08:57:44 +00:00
|
|
|
endif
|
2023-09-20 12:11:20 +00:00
|
|
|
@- echo "\n%%%DEBUG22"
|
2023-09-20 08:57:44 +00:00
|
|
|
|
|
|
|
@ cat _manifest.yaml | envsubst | kubectl apply -f -
|
|
|
|
@- rm _manifest.yaml
|
2022-11-18 14:25:23 +00:00
|
|
|
|
|
|
|
pull-k8s:
|
|
|
|
# nop
|
|
|
|
|