Skip to content

Commit

Permalink
grafana zone redundancy
Browse files Browse the repository at this point in the history
Signed-off-by: Gerd Oberlechner <goberlec@redhat.com>
  • Loading branch information
geoberle committed Feb 25, 2025
1 parent ecf2d10 commit a12ff86
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/config.msft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ defaults:

# Metrics
monitoring:
grafanaZoneRedundantMode: Enabled
workspaceName: 'arohcp-{{ .ctx.regionShort }}'

# Logs
Expand Down
4 changes: 4 additions & 0 deletions config/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,9 @@
"grafanaName": {
"type": "string"
},
"grafanaZoneRedundantMode": {
"$ref": "#/definitions/zoneRedundantMode"
},
"workspaceName": {
"type": "string"
}
Expand All @@ -807,6 +810,7 @@
"required": [
"grafanaAdminGroupPrincipalId",
"grafanaName",
"grafanaZoneRedundantMode",
"workspaceName"
]
},
Expand Down
1 change: 1 addition & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ clouds:
monitoring:
workspaceName: 'arohcp-{{ .ctx.regionShort }}'
grafanaName: 'arohcp-dev'
grafanaZoneRedundantMode: Enabled
grafanaAdminGroupPrincipalId: 6b6d3adf-8476-4727-9812-20ffdef2b85c
# Logs
logs:
Expand Down
1 change: 1 addition & 0 deletions config/public-cloud-cs-pr.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
"monitoring": {
"grafanaAdminGroupPrincipalId": "6b6d3adf-8476-4727-9812-20ffdef2b85c",
"grafanaName": "arohcp-dev",
"grafanaZoneRedundantMode": "Enabled",
"workspaceName": "arohcp-cspr"
},
"msiKeyVault": {
Expand Down
1 change: 1 addition & 0 deletions config/public-cloud-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
"monitoring": {
"grafanaAdminGroupPrincipalId": "6b6d3adf-8476-4727-9812-20ffdef2b85c",
"grafanaName": "arohcp-dev",
"grafanaZoneRedundantMode": "Enabled",
"workspaceName": "arohcp-dev"
},
"msiKeyVault": {
Expand Down
1 change: 1 addition & 0 deletions config/public-cloud-msft-int.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
"monitoring": {
"grafanaAdminGroupPrincipalId": "2fdb57d4-3fd3-415d-b604-1d0e37a188fe",
"grafanaName": "arohcp-int",
"grafanaZoneRedundantMode": "Enabled",
"workspaceName": "arohcp-int"
},
"msiKeyVault": {
Expand Down
1 change: 1 addition & 0 deletions config/public-cloud-personal-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
"monitoring": {
"grafanaAdminGroupPrincipalId": "6b6d3adf-8476-4727-9812-20ffdef2b85c",
"grafanaName": "arohcp-dev",
"grafanaZoneRedundantMode": "Enabled",
"workspaceName": "arohcp-usw3tst"
},
"msiKeyVault": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ using '../templates/global-grafana.bicep'
param globalMSIName = '{{ .global.globalMSIName }}'
param grafanaName = '{{ .monitoring.grafanaName }}'
param grafanaAdminGroupPrincipalId = '{{ .monitoring.grafanaAdminGroupPrincipalId }}'
param grafanaZoneRedundantMode = '{{ .monitoring.grafanaZoneRedundantMode }}'
15 changes: 15 additions & 0 deletions dev-infrastructure/templates/global-grafana.bicep
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import { getLocationAvailabilityZonesCSV, determineZoneRedundancy, csvToArray } from '../modules/common.bicep'

@description('Azure Global Location')
param location string = resourceGroup().location

@description('The global msi name')
param globalMSIName string

Expand All @@ -7,6 +12,13 @@ param grafanaName string
@description('The admin group principal ID to manage Grafana')
param grafanaAdminGroupPrincipalId string

@description('The zone redundant mode of Grafana')
param grafanaZoneRedundantMode string

@description('Availability Zones to use for the infrastructure, as a CSV string. Defaults to all the zones of the location')
param locationAvailabilityZones string = getLocationAvailabilityZonesCSV(location)
var locationAvailabilityZoneList = csvToArray(locationAvailabilityZones)

resource ev2MSI 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' existing = {
name: globalMSIName
}
Expand All @@ -33,6 +45,9 @@ resource grafana 'Microsoft.Dashboard/grafana@2023-09-01' = {
identity: {
type: 'SystemAssigned'
}
properties: {
zoneRedundancy: determineZoneRedundancy(locationAvailabilityZoneList, grafanaZoneRedundantMode) ? 'Enabled' : 'Disabled'
}
}

resource contributorRole 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
Expand Down

0 comments on commit a12ff86

Please sign in to comment.