Skip to content

Commit

Permalink
Merge pull request #194 from ElYusubov/development
Browse files Browse the repository at this point in the history
Adding the 22-deploy-AKS bicep file snippet
  • Loading branch information
ElYusubov authored Dec 11, 2024
2 parents ae2ede7 + 867aad9 commit dc16192
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions samples/22-deploy-AKS.bicep
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

0 comments on commit dc16192

Please sign in to comment.