Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Gerd Oberlechner <[email protected]>
  • Loading branch information
geoberle committed Dec 12, 2024
1 parent 0a70b5f commit 19b4c34
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
9 changes: 4 additions & 5 deletions maestro/server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ deploy:
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=$(shell az postgres flexible-server show -g ${SVC_RG} -n ${DATABASE_NAME} --query fullyQualifiedDomainName -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 \
--namespace maestro \
-f helm/$${OVERRIDES} \
--set broker.host=$${EVENTGRID_HOSTNAME} \
--set credsKeyVault.name=${KEYVAULT_NAME} \
--set credsKeyVault.secret=${MQTT_CLIENT_NAME} \
Expand All @@ -21,8 +23,5 @@ deploy:
--set istio.restrictIngress=${ISTIO_RESTRICT_INGRESS} \
--set image.base=${IMAGE_BASE} \
--set image.tag=${IMAGE_TAG} \
--set database.containerizedDb=${USE_CONTAINERIZED_DB} \
--set database.ssl='${USE_DATABASE_SSL}' \
$(if $(filter false,$(USE_CONTAINERIZED_DB)),--set database.host=$${DATABASE_HOST}) \
--set database.authMethod='${DATABASE_AUTH_METHOD}'
--set database.host=$${DATABASE_HOST}
.PHONY: deploy
4 changes: 1 addition & 3 deletions maestro/server/config.tmpl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ AKS_NAME ?= {{ .aksName }}
SVC_RG ?= {{ .svc.rg }}
IMAGE_BASE ?= {{ .maestro.imageBase }}
IMAGE_TAG ?= {{ .maestro.imageTag }}
USE_CONTAINERIZED_DB ?= {{ not .maestro.postgres.deploy }}
USE_DATABASE_SSL ?= {{ ternary "require" "disable" .maestro.postgres.deploy }}
USE_AZURE_DB ?= {{ .maestro.postgres.deploy }}
DATABASE_NAME ?= {{ .maestro.postgres.name }}
DATABASE_AUTH_METHOD ?= {{ ternary "az-entra" "password" .maestro.postgres.deploy }}
ISTIO_RESTRICT_INGRESS ?= {{ .maestro.restrictIstioIngress }}
KEYVAULT_NAME ?= {{ .serviceKeyVault.name }}
MQTT_CLIENT_NAME ?= {{ .maestro.serverMqttClientName }}
4 changes: 4 additions & 0 deletions maestro/server/helm/azuredb.values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
database:
containerizedDb: false
ssl: require
authMethod: az-entra
7 changes: 7 additions & 0 deletions maestro/server/helm/containerdb.values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
database:
containerizedDb: true
ssl: disable
authMethod: password
password: "TheBlurstOfTimes"
containerizedDbImage: docker.io/library/postgres:14.2
containerizedDbPvcCapacity: 512Mi
12 changes: 6 additions & 6 deletions maestro/server/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ broker:
port: 8883
database:
containerizedDb: false
containerizedDbImage: docker.io/library/postgres:14.2
containerizedDbPvcCapacity: 512Mi
host: "maestro-db"
containerizedDbImage: ""
containerizedDbPvcCapacity: ""
host: ""
port: 5432
name: "maestro"
user: "maestro-server"
password: "TheBlurstOfTimes"
ssl: "require"
password: ""
ssl: ""
maxOpenConnections: 50
debug: false
authMethod: "password"
authMethod: ""
maestro:
serviceAccount: maestro
httpReadTimeout: 60s
Expand Down

0 comments on commit 19b4c34

Please sign in to comment.