-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathmain.bicep
More file actions
95 lines (88 loc) · 2.63 KB
/
main.bicep
File metadata and controls
95 lines (88 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
param nameseed string = 'petclinic'
param location string = resourceGroup().location
param petClinicHelmUri string = 'https://github.com/Gordonby/aksc-petclinic/raw/main/spring-petclinic-cloud-chart/PetClinic-0.1.0.tgz'
param wavefrontApiKey string = ''
//---------Kubernetes Construction---------
module aksconst './aks-construction/bicep/main.bicep' = {
name: 'aksconstruction'
params: {
location : location
resourceName: nameseed
enable_aad: true
enableAzureRBAC : true
registries_sku: 'Standard'
omsagent: true
retentionInDays: 30
agentCount: 2
JustUseSystemPool: true
}
}
module acrImages 'importImages.bicep' = {
name: 'Import-PetClinic-Images'
params: {
location: location
acrName: aksconst.outputs.containerRegistryName
}
}
//RBAC for deployment-scripts
var contributor='b24988ac-6180-42a0-ab88-20f7382dd24c'
var rbacClusterAdmin='b1ff04bb-8a4e-4dc4-8eb5-8693973ce19b'
var rbacWriter='a7ffa36f-339b-4b5c-8bdf-e2c188b2c0eb'
module kubeNamespace 'br/public:deployment-scripts/aks-run-command:1.0.1' = {
name: 'CreateNamespace'
params: {
aksName: aksconst.outputs.aksClusterName
location: location
managedIdentityName: 'id-AksRunCommandProxy-Admin'
rbacRolesNeeded:[
contributor
rbacClusterAdmin
]
commands: [
'kubectl create namespace spring-petclinic'
]
}
dependsOn: [
acrImages
]
}
module dbs 'br/public:deployment-scripts/aks-run-command:1.0.1' = {
name: 'Install-Databases'
params: {
aksName: aksconst.outputs.aksClusterName
location: location
rbacRolesNeeded:[
contributor
rbacWriter
]
commands: [
'''
helm repo add bitnami https://charts.bitnami.com/bitnami;
helm repo update;
helm upgrade --install vets-db-mysql bitnami/mysql --namespace spring-petclinic --version 8.8.8 --set auth.database=service_instance_db;
helm upgrade --install visits-db-mysql bitnami/mysql --namespace spring-petclinic --version 8.8.8 --set auth.database=service_instance_db;
helm upgrade --install customers-db-mysql bitnami/mysql --namespace spring-petclinic --version 8.8.8 --set auth.database=service_instance_db;
'''
]
}
dependsOn: [
kubeNamespace
]
}
module app 'br/public:deployment-scripts/aks-run-command:1.0.1' = {
name: 'Install-PetClinic-App'
params: {
aksName: aksconst.outputs.aksClusterName
location: location
rbacRolesNeeded:[
contributor
rbacWriter
]
commands: [
'helm upgrade --install petapp ${petClinicHelmUri} -n spring-petclinic --set wavefrontApiKey="${wavefrontApiKey}"'
]
}
dependsOn: [
kubeNamespace
]
}