Skip to content

Instantly share code, notes, and snippets.

@feiskyer
Created November 3, 2020 01:57
Show Gist options
  • Save feiskyer/689809d41b9a8358095da1d9b0ec0837 to your computer and use it in GitHub Desktop.
Save feiskyer/689809d41b9a8358095da1d9b0ec0837 to your computer and use it in GitHub Desktop.
Templates to create private cluster with "none" PrivateDNSZone
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.1",
"parameters": {
"clusterName": {
"type": "string",
"metadata": {
"description": "The name of the Managed Cluster resource."
},
"defaultValue": "demo"
},
"location": {
"type": "string",
"metadata": {
"description": "The location of AKS resource."
},
"defaultValue": "eastus2euap"
},
"dnsPrefix": {
"type": "string",
"metadata": {
"description": "Optional DNS prefix to use with hosted Kubernetes API server FQDN."
},
"defaultValue": "aks"
},
"osDiskSizeGB": {
"type": "int",
"defaultValue": 30,
"metadata": {
"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
},
"agentCount": {
"type": "int",
"defaultValue": 3,
"metadata": {
"description": "The number of agent nodes for the cluster."
},
"minValue": 1,
"maxValue": 50
},
"agentVMSize": {
"type": "string",
"defaultValue": "Standard_D2_v2",
"metadata": {
"description": "The size of the Virtual Machine."
}
},
"osType": {
"type": "string",
"defaultValue": "Linux",
"allowedValues": [
"Linux"
],
"metadata": {
"description": "The type of operating system."
}
},
"kubernetesVersion": {
"type": "string",
"defaultValue": "1.18.8",
"metadata": {
"description": "The version of Kubernetes."
}
},
"networkPlugin": {
"type": "string",
"allowedValues": [
"azure",
"kubenet"
],
"metadata": {
"description": "Network plugin used for building Kubernetes network."
},
"defaultValue": "kubenet"
},
"maxPods": {
"type": "int",
"defaultValue": 110,
"metadata": {
"description": "Maximum number of pods that can run on a node."
}
}
},
"resources": [
{
"apiVersion": "2020-11-01",
"type": "Microsoft.ContainerService/managedClusters",
"location": "[parameters('location')]",
"name": "[parameters('clusterName')]",
"identity": {
"type": "SystemAssigned"
},
"properties": {
"kubernetesVersion": "[parameters('kubernetesVersion')]",
"dnsPrefix": "[parameters('dnsPrefix')]",
"agentPoolProfiles": [
{
"name": "nodepool1",
"mode" : "System",
"vmSize": "[parameters('agentVMSize')]",
"osDiskSizeGB": "[parameters('osDiskSizeGB')]",
"count": "[parameters('agentCount')]",
"maxPods": "[parameters('maxPods')]",
"osType": "[parameters('osType')]",
"type": "VirtualMachineScaleSets"
}
],
"networkProfile": {
"networkPlugin": "[parameters('networkPlugin')]"
},
"apiServerAccessProfile": {
"enablePrivateCluster": true,
"privateDNSZone": "none"
}
},
"tags": {}
}
],
"outputs": {
"privateFQDN": {
"type": "string",
"value": "[reference(parameters('clusterName')).privateFQDN]"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment