-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from ElYusubov/development
Adding the 22-deploy-AKS bicep file snippet
- Loading branch information
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// 22-deploy-AKS.bicep | ||
|
||
/* This Bicep code snippet sets up parameters for deploying an AKS cluster, including the cluster name, location, | ||
DNS prefix, disk size, number of nodes, VM size, Linux admin username, and SSH RSA public key. | ||
It then defines the AKS managed cluster resource with the specified parameters and | ||
assigns a system-assigned managed identity to the cluster. | ||
This setup allows for the deployment and configuration of an AKS cluster in Azure. | ||
*/ | ||
|
||
@description('The name of the Managed Cluster resource.') | ||
param clusterName string = 'santa21cluster' | ||
|
||
@description('The location of the Managed Cluster resource.') | ||
param location string = resourceGroup().location | ||
|
||
@description('Optional DNS prefix to use with hosted Kubernetes API server FQDN.') | ||
param dnsPrefix string | ||
|
||
@description('Disk size (in GB) to provision for each of the agent pool nodes. This value ranges from 0 to 1023. Specifying 0 will apply the default disk size for that agentVMSize.') | ||
@minValue(0) | ||
@maxValue(1023) | ||
param osDiskSizeGB int = 0 | ||
|
||
@description('The number of nodes for the cluster.') | ||
@minValue(1) | ||
@maxValue(50) | ||
param agentCount int = 3 | ||
|
||
@description('The size of the Virtual Machine.') | ||
param agentVMSize string = 'standard_d2s_v3' | ||
|
||
@description('User name for the Linux Virtual Machines.') | ||
param linuxAdminUsername string | ||
|
||
@description('Configure all linux machines with the SSH RSA public key string. Your key should include three parts, for example \'ssh-rsa AAAAB...snip...UcyupgH azureuser@linuxvm\'') | ||
param sshRSAPublicKey string | ||
|
||
resource aks 'Microsoft.ContainerService/managedClusters@2024-02-01' = { | ||
name: clusterName | ||
location: location | ||
identity: { | ||
type: 'SystemAssigned' | ||
} | ||
properties: { | ||
dnsPrefix: dnsPrefix | ||
agentPoolProfiles: [ | ||
{ | ||
name: 'agentpool' | ||
osDiskSizeGB: osDiskSizeGB | ||
count: agentCount | ||
vmSize: agentVMSize | ||
osType: 'Linux' | ||
mode: 'System' | ||
} | ||
] | ||
linuxProfile: { | ||
adminUsername: linuxAdminUsername | ||
ssh: { | ||
publicKeys: [ | ||
{ | ||
keyData: sshRSAPublicKey | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
|
||
output controlPlaneFQDN string = aks.properties.fqdn |