From 6921533ab3cb09b629b77ef5a531d59cbba5c4d9 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Sun, 15 Sep 2024 16:11:14 +0200 Subject: init repo --- run.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 run.sh (limited to 'run.sh') diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..87fc19b --- /dev/null +++ b/run.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +usage() { + echo "Usage: $0 (apply|delete)" +} + +if [ $# -ne 1 ]; then + usage + exit 1 +fi + +command=$1 + +if [ "$1" != "apply" ] && [ "$1" != "delete" ]; then + usage + exit 1 +fi + +K8S_FOLDER="./yaml" + +YAML_FILES=( + "cas-config.yaml" + "cas-deployment.yaml" + "cas-secret.yaml" + "cas-service.yaml" + "network-policy.yaml" + "pgdata-pvc.yaml" + "postgres-deployment.yaml" + "postgres-service.yaml" +) + +for file in "${YAML_FILES[@]}"; do + file="$K8S_FOLDER/$file" + echo "${command^}ing $file ..." + envsubst < $file | kubectl "$command" -f - +done -- cgit v1.2.3-71-g8e6c