From afa0127b4bd8b3b07520440a9244fbd9348aa91b Mon Sep 17 00:00:00 2001 From: Melony QIN Date: Fri, 16 Apr 2021 15:48:23 +0100 Subject: [PATCH 1/2] initiating --- .../platform-ops/Readme.md | 0 .../bdc-aks-ops/azure-cni/azuredeploy.json | 250 ++++++++++++++++++ .../azure-cni/azuredeploy.parameters.json | 33 +++ 3 files changed, 283 insertions(+) create mode 100644 samples/features/sql-big-data-cluster/platform-ops/Readme.md create mode 100644 samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.json create mode 100644 samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.parameters.json diff --git a/samples/features/sql-big-data-cluster/platform-ops/Readme.md b/samples/features/sql-big-data-cluster/platform-ops/Readme.md new file mode 100644 index 00000000..e69de29b diff --git a/samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.json b/samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.json new file mode 100644 index 00000000..dffeae90 --- /dev/null +++ b/samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.json @@ -0,0 +1,250 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "resourceName": { + "type": "string", + "metadata": { + "description": "The name of the 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." + } + }, + "osDiskSizeGB": { + "defaultValue": 0, + "minValue": 0, + "maxValue": 1023, + "type": "int", + "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." + } + }, + "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_D2_v3", + "type": "string", + "metadata": { + "description": "The size of the Virtual Machine." + } + }, + "existingServicePrincipalObjectId": { + "type": "string", + "metadata": { + "description": "Oject 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." + } + }, + "osType": { + "defaultValue": "Linux", + "allowedValues": [ + "Linux" + ], + "type": "string", + "metadata": { + "description": "The type of operating system." + } + }, + "kubernetesVersion": { + "defaultValue": "1.17.9", + "type": "string", + "metadata": { + "description": "The version of Kubernetes." + } + }, + "enableHttpApplicationRouting": { + "defaultValue": false, + "type": "bool", + "metadata": { + "description": "boolean flag to turn on and off of http application routing" + } + }, + "networkPlugin": { + "allowedValues": [ + "azure", + "kubenet" + ], + "defaultValue": "azure", + "type": "string", + "metadata": { + "description": "Network plugin used for building Kubernetes network." + } + }, + "maxPods": { + "defaultValue": 30, + "type": "int", + "metadata": { + "description": "Maximum number of pods that can run on a node." + } + }, + "enableRBAC": { + "defaultValue": true, + "type": "bool", + "metadata": { + "description": "boolean flag to turn on and off of RBAC" + } + }, + "builtInRoleType": { + "type": "string", + "allowedValues": [ + "Owner", + "Contributor", + "Reader" + ], + "metadata": { + "description": "Built-in role to assign" + } + }, + "existingVirtualNetworkName": { + "type": "string", + "metadata": { + "description": "Name of an existing VNET that will contain this AKS deployment." + } + }, + "existingVirtualNetworkResourceGroup": { + "type": "string", + "metadata": { + "description": "Name of the existing VNET resource group" + } + }, + "existingSubnetName": { + "type": "string", + "metadata": { + "description": "Subnet name that will contain the App Service Environment" + } + }, + "serviceCidr": { + "type": "string", + "defaultValue": "10.0.0.0/16", + "metadata": { + "description": "A CIDR notation IP range from which to assign service cluster IPs." + } + }, + "dnsServiceIP": { + "type": "string", + "defaultValue": "10.0.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." + } + } + }, + "variables": { + "builtInRole":{ + "Owner":"[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')]", + "Contributor": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]", + "Reader": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')]" + }, + "vnetSubnetId": "[resourceId(parameters('existingVirtualNetworkResourceGroup'),'Microsoft.Network/virtualNetworks/subnets',parameters('existingVirtualNetworkName'),parameters('existingSubnetName'))]" + }, + "resources": [ + { + "type": "Microsoft.Resources/deployments", + "name": "ClusterSubnetRoleAssignmentDeployment", + "apiVersion": "2019-10-01", + "resourceGroup": "[parameters('existingVirtualNetworkResourceGroup')]", + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [ + { + "type": "Microsoft.Network/virtualNetworks/subnets/providers/roleAssignments", + "apiVersion": "2020-04-01-preview", + "name": "[concat(parameters('existingVirtualNetworkName'), '/', parameters('existingSubnetName'), '/Microsoft.Authorization/', guid(resourceGroup().id, deployment().name))]", + "properties": { + "roleDefinitionId": "[variables('builtInRole')[parameters('builtInRoleType')]]", + "principalId": "[parameters('existingServicePrincipalObjectId')]", + "scope": "[variables('vnetSubnetId')]" + } + } + ] + } + } + }, + { + "type": "Microsoft.ContainerService/managedClusters", + "name": "[parameters('resourceName')]", + "apiVersion": "2020-07-01", + "location": "[parameters('location')]", + "dependsOn": [ + "ClusterSubnetRoleAssignmentDeployment" + ], + "properties": { + "kubernetesVersion": "[parameters('kubernetesVersion')]", + "enableRBAC": "[parameters('enableRBAC')]", + "dnsPrefix": "[parameters('dnsPrefix')]", + "addonProfiles": { + "httpApplicationRouting": { + "enabled": "[parameters('enableHttpApplicationRouting')]" + } + }, + "agentPoolProfiles": [ + { + "name": "agentpool", + "osDiskSizeGB": "[parameters('osDiskSizeGB')]", + "count": "[parameters('agentCount')]", + "vmSize": "[parameters('agentVMSize')]", + "osType": "[parameters('osType')]", + "storageProfile": "ManagedDisks", + "vnetSubnetID": "[variables('vnetSubnetID')]", + "maxPods": "[parameters('maxPods')]", + "mode" : "System" + } + ], + "servicePrincipalProfile": { + "clientId": "[parameters('existingServicePrincipalClientId')]", + "secret": "[parameters('existingServicePrincipalClientSecret')]" + }, + "networkProfile": { + "networkPlugin": "[parameters('networkPlugin')]", + "serviceCidr": "[parameters('serviceCidr')]", + "dnsServiceIP": "[parameters('dnsServiceIP')]", + "dockerBridgeCidr": "[parameters('dockerBridgeCidr')]" + } + } + } + ], + "outputs": { + "controlPlaneFQDN": { + "type": "string", + "value": "[reference(resourceId('Microsoft.ContainerService/managedClusters', parameters('resourceName'))).fqdn]" + } + } +} \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.parameters.json b/samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.parameters.json new file mode 100644 index 00000000..719a6ea1 --- /dev/null +++ b/samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.parameters.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "resourceName": { + "value": "GEN-UNIQUE" + }, + "dnsPrefix": { + "value": "GEN-UNIQUE" + }, + "builtInRoleType":{ + "value": "Contributor" + }, + "existingServicePrincipalObjectId": { + "value": "GEN-AZUREAD-AKS-OBJID" + }, + "existingServicePrincipalClientId": { + "value": "GEN-AZUREAD-AKS-APPID" + }, + "existingServicePrincipalClientSecret": { + "value": "GEN-AZUREAD-AKS-APPID-SECRET" + }, + "existingVirtualNetworkName": { + "value": "GET-PREREQ-vnetName" + }, + "existingVirtualNetworkResourceGroup": { + "value": "GET-PREREQ-vnetResourceGroupName" + }, + "existingSubnetName": { + "value": "GET-PREREQ-subnetName" + } + } +} \ No newline at end of file From 796e135039a021248e8c98c5bc896055c85dec05 Mon Sep 17 00:00:00 2001 From: cloudmelon Date: Tue, 31 Aug 2021 16:00:47 +0100 Subject: [PATCH 2/2] refresh deployment scripts and enable pass the kubernetes version in the parametters upon the tested configurations on BDC release notes --- .../deployment/platform-ops/Readme.md | 91 +++++++ .../platform-ops/azure-cni/deploy-cni-aks.sh | 63 +++++ .../bdc-aks-ops/azure-cni/deploy-cni-aks.sh | 63 +++++ .../bdc-aks-ops/deploy-bdc-aks.sh | 33 +++ .../deployment/platform-ops/deploy-bdc-aks.sh | 33 +++ .../kubelet/deploy-kubenet-aks.sh | 40 +++ .../deployment/private-aks/README.md | 4 +- ...eploy-bdc.sh => deploy-bdc-private-aks.sh} | 16 +- .../private-aks/scripts/deploy-private-aks.sh | 2 + .../platform-ops/Readme.md | 0 .../bdc-aks-ops/azure-cni/azuredeploy.json | 250 ------------------ .../azure-cni/azuredeploy.parameters.json | 33 --- 12 files changed, 336 insertions(+), 292 deletions(-) create mode 100644 samples/features/sql-big-data-cluster/deployment/platform-ops/Readme.md create mode 100644 samples/features/sql-big-data-cluster/deployment/platform-ops/azure-cni/deploy-cni-aks.sh create mode 100644 samples/features/sql-big-data-cluster/deployment/platform-ops/bdc-aks-ops/azure-cni/deploy-cni-aks.sh create mode 100644 samples/features/sql-big-data-cluster/deployment/platform-ops/bdc-aks-ops/deploy-bdc-aks.sh create mode 100644 samples/features/sql-big-data-cluster/deployment/platform-ops/deploy-bdc-aks.sh create mode 100644 samples/features/sql-big-data-cluster/deployment/platform-ops/kubelet/deploy-kubenet-aks.sh rename samples/features/sql-big-data-cluster/deployment/private-aks/scripts/{deploy-bdc.sh => deploy-bdc-private-aks.sh} (71%) delete mode 100644 samples/features/sql-big-data-cluster/platform-ops/Readme.md delete mode 100644 samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.json delete mode 100644 samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.parameters.json diff --git a/samples/features/sql-big-data-cluster/deployment/platform-ops/Readme.md b/samples/features/sql-big-data-cluster/deployment/platform-ops/Readme.md new file mode 100644 index 00000000..45a91258 --- /dev/null +++ b/samples/features/sql-big-data-cluster/deployment/platform-ops/Readme.md @@ -0,0 +1,91 @@ +# Deploy BDC on Azure Kubernetes Service cluster + +SQL Server Big Data Clusters allow you to deploy scalable clusters of SQL Server, Spark, and HDFS containers running on Kubernetes, it allows you to easily combine and analyze your high-value relational data with high-volume big data. + +This repository contains the scripts that you can use to deploy a BDC cluster on Azure Kubernetes Service (AKS) cluster with basic networking ( Kubenet ) and advanced networking ( CNI ). + +This repository contains 3 bash scripts : +- **deploy-cni-aks.sh** : You can use it to deploy AKS cluster using CNI networking, it fits the use case that you need to deploy BDC with AKS cluster with CNI networking plugin for integration with existing virtual networks in Azure, and this network model allows greater separation of resources and controls in an enterprise environment. + +- **deploy-kubenet-aks.sh** : You can use it to deploy AKS cluster using kubenet networking, it fits the use case that you need to deploy BDC with AKS cluster with kubenet networking. Kubenet is a basic network plugin, on Linux only. AKS cluster by default is on kubenet networking, after provisioning it, it also creates an Azure virtual network and a subnet, where your nodes get an IP address from the subnet and all pods receive an IP address from a logically different address space to the subnet of the nodes. + +- **deploy-bdc.sh** : You can use it to deploy Big Data Clusters ( BDC ) AKS cluster. Please find the inline comments about the deployment steps and configurations which allows your customization. + +## Above all + +SQL Server Big Data Clusters is a fully containerized solution orchestrated by Kubernetes. Starting with CU12, each release of SQL Server Big Data Clusters is tested against a fixed configuration of components. The configuration is evaluated with each release and adjustments are made to stay in-line with the ecosystem as Kubernetes continues to evolve. Further information see [Tested Configurations from SQL Server Big Data Clusters platform release notes](https://docs.microsoft.com/en-us/sql/big-data-cluster/release-notes-big-data-cluster?view=sql-server-ver15#tested-configurations). + +Please note that a no later than 1.13 version for Kubernetes server to deploy your big data clusters. Therefore you need to use --kubernetes-version parameter to specify a version different than the default for AKS. + +## Prerequisites + +You can run those scripts on the following client environment with Linux OS or WSL/WSL2. + +The following link listed common big data cluster tools and how to install them: + +https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-big-data-tools?view=sql-server-ver15 + + +## Instructions + +### deploy-cni-aks.sh + +1. Download the script on the location that you are planning to use for the deployment + +``` bash +curl --output deploy-cni-aks.sh https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/features/sql-big-data-cluster/deployment/platform-ops/scripts/deploy-cni-aks.sh +``` + +2. Make the script executable + +``` bash +chmod +x deploy-cni-aks.sh +``` + +3. Run the script (make sure you are running with sudo) + +``` bash +sudo ./deploy-cni-aks.sh +``` + +### deploy-kubenet-aks.sh + +1. Download the script on the location that you are planning to use for the deployment + +``` bash +curl --output deploy-kubenet-aks.sh https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/features/sql-big-data-cluster/deployment/platform-ops/scripts/deploy-kubenet-aks.sh +``` + +2. Make the script executable + +``` bash +chmod +x deploy-kubenet-aks.sh +``` + +3. Run the script (make sure you are running with sudo) + +``` bash +sudo ./deploy-kubenet-aks.sh +``` + +### deploy-bdc-aks.sh + + +1. Download the script on the location that you are planning to use for the deployment + +``` bash +curl --output deploy-bdc-aks.sh https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/features/sql-big-data-cluster/deployment/platform-ops/scripts/deploy-bdc-aks.sh +``` + +2. Make the script executable + +``` bash +chmod +x deploy-bdc-aks.sh +``` + +3. Run the script (make sure you are running with sudo) + +``` bash +sudo ./deploy-bdc-aks.sh +``` + diff --git a/samples/features/sql-big-data-cluster/deployment/platform-ops/azure-cni/deploy-cni-aks.sh b/samples/features/sql-big-data-cluster/deployment/platform-ops/azure-cni/deploy-cni-aks.sh new file mode 100644 index 00000000..b8e13c24 --- /dev/null +++ b/samples/features/sql-big-data-cluster/deployment/platform-ops/azure-cni/deploy-cni-aks.sh @@ -0,0 +1,63 @@ +#!/bin/bash +#Define a set of environment variables to be used in resource creations. +# + +#!/bin/bash +#Get Subscription ID and resource groups. It is used as default for controller, SQL Server Master instance (sa account) and Knox. +# + +read -p "Your Azure Subscription: " subscription +echo +read -p "Your Resource Group Name: " resourcegroup +echo +read -p "In which region you're deploying: " region +echo + + +#Define a set of environment variables to be used in resource creations. +export SUBID=$subscription + +export REGION_NAME=$region +export RESOURCE_GROUP=$resourcegroup +export KUBERNETES_VERSION=$version +export SUBNET_NAME=aks-subnet +export VNET_NAME=bdc-vnet +export AKS_NAME=bdcakscluster + +#Set Azure subscription current in use +az account set --subscription $subscription + +#Create Azure Resource Group +az group create -n $RESOURCE_GROUP -l $REGION_NAME + +#Create Azure Virtual Network to host your AKS clus +az network vnet create \ + --resource-group $RESOURCE_GROUP \ + --location $REGION_NAME \ + --name $VNET_NAME \ + --address-prefixes 10.0.0.0/8 \ + --subnet-name $SUBNET_NAME \ + --subnet-prefix 10.1.0.0/16 + +SUBNET_ID=$(az network vnet subnet show \ + --resource-group $RESOURCE_GROUP \ + --vnet-name $VNET_NAME \ + --name $SUBNET_NAME \ + --query id -o tsv) + +#Create AKS Cluster +az aks create \ + --resource-group $RESOURCE_GROUP \ + --name $AKS_NAME \ + --kubernetes-version $version \ + --load-balancer-sku standard \ + --network-plugin azure \ + --vnet-subnet-id $SUBNET_ID \ + --docker-bridge-address 172.17.0.1/16 \ + --dns-service-ip 10.2.0.10 \ + --service-cidr 10.2.0.0/24 \ + --node-vm-size Standard_D13_v2 \ + --node-count 2 \ + --generate-ssh-keys + +az aks get-credentials -g $RESOURCE_GROUP -n $AKS_NAME diff --git a/samples/features/sql-big-data-cluster/deployment/platform-ops/bdc-aks-ops/azure-cni/deploy-cni-aks.sh b/samples/features/sql-big-data-cluster/deployment/platform-ops/bdc-aks-ops/azure-cni/deploy-cni-aks.sh new file mode 100644 index 00000000..b8e13c24 --- /dev/null +++ b/samples/features/sql-big-data-cluster/deployment/platform-ops/bdc-aks-ops/azure-cni/deploy-cni-aks.sh @@ -0,0 +1,63 @@ +#!/bin/bash +#Define a set of environment variables to be used in resource creations. +# + +#!/bin/bash +#Get Subscription ID and resource groups. It is used as default for controller, SQL Server Master instance (sa account) and Knox. +# + +read -p "Your Azure Subscription: " subscription +echo +read -p "Your Resource Group Name: " resourcegroup +echo +read -p "In which region you're deploying: " region +echo + + +#Define a set of environment variables to be used in resource creations. +export SUBID=$subscription + +export REGION_NAME=$region +export RESOURCE_GROUP=$resourcegroup +export KUBERNETES_VERSION=$version +export SUBNET_NAME=aks-subnet +export VNET_NAME=bdc-vnet +export AKS_NAME=bdcakscluster + +#Set Azure subscription current in use +az account set --subscription $subscription + +#Create Azure Resource Group +az group create -n $RESOURCE_GROUP -l $REGION_NAME + +#Create Azure Virtual Network to host your AKS clus +az network vnet create \ + --resource-group $RESOURCE_GROUP \ + --location $REGION_NAME \ + --name $VNET_NAME \ + --address-prefixes 10.0.0.0/8 \ + --subnet-name $SUBNET_NAME \ + --subnet-prefix 10.1.0.0/16 + +SUBNET_ID=$(az network vnet subnet show \ + --resource-group $RESOURCE_GROUP \ + --vnet-name $VNET_NAME \ + --name $SUBNET_NAME \ + --query id -o tsv) + +#Create AKS Cluster +az aks create \ + --resource-group $RESOURCE_GROUP \ + --name $AKS_NAME \ + --kubernetes-version $version \ + --load-balancer-sku standard \ + --network-plugin azure \ + --vnet-subnet-id $SUBNET_ID \ + --docker-bridge-address 172.17.0.1/16 \ + --dns-service-ip 10.2.0.10 \ + --service-cidr 10.2.0.0/24 \ + --node-vm-size Standard_D13_v2 \ + --node-count 2 \ + --generate-ssh-keys + +az aks get-credentials -g $RESOURCE_GROUP -n $AKS_NAME diff --git a/samples/features/sql-big-data-cluster/deployment/platform-ops/bdc-aks-ops/deploy-bdc-aks.sh b/samples/features/sql-big-data-cluster/deployment/platform-ops/bdc-aks-ops/deploy-bdc-aks.sh new file mode 100644 index 00000000..cba195ca --- /dev/null +++ b/samples/features/sql-big-data-cluster/deployment/platform-ops/bdc-aks-ops/deploy-bdc-aks.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#Get password as input. It is used as default for controller, SQL Server Master instance (sa account) and Knox. +# + +while true; do + read -p "Create Admin username for Big Data Cluster: " bdcadmin + echo + read -s -p "Create Password for Big Data Cluster: " password + echo + read -s -p "Confirm your Password: " password2 + echo + [ "$password" = "$password2" ] && break + echo "Password mismatch. Please try again." +done + + +#Create BDC custom profile +azdata bdc config init --source aks-dev-test --target bdc-aks --force + +#Configurations for BDC deployment +azdata bdc config replace -p private-bdc-aks/control.json -j "$.spec.docker.imageTag=2019-CU12-ubuntu-20.04" +azdata bdc config replace -p private-bdc-aks/control.json -j "$.spec.storage.data.className=default" +azdata bdc config replace -p private-bdc-aks/control.json -j "$.spec.storage.logs.className=default" + + +azdata bdc create --config-profile bdc-aks --accept-eula yes + +#Login and get endpoint list for the cluster. +# +azdata login -n mssql-cluster + +azdata bdc endpoint list --output table diff --git a/samples/features/sql-big-data-cluster/deployment/platform-ops/deploy-bdc-aks.sh b/samples/features/sql-big-data-cluster/deployment/platform-ops/deploy-bdc-aks.sh new file mode 100644 index 00000000..cba195ca --- /dev/null +++ b/samples/features/sql-big-data-cluster/deployment/platform-ops/deploy-bdc-aks.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#Get password as input. It is used as default for controller, SQL Server Master instance (sa account) and Knox. +# + +while true; do + read -p "Create Admin username for Big Data Cluster: " bdcadmin + echo + read -s -p "Create Password for Big Data Cluster: " password + echo + read -s -p "Confirm your Password: " password2 + echo + [ "$password" = "$password2" ] && break + echo "Password mismatch. Please try again." +done + + +#Create BDC custom profile +azdata bdc config init --source aks-dev-test --target bdc-aks --force + +#Configurations for BDC deployment +azdata bdc config replace -p private-bdc-aks/control.json -j "$.spec.docker.imageTag=2019-CU12-ubuntu-20.04" +azdata bdc config replace -p private-bdc-aks/control.json -j "$.spec.storage.data.className=default" +azdata bdc config replace -p private-bdc-aks/control.json -j "$.spec.storage.logs.className=default" + + +azdata bdc create --config-profile bdc-aks --accept-eula yes + +#Login and get endpoint list for the cluster. +# +azdata login -n mssql-cluster + +azdata bdc endpoint list --output table diff --git a/samples/features/sql-big-data-cluster/deployment/platform-ops/kubelet/deploy-kubenet-aks.sh b/samples/features/sql-big-data-cluster/deployment/platform-ops/kubelet/deploy-kubenet-aks.sh new file mode 100644 index 00000000..48e55336 --- /dev/null +++ b/samples/features/sql-big-data-cluster/deployment/platform-ops/kubelet/deploy-kubenet-aks.sh @@ -0,0 +1,40 @@ +#!/bin/bash +#Define a set of environment variables to be used in resource creations. +# + +#!/bin/bash +#Get Subscription ID and resource groups. It is used as default for controller, SQL Server Master instance (sa account) and Knox. +# + +read -p "Your Azure Subscription: " subscription +echo +read -p "Your Resource Group Name: " resourcegroup +echo +read -p "In which region you're deploying: " region +echo + + +#Define a set of environment variables to be used in resource creations. +export SUBID=$subscription + +export REGION_NAME=$region +export RESOURCE_GROUP=$resourcegroup +export KUBERNETES_VERSION=$version +export AKS_NAME=bdcakscluster + +#Set Azure subscription current in use +az account set --subscription $subscription + +#Create Azure Resource Group +az group create -n $RESOURCE_GROUP -l $REGION_NAME + +#Create AKS Cluster +az aks create \ + --resource-group $RESOURCE_GROUP \ + --name $AKS_NAME \ + --kubernetes-version $version \ + --node-vm-size Standard_D13_v2 \ + --node-count 2 \ + --generate-ssh-keys + +az aks get-credentials -g $RESOURCE_GROUP -n $AKS_NAME \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/deployment/private-aks/README.md b/samples/features/sql-big-data-cluster/deployment/private-aks/README.md index d5289dd4..a1680c5d 100644 --- a/samples/features/sql-big-data-cluster/deployment/private-aks/README.md +++ b/samples/features/sql-big-data-cluster/deployment/private-aks/README.md @@ -1,5 +1,7 @@ # Deploy BDC in private AKS cluster with Advanced Networking (CNI) +SQL Server Big Data Clusters allow you to deploy scalable clusters of SQL Server, Spark, and HDFS containers running on Kubernetes, it allows you to easily combine and analyze your high-value relational data with high-volume big data. + This repository contains the scripts that you can use to deploy a BDC cluster in Azure Kubernetes Service (AKS) private cluster with advanced networking ( CNI ). This repository contains 3 bash scripts : @@ -7,7 +9,7 @@ This repository contains 3 bash scripts : - **deploy-private-aks-udr.sh** : You can use it to deploy private AKS cluster with private endpoint, it fits the use case that you need to deploy BDC with AKS private cluster and limit egress traffic with UDR ( User-defined Routes ). -- **deploy-bdc.sh** : You can use it to deploy Big Data Clusters ( BDC ) in private deployment mode on private AKS cluster with or without User-defined routes based on your project requirements. **Note** : Please use this scripts in the Azure VM which manages your AKS private cluster. +- **deploy-bdc.sh** : You can use it to deploy Big Data Clusters ( BDC ) in private deployment mode on private AKS cluster with or without user-defined routes based on your project requirements. **Note** : Please use this scripts in the Azure VM or Azure Bastion instance which manages your AKS private cluster. ## Prerequisites diff --git a/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-bdc.sh b/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-bdc-private-aks.sh similarity index 71% rename from samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-bdc.sh rename to samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-bdc-private-aks.sh index 90337531..a563299a 100644 --- a/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-bdc.sh +++ b/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-bdc-private-aks.sh @@ -18,16 +18,16 @@ done azdata bdc config init --source aks-dev-test --target private-bdc-aks --force #Configurations for BDC deployment -azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.docker.imageTag=2019-CU6-ubuntu-16.04" -azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.storage.data.className=default" -azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.storage.logs.className=default" +azdata bdc config replace -p private-bdc-aks/control.json -j "$.spec.docker.imageTag=2019-CU12-ubuntu-20.04" +azdata bdc config replace -p private-bdc-aks/control.json -j "$.spec.storage.data.className=default" +azdata bdc config replace -p private-bdc-aks/control.json -j "$.spec.storage.logs.className=default" -azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.endpoints[0].serviceType=NodePort" -azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.endpoints[1].serviceType=NodePort" +azdata bdc config replace -p private-bdc-aks/control.json -j "$.spec.endpoints[0].serviceType=NodePort" +azdata bdc config replace -p private-bdc-aks/control.json -j "$.spec.endpoints[1].serviceType=NodePort" -azdata bdc config replace -c private-bdc-aks/bdc.json -j "$.spec.resources.master.spec.endpoints[0].serviceType=NodePort" -azdata bdc config replace -c private-bdc-aks/bdc.json -j "$.spec.resources.gateway.spec.endpoints[0].serviceType=NodePort" -azdata bdc config replace -c private-bdc-aks/bdc.json -j "$.spec.resources.appproxy.spec.endpoints[0].serviceType=NodePort" +azdata bdc config replace -p private-bdc-aks/bdc.json -j "$.spec.resources.master.spec.endpoints[0].serviceType=NodePort" +azdata bdc config replace -p private-bdc-aks/bdc.json -j "$.spec.resources.gateway.spec.endpoints[0].serviceType=NodePort" +azdata bdc config replace -p private-bdc-aks/bdc.json -j "$.spec.resources.appproxy.spec.endpoints[0].serviceType=NodePort" #In case you're deploying BDC in HA mode ( aks-dev-test-ha profile ) please also use the following command #azdata bdc config replace -c private-bdc-aks /bdc.json -j "$.spec.resources.master.spec.endpoints[1].serviceType=NodePort" diff --git a/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-private-aks.sh b/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-private-aks.sh index addb4b21..1893f848 100644 --- a/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-private-aks.sh +++ b/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-private-aks.sh @@ -19,6 +19,7 @@ export SUBID=$subscription export REGION_NAME=$region export RESOURCE_GROUP=$resourcegroup +export KUBERNETES_VERSION=$version export SUBNET_NAME=aks-subnet export VNET_NAME=bdc-vnet export AKS_NAME=bdcaksprivatecluster @@ -50,6 +51,7 @@ az aks create \ --name $AKS_NAME \ --load-balancer-sku standard \ --enable-private-cluster \ + --kubernetes-version $version \ --network-plugin azure \ --vnet-subnet-id $SUBNET_ID \ --docker-bridge-address 172.17.0.1/16 \ diff --git a/samples/features/sql-big-data-cluster/platform-ops/Readme.md b/samples/features/sql-big-data-cluster/platform-ops/Readme.md deleted file mode 100644 index e69de29b..00000000 diff --git a/samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.json b/samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.json deleted file mode 100644 index dffeae90..00000000 --- a/samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.json +++ /dev/null @@ -1,250 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "resourceName": { - "type": "string", - "metadata": { - "description": "The name of the 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." - } - }, - "osDiskSizeGB": { - "defaultValue": 0, - "minValue": 0, - "maxValue": 1023, - "type": "int", - "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." - } - }, - "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_D2_v3", - "type": "string", - "metadata": { - "description": "The size of the Virtual Machine." - } - }, - "existingServicePrincipalObjectId": { - "type": "string", - "metadata": { - "description": "Oject 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." - } - }, - "osType": { - "defaultValue": "Linux", - "allowedValues": [ - "Linux" - ], - "type": "string", - "metadata": { - "description": "The type of operating system." - } - }, - "kubernetesVersion": { - "defaultValue": "1.17.9", - "type": "string", - "metadata": { - "description": "The version of Kubernetes." - } - }, - "enableHttpApplicationRouting": { - "defaultValue": false, - "type": "bool", - "metadata": { - "description": "boolean flag to turn on and off of http application routing" - } - }, - "networkPlugin": { - "allowedValues": [ - "azure", - "kubenet" - ], - "defaultValue": "azure", - "type": "string", - "metadata": { - "description": "Network plugin used for building Kubernetes network." - } - }, - "maxPods": { - "defaultValue": 30, - "type": "int", - "metadata": { - "description": "Maximum number of pods that can run on a node." - } - }, - "enableRBAC": { - "defaultValue": true, - "type": "bool", - "metadata": { - "description": "boolean flag to turn on and off of RBAC" - } - }, - "builtInRoleType": { - "type": "string", - "allowedValues": [ - "Owner", - "Contributor", - "Reader" - ], - "metadata": { - "description": "Built-in role to assign" - } - }, - "existingVirtualNetworkName": { - "type": "string", - "metadata": { - "description": "Name of an existing VNET that will contain this AKS deployment." - } - }, - "existingVirtualNetworkResourceGroup": { - "type": "string", - "metadata": { - "description": "Name of the existing VNET resource group" - } - }, - "existingSubnetName": { - "type": "string", - "metadata": { - "description": "Subnet name that will contain the App Service Environment" - } - }, - "serviceCidr": { - "type": "string", - "defaultValue": "10.0.0.0/16", - "metadata": { - "description": "A CIDR notation IP range from which to assign service cluster IPs." - } - }, - "dnsServiceIP": { - "type": "string", - "defaultValue": "10.0.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." - } - } - }, - "variables": { - "builtInRole":{ - "Owner":"[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')]", - "Contributor": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]", - "Reader": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')]" - }, - "vnetSubnetId": "[resourceId(parameters('existingVirtualNetworkResourceGroup'),'Microsoft.Network/virtualNetworks/subnets',parameters('existingVirtualNetworkName'),parameters('existingSubnetName'))]" - }, - "resources": [ - { - "type": "Microsoft.Resources/deployments", - "name": "ClusterSubnetRoleAssignmentDeployment", - "apiVersion": "2019-10-01", - "resourceGroup": "[parameters('existingVirtualNetworkResourceGroup')]", - "properties": { - "mode": "Incremental", - "template": { - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "resources": [ - { - "type": "Microsoft.Network/virtualNetworks/subnets/providers/roleAssignments", - "apiVersion": "2020-04-01-preview", - "name": "[concat(parameters('existingVirtualNetworkName'), '/', parameters('existingSubnetName'), '/Microsoft.Authorization/', guid(resourceGroup().id, deployment().name))]", - "properties": { - "roleDefinitionId": "[variables('builtInRole')[parameters('builtInRoleType')]]", - "principalId": "[parameters('existingServicePrincipalObjectId')]", - "scope": "[variables('vnetSubnetId')]" - } - } - ] - } - } - }, - { - "type": "Microsoft.ContainerService/managedClusters", - "name": "[parameters('resourceName')]", - "apiVersion": "2020-07-01", - "location": "[parameters('location')]", - "dependsOn": [ - "ClusterSubnetRoleAssignmentDeployment" - ], - "properties": { - "kubernetesVersion": "[parameters('kubernetesVersion')]", - "enableRBAC": "[parameters('enableRBAC')]", - "dnsPrefix": "[parameters('dnsPrefix')]", - "addonProfiles": { - "httpApplicationRouting": { - "enabled": "[parameters('enableHttpApplicationRouting')]" - } - }, - "agentPoolProfiles": [ - { - "name": "agentpool", - "osDiskSizeGB": "[parameters('osDiskSizeGB')]", - "count": "[parameters('agentCount')]", - "vmSize": "[parameters('agentVMSize')]", - "osType": "[parameters('osType')]", - "storageProfile": "ManagedDisks", - "vnetSubnetID": "[variables('vnetSubnetID')]", - "maxPods": "[parameters('maxPods')]", - "mode" : "System" - } - ], - "servicePrincipalProfile": { - "clientId": "[parameters('existingServicePrincipalClientId')]", - "secret": "[parameters('existingServicePrincipalClientSecret')]" - }, - "networkProfile": { - "networkPlugin": "[parameters('networkPlugin')]", - "serviceCidr": "[parameters('serviceCidr')]", - "dnsServiceIP": "[parameters('dnsServiceIP')]", - "dockerBridgeCidr": "[parameters('dockerBridgeCidr')]" - } - } - } - ], - "outputs": { - "controlPlaneFQDN": { - "type": "string", - "value": "[reference(resourceId('Microsoft.ContainerService/managedClusters', parameters('resourceName'))).fqdn]" - } - } -} \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.parameters.json b/samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.parameters.json deleted file mode 100644 index 719a6ea1..00000000 --- a/samples/features/sql-big-data-cluster/platform-ops/bdc-aks-ops/azure-cni/azuredeploy.parameters.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "resourceName": { - "value": "GEN-UNIQUE" - }, - "dnsPrefix": { - "value": "GEN-UNIQUE" - }, - "builtInRoleType":{ - "value": "Contributor" - }, - "existingServicePrincipalObjectId": { - "value": "GEN-AZUREAD-AKS-OBJID" - }, - "existingServicePrincipalClientId": { - "value": "GEN-AZUREAD-AKS-APPID" - }, - "existingServicePrincipalClientSecret": { - "value": "GEN-AZUREAD-AKS-APPID-SECRET" - }, - "existingVirtualNetworkName": { - "value": "GET-PREREQ-vnetName" - }, - "existingVirtualNetworkResourceGroup": { - "value": "GET-PREREQ-vnetResourceGroupName" - }, - "existingSubnetName": { - "value": "GET-PREREQ-subnetName" - } - } -} \ No newline at end of file