Skip to content

Commit

Permalink
nsg
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 27, 2025
1 parent d849641 commit d42aa88
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 0 deletions.
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
4 changes: 4 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
10 changes: 10 additions & 0 deletions dev-infrastructure/templates/mgmt-cluster.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ 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 +133,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
39 changes: 39 additions & 0 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

0 comments on commit d42aa88

Please sign in to comment.