-
Notifications
You must be signed in to change notification settings - Fork 24
/
aks.bicep
70 lines (59 loc) · 2.53 KB
/
aks.bicep
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
// mandatory params
@description('The unique DNS prefix for your cluster, such as myakscluster. This cannot be updated once the Managed Cluster has been created.')
param dnsPrefix string = resourceGroup().name
@description('The administrator username to use for Linux VMs.')
param linuxAdminUsername string
@description('Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers.')
param sshRSAPublicKey string
@description('The ID for the service principal.')
param servicePrincipalClientId string
@description('The unique name for the AKS cluster, such as myAKSCluster.')
param uniqueclustername string = resourceGroup().name
@secure()
@description('The secret password associated with the service principal.')
param servicePrincipalClientSecret string
// Optional params
@description('The region to deploy the cluster. By default this will use the same region as the resource group.')
param location string = resourceGroup().location
@minValue(0)
@maxValue(1023)
@description('OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified.')
param osDiskSizeGB int = 0
@minValue(1)
@maxValue(50)
@description('Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1.')
param agentCount int = 3
@description('VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions')
param agentVMSize string = 'Standard_DS2_v2'
resource aks 'Microsoft.ContainerService/managedClusters@2021-07-01' = {
name: uniqueclustername
location: location
properties: {
dnsPrefix: dnsPrefix
agentPoolProfiles: [
{
name: 'agentpool'
osDiskSizeGB: osDiskSizeGB
count: agentCount
vmSize: agentVMSize
osType: 'Linux'
mode: 'System'
}
]
linuxProfile: {
adminUsername: linuxAdminUsername
ssh: {
publicKeys: [
{
keyData: sshRSAPublicKey
}
]
}
}
servicePrincipalProfile: {
clientId: servicePrincipalClientId
secret: servicePrincipalClientSecret
}
}
}
output controlPlaneFQDN string = aks.properties.fqdn