From 588c340bb26e6bf76ef8f733edd0d0175e41bd2a Mon Sep 17 00:00:00 2001 From: Ariel Sosnovsky Date: Thu, 14 Mar 2024 14:04:18 -0400 Subject: [PATCH] Updated dryrun script * root level certificates --- bin/dryrun-app.sh | 15 ++++++++--- .../ingresses/templates/clusterissuer.yaml | 26 +++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/bin/dryrun-app.sh b/bin/dryrun-app.sh index 667c681..8e33929 100755 --- a/bin/dryrun-app.sh +++ b/bin/dryrun-app.sh @@ -3,6 +3,8 @@ set -e full_path=${1} deployment=${2:-dev} +keep_old=${3:-no} +keep_old=$(echo "${keep_old:0:1}" | tr '[:upper:]' '[:lower:]') app=$(basename $full_path) location=$(dirname $full_path) tmp_path=".tmp/$location/$deployment-$app.yaml" @@ -32,9 +34,16 @@ popd &> /dev/null echo $chart_checksum > $chart_checksum_path if [ -f "$tmp_path" ]; then - echo " > found existing file" - echo " > renaming old file to "$tmp_path".old" - mv $tmp_path $tmp_path".old" + echo "Found existing file" + if [[ -f "$tmp_path".old && "${keep_old:0:1}" == "y" ]]; then + num_files=$(ls -1q "${tmp_path}.old"* 2> /dev/null | wc -l | tr -d '[:space:]') + echo " -> Renaming old file to "$tmp_path".old.${num_files}" + mv $tmp_path $tmp_path".old.${num_files}" + else + rm $tmp_path".old"* + echo " -> Renaming old file to "$tmp_path".old" + mv $tmp_path $tmp_path".old" + fi fi echo " > running..." diff --git a/k8s/apps/ingresses/templates/clusterissuer.yaml b/k8s/apps/ingresses/templates/clusterissuer.yaml index 145d305..8534961 100644 --- a/k8s/apps/ingresses/templates/clusterissuer.yaml +++ b/k8s/apps/ingresses/templates/clusterissuer.yaml @@ -50,5 +50,31 @@ spec: dnsNames: - "*{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }}" {{ end }} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: cloudflare-wildcard.{{ $.Values.global.domain }} +spec: + secretName: cloudflare-wildcard.{{ $.Values.global.domain }} + issuerRef: + name: cloudflare + kind: Issuer + commonName: '*.{{ $.Values.global.domain }}' + dnsNames: + - "*.{{ $.Values.global.domain }}" +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: cloudflare-wildcard.{{ $.Values.global.secondaryDomain }} +spec: + secretName: cloudflare-wildcard.{{ $.Values.global.secondaryDomain }} + issuerRef: + name: cloudflare + kind: Issuer + commonName: '*.{{ $.Values.global.secondaryDomain }}' + dnsNames: + - "*.{{ $.Values.global.secondaryDomain }}" {{ end }} {{ end }} \ No newline at end of file