Skip to content

Commit ccedcf5

Browse files
author
Jonathan Chang
committed
address comments
1 parent 0175e72 commit ccedcf5

11 files changed

+44
-42
lines changed

config/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ detect-change: materialize
1515
echo "Please review the diffs below:\n\n"; \
1616
echo "$$diff_output"; \
1717
echo "\n\n===================================================="; \
18-
echo "\n\nOnce you reviewed the changes and consider them meaningful, commit them by running "make -C config/ materialize" and commit your changes."; \
18+
echo "\n\nOnce you reviewed the changes and consider them meaningful, update them by running "make -C config/ materialize" and commit your changes."; \
1919
echo "\n\n===================================================="; \
2020
exit 1; \
2121
else \

config/config.msft.yaml

+3-4
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ defaults:
3030
kvName: arohcp-etcd-{{ .ctx.regionShort }}
3131
kvSoftDelete: true
3232
istio:
33-
url: "https://github.com/istio/istio/releases/download"
34-
istioctlVersion: "1.23.1"
33+
istioctlVersion: "1.24.1"
3534
tag: "prod-stable"
36-
targetVersion: ""
37-
version: "asm-1-22"
35+
targetVersion: "asm-1-23"
36+
versions: ["asm-1-22", "asm-1-23"]
3837

3938
# MGMT cluster specifics
4039
mgmt:

config/config.schema.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,6 @@
665665
"istio": {
666666
"type": "object",
667667
"properties": {
668-
"url": {
669-
"description": "The download Url for istioctl",
670-
"type": "string"
671-
},
672668
"istioctlVersion": {
673669
"description": "Latest version of istioctl. This is used to download the istioctl",
674670
"type": "string"
@@ -677,9 +673,9 @@
677673
"description": "The revision tag used in istioctl",
678674
"type": "string"
679675
},
680-
"version": {
676+
"versions": {
681677
"description": "The current istio version in the AKS cluster",
682-
"type": "string"
678+
"type": "array"
683679
},
684680
"targetVersion": {
685681
"description": "The target istio version that will be updated to",

config/config.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ defaults:
2828
kvName: arohcp-etcd-{{ .ctx.regionShort }}
2929
kvSoftDelete: true
3030
istio:
31-
url: "https://github.com/istio/istio/releases/download"
3231
istioctlVersion: "1.23.1"
3332
tag: "prod-stable"
3433
targetVersion: ""
35-
version: "asm-1-22"
34+
versions: ["asm-1-22"]
3635

3736
# MGMT cluster specifics
3837
mgmt:

config/public-cloud-cs-pr.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,11 @@
161161
"istioctlVersion": "1.23.1",
162162
"tag": "prod-stable",
163163
"targetVersion": "",
164-
"url": "https://istio.io/downloadIstio",
165-
"version": "asm-1-22"
164+
"url": "https://github.com/istio/istio/releases/download",
165+
"version": "asm-1-22",
166+
"versions": [
167+
"asm-1-22"
168+
]
166169
},
167170
"rg": "hcp-underlay-cspr-svc",
168171
"subscription": "ARO Hosted Control Planes (EA Subscription 1)",

config/public-cloud-dev.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,11 @@
161161
"istioctlVersion": "1.23.1",
162162
"tag": "prod-stable",
163163
"targetVersion": "",
164-
"url": "https://istio.io/downloadIstio",
165-
"version": "asm-1-22"
164+
"url": "https://github.com/istio/istio/releases/download",
165+
"version": "asm-1-22",
166+
"versions": [
167+
"asm-1-22"
168+
]
166169
},
167170
"rg": "hcp-underlay-dev-svc",
168171
"subscription": "ARO Hosted Control Planes (EA Subscription 1)",

config/public-cloud-msft-int.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@
160160
"istioctlVersion": "1.24.1",
161161
"tag": "prod-stable",
162162
"targetVersion": "asm-1-23",
163-
"url": "https://istio.io/downloadIstio",
164-
"version": "asm-1-22"
163+
"versions": [
164+
"asm-1-22",
165+
"asm-1-23"
166+
]
165167
},
166168
"rg": "hcp-underlay-westus3-svc",
167169
"subscription": "hcp-westus3",

config/public-cloud-personal-dev.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,11 @@
161161
"istioctlVersion": "1.23.1",
162162
"tag": "prod-stable",
163163
"targetVersion": "",
164-
"url": "https://istio.io/downloadIstio",
165-
"version": "asm-1-22"
164+
"url": "https://github.com/istio/istio/releases/download",
165+
"version": "asm-1-22",
166+
"versions": [
167+
"asm-1-22"
168+
]
166169
},
167170
"rg": "hcp-underlay-usw3tst-svc",
168171
"subscription": "ARO Hosted Control Planes (EA Subscription 1)",

dev-infrastructure/configurations/svc-cluster.tmpl.bicepparam

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using '../templates/svc-cluster.bicep'
22

33
param kubernetesVersion = '{{ .kubernetesVersion }}'
4-
param istioVersion = ['{{ .svc.istio.version }}', '{{ .svc.istio.targetVersion }}']
4+
param istioVersion = ['{{ .svc.istio.version }}']
55
param vnetAddressPrefix = '{{ .vnetAddressPrefix }}'
66
param subnetPrefix = '{{ .subnetPrefix }}'
77
param podSubnetPrefix = '{{ .podSubnetPrefix }}'

dev-infrastructure/scripts/istio.sh

+16-18
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ case "${LOCAL_ARCH}" in
2929
esac
3030

3131

32-
ISTIO_URL="${ISTIOCTL_URL}/${ISTIOCTL_VERSION}/istio-${ISTIOCTL_VERSION}-${OSEXT}-${ISTIO_ARCH}.tar.gz"
33-
SHA256_URL="${ISTIOCTL_URL}/${ISTIOCTL_VERSION}/istio-${ISTIOCTL_VERSION}-${OSEXT}-${ISTIO_ARCH}.tar.gz.sha256"
32+
ISTIO_URL="https://github.com/istio/istio/releases/download/${ISTIOCTL_VERSION}/istio-${ISTIOCTL_VERSION}-${OSEXT}-${ISTIO_ARCH}.tar.gz"
33+
SHA256_URL="https://github.com/istio/istio/releases/download/${ISTIOCTL_VERSION}/istio-${ISTIOCTL_VERSION}-${OSEXT}-${ISTIO_ARCH}.tar.gz.sha256"
3434
# Download the Istioctl binary
3535
wget -q "$ISTIO_URL" -O istio-"${ISTIOCTL_VERSION}"-${OSEXT}-${ISTIO_ARCH}.tar.gz
3636

@@ -58,12 +58,12 @@ echo "==========================================================================
5858
#
5959

6060
ISTIO_NAMESPACE="aks-istio-system"
61-
CURRENT_TAG_REVISION=$(istioctl tag list --istioNamespace ${ISTIO_NAMESPACE} -o json | jq --arg tag ${TAG} '.[] | select(.tag == $tag).revision' -r)
61+
CURRENT_TAG_REVISION=$(istioctl tag list --istioNamespace "${ISTIO_NAMESPACE}" -o json | jq --arg tag "${TAG}" '.[] | select(.tag == $tag).revision' -r)
6262

6363
echo "********** Ensure tag ${TAG} exists **************"
6464
if [ -z "$CURRENT_TAG_REVISION" ]; then
6565
echo "Tag ${TAG} does not exist yet. Creating it with version ${CURRENT_VERSION}"
66-
istioctl tag set ${TAG} --revision ${CURRENT_VERSION} --istioNamespace ${ISTIO_NAMESPACE}
66+
istioctl tag set "${TAG}" --revision "${CURRENT_VERSION}" --istioNamespace "${ISTIO_NAMESPACE}"
6767
else
6868
echo "Tag ${TAG} already exists and refers to version ${CURRENT_TAG_REVISION}"
6969
fi
@@ -73,37 +73,35 @@ echo "********** ISTIO Upgrade **************"
7373
# To upgrade or rollback, change the targetVersion to the desire version, and version to the current version.
7474
if [[ -z "$TARGET_VERSION" ]]; then
7575
echo "Istio is using Target Version. Exiting script."
76-
exit 0
76+
exit 1
7777
fi
7878

7979
NEWVERSION="$TARGET_VERSION"
8080
echo "********** Istio Upgrade Started with version ${NEWVERSION} **************"
8181

8282
istioctl tag set "$TAG" --revision "${NEWVERSION}" --istioNamespace ${ISTIO_NAMESPACE} --overwrite
83-
# Get the namespaces with the label istio.io/rev=$TAG
84-
namespaces=$(kubectl get namespaces --selector=istio.io/rev="$TAG" -o jsonpath='{.items[*].metadata.name}' | xargs -n1 echo)
8583

86-
for ns in $namespaces; do
87-
pods=$(kubectl get pods -n "$ns" -o jsonpath='{.items[*].metadata.name}'| xargs -n1 echo)
88-
for pod_name in $pods; do
89-
istio_version=$(kubectl get pod "$pod_name" -n "$ns" -o jsonpath='{.metadata.annotations.sidecar\.istio\.io/status}' | grep -oP '(?<="revision":")[^"]*')
84+
# Get the namespaces with the label istio.io/rev=$TAG
85+
for namespace in $( kubectl get namespaces --selector=istio.io/rev="$TAG" -o jsonpath='{.items[*].metadata.name}' ); do
86+
for pod in $( kubectl get pods -n "$namespace" -o jsonpath='{.items[*].metadata.name}' ); do
87+
istio_version=$(kubectl get pod "$pod" -n "$namespace" -o jsonpath='{.metadata.annotations.sidecar\.istio\.io/status}' | grep -oP '(?<="revision":")[^"]*')
9088
if [[ "$istio_version" != "$NEWVERSION" ]]; then
91-
owner_kind=$(kubectl get pod "$pod_name" -n "$ns" -o jsonpath='{.metadata.ownerReferences[0].kind}')
92-
owner_name=$(kubectl get pod "$pod_name" -n "$ns" -o jsonpath='{.metadata.ownerReferences[0].name}')
89+
owner_kind=$(kubectl get pod "$pod" -n "$namespace" -o jsonpath='{.metadata.ownerReferences[0].kind}')
90+
owner_name=$(kubectl get pod "$pod" -n "$namespace" -o jsonpath='{.metadata.ownerReferences[0].name}')
9391

9492
case "$owner_kind" in
9593
"ReplicaSet")
96-
deployment=$(kubectl get replicaset "$owner_name" -n "$ns" -o jsonpath='{.metadata.ownerReferences[0].name}')
94+
deployment=$(kubectl get replicaset "$owner_name" -n "$namespace" -o jsonpath='{.metadata.ownerReferences[0].name}')
9795
if [[ -n "$deployment" ]]; then
98-
kubectl rollout restart deployment "$deployment" -n "$ns"
96+
kubectl rollout restart deployment "$deployment" -n "$namespace"
9997
continue 2
10098
else
101-
kubectl delete pod "$pod_name" -n "$ns"
99+
kubectl delete pod "$pod" -n "$namespace"
102100
fi
103101
;;
104102
"StatefulSet")
105-
deployment=$(kubectl get replicaset "$owner_name" -n "$ns" -o jsonpath='{.metadata.ownerReferences[0].name}')
106-
kubectl rollout restart deployment "$deployment" -n "$ns"
103+
deployment=$(kubectl get replicaset "$owner_name" -n "$namespace" -o jsonpath='{.metadata.ownerReferences[0].name}')
104+
kubectl rollout restart deployment "$deployment" -n "$namespace"
107105
continue 2
108106
;;
109107
*)

dev-infrastructure/templates/svc-cluster.bicep

+1-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ param aroDevopsMsiId string
138138
param regionalDNSZoneName string
139139

140140
var clusterServiceMIName = 'clusters-service'
141-
var istio = empty(istioVersion[1]) ? [istioVersion[0]] : istioVersion
142141

143142
resource serviceKeyVault 'Microsoft.KeyVault/vaults@2024-04-01-preview' existing = {
144143
name: serviceKeyVaultName
@@ -167,7 +166,7 @@ module svcCluster '../modules/aks-cluster-base.bicep' = {
167166
aksEtcdKVEnableSoftDelete: aksEtcdKVEnableSoftDelete
168167
kubernetesVersion: kubernetesVersion
169168
deployIstio: true
170-
istioVersion: istio
169+
istioVersion: istioVersion
171170
vnetAddressPrefix: vnetAddressPrefix
172171
subnetPrefix: subnetPrefix
173172
podSubnetPrefix: podSubnetPrefix

0 commit comments

Comments
 (0)