update scripts

This commit is contained in:
cloudmelon
2020-08-14 00:34:30 +01:00
parent 31731966be
commit b7abae0319
3 changed files with 3 additions and 433 deletions
@@ -1,21 +0,0 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"routeTables_bdcaks_rt_name": {
"value": null
},
"virtualNetworks_bdc_vnet_name": {
"value": null
},
"azureFirewalls_bdcaksazfw_name": {
"value": null
},
"publicIPAddresses_bdcaksazfw_ip_name": {
"value": null
},
"managedClusters_bdcaksprivatecluster_name": {
"value": null
}
}
}
@@ -1,409 +0,0 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"aksclusterName": {
"type": "string",
"metadata": {
"description": "The name of the AKS Managed Cluster resource."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "The Azure location of the AKS resource."
}
},
"dnsPrefix": {
"type": "string",
"metadata": {
"description": "Optional DNS prefix to use with hosted Kubernetes API server FQDN."
}
},
"agentCount": {
"defaultValue": 3,
"minValue": 1,
"maxValue": 50,
"type": "int",
"metadata": {
"description": "The number of agent nodes for the cluster. Production workloads have a recommended minimum of 3."
}
},
"agentVMSize": {
"defaultValue": "Standard_D13_v2",
"type": "string",
"metadata": {
"description": "The recommended size of the Virtual Machine."
}
},
"existingServicePrincipalObjectId": {
"type": "string",
"metadata": {
"description": "Object ID against which the Network Contributor roles will be assigned on the subnet"
}
},
"existingServicePrincipalClientId": {
"type": "string",
"metadata": {
"description": "Client ID (used by cloudprovider)"
}
},
"existingServicePrincipalClientSecret": {
"type": "securestring",
"metadata": {
"description": "The Service Principal Client Secret."
}
},
"kubernetesVersion": {
"defaultValue": "1.16.13",
"type": "string",
"metadata": {
"description": "The version of Kubernetes."
}
},
"serviceCidr": {
"type": "string",
"defaultValue": "10.3.0.0/24",
"metadata": {
"description": "A CIDR notation IP range from which to assign service cluster IPs."
}
},
"dnsServiceIP": {
"type": "string",
"defaultValue": "10.3.0.10",
"metadata": {
"description": "Containers DNS server IP address."
}
},
"dockerBridgeCidr": {
"type": "string",
"defaultValue": "172.17.0.1/16",
"metadata": {
"description": "A CIDR notation IP for Docker bridge."
}
},
"routetableName": {
"defaultValue": "bdcaks-rt",
"type": "String"
},
"vnetName": {
"defaultValue": "bdcaks-vnet",
"type": "String"
},
"subnetName": {
"defaultValue": "bdcaks-subnet",
"type": "String"
},
"azureFirewallName": {
"defaultValue": "bdcaksazfw",
"type": "String"
},
"azureFirewallPublicIP": {
"defaultValue": "bdcaksazfw-ip",
"type": "String"
}
},
"variables": {
"networkRoleDefinitionID":"[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', '4d97b98b-1d4f-4787-a291-c67834d212e7')]",
"vnetSubnetID":"[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"
},
"resources": [
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-05-01",
"name": "[parameters('vnetName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/routeTables', parameters('routetableName'))]"
],
"properties": {
"addressSpace": {
"addressPrefixes": [
"10.0.0.0/8"
]
},
"dhcpOptions": {
"dnsServers": []
},
"virtualNetworkPeerings": [],
"enableDdosProtection": false,
"enableVmProtection": false
},
"resources": [
{
"type": "subnets",
"apiVersion": "2020-05-01",
"location": "[parameters('location')]",
"name": "AzureFirewallSubnet",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', parameters('vnetName'))]"
],
"properties": {
"addressPrefix": "10.2.0.0/24",
"delegations": [],
"privateEndpointNetworkPolicies": "Enabled",
"privateLinkServiceNetworkPolicies": "Enabled"
}
},
{
"type": "subnets",
"apiVersion": "2020-05-01",
"location": "[parameters('location')]",
"name": "[parameters('subnetName')]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', parameters('vnetName'))]",
"[resourceId('Microsoft.Network/routeTables', parameters('routetableName'))]"
],
"properties": {
"addressPrefix": "10.1.0.0/16",
"routeTable": {
"id": "[resourceId('Microsoft.Network/routeTables', parameters('routetableName'))]"
},
"delegations": [],
"privateEndpointNetworkPolicies": "Disabled",
"privateLinkServiceNetworkPolicies": "Enabled"
}
}
]
},
{
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2020-05-01",
"name": "[parameters('azureFirewallPublicIP')]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard"
},
"properties": {
"ipAddress": "51.104.159.190",
"publicIPAddressVersion": "IPv4",
"publicIPAllocationMethod": "Static",
"idleTimeoutInMinutes": 4,
"ipTags": []
}
},
{
"type": "Microsoft.Network/routeTables",
"apiVersion": "2020-05-01",
"name": "[parameters('routetableName')]",
"location": "[parameters('location')]",
"properties": {
"disableBgpRoutePropagation": false,
"routes": [
{
"name": "bdcaksrouteinet",
"properties": {
"addressPrefix": "51.104.159.190/32",
"nextHopType": "Internet"
}
},
{
"name": "bdcaksroute",
"properties": {
"addressPrefix": "0.0.0.0/0",
"nextHopType": "VirtualAppliance",
"nextHopIpAddress": "10.2.0.4"
}
}
]
}
},
{
"type": "Microsoft.Network/azureFirewalls",
"apiVersion": "2020-05-01",
"name": "[parameters('azureFirewallName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPAddresses', parameters('azureFirewallPublicIP'))]",
"[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), 'AzureFirewallSubnet')]"
],
"properties": {
"sku": {
"name": "AZFW_VNet",
"tier": "Standard"
},
"threatIntelMode": "Alert",
"additionalProperties": {
"Network.DNS.EnableProxy": "True",
"Network.DNS.RequireProxyForNetworkRules": "True"
},
"ipConfigurations": [
{
"name": "[concat(parameters('azureFirewallName'), '-config')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('azureFirewallPublicIP'))]"
},
"subnet": {
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), 'AzureFirewallSubnet')]"
}
}
}
],
"networkRuleCollections": [
{
"name": "aksfwnr",
"properties": {
"priority": 100,
"action": {
"type": "Allow"
},
"rules": [
{
"name": "apiudp",
"protocols": [
"UDP"
],
"sourceAddresses": [
"*"
],
"destinationAddresses": [
"AzureCloud.northeurope"
],
"sourceIpGroups": [],
"destinationIpGroups": [],
"destinationFqdns": [],
"destinationPorts": [
"1194"
]
},
{
"name": "apitcp",
"protocols": [
"TCP"
],
"sourceAddresses": [
"*"
],
"destinationAddresses": [
"AzureCloud.northeurope"
],
"sourceIpGroups": [],
"destinationIpGroups": [],
"destinationFqdns": [],
"destinationPorts": [
"9000"
]
},
{
"name": "time",
"protocols": [
"UDP"
],
"sourceAddresses": [
"*"
],
"destinationAddresses": [],
"sourceIpGroups": [],
"destinationIpGroups": [],
"destinationFqdns": [
"ntp.ubuntu.com"
],
"destinationPorts": [
"123"
]
}
]
}
}
],
"applicationRuleCollections": [],
"natRuleCollections": []
}
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2019-10-01",
"name": "DeployPrivateAksCluster",
"dependsOn": [
"[variables('vnetSubnetID')]"
],
"resourceGroup": "[resourceGroup().name]",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2020-06-01",
"name": "[parameters('aksclusterName')]",
"location": "[parameters('location')]",
"dependsOn": [
"ClusterSubnetRoleAssignmentDeployment"
],
"sku": {
"name": "Basic",
"tier": "Free"
},
"properties": {
"kubernetesVersion": "[parameters('kubernetesVersion')]",
"dnsPrefix": "[parameters('dnsPrefix')]",
"agentPoolProfiles": [
{
"name": "nodepool",
"count": "[parameters('agentCount')]",
"vmSize": "[parameters('agentVMSize')]",
"osDiskSizeGB": 128,
"vnetSubnetID":"[variables('vnetSubnetID')]",
"maxPods": 30,
"type": "VirtualMachineScaleSets",
"orchestratorVersion": "[parameters('kubernetesVersion')]",
"enableNodePublicIP": false,
"mode": "System",
"osType": "Linux",
"nodeImageVersion": "AKSUbuntu-1604-2020.07.16"
}
],
"servicePrincipalProfile": {
"clientId": "[parameters('existingServicePrincipalClientId')]",
"secret": "[parameters('existingServicePrincipalClientSecret')]"
},
"networkProfile": {
"networkPlugin": "azure",
"loadBalancerSku": "Standard",
"serviceCidr": "[parameters('serviceCidr')]",
"dnsServiceIP": "[parameters('dnsServiceIP')]",
"dockerBridgeCidr": "[parameters('dockerBridgeCidr')]",
"outboundType": "userDefinedRouting"
},
"apiServerAccessProfile": {
"enablePrivateCluster": true
}
}
},
{
"type": "Microsoft.Resources/deployments",
"name": "ClusterSubnetRoleAssignmentDeployment",
"apiVersion": "2017-05-10",
"resourceGroup": "[resourceGroup().name]",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"type": "Microsoft.Network/virtualNetworks/providers/roleAssignments",
"apiVersion": "2017-05-01",
"name": "[concat(parameters('vnetName'),'/Microsoft.Authorization/', guid(resourceGroup().id, deployment().name))]",
"properties": {
"roleDefinitionId": "[variables('networkRoleDefinitionID')]",
"principalId": "[parameters('existingServicePrincipalObjectId')]",
"scope": "[resourceId(resourceGroup().name,'Microsoft.Network/virtualNetworks',parameters('vnetName'))]"
}
}
]
}
}
}
]
}
}
}
]
}
@@ -3,8 +3,8 @@
This repository contains :
Bash Scripts :
- deploy-private-aks.sh
- deploy-private-aks-udr.sh
- deploy-private-bdc.sh
- deploy-private-aks.sh To deploy private AKS cluster ( private endpoint )
- deploy-private-aks-udr.sh To deploy private AKS cluster with UDR.
- deploy-private-bdc.sh To deploy Big Data Clusters ( BDC ) in private deployment mode.