#!/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