From 1b3ac572db41d06733eb3364127c6f5f6cc69fb4 Mon Sep 17 00:00:00 2001 From: Gerd Oberlechner Date: Thu, 12 Dec 2024 08:24:07 +0100 Subject: [PATCH] update pipeline yaml and introduce dry-run Signed-off-by: Gerd Oberlechner --- config/config.yaml | 4 ---- maestro/server/Makefile | 15 ++++++--------- maestro/server/config.tmpl.mk | 11 ----------- maestro/server/pipeline.yaml | 13 +++++++++++-- 4 files changed, 17 insertions(+), 26 deletions(-) delete mode 100644 maestro/server/config.tmpl.mk diff --git a/config/config.yaml b/config/config.yaml index 42d00be67..faf2c7357 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -266,11 +266,7 @@ clouds: regionalDNSSubdomain: '{{ .ctx.regionShort }}' # Maestro maestro: - imageBase: quay.io/clyang82/maestro - imageTag: entra serverMqttClientName: 'maestro-server-{{ .ctx.regionShort }}' - postgres: - deploy: true # Frontend frontend: cosmosDB: diff --git a/maestro/server/Makefile b/maestro/server/Makefile index 913738b75..09f7af5b7 100644 --- a/maestro/server/Makefile +++ b/maestro/server/Makefile @@ -1,18 +1,15 @@ -SHELL = /bin/bash -DEPLOY_ENV ?= personal-dev -$(shell ../../templatize.sh $(DEPLOY_ENV) config.tmpl.mk config.mk) -include config.mk +-include ../../setup-env.mk deploy: - kubectl create namespace maestro --dry-run=client -o json | kubectl apply -f - - ISTO_VERSION=$(shell az aks show -n ${AKS_NAME} -g ${SVC_RG} --query serviceMeshProfile.istio.revisions[-1] -o tsv) && \ - kubectl label namespace maestro "istio.io/rev=$${ISTO_VERSION}" --overwrite=true - EVENTGRID_HOSTNAME=$(shell az resource show -n ${EVENTGRID_NAME} -g ${REGION_RG} --resource-type "Microsoft.EventGrid/namespaces" --query properties.topicSpacesConfiguration.hostname -o tsv) && \ + @kubectl create namespace maestro --dry-run=client -o json | kubectl apply -f - + @ISTO_VERSION=$(shell az aks show -n ${AKS_NAME} -g ${SVC_RG} --query serviceMeshProfile.istio.revisions[-1] -o tsv) && \ + kubectl label ${KUBECTL_DRY_RUN} namespace maestro "istio.io/rev=$${ISTO_VERSION}" --overwrite=true + @EVENTGRID_HOSTNAME=$(shell az resource show -n ${EVENTGRID_NAME} -g ${REGION_RG} --resource-type "Microsoft.EventGrid/namespaces" --query properties.topicSpacesConfiguration.hostname -o tsv) && \ TENANT_ID=$(shell az account show --query tenantId --output tsv) && \ MAESTRO_MI_CLIENT_ID=$(shell az identity show -g "${SVC_RG}" -n maestro-server --query clientId -o tsv) && \ DATABASE_HOST=$$(if [ "${USE_AZURE_DB}" = "true" ]; then az postgres flexible-server show -g ${SVC_RG} -n ${DATABASE_NAME} --query fullyQualifiedDomainName -o tsv; else echo "maestro-db"; fi) && \ OVERRIDES=$$(if [ "${USE_AZURE_DB}" = "true" ]; then echo "azuredb.values.yaml"; else echo "containerdb.values.yaml"; fi) && \ - helm upgrade --install maestro-server ./helm \ + helm upgrade --install --wait ${HELM_DRY_RUN} maestro-server ./helm \ --namespace maestro \ -f helm/$${OVERRIDES} \ --set broker.host=$${EVENTGRID_HOSTNAME} \ diff --git a/maestro/server/config.tmpl.mk b/maestro/server/config.tmpl.mk deleted file mode 100644 index fa3b10c13..000000000 --- a/maestro/server/config.tmpl.mk +++ /dev/null @@ -1,11 +0,0 @@ -EVENTGRID_NAME ?= {{ .maestro.eventGrid.name }} -REGION_RG ?= {{ .regionRG }} -AKS_NAME ?= {{ .aksName }} -SVC_RG ?= {{ .svc.rg }} -IMAGE_BASE ?= {{ .maestro.imageBase }} -IMAGE_TAG ?= {{ .maestro.imageTag }} -USE_AZURE_DB ?= {{ .maestro.postgres.deploy }} -DATABASE_NAME ?= {{ .maestro.postgres.name }} -ISTIO_RESTRICT_INGRESS ?= {{ .maestro.restrictIstioIngress }} -KEYVAULT_NAME ?= {{ .serviceKeyVault.name }} -MQTT_CLIENT_NAME ?= {{ .maestro.serverMqttClientName }} diff --git a/maestro/server/pipeline.yaml b/maestro/server/pipeline.yaml index 982799129..23bb724ac 100644 --- a/maestro/server/pipeline.yaml +++ b/maestro/server/pipeline.yaml @@ -1,4 +1,5 @@ -serviceGroup: Microsoft.Azure.ARO.Test +$schema: "pipeline.schema.v1" +serviceGroup: Microsoft.Azure.ARO.HCP.Maestro.Server rolloutName: Maestro Server Rollout resourceGroups: - name: {{ .svc.rg }} @@ -8,6 +9,12 @@ resourceGroups: - name: deploy action: Shell command: make deploy + dryRun: + variables: + - name: HELM_DRY_RUN + value: "--dry-run=server --debug" + - name: KUBECTL_DRY_RUN + value: "--dry-run=server" variables: - name: EVENTGRID_NAME configRef: maestro.eventGrid.name @@ -22,7 +29,9 @@ resourceGroups: - name: IMAGE_TAG configRef: maestro.imageTag - name: USE_AZURE_DB - configRef: maestroPostgresDeploy + configRef: maestro.postgres.deploy + - name: DATABASE_NAME + configRef: maestro.postgres.name - name: ISTIO_RESTRICT_INGRESS configRef: maestro.restrictIstioIngress - name: KEYVAULT_NAME