From 20befe6624f78c3aa7302f48a233dc085639439a Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Tue, 14 Mar 2023 22:40:28 +0000 Subject: [PATCH] keep 1 --- bin/upgrade-app.sh | 21 +++++++++++++-------- k8s/infra/longhorn/templates/iscsi.yaml | 1 + k8s/infra/longhorn/templates/nfs.yaml | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/bin/upgrade-app.sh b/bin/upgrade-app.sh index b1eae58..4ddc003 100755 --- a/bin/upgrade-app.sh +++ b/bin/upgrade-app.sh @@ -5,15 +5,20 @@ full_path=${1} deployment=${2:-dev} app=$(basename $full_path) location=$(dirname $full_path) -tmp_path=$(realpath ".tmp/$location/$deployment-$app.yaml") -echo "writing $location/$app to $tmp_path" - +tmp_path=".tmp/$location/$deployment-$app.yaml" +argocd_values_path=$(realpath k8s/argocd/values-$deployment.yaml) +echo "> writing $location/$app to $tmp_path" +echo "> using argo values of $argocd_values_path" +cat $argocd_values_path | yq mkdir -p $(dirname $tmp_path) -pushd $full_path -helm dependency update -helm upgrade $app . --namespace $app \ +pushd $full_path &> /dev/null +helm dependency update &> /dev/null +popd &> /dev/null + +helm upgrade $app $full_path --namespace $app \ --debug \ - --values values.yaml \ - --values values-$deployment.yaml \ + --values $argocd_values_path \ + --values $full_path/values.yaml \ + --values $full_path/values-$deployment.yaml \ > $tmp_path \ No newline at end of file diff --git a/k8s/infra/longhorn/templates/iscsi.yaml b/k8s/infra/longhorn/templates/iscsi.yaml index 71e9146..80d2f08 100644 --- a/k8s/infra/longhorn/templates/iscsi.yaml +++ b/k8s/infra/longhorn/templates/iscsi.yaml @@ -8,6 +8,7 @@ metadata: annotations: command: &cmd OS=$(grep -E "^ID_LIKE=" /etc/os-release | cut -d '=' -f 2); if [[ -z "${OS}" ]]; then OS=$(grep -E "^ID=" /etc/os-release | cut -d '=' -f 2); fi; if [[ "${OS}" == *"debian"* ]]; then sudo apt-get update -q -y && sudo apt-get install -q -y open-iscsi && sudo systemctl -q enable iscsid && sudo systemctl start iscsid && sudo modprobe iscsi_tcp; elif [[ "${OS}" == *"suse"* ]]; then sudo zypper --gpg-auto-import-keys -q refresh && sudo zypper --gpg-auto-import-keys -q install -y open-iscsi && sudo systemctl -q enable iscsid && sudo systemctl start iscsid && sudo modprobe iscsi_tcp; else sudo yum makecache -q -y && sudo yum --setopt=tsflags=noscripts install -q -y iscsi-initiator-utils && echo "InitiatorName=$(/sbin/iscsi-iname)" > /etc/iscsi/initiatorname.iscsi && sudo systemctl -q enable iscsid && sudo systemctl start iscsid && sudo modprobe iscsi_tcp; fi && if [ $? -eq 0 ]; then echo "iscsi install successfully"; else echo "iscsi install failed error code $?"; fi spec: + replicas: 1 selector: matchLabels: app: iscsi-installation diff --git a/k8s/infra/longhorn/templates/nfs.yaml b/k8s/infra/longhorn/templates/nfs.yaml index 1c896ae..2363780 100644 --- a/k8s/infra/longhorn/templates/nfs.yaml +++ b/k8s/infra/longhorn/templates/nfs.yaml @@ -9,6 +9,7 @@ metadata: annotations: command: &cmd OS=$(grep -E "^ID_LIKE=" /etc/os-release | cut -d '=' -f 2); if [[ -z "${OS}" ]]; then OS=$(grep -E "^ID=" /etc/os-release | cut -d '=' -f 2); fi; if [[ "${OS}" == *"debian"* ]]; then sudo apt-get update -q -y && sudo apt-get install -q -y nfs-common && sudo modprobe nfs; elif [[ "${OS}" == *"suse"* ]]; then sudo zypper --gpg-auto-import-keys -q refresh && sudo zypper --gpg-auto-import-keys -q install -y nfs-client && sudo modprobe nfs; else sudo yum makecache -q -y && sudo yum --setopt=tsflags=noscripts install -q -y nfs-utils && sudo modprobe nfs; fi && if [ $? -eq 0 ]; then echo "nfs install successfully"; else echo "nfs install failed error code $?"; fi spec: + replicas: 1 selector: matchLabels: app: nfs-installation