Skip to content

Commit

Permalink
config controlled cosmos db zone redundancy (#1327)
Browse files Browse the repository at this point in the history
there are situations where we want to control zone redundancy settings for cosmos db, e.g. a region that has generally zone redundancy support is not offering it right now. crucial for dev envs

Signed-off-by: Gerd Oberlechner <[email protected]>
  • Loading branch information
geoberle authored Feb 14, 2025
1 parent abff360 commit a405143
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 5 deletions.
1 change: 1 addition & 0 deletions config/config.msft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ defaults:
disableLocalAuth: true
name: arohcp-rp-{{ .ctx.regionShort }}
private: true
zoneRedundantMode: 'Auto'

# Maestro
maestro:
Expand Down
4 changes: 4 additions & 0 deletions config/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@
},
"private": {
"type": "boolean"
},
"zoneRedundantMode": {
"type": "string",
"enum": ["Disabled", "Enabled", "Auto"]
}
},
"additionalProperties": false,
Expand Down
4 changes: 4 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ defaults:
disableLocalAuth: true
name: arohcp-rp-{{ .ctx.regionShort }}
private: true
zoneRedundantMode: 'Auto'
cert:
name: frontend-cert-{{ .ctx.regionShort }}
issuer: Self
Expand Down Expand Up @@ -321,6 +322,7 @@ clouds:
frontend:
cosmosDB:
private: false
zoneRedundantMode: 'Disabled'
cs-pr:
# this is the cluster service PR check and full cycle test environment
defaults:
Expand Down Expand Up @@ -357,6 +359,7 @@ clouds:
frontend:
cosmosDB:
private: false
zoneRedundantMode: 'Disabled'
personal-dev:
# this is the personal DEV environment
defaults:
Expand All @@ -377,6 +380,7 @@ clouds:
frontend:
cosmosDB:
private: false
zoneRedundantMode: 'Disabled'
personal-perfscale:
defaults:
dns:
Expand Down
3 changes: 2 additions & 1 deletion config/public-cloud-cs-pr.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
"deploy": true,
"disableLocalAuth": true,
"name": "arohcp-rp-cspr",
"private": false
"private": false,
"zoneRedundantMode": "Disabled"
},
"imageTag": ""
},
Expand Down
3 changes: 2 additions & 1 deletion config/public-cloud-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
"deploy": true,
"disableLocalAuth": true,
"name": "arohcp-rp-dev",
"private": false
"private": false,
"zoneRedundantMode": "Disabled"
},
"imageTag": ""
},
Expand Down
3 changes: 2 additions & 1 deletion config/public-cloud-msft-int.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
"deploy": true,
"disableLocalAuth": true,
"name": "arohcp-rp-int",
"private": false
"private": false,
"zoneRedundantMode": "Auto"
},
"imageTag": "be13820"
},
Expand Down
3 changes: 2 additions & 1 deletion config/public-cloud-personal-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
"deploy": true,
"disableLocalAuth": true,
"name": "arohcp-rp-usw3tst",
"private": false
"private": false,
"zoneRedundantMode": "Disabled"
},
"imageTag": ""
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ param disableLocalAuth = {{ .frontend.cosmosDB.disableLocalAuth }}
param deployFrontendCosmos = {{ .frontend.cosmosDB.deploy }}
param rpCosmosDbName = '{{ .frontend.cosmosDB.name }}'
param rpCosmosDbPrivate = {{ .frontend.cosmosDB.private }}
param rpCosmosZoneRedundantMode = '{{ .frontend.cosmosDB.zoneRedundantMode }}'

param maestroMIName = '{{ .maestro.server.managedIdentityName }}'
param maestroNamespace = '{{ .maestro.server.k8s.namespace }}'
Expand Down
6 changes: 5 additions & 1 deletion dev-infrastructure/templates/svc-cluster.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ param rpCosmosDbName string
@description('If true, make the Cosmos DB instance private')
param rpCosmosDbPrivate bool

@description('If true, make the Cosmos DB instance zone redundant')
@allowed(['Enabled', 'Disabled', 'Auto'])
param rpCosmosZoneRedundantMode string

@description('The resourcegroup for regional infrastructure')
param regionalResourceGroup string

Expand Down Expand Up @@ -291,7 +295,7 @@ module rpCosmosDb '../modules/rp-cosmos.bicep' = if (deployFrontendCosmos) {
params: {
name: rpCosmosDbName
location: location
locationIsZoneRedundant: locationHasAvailabilityZones
locationIsZoneRedundant: rpCosmosZoneRedundantMode == 'Auto' ? locationHasAvailabilityZones : rpCosmosZoneRedundantMode == 'Enabled'
aksNodeSubnetId: svcCluster.outputs.aksNodeSubnetId
vnetId: svcCluster.outputs.aksVnetId
disableLocalAuth: disableLocalAuth
Expand Down

0 comments on commit a405143

Please sign in to comment.