Skip to content

Commit

Permalink
fixes a couple of bugs in aks samples (Azure#3912)
Browse files Browse the repository at this point in the history
* readme and small fix in script

* fix: script

* fix: removed explict k8s version and upd. readme

* changed json to pass tests
  • Loading branch information
buzzfrog authored Aug 7, 2021
1 parent c7f3bcd commit 97742bc
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 14 deletions.
14 changes: 7 additions & 7 deletions docs/examples/101/aks-vmss-systemassigned-identity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ This Bicep template deploys a managed **Azure hosted Kubernetes cluster** via **
## Deployment steps ##

* [Install the Bicep CLI](https://github.com/Azure/bicep/blob/main/docs/installing.md) by following the instruction.
* Build the `main.bicep` file by running the Bicep CLI command:
```bash
bicep build ./main.bicep

New-AzResourceGroup -Name my-rg-aks -Location westeurope
New-AzResourceGroupDeployment -TemplateFile ./main.json -ResourceGroupName my-rg-aks -Verbose
* Create Resource Group
```
az group create -n <resource-group-name> -l westus
```
* Execute deployment
```
az deployment group create -g <resource-group-name> -f .\main.bicep
```
2 changes: 0 additions & 2 deletions docs/examples/101/aks-vmss-systemassigned-identity/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ param agentCount int = 1
param agentVMSize string = 'Standard_D2_v3'

// vars
var kubernetesVersion = '1.19.0'
var subnetRef = '${vn.id}/subnets/${subnetName}'
var addressPrefix = '20.0.0.0/16'
var subnetName = 'Subnet01'
Expand Down Expand Up @@ -61,7 +60,6 @@ resource aks 'Microsoft.ContainerService/managedClusters@2020-09-01' = {
type: 'SystemAssigned'
}
properties: {
kubernetesVersion: kubernetesVersion
enableRBAC: true
dnsPrefix: dnsPrefix
agentPoolProfiles: [
Expand Down
4 changes: 1 addition & 3 deletions docs/examples/101/aks-vmss-systemassigned-identity/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "8956462873572192114"
"templateHash": "8178613380287402826"
}
},
"parameters": {
Expand Down Expand Up @@ -49,7 +49,6 @@
},
"functions": [],
"variables": {
"kubernetesVersion": "1.19.0",
"subnetRef": "[format('{0}/subnets/{1}', resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName')), variables('subnetName'))]",
"addressPrefix": "20.0.0.0/16",
"subnetName": "Subnet01",
Expand Down Expand Up @@ -95,7 +94,6 @@
"type": "SystemAssigned"
},
"properties": {
"kubernetesVersion": "[variables('kubernetesVersion')]",
"enableRBAC": true,
"dnsPrefix": "[parameters('dnsPrefix')]",
"agentPoolProfiles": [
Expand Down
24 changes: 24 additions & 0 deletions docs/examples/101/aks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

# Azure Kubernetes Service

## Deployment steps ##

### 0. Optional: Install Bicep ###
* [Install the Bicep CLI](https://github.com/Azure/bicep/blob/main/docs/installing.md) by following the instruction.

### 1. Create Service Principal ###
```
az ad sp create-for-rbac
```
### 2. Create Resource Group ####
```
az group create -n <resource-group-name> -l westus
```

### 3. Optional: Generete SSH Keys (Windows) ###
[How to Generate SSH Key in Windows 10](https://phoenixnap.com/kb/generate-ssh-key-windows-10)

### 4. Deploy ####
```
az deployment group create -g <resource-group-name> -f .\main.bicep --parameters dnsPrefix=<dns-prefix> linuxAdminUsername=<username> servicePrincipalClientId=<sp-appid> servicePrincipalClientSecret=<sp-password> sshRSAPublicKey=<ssh-public-key>
```
1 change: 1 addition & 0 deletions docs/examples/101/aks/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ resource aks 'Microsoft.ContainerService/managedClusters@2020-09-01' = {
count: agentCount
vmSize: agentVMSize
osType: 'Linux'
mode: 'System'
}
]
linuxProfile: {
Expand Down
5 changes: 3 additions & 2 deletions docs/examples/101/aks/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "3927513209688740701"
"templateHash": "10495848497300076865"
}
},
"parameters": {
Expand Down Expand Up @@ -64,7 +64,8 @@
"osDiskSizeGB": "[parameters('osDiskSizeGB')]",
"count": "[parameters('agentCount')]",
"vmSize": "[parameters('agentVMSize')]",
"osType": "Linux"
"osType": "Linux",
"mode": "System"
}
],
"linuxProfile": {
Expand Down

0 comments on commit 97742bc

Please sign in to comment.