Skip to content

Commit 86cbe89

Browse files
author
cloudmelon
committed
add details for scripts
1 parent b7abae0 commit 86cbe89

6 files changed

Lines changed: 106 additions & 21 deletions

File tree

samples/features/sql-big-data-cluster/deployment/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ Using the sample Python script in **aks** folder, you will deploy a Kubernetes c
1313

1414
## __[Push SQL Server big data cluster images to your own private Docker repository](offline/)__
1515

16-
Using the sample Python script in **offline** folder, you will push the necessary images required for the deployment to your own repository.
16+
Using the sample Python script in **offline** folder, you will push the necessary images required for the deployment to your own repository.
17+
18+
## __[Deploy SQL Server big data cluster in private mode with Azure Kubernetes service (AKS) private cluster](private-bdc/)__
19+
20+
Using the sample Python script in **private-bdc** folder, you will Deploy SQL Server big data cluster in private mode with Azure Kubernetes service (AKS) private cluster.
21+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Deploy BDC in private AKS cluster with User-defined Route (UDR)
2+
3+
This repository contains the scripts that you can use to deploy a private BDC cluster in Azure Kubernetes Service (AKS) with advanced networking ( CNI ).
4+
5+
This repository contains 3 bash scripts :
6+
- deploy-private-aks.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 a private endpoint with AKS private cluster.
7+
- 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 a private endpoint with AKS private cluster and limit egress traffic with UDR ( User-defined Routes ).
8+
- deploy-private-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.
9+
10+
11+
## Prerequisite
12+
13+
The following table lists common big data cluster tools and how to install them:
14+
15+
| Tool | Required | Description | Installation |
16+
|---|---|---|---|
17+
| `python` | Yes | Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Many parts of big data clusters for SQL Server use python. | [Install python](#python)|
18+
| `azdata` | Yes | Command-line tool for installing and managing a big data cluster. | [Install](deploy-install-azdata.md) |
19+
| `kubectl`<sup>1</sup> | Yes | Command-line tool for monitoring the underlying Kubernetes cluster ([More info](https://kubernetes.io/docs/tasks/tools/install-kubectl/)). | [Windows](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-with-powershell-from-psgallery) \| [Linux](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-using-native-package-management) |
20+
| **Azure Data Studio** | Yes | Cross-platform graphical tool for querying SQL Server. | [Install](https://aka.ms/getazuredatastudio) |
21+
| **Data Virtualization extension** | Yes | Extension for Azure Data Studio that provides a Data Virtualization wizard. | [Install](../azure-data-studio/data-virtualization-extension.md) |
22+
| **Azure CLI**<sup>2</sup> | For AKS | Modern command-line interface for managing Azure services. Used with AKS big data cluster deployments ([More info](https://docs.microsoft.com/cli/azure/?view=azure-cli-latest)). | [Install](https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest) |
23+
| **mssql-cli** | Optional | Modern command-line interface for querying SQL Server ([More info](../tools/mssql-cli.md)). | [Windows](https://github.com/dbcli/mssql-cli/blob/master/doc/installation/windows.md) \| [Linux](https://github.com/dbcli/mssql-cli/blob/master/doc/installation/linux.md) |
24+
| **sqlcmd** | For some scripts | Legacy command-line tool for querying SQL Server ([More info](https://docs.microsoft.com/sql/tools/sqlcmd-utility?view=sql-server-ver15)). You might need to install the Microsoft ODBC Driver 11 for SQL Server before installing the SQLCMD package. | [Windows](https://www.microsoft.com/download/details.aspx?id=36433) \| [Linux](../linux/sql-server-linux-setup-tools.md) |
25+
| `curl` <sup>3</sup> | For some scripts | Command-line tool for transferring data with URLs. | [Windows](https://curl.haxx.se/windows/) \| Linux: install curl package |
26+
| `oc` | Required for Red Hat OpenShift and Azure Redhat OpenShift deployments. |`oc` is the Open Shift command line interface (CLI). | [Installing the CLI](https://docs.openshift.com/container-platform/4.4/cli_reference/openshift_cli/getting-started-cli.html#installing-the-cli)
27+
28+
29+
30+
## Instructions
31+
32+
1. Download the script on the VM you are planning to use for the deployment
33+
34+
``` bash
35+
curl --output setup-bdc.sh https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/features/sql-big-data-cluster/deployment/private-bdc/ubuntu-single-node-vm/deploy-private-aks.sh
36+
```
37+
38+
2. Make the script executable
39+
40+
``` bash
41+
chmod +x deploy-private-aks.sh
42+
```
43+
44+
3. Run the script (make sure you are running with sudo)
45+
46+
``` bash
47+
sudo ./deploy-private-aks.sh
48+
```
49+
50+
51+

samples/features/sql-big-data-cluster/private-bdc/scripts/deploy-private-aks-udr.sh renamed to samples/features/sql-big-data-cluster/deployment/private-bdc/scripts/deploy-private-aks-udr.sh

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
#!/bin/bash
22

3-
export SUBID= <your Azure subscription ID>
3+
# Get Subscription ID and service principles as input. It is used as default for controller, SQL Server Master instance (sa account) and Knox.
4+
#
5+
while true; do
6+
read -s -p "Your Azure Subscription: " subscription
7+
echo
8+
read -s -p "Your service principles ID: " sp_id
9+
echo
10+
read -s -p "Your service principles Password: " sp_pwd
11+
12+
done
13+
14+
# Define a set of environment variables to be used in resource creations.
15+
16+
export SUBID=$subscription
417

518
export REGION_NAME=northeurope
619
export RESOURCE_GROUP=private-bdc-rg
@@ -16,9 +29,10 @@ export FWROUTE_NAME=bdcaksroute
1629
export FWROUTE_NAME_INTERNET=bdcaksrouteinet
1730

1831

19-
32+
# Create Azure Resource Group
2033
az group create -n $RESOURCE_GROUP -l $REGION_NAME
2134

35+
# Create Azure Virtual Network to host your AKS cluster
2236
az network vnet create \
2337
--resource-group $RESOURCE_GROUP \
2438
--location $REGION_NAME \
@@ -35,29 +49,34 @@ SUBNET_ID=$(az network vnet subnet show \
3549
--query id -o tsv)
3650

3751

52+
# Add Azure firewall extension
3853
az extension add --name azure-firewall
3954

4055
# Dedicated subnet for Azure Firewall (Firewall name cannot be changed)
41-
4256
az network vnet subnet create \
4357
--resource-group $RESOURCE_GROUP \
4458
--vnet-name $VNET_NAME \
4559
--name AzureFirewallSubnet \
4660
--address-prefix 10.2.0.0/24
4761

62+
# Create Azure firewall
4863
az network firewall create -g $RESOURCE_GROUP -n $FWNAME -l $REGION_NAME --enable-dns-proxy true
4964

65+
# Create public IP for Azure Firewall
5066
az network public-ip create -g $RESOURCE_GROUP -n $FWPUBIP -l $REGION_NAME --sku "Standard"
5167

68+
# Create IP configurations for Azure Firewall
5269
az network firewall ip-config create -g $RESOURCE_GROUP -f $FWNAME -n $FWIPCONFIG_NAME --public-ip-address $FWPUBIP --vnet-name $VNET_NAME
5370

5471

55-
72+
# Getting public and private IP addresses for Azure Firewall
5673
export FWPUBLIC_IP=$(az network public-ip show -g $RESOURCE_GROUP -n $FWPUBIP --query "ipAddress" -o tsv)
5774
export FWPRIVATE_IP=$(az network firewall show -g $RESOURCE_GROUP -n $FWNAME --query "ipConfigurations[0].privateIpAddress" -o tsv)
5875

76+
## Create an User defined route table
5977
az network route-table create -g $RESOURCE_GROUP --name $FWROUTE_TABLE_NAME
6078

79+
# Create User defined routes
6180
az network route-table route create -g $RESOURCE_GROUP --name $FWROUTE_NAME --route-table-name $FWROUTE_TABLE_NAME --address-prefix 0.0.0.0/0 --next-hop-type VirtualAppliance --next-hop-ip-address $FWPRIVATE_IP --subscription $SUBID
6281

6382
az network route-table route create -g $RESOURCE_GROUP --name $FWROUTE_NAME_INTERNET --route-table-name $FWROUTE_TABLE_NAME --address-prefix $FWPUBLIC_IP/32 --next-hop-type Internet
@@ -84,19 +103,20 @@ az network vnet subnet update -g $RESOURCE_GROUP --vnet-name $VNET_NAME --name $
84103

85104
az ad sp create-for-rbac -n "bdcaks-sp" --skip-assignment
86105

87-
export APPID=<your service principle ID >
88-
export PASSWORD=< your service principle password >
106+
export APPID=$sp_id
107+
export PASSWORD=$sp_pwd
89108
export VNETID=$(az network vnet show -g $RESOURCE_GROUP --name $VNET_NAME --query id -o tsv)
90109

91110
# Assign SP Permission to VNET
92111

93112
az role assignment create --assignee $APPID --scope $VNETID --role "Network Contributor"
94113

95-
114+
# Assign SP Permission to route table
96115
export RTID=$(az network route-table show -g $RESOURCE_GROUP -n $FWROUTE_TABLE_NAME --query id -o tsv)
97116
az role assignment create --assignee $APPID --scope $RTID --role "Network Contributor"
98117

99118

119+
# Create AKS Cluster
100120
az aks create \
101121
--resource-group $RESOURCE_GROUP \
102122
--location $REGION_NAME \

samples/features/sql-big-data-cluster/private-bdc/scripts/deploy-private-aks.sh renamed to samples/features/sql-big-data-cluster/deployment/private-bdc/scripts/deploy-private-aks.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,26 @@ export SUBNET_NAME=aks-subnet
88
export VNET_NAME=bdc-vnet
99
export AKS_NAME=bdcaksprivatecluster
1010

11+
12+
# Create Azure Resource Group
1113
az group create -n $RESOURCE_GROUP -l $REGION_NAME
1214

15+
# Create Azure Virtual Network to host your AKS clus
1316
az network vnet create \
1417
--resource-group $RESOURCE_GROUP \
1518
--location $REGION_NAME \
1619
--name $VNET_NAME \
1720
--address-prefixes 10.0.0.0/8 \
1821
--subnet-name $SUBNET_NAME \
1922
--subnet-prefix 10.1.0.0/16
20-
2123

2224
SUBNET_ID=$(az network vnet subnet show \
2325
--resource-group $RESOURCE_GROUP \
2426
--vnet-name $VNET_NAME \
2527
--name $SUBNET_NAME \
2628
--query id -o tsv)
2729

30+
# Create AKS Cluster
2831
az aks create \
2932
--resource-group $RESOURCE_GROUP \
3033
--name $AKS_NAME \

samples/features/sql-big-data-cluster/private-bdc/scripts/deploy-private-bdc.sh renamed to samples/features/sql-big-data-cluster/deployment/private-bdc/scripts/deploy-private-bdc.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
#!/bin/bash
22

3+
# Get password as input. It is used as default for controller, SQL Server Master instance (sa account) and Knox.
4+
#
5+
while true; do
6+
read -s -p "Create Admin username for Big Data Cluster: " bdcadmin
7+
echo
8+
read -s -p "Create Password for Big Data Cluster: " password
9+
echo
10+
read -s -p "Confirm your Password: " password2
11+
echo
12+
[ "$password" = "$password2" ] && break
13+
echo "Password mismatch. Please try again."
14+
done
15+
16+
17+
# Create BDC custom profile
318
azdata bdc config init --source aks-dev-test --target private-bdc-aks --force
419

20+
# Configurations for private BDC deployment
521
azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.docker.imageTag=2019-CU6-ubuntu-16.04"
622
azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.storage.data.className=default"
723
azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.storage.logs.className=default"
@@ -17,8 +33,8 @@ azdata bdc config replace -c private-bdc-aks /bdc.json -j "$.spec.resources.appp
1733
# azdata bdc config replace -c private-bdc-aks /bdc.json -j "$.spec.resources.master.spec.endpoints[1].serviceType= NodePort"
1834

1935

20-
export AZDATA_USERNAME=<your bdcadmin username>
21-
export AZDATA_PASSWORD=< your bdcadmin password>
36+
export AZDATA_USERNAME=$bdcadmin
37+
export AZDATA_PASSWORD=$password
2238
export ACCEPT_EULA=yes #accept agreement
2339

2440
azdata bdc create --config-profile private-bdc-aks --accept-eula yes

samples/features/sql-big-data-cluster/private-bdc/README.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)