Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Chang committed Dec 16, 2024
1 parent 3f85fb4 commit 8adcaa7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions config/config.msft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions config/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
19 changes: 15 additions & 4 deletions dev-infrastructure/scripts/istio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}')
Expand All @@ -33,4 +42,6 @@ for ns in $namespaces; do
done
done

istioctl tag remove prod-canary --istioNamespace aks-istio-system

echo "********** ISTIO Upgrade Finished**************"
2 changes: 1 addition & 1 deletion dev-infrastructure/svc-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8adcaa7

Please sign in to comment.