Skip to content

Commit 0c50cca

Browse files
authored
Merge pull request #60 from Azure-Samples/aks-arm
Add cloud-native/aks-arm/
2 parents 6693c66 + 76eaff9 commit 0c50cca

4 files changed

Lines changed: 109 additions & 0 deletions

File tree

cloud-native/aks-arm/NOTES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# NOTES
2+
3+
https://azure.github.io/Azure-Verified-Modules/indexes/bicep/bicep-resource-modules/
4+
5+
https://github.com/Azure/bicep-registry-modules/tree/main/avm/res/container-service/managed-cluster#example-3-using-only-defaults
6+
7+
https://techcommunity.microsoft.com/blog/linuxandopensourceblog/azure-linux-3-0-now-in-preview-on-azure-kubernetes-service-v1-31/4287229

cloud-native/aks-arm/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Azure Kubernetes Service (AKS)
2+
3+
## Prerequisites
4+
5+
- Azure CLI
6+
- Bicep
7+
- Azure Subscription
8+
9+
## Deploy
10+
11+
Azure Linux V3 Preview feature registration:
12+
13+
```bash
14+
az feature register \
15+
--namespace Microsoft.ContainerService \
16+
--name AzureLinuxV3Preview
17+
```
18+
19+
```bash
20+
az feature show \
21+
--namespace Microsoft.ContainerService \
22+
--name AzureLinuxV3Preview
23+
```
24+
25+
```bash
26+
az provider register \
27+
-n Microsoft.ContainerService
28+
```
29+
30+
Create resource group:
31+
32+
```bash
33+
az group create \
34+
--name 250100-aks \
35+
--location eastus
36+
```
37+
38+
Deploy Azure Kubernetes Service (AKS) cluster:
39+
40+
```bash
41+
az deployment group create \
42+
--resource-group 250100-aks \
43+
--template-file cloud-native/aks-arm/aks.bicep
44+
```
45+
46+
## Cleanup
47+
48+
Deploy the empty Bicep template:
49+
50+
```bash
51+
az deployment group create \
52+
--resource-group 250100-aks \
53+
--mode Complete \
54+
--template-file cloud-native/aks-arm/empty.bicep
55+
```

cloud-native/aks-arm/aks.bicep

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
param location string = resourceGroup().location
2+
3+
var managedIdentityName = '${resourceGroup().name}-identity'
4+
5+
resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = {
6+
name: managedIdentityName
7+
location: location
8+
}
9+
10+
module managedCluster 'br/public:avm/res/container-service/managed-cluster:0.6.2' = {
11+
name: 'managedClusterDeployment'
12+
params: {
13+
// Required parameters
14+
name: 'aks-1'
15+
kubernetesVersion: '1.31.2'
16+
primaryAgentPoolProfiles: [
17+
{
18+
count: 1
19+
mode: 'System'
20+
name: 'systempool'
21+
osSKU: 'AzureLinux'
22+
vmSize: 'Standard_D2pds_v6'
23+
orchestratorVersion: '1.31.2'
24+
}
25+
{
26+
count: 1
27+
mode: 'User'
28+
name: 'pool1'
29+
osSKU: 'AzureLinux'
30+
vmSize: 'Standard_D2pds_v6'
31+
orchestratorVersion: '1.31.2'
32+
}
33+
]
34+
// Non-required parameters
35+
location: location
36+
aadProfile: {
37+
aadProfileEnableAzureRBAC: true
38+
aadProfileManaged: true
39+
}
40+
disableLocalAccounts: true
41+
managedIdentities: {
42+
userAssignedResourceIds: [
43+
managedIdentity.id
44+
]
45+
}
46+
}
47+
}

cloud-native/aks-arm/empty.bicep

Whitespace-only changes.

0 commit comments

Comments
 (0)