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

[WIPChanges to yaml files, deployment bicep script, and readme file. #247

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b2c6325
adding app insights connection string as a kubernetes secret
francisnazareth Jan 27, 2025
62921ab
Update package-deploy.yaml
francisnazareth Jan 27, 2025
92c1088
Update deployment.md
francisnazareth Jan 29, 2025
9cba27d
Update deployment.md
francisnazareth Jan 29, 2025
ee49325
Update deployment.md
francisnazareth Jan 29, 2025
c734066
Update deployment.md
francisnazareth Jan 29, 2025
cbc5e33
Update deployment.md
francisnazareth Jan 29, 2025
b5bd9b0
Update deployment.md
francisnazareth Jan 29, 2025
f57bf3a
Update deployment.md
francisnazareth Jan 29, 2025
2247f75
Update deployment.md
francisnazareth Jan 29, 2025
06e7b22
Update deployment.md
francisnazareth Jan 29, 2025
41b126b
Update deployment.md
francisnazareth Jan 29, 2025
c1f92f3
Update deployment.md
francisnazareth Jan 29, 2025
e7e26d3
Update azuredeploy.bicep
francisnazareth Jan 29, 2025
182b9ca
Update deployment.md
francisnazareth Jan 29, 2025
05fcec7
Update deployment.md
francisnazareth Jan 29, 2025
16af31b
Update deployment.md
francisnazareth Jan 29, 2025
5d88112
Update deployment.md
francisnazareth Jan 29, 2025
c851e48
Update deployment.md
francisnazareth Jan 29, 2025
a0c94b3
Update deployment.md
francisnazareth Jan 29, 2025
8c80cca
Update deployment.md
francisnazareth Jan 29, 2025
029f8f7
Update deployment.md
francisnazareth Jan 29, 2025
5b3812d
Update azuredeploy.bicep - removing service principal.
francisnazareth Jan 30, 2025
535fa68
Update deployment.md
francisnazareth Jan 30, 2025
34080d0
Update azuredeploy.bicep
francisnazareth Jan 30, 2025
f740d1d
Update deployment.md
francisnazareth Jan 30, 2025
a02ee19
Update azuredeploy.bicep
francisnazareth Jan 30, 2025
2ba9c14
Update azuredeploy.bicep - removing storage
francisnazareth Jan 30, 2025
d513ac9
Update deployment.md
francisnazareth Jan 30, 2025
b09139a
Update azuredeploy.bicep
francisnazareth Jan 30, 2025
ddeed20
Update azuredeploy.bicep
francisnazareth Jan 30, 2025
3b9f60c
Update azuredeploy.bicep
francisnazareth Jan 30, 2025
5c08d40
Update azuredeploy.bicep
francisnazareth Jan 30, 2025
1297193
Update azuredeploy.bicep
francisnazareth Jan 30, 2025
7027d64
Update azuredeploy.bicep
francisnazareth Jan 30, 2025
def2364
Update deployment.md
francisnazareth Jan 30, 2025
6f7936e
Update deployment.md
francisnazareth Jan 30, 2025
2d136a7
Update deployment.md
francisnazareth Jan 30, 2025
b98c652
Update deployment.md
francisnazareth Jan 30, 2025
5f9d5ce
Update deployment.md
francisnazareth Jan 31, 2025
09bed7e
Update deployment.md
francisnazareth Jan 31, 2025
f3c7427
Update deployment.md
francisnazareth Jan 31, 2025
5edd080
Update deployment.md
francisnazareth Jan 31, 2025
e551654
Update deployment.md
francisnazareth Jan 31, 2025
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
75 changes: 18 additions & 57 deletions azuredeploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ param ingestionIdName string
@description('Name of the package managed identity')
param packageIdName string

@description('Client ID (used by cloudprovider)')
param servicePrincipalClientId string

@description('The Service Principal Client Secret.')
@secure()
param servicePrincipalClientSecret string

@description('The type of operating system.')
@allowed([
'Linux'
Expand All @@ -40,30 +33,19 @@ param osType string = 'Linux'
@maxValue(1023)
param osDiskSizeGB int = 0

@description('The version of Kubernetes. It must be supported in the target location.')
param kubernetesVersion string
//@description('The version of Kubernetes. It must be supported in the target location.')
//param kubernetesVersion string

@description('Type of the storage account that will store Redis Cache.')
@allowed([
'Standard_LRS'
'Standard_ZRS'
'Standard_GRS'
])
param deliveryRedisStorageType string = 'Standard_LRS'
param logAnalyticsWorkspaceID string

var clusterNamePrefix = 'aks'
var managedIdentityOperatorRoleId = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'f1a07417-d97a-45cb-824c-7a7467783830')
var deliveryRedisStorageName = 'rsto${uniqueString(resourceGroup().id)}'
var nestedACRDeploymentName = 'azuredeploy-acr-${acrResourceGroupName}'
var aksLogAnalyticsNamePrefix = 'logsAnalytics'
var monitoringMetricsPublisherRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '3913510d-42f4-4e42-8a64-420c390055eb')
var contributorRoleId = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
var nodeResourceGroupName = 'rg-${aksClusterName}-nodepools'
var aksClusterName = uniqueString(clusterNamePrefix, resourceGroup().id)
var aksClusterName = 'aks-${uniqueString(resourceGroup().id)}'
var agentCount = 2
var agentVMSize = 'Standard_D2_v2'
var workspaceName = 'la-${uniqueString(aksLogAnalyticsNamePrefix, resourceGroup().id)}'
var workspaceSku = 'pergb2018'
var workspaceRetentionInDays = 0

module nestedACRDeployment './azuredeploy_nested_nestedACRDeployment.bicep' = {
name: nestedACRDeploymentName
Expand All @@ -74,34 +56,31 @@ module nestedACRDeployment './azuredeploy_nested_nestedACRDeployment.bicep' = {
}
}

resource workspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
name: workspaceName
location: location
properties: {
retentionInDays: workspaceRetentionInDays
sku: {
name: workspaceSku
}
features: {
searchVersion: 1
}
}
}

// The control plane identity used by the cluster. Used for networking access (VNET joining and DNS updating)
resource miClusterControlPlane 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
name: 'mi-${aksClusterName}-controlplane'
location: location
}

//provide contributor role to the RG to AKS managed identity.
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
name: guid(resourceGroup().id, miClusterControlPlane.id)
scope: resourceGroup()
properties: {
principalId: miClusterControlPlane.properties.principalId
roleDefinitionId: contributorRoleId
principalType: 'ServicePrincipal'
}
}

resource aksCluster 'Microsoft.ContainerService/managedClusters@2024-09-02-preview' = {
name: aksClusterName
location: location
tags: {
environment: 'shared cluster'
}
properties: {
kubernetesVersion: kubernetesVersion
// kubernetesVersion: kubernetesVersion
nodeResourceGroup: nodeResourceGroupName
dnsPrefix: aksClusterName
agentPoolProfiles: [
Expand All @@ -122,14 +101,10 @@ resource aksCluster 'Microsoft.ContainerService/managedClusters@2024-09-02-previ
mode: 'User'
}
]
servicePrincipalProfile: {
clientId: servicePrincipalClientId
secret: servicePrincipalClientSecret
}
addonProfiles: {
omsagent: {
config: {
logAnalyticsWorkspaceResourceID: workspace.id
logAnalyticsWorkspaceResourceID: logAnalyticsWorkspaceID
}
enabled: true
}
Expand Down Expand Up @@ -174,20 +149,6 @@ resource aksCluster 'Microsoft.ContainerService/managedClusters@2024-09-02-previ
'${miClusterControlPlane.id}': {}
}
}

}

resource deliveryRedisStorage 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: deliveryRedisStorageName
sku: {
name: deliveryRedisStorageType
}
kind: 'Storage'
location: location
tags: {
displayName: 'Storage account for inflight deliveries'
app: 'fabrikam-delivery'
}
}

resource clusterIdentityPublisherRoleAssigment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
Expand Down
7 changes: 6 additions & 1 deletion charts/package/templates/package-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ spec:
secretKeyRef:
name: package-secrets
key: appinsights-ikey
- name: APPINSIGHTS_CONNECTION_STRING
valueFrom:
secretKeyRef:
name: package-secrets
key: appinsights-connstr
- name: LOG_LEVEL
value: {{ .Values.log.level }}
- name: CONTAINER_NAME
Expand All @@ -114,4 +119,4 @@ spec:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: package-secrets-csi-akv-{{ $svcversion }}
secretProviderClass: package-secrets-csi-akv-{{ $svcversion }}
8 changes: 7 additions & 1 deletion charts/package/templates/package-secret-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ spec:
key: cosmosdb-connstr
- objectName: ApplicationInsights--InstrumentationKey
key: appinsights-ikey
- objectName: ApplicationInsights--ConnectionString
key: appinsights-connstr
parameters:
usePodIdentity: "false"
clientID: {{ .Values.identity.clientid }}
Expand All @@ -35,6 +37,10 @@ spec:
- |
objectName: ApplicationInsights--InstrumentationKey
objectAlias: ApplicationInsights--InstrumentationKey
objectType: secret
objectType: secret
- |
objectName: ApplicationInsights--ConnectionString
objectAlias: ApplicationInsights--ConnectionString
objectType: secret
tenantId: {{ .Values.identity.tenantId }}
---
Loading