Auto-create app kustomization variables
Here a little prototype to modularize the create-kustomization-variables-configmaps.sh
script:
for app in $({ kubectl get cm -n flux-system stackspin-apps -o jsonpath-as-json="{.data}"; kubectl get cm -n flux-system stackspin-apps-custom -o jsonpath-as-json="{.data}"; } 2>/dev/null | grep '"' | cut -d'"' -f2 | grep -v velero)
do kubectl get cm stackspin-${app}-kustomization-variables || kubectl create cm stackspin-${app}-kustomization-variables --from-literal=${app}_domain=${app}.${domain}
done
A few issues to be solved though:
- the default subdomain should be part of the stackspin-apps(-custom) configmap to set it appropriately
- it would need to respond to changes in either of the configmaps But actually, should the creation of this configmap not simply be part of the app-installation routine so we also do not create excess unused configmaps? Unsure how I would best handle that in my extension repo then...