Skip to content

Instantly share code, notes, and snippets.

@ams0
Created March 8, 2018 09:07
Show Gist options
  • Save ams0/c8d593c6043cff1e55a9b356d8a6c0cc to your computer and use it in GitHub Desktop.
Save ams0/c8d593c6043cff1e55a9b356d8a6c0cc to your computer and use it in GitHub Desktop.
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"type": "string",
"defaultValue": "azureuser",
"metadata": {
"description": "User name for the Virtual Machine."
}
},
"sshPublicKey": {
"type": "string",
"metadata": {
"description": "Configure all linux machines with the SSH public key string, for example 'ssh-rsa AAAAB...snip...UcyupgH azureuser@linuxvm'"
}
},
"virtualMachineSize": {
"type": "string",
"defaultValue": "Standard_DS2_v2",
"allowedValues": [
"Standard_B2s",
"Standard_B2ms",
"Standard_D2s_v3",
"Standard_D2_v3",
"Standard_DS2_v2",
"Standard_D2_v2",
"Standard_DS2",
"Standard_D2",
"Standard_A2_v2",
"Standard_A2"
],
"metadata": {
"description": "The virutal machine size to use. We picked out the sizes with 2 vCPUs, but in real world projects you can choose other sizes as you desired."
}
},
"kubernetesVersion": {
"type": "string",
"defaultValue": "1.8.7",
"allowedValues": [
"1.8.6",
"1.8.7"
],
"metadata": {
"description": "The version of the Kubernetes running in AKS."
}
},
"ServicePrincipalClientID":
{
"type": "string"
},
"keyVaultSecretVaultID":
{
"type": "string"
},
"keyVaultSecretName":
{
"type": "string"
},
"resourcePrefix": {
"type": "string",
"metadata": {
"description": "Will be prefixed to each resource"
}
},
"agentCount": {
"type": "int",
"metadata": {
"description": "Number of AKS agents"
}
}
},
"variables": {
"aksName": "[concat(parameters('resourcePrefix'), '-aks')]",
"aksDnsPrefix": "[concat('aks', uniqueString(resourceGroup().id))]"
},
"resources": [
{
"apiVersion": "2017-08-31",
"type": "Microsoft.ContainerService/managedClusters",
"location": "[resourceGroup().location]",
"name": "[variables('aksName')]",
"properties": {
"kubernetesVersion": "[parameters('kubernetesVersion')]",
"dnsPrefix": "[variables('aksDnsPrefix')]",
"agentPoolProfiles": [
{
"name": "agentpool",
"count": "[parameters('agentCount')]",
"vmSize": "[parameters('virtualMachineSize')]",
"osType": "Linux",
"storageProfile": "ManagedDisks"
}
],
"linuxProfile": {
"adminUsername": "[parameters('adminUsername')]",
"ssh": {
"publicKeys": [
{
"path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]",
"keyData": "[parameters('sshPublicKey')]"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "[parameters('ServicePrincipalClientID')]",
"secret": "",
"keyvaultSecretRef": {
"vaultID": "[parameters('keyVaultSecretVaultID')]",
"secretName": "[parameters('keyVaultSecretName')]"
}
}
}
}
],
"outputs": {
"clusterName": {
"type": "string",
"value": "[variables('aksName')]"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment