provisioning/templates/services/k8s-deploy/install-deploy.sh.j2

19 lines
521 B
Plaintext
Raw Normal View History

2025-10-07 11:12:02 +01:00
#!/bin/bash
kubectl apply -f ns
kubectl apply -f volumes
{%- if k8s_deploy.spec.volumes %}
{%- for vol in k8s_deploy.spec.volumes %}
{%- if vol.persitentVolumeClaim %}
PVC_ID=$(kubectl get pv | grep {{k8s_deploy.namespace}}/{{vol.persitentVolumeClaim.name}} | cut -f1 -d" " | sed "s/ //g")
[ -n "$PVC_ID" ] && kubectl patch pv $PVC_ID -p '{"spec":{"persistentVolumeReclaimPolicy":"{{vol.persitentVolumeClaim.reclaimPolicy}}"}}'
{%- endif %}
{%- endfor %}
{%- endif %}
[ -r "bin/apply.sh" ] && ./bin/apply.sh
exit 0