diff --git a/dev-infrastructure/scripts/istio.sh b/dev-infrastructure/scripts/istio.sh index e3a97a0c8..5c445a8a7 100755 --- a/dev-infrastructure/scripts/istio.sh +++ b/dev-infrastructure/scripts/istio.sh @@ -59,7 +59,7 @@ echo "========================================================================== ISTIO_NAMESPACE="aks-istio-system" CURRENT_TAG_REVISION=$(istioctl tag list --istioNamespace "${ISTIO_NAMESPACE}" -o json | jq --arg tag "${TAG}" '.[] | select(.tag == $tag).revision' -r) - +CURRENT_VERSION=$(kubectl get pods -n aks-istio-system -o jsonpath="{.items[0].metadata.name}" | grep -oP '(?<=istiod-)[^-]+-[^-]+-[^-]+') echo "********** Ensure tag ${TAG} exists **************" if [ -z "$CURRENT_TAG_REVISION" ]; then echo "Tag ${TAG} does not exist yet. Creating it with version ${CURRENT_VERSION}" @@ -81,7 +81,7 @@ echo "********** Istio Upgrade Started with version ${NEWVERSION} ************** istioctl tag set "$TAG" --revision "${NEWVERSION}" --istioNamespace ${ISTIO_NAMESPACE} --overwrite -# Get the namespaces with the label istio.io/rev=$TAG +#Get the namespaces with the label istio.io/rev=$TAG for namespace in $( kubectl get namespaces --selector=istio.io/rev="$TAG" -o jsonpath='{.items[*].metadata.name}' ); do for pod in $( kubectl get pods -n "$namespace" -o jsonpath='{.items[*].metadata.name}' ); do istio_version=$(kubectl get pod "$pod" -n "$namespace" -o jsonpath='{.metadata.annotations.sidecar\.istio\.io/status}' | grep -oP '(?<="revision":")[^"]*') @@ -113,4 +113,5 @@ for namespace in $( kubectl get namespaces --selector=istio.io/rev="$TAG" -o jso done done + echo "********** ISTIO Upgrade Finished**************" diff --git a/dev-infrastructure/svc-pipeline.yaml b/dev-infrastructure/svc-pipeline.yaml index 211e7e0e5..4226a725b 100644 --- a/dev-infrastructure/svc-pipeline.yaml +++ b/dev-infrastructure/svc-pipeline.yaml @@ -6,38 +6,36 @@ resourceGroups: subscription: {{ .svc.subscription }} aksCluster: {{ .aksName }} steps: - - name: svc-infra - action: ARM - template: templates/svc-infra.bicep - parameters: configurations/svc-infra.tmpl.bicepparam - - name: svc - action: ARM - template: templates/svc-cluster.bicep - parameters: configurations/svc-cluster.tmpl.bicepparam - dependsOn: - - svc-infra - - name: enable-metrics - action: Shell - command: scripts/enable-aks-metrics.sh - variables: - - name: RESOURCEGROUP - configRef: svc.rg - - name: AKS_NAME - configRef: aksName - - name: GRAFANA_RESOURCEGROUP - configRef: regionRG - - name: MONITORING_WORKSPACE_NAME - configRef: monitoring.workspaceName - - name: GRAFANA_NAME - configRef: monitoring.grafanaName - dependsOn: - - svc + # - name: svc-infra + # action: ARM + # template: templates/svc-infra.bicep + # parameters: configurations/svc-infra.tmpl.bicepparam + # - name: svc + # action: ARM + # template: templates/svc-cluster.bicep + # parameters: configurations/svc-cluster.tmpl.bicepparam + # dependsOn: + # - svc-infra + # - name: enable-metrics + # action: Shell + # command: scripts/enable-aks-metrics.sh + # variables: + # - name: RESOURCEGROUP + # configRef: svc.rg + # - name: AKS_NAME + # configRef: aksName + # - name: GRAFANA_RESOURCEGROUP + # configRef: regionRG + # - name: MONITORING_WORKSPACE_NAME + # configRef: monitoring.workspaceName + # - name: GRAFANA_NAME + # configRef: monitoring.grafanaName + # dependsOn: + # - svc - name: istio action: Shell command: scripts/istio.sh variables: - - name: CURRENT_VERSION - configRef: svc.istio.version - name: TARGET_VERSION configRef: svc.istio.targetVersion - name: ISTIOCTL_VERSION @@ -46,5 +44,5 @@ resourceGroups: configRef: svc.istio.url - name: TAG configRef: svc.istio.tag - dependsOn: - - enable-metrics + # dependsOn: + # - enable-metrics