diff --git a/config/Makefile b/config/Makefile index 0de74465d..f9b7289a3 100644 --- a/config/Makefile +++ b/config/Makefile @@ -15,7 +15,7 @@ detect-change: materialize echo "Please review the diffs below:\n\n"; \ echo "$$diff_output"; \ echo "\n\n===================================================="; \ - echo "\n\nOnce you reviewed the changes and consider them meaningful, commit them by running "make -C config/ materialize"."; \ + echo "\n\nOnce you reviewed the changes and consider them meaningful, commit them by running "make -C config/ materialize" and commit your changes."; \ echo "\n\n===================================================="; \ exit 1; \ else \ diff --git a/config/config.msft.yaml b/config/config.msft.yaml index 14a69d2b1..be000880e 100644 --- a/config/config.msft.yaml +++ b/config/config.msft.yaml @@ -31,9 +31,9 @@ defaults: kvSoftDelete: true istio: url: "https://istio.io/downloadIstio" - istioctlVersion: "1.23.1" + istioctlVersion: "1.24.1" tag: "prod-stable" - newVersion: "" + targetVersion: "asm-1-23" version: "asm-1-22" # MGMT cluster specifics diff --git a/config/config.schema.json b/config/config.schema.json index d9fd55126..282237563 100644 --- a/config/config.schema.json +++ b/config/config.schema.json @@ -678,11 +678,11 @@ "type": "string" }, "version": { - "description": "The current istio version in the aks cluster", + "description": "The current istio version in the AKS cluster", "type": "string" }, - "newVersion": { - "description": "The new istio version that will be updated to", + "targetVersion": { + "description": "The target istio version that will be updated to", "type": "string" } } diff --git a/dev-infrastructure/scripts/istio.sh b/dev-infrastructure/scripts/istio.sh index 636bc18bd..dcd77880f 100755 --- a/dev-infrastructure/scripts/istio.sh +++ b/dev-infrastructure/scripts/istio.sh @@ -4,8 +4,8 @@ set -euxo pipefail echo "********** ISTIO Upgrade Started **************" # Get the current istio and check if it match target version -export CURRENTVERSION=$(kubectl get pods -n aks-istio-system | tail -n +2 | tail -n 1 | cut -d '-' -f 2,3,4) -if [ "$CURRENTVERSION" == "$TARGET_VERSION" ] || [ -z "$TARGET_VERSION" ]; then +export CURRENTVERSION=$(kubectl get pods -n aks-istio-system -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | tail -n +2 | head -n 1 | cut -d '-' -f 2,3,4) +if [[ "$CURRENTVERSION" == "$TARGET_VERSION" ]] || [[ -z "$TARGET_VERSION" ]]; then echo "Istio is using Target Version. Exiting script." exit 0 fi @@ -17,13 +17,22 @@ export PATH=$PWD/bin:$PATH echo "==========================================================================" export NEWVERSION="$TARGET_VERSION" +export OLDVERSION="$CURRENT_VERSION" echo "********** Istio UpGrade Started with version ${NEWVERSION} **************" -# Overwrite the tag with new istio version -istioctl tag set "$TAG" --revision "${NEWVERSION}" -i aks-istio-system --overwrite +# Use revision tag to upgrade istio. +istioctl tag set "$TAG" --revision "${OLDVERSION}" --istioNamespace aks-istio-system +istioctl tag set prod-canary --revision "${NEWVERSION}" --istioNamespace aks-istio-system # Get the namespaces with the label istio.io/rev=$TAG export namespaces=$(kubectl get namespaces --selector=istio.io/rev="$TAG") + +for ns in $namespaces; do + kubectl label "$ns" default istio.io/rev="$TAG" --overwrite +done + +istioctl tag set "$TAG" --revision "${NEWVERSION}" --istioNamespace aks-istio-system --overwrite + for ns in $namespaces; do # Get all deployments in the namespace deployments=$(kubectl get deployments -n "$ns" -o jsonpath='{.items[*].metadata.name}') @@ -33,4 +42,6 @@ for ns in $namespaces; do done done +istioctl tag remove prod-canary --istioNamespace aks-istio-system + echo "********** ISTIO Upgrade Finished**************" \ No newline at end of file diff --git a/dev-infrastructure/svc-pipeline.yaml b/dev-infrastructure/svc-pipeline.yaml index 4cef9b76f..d23556cd5 100644 --- a/dev-infrastructure/svc-pipeline.yaml +++ b/dev-infrastructure/svc-pipeline.yaml @@ -37,7 +37,7 @@ resourceGroups: command: scripts/istio.sh variables: - name: TARGET_VERSION - configRef: svc.istio.newVersion + configRef: svc.istio.targetVersion - name: ISTIOCTL_VERSION configRef: svc.istio.istioctlVersion - name: ISTIOCTL_URL