apps: fix substitution issue by generating k8s kustomizations

This commit is contained in:
xeruf 2024-02-12 23:53:49 +01:00
parent 04c20ae36b
commit de4a15fa88
4 changed files with 15 additions and 4 deletions

View File

@ -1,5 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- vikunja-kustomization.yaml
- vikunja-secrets-kustomization.yaml - vikunja-secrets-kustomization.yaml
- vikunja-kustomization.yaml

View File

@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- forgejo-kustomization.yaml
- forgejo-secrets-kustomization.yaml

View File

@ -1,14 +1,15 @@
#!/bin/sh -e #!/bin/sh -e
# Generates kubernetes kustomizations # Generates kubernetes kustomizations for given directories or all subdirectories
if test $# -gt 0 if test $# -gt 0
then dir=$1 then for dir; do
{ echo 'apiVersion: kustomize.config.k8s.io/v1beta1 { echo 'apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources:' resources:'
find $dir -maxdepth 1 -type f -name "*.yaml" -not -name "kustomization.yaml" -printf " - %f\n"; } | tee $dir/kustomization.yaml find $dir -maxdepth 1 -type f -name "*.yaml" -not -name "kustomization.yaml" -printf " - %f\n"; } | tee $dir/kustomization.yaml
done
else else
find -mindepth 1 -maxdepth 1 -type d | while read dir find -mindepth 1 -maxdepth 1 -type d | while read dir
do echo "$dir" do echo "$dir"
$0 "$dir" $0 "$dir"
done done
fi fi

View File

@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- invoiceninja-kustomization.yaml
- invoiceninja-secrets-kustomization.yaml