netflux-kubernetes/deploy/bin/helm-chart-inflate.sh

27 lines
682 B
Bash
Raw Normal View History

2022-05-11 01:10:37 +00:00
#!/usr/bin/env bash
#
# Usage:
#
# helm-chart-inflate.sh prometheus prometheus-community/prometheus
set -euo pipefail
IFS=$'\n\t'
name="$1"
chart="$2"
base="$3"
2022-05-11 01:10:37 +00:00
mkdir -p "$base/inflated"
rm -rf "$base/inflated/$name"
2022-05-11 01:10:37 +00:00
valuesfile="$base/values/$name.yaml"
2022-05-11 01:10:37 +00:00
if [ -f $valuesfile ]; then
echo "Inflating template with values file: $valuesfile ..."
helm template $name $chart --output-dir $base/inflated -f $valuesfile
2022-05-11 01:10:37 +00:00
else
echo "Inflating template with default values ..."
helm template $name $chart --output-dir $base/inflated
2022-05-11 01:10:37 +00:00
fi
echo "YAML entries for $base/kustomzation.yaml:"
find $base/inflated/$name -iname '*.yaml' | xargs realpath --relative-to $base | sed 's/^/- /'