Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend dns record #1401

Merged
merged 4 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/config.msft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ clouds:
clusterService:
environment: "arohcpint"

# Geneva Actions
genevaActions:
serviceTag: GenevaActionsNonProd

# OIDC
oidcStorageAccountName: arohcpoidcint{{ .ctx.regionShort }}
oidcZoneRedundantMode: Auto
Expand Down
13 changes: 13 additions & 0 deletions config/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,18 @@
"cert"
]
},
"genevaActions": {
"type": "object",
"properties": {
"serviceTag": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"serviceTag"
]
},
"global": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -977,6 +989,7 @@
"firstPartyAppClientId",
"firstPartyAppCertName",
"frontend",
"genevaActions",
"global",
"hypershift",
"hypershiftOperator",
Expand Down
4 changes: 4 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ defaults:
logs:
enableLogAnalytics: false

# Geneva Actions
genevaActions:
serviceTag: GenevaActionsNonProd

# SVC cluster specifics
svc:
subscription: ARO Hosted Control Planes (EA Subscription 1)
Expand Down
3 changes: 3 additions & 0 deletions config/public-cloud-cs-pr.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
"repository": "arohcpfrontend"
}
},
"genevaActions": {
"serviceTag": "GenevaActionsNonProd"
},
"global": {
"globalMSIName": "global-rollout-identity",
"region": "westus3",
Expand Down
3 changes: 3 additions & 0 deletions config/public-cloud-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
"repository": "arohcpfrontend"
}
},
"genevaActions": {
"serviceTag": "GenevaActionsNonProd"
},
"global": {
"globalMSIName": "global-rollout-identity",
"region": "westus3",
Expand Down
3 changes: 3 additions & 0 deletions config/public-cloud-msft-int.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
"repository": "arohcpfrontend"
}
},
"genevaActions": {
"serviceTag": "GenevaActionsNonProd"
},
"global": {
"globalMSIName": "global-ev2-identity",
"region": "uksouth",
Expand Down
3 changes: 3 additions & 0 deletions config/public-cloud-personal-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
"repository": "arohcpfrontend"
}
},
"genevaActions": {
"serviceTag": "GenevaActionsNonProd"
},
"global": {
"globalMSIName": "global-rollout-identity",
"region": "westus3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ param regionalResourceGroup = '{{ .regionRG }}'

param frontendIngressCertName = '{{ .frontend.cert.name }}'
param frontendIngressCertIssuer = '{{ .frontend.cert.issuer }}'
param genevaActionsServiceTag = '{{ .genevaActions.serviceTag }}'

// Azure Monitor Workspace
param azureMonitoringWorkspaceId = '__azureMonitoringWorkspaceId__'
Expand Down
5 changes: 5 additions & 0 deletions dev-infrastructure/modules/aks-cluster-base.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ param subnetPrefix string
param podSubnetPrefix string
param clusterType string
param workloadIdentities array
param nodeSubnetNSGId string

@description('Istio Ingress Gateway Public IP Address resource name')
param istioIngressGatewayIPAddressName string = ''
Expand Down Expand Up @@ -192,6 +193,9 @@ resource aksNodeSubnet 'Microsoft.Network/virtualNetworks/subnets@2023-11-01' =
service: 'Microsoft.KeyVault'
}
]
networkSecurityGroup: {
id: nodeSubnetNSGId
}
}
}

Expand Down Expand Up @@ -691,3 +695,4 @@ output aksNodeSubnetId string = aksNodeSubnet.id
output aksOidcIssuerUrl string = aksCluster.properties.oidcIssuerProfile.issuerURL
output aksClusterName string = aksClusterName
output aksClusterKeyVaultSecretsProviderPrincipalId string = aksCluster.properties.addonProfiles.azureKeyvaultSecretsProvider.identity.objectId
output istioIngressGatewayIPAddress string = deployIstio ? istioIngressGatewayIPAddress.outputs.ipAddress : ''
21 changes: 21 additions & 0 deletions dev-infrastructure/modules/dns/a-record.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
param zoneName string
param recordName string
param ipAddress string
param ttl int

resource dnsZone 'Microsoft.Network/dnsZones@2018-05-01' existing = {
name: zoneName
}

resource frontendDNSRecord 'Microsoft.Network/dnsZones/A@2023-07-01-preview' = {
name: recordName
parent: dnsZone
properties: {
TTL: ttl
ARecords: [
{
ipv4Address: ipAddress
}
]
}
}
2 changes: 2 additions & 0 deletions dev-infrastructure/modules/network/publicipaddress.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = i
properties: roleAssignmentProperties
scope: publicIPAddress
}

output ipAddress string = publicIPAddress.properties.ipAddress
9 changes: 9 additions & 0 deletions dev-infrastructure/templates/mgmt-cluster.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ param logsServiceAccount string
// Log Analytics Workspace ID will be passed from region pipeline if enabled in config
param logAnalyticsWorkspaceId string = ''

resource mgmtClusterNSG 'Microsoft.Network/networkSecurityGroups@2023-11-01' = {
location: location
name: 'mgmt-cluster-node-nsg'
properties: {
securityRules: []
}
}

module mgmtCluster '../modules/aks-cluster-base.bicep' = {
name: 'cluster'
scope: resourceGroup()
Expand All @@ -124,6 +132,7 @@ module mgmtCluster '../modules/aks-cluster-base.bicep' = {
deployIstio: false
kubernetesVersion: kubernetesVersion
vnetAddressPrefix: vnetAddressPrefix
nodeSubnetNSGId: mgmtClusterNSG.id
subnetPrefix: subnetPrefix
podSubnetPrefix: podSubnetPrefix
clusterType: 'mgmt-cluster'
Expand Down
2 changes: 1 addition & 1 deletion dev-infrastructure/templates/region.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ module maestroInfra '../modules/maestro/maestro-infra.bicep' = {
maxClientSessionsPerAuthName: maestroEventGridMaxClientSessionsPerAuthName
publicNetworkAccess: maestroEventGridPrivate ? 'Disabled' : 'Enabled'
certificateIssuer: maestroCertificateIssuer
logAnalyticsWorkspaceId: logAnalyticsWorkspace.id
logAnalyticsWorkspaceId: enableLogAnalytics ? logAnalyticsWorkspace.id : ''
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated fix

}
}

Expand Down
59 changes: 56 additions & 3 deletions dev-infrastructure/templates/svc-cluster.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ param frontendIngressCertName string
@description('Frontend Ingress Certificate Issuer')
param frontendIngressCertIssuer string

@description('The service tag for Geneva Actions')
param genevaActionsServiceTag string

@description('The Azure Resource ID of the Azure Monitor Workspace (stores prometheus metrics)')
param azureMonitoringWorkspaceId string

Expand Down Expand Up @@ -209,6 +212,41 @@ resource serviceKeyVault 'Microsoft.KeyVault/vaults@2024-04-01-preview' existing
scope: resourceGroup(serviceKeyVaultResourceGroup)
}

resource svcClusterNSG 'Microsoft.Network/networkSecurityGroups@2023-11-01' = {
location: location
name: 'svc-cluster-node-nsg'
properties: {
securityRules: [
{
name: 'rp-in-arm'
properties: {
access: 'Allow'
destinationAddressPrefix: '*'
destinationPortRange: '443'
direction: 'Inbound'
priority: 120
protocol: 'Tcp'
sourceAddressPrefix: 'AzureResourceManager'
sourcePortRange: '*'
}
}
{
name: 'admin-in-geneva'
properties: {
access: 'Allow'
destinationAddressPrefix: '*'
destinationPortRange: '443'
direction: 'Inbound'
priority: 130
protocol: 'Tcp'
sourceAddressPrefix: genevaActionsServiceTag
sourcePortRange: '*'
}
}
]
}
}

module svcCluster '../modules/aks-cluster-base.bicep' = {
name: 'cluster'
scope: resourceGroup()
Expand All @@ -225,6 +263,7 @@ module svcCluster '../modules/aks-cluster-base.bicep' = {
istioIngressGatewayIPAddressName: istioIngressGatewayIPAddressName
istioIngressGatewayIPAddressIPTags: istioIngressGatewayIPAddressIPTags
vnetAddressPrefix: vnetAddressPrefix
nodeSubnetNSGId: svcClusterNSG.id
subnetPrefix: subnetPrefix
podSubnetPrefix: podSubnetPrefix
clusterType: 'svc-cluster'
Expand Down Expand Up @@ -450,19 +489,22 @@ module eventGrindPrivateEndpoint '../modules/private-endpoint.bicep' = {
}

//
// F R O N T E N D C E R T I F I C A T E
// F R O N T E N D
//

var frontendDnsName = 'rp'
var frontendDnsFQDN = '${frontendDnsName}.${regionalSvcDNSZoneName}'

module frontendIngressCert '../modules/keyvault/key-vault-cert.bicep' = {
name: 'frontend-cert-${uniqueString(resourceGroup().name)}'
scope: resourceGroup(serviceKeyVaultResourceGroup)
params: {
keyVaultName: serviceKeyVaultName
subjectName: 'CN=frontend.${regionalSvcDNSZoneName}'
subjectName: 'CN=${frontendDnsFQDN}'
certName: frontendIngressCertName
keyVaultManagedIdentityId: aroDevopsMsiId
dnsNames: [
'frontend.${regionalSvcDNSZoneName}'
frontendDnsFQDN
]
issuerName: frontendIngressCertIssuer
}
Expand All @@ -478,3 +520,14 @@ module frontendIngressCertCSIAccess '../modules/keyvault/keyvault-secret-access.
secretName: frontendIngressCertName
}
}

module frontendDNS '../modules/dns/a-record.bicep' = {
name: 'frontend-dns'
scope: resourceGroup(regionalResourceGroup)
params: {
zoneName: regionalSvcDNSZoneName
recordName: frontendDnsName
ipAddress: svcCluster.outputs.istioIngressGatewayIPAddress
ttl: 300
}
}