You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

36 lines
1006 B

#!/bin/bash
# create neccesary folder in charts-templated
# cp kustomization.yml's to each folder
# create helm templates for later use with kustomize in a subfolder for each file
pushd charts
for chart in *; do
# override namespace for grafana,prometheus etc..
case $chart in
grafana)
namespace=monitoring
;;
prometheus)
namespace=monitoring
;;
metrics-server)
namespace=kube-system
;;
kube-state-metrics)
namespace=kube-system
;;
# default namespace name is chart/folder name
*)
namespace=${chart}
;;
esac
# create folder structure
mkdir -p ../charts-templated/${chart}/base
# copy base kustomization yaml
cp ${chart}/kustomization.yml ../charts-templated/${chart}/base/kustomization.yml
# helm template the charts and write them to the created folder structure in charts-templated
helm template ${chart} --namespace ${namespace} ${chart}/ -f ${chart}/values.yaml > ../charts-templated/${chart}/base/${chart}-templated.yml
done