Skip to content

Commit 6208c50

Browse files
author
cloudmelon
committed
adjust upon suggestions
1 parent 82b8610 commit 6208c50

5 files changed

Lines changed: 40 additions & 35 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Using the sample Python script in **aks** folder, you will deploy a Kubernetes c
1515

1616
Using the sample Python script in **offline** folder, you will push the necessary images required for the deployment to your own repository.
1717

18-
## __[Deploy SQL Server big data cluster in private mode with Azure Kubernetes service (AKS) private cluster](private-bdc/)__
18+
## __[Deploy SQL Server big data clusters (BDC) with Azure Kubernetes service (AKS) private cluster](private-aks/)__
1919

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.
20+
Using the sample Python script in **private-aks** folder, you will Deploy SQL Server big data cluster in private mode with Azure Kubernetes service (AKS) private cluster.
2121

samples/features/sql-big-data-cluster/deployment/private-bdc/README.md renamed to samples/features/sql-big-data-cluster/deployment/private-aks/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Deploy BDC in private AKS cluster with User-defined Route (UDR)
22

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 ).
3+
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 ).
44

55
This repository contains 3 bash scripts :
66
- 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.
77
- 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 ).
88
- 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.
99

1010

11-
## Prerequisite
11+
## Prerequisites
1212

1313
The following table lists common big data cluster tools and how to install them:
1414

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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-
#
3+
#Get password as input. It is used as default for controller, SQL Server Master instance (sa account) and Knox.
4+
55
while true; do
66
read -s -p "Create Admin username for Big Data Cluster: " bdcadmin
77
echo
@@ -14,10 +14,10 @@ while true; do
1414
done
1515

1616

17-
# Create BDC custom profile
17+
#Create BDC custom profile
1818
azdata bdc config init --source aks-dev-test --target private-bdc-aks --force
1919

20-
# Configurations for private BDC deployment
20+
#Configurations for private BDC deployment
2121
azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.docker.imageTag=2019-CU6-ubuntu-16.04"
2222
azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.storage.data.className=default"
2323
azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.storage.logs.className=default"
@@ -29,12 +29,17 @@ azdata bdc config replace -c private-bdc-aks /bdc.json -j "$.spec.resources.mast
2929
azdata bdc config replace -c private-bdc-aks /bdc.json -j "$.spec.resources.gateway.spec.endpoints[0].serviceType=NodePort"
3030
azdata bdc config replace -c private-bdc-aks /bdc.json -j "$.spec.resources.appproxy.spec.endpoints[0].serviceType=NodePort"
3131

32-
# In case you're deploying BDC in HA mode ( aks-dev-test-ha profile ) please also use the following command
33-
# azdata bdc config replace -c private-bdc-aks /bdc.json -j "$.spec.resources.master.spec.endpoints[1].serviceType= NodePort"
32+
#In case you're deploying BDC in HA mode ( aks-dev-test-ha profile ) please also use the following command
33+
#azdata bdc config replace -c private-bdc-aks /bdc.json -j "$.spec.resources.master.spec.endpoints[1].serviceType= NodePort"
3434

3535

3636
export AZDATA_USERNAME=$bdcadmin
3737
export AZDATA_PASSWORD=$password
38-
export ACCEPT_EULA=yes #accept agreement
3938

4039
azdata bdc create --config-profile private-bdc-aks --accept-eula yes
40+
41+
#Login and get endpoint list for the cluster.
42+
43+
azdata login -n mssql-cluster
44+
45+
azdata bdc endpoint list --output table

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

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

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-
#
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+
55
while true; do
66
read -s -p "Your Azure Subscription: " subscription
77
echo
@@ -11,7 +11,7 @@ while true; do
1111

1212
done
1313

14-
# Define a set of environment variables to be used in resource creations.
14+
#Define a set of environment variables to be used in resource creations.
1515

1616
export SUBID=$subscription
1717

@@ -29,10 +29,10 @@ export FWROUTE_NAME=bdcaksroute
2929
export FWROUTE_NAME_INTERNET=bdcaksrouteinet
3030

3131

32-
# Create Azure Resource Group
32+
#Create Azure Resource Group
3333
az group create -n $RESOURCE_GROUP -l $REGION_NAME
3434

35-
# Create Azure Virtual Network to host your AKS cluster
35+
#Create Azure Virtual Network to host your AKS cluster
3636
az network vnet create \
3737
--resource-group $RESOURCE_GROUP \
3838
--location $REGION_NAME \
@@ -49,74 +49,74 @@ SUBNET_ID=$(az network vnet subnet show \
4949
--query id -o tsv)
5050

5151

52-
# Add Azure firewall extension
52+
#Add Azure firewall extension
5353
az extension add --name azure-firewall
5454

55-
# Dedicated subnet for Azure Firewall (Firewall name cannot be changed)
55+
#Dedicated subnet for Azure Firewall (Firewall name cannot be changed)
5656
az network vnet subnet create \
5757
--resource-group $RESOURCE_GROUP \
5858
--vnet-name $VNET_NAME \
5959
--name AzureFirewallSubnet \
6060
--address-prefix 10.2.0.0/24
6161

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

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

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

7171

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

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

79-
# Create User defined routes
79+
#Create User defined routes
8080
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
8181

8282
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
8383

8484

85-
# Add FW Network Rules
85+
#Add FW Network Rules
8686

8787
az network firewall network-rule create -g $RESOURCE_GROUP -f $FWNAME --collection-name 'aksfwnr' -n 'apiudp' --protocols 'UDP' --source-addresses '*' --destination-addresses "AzureCloud.$REGION_NAME" --destination-ports 1194 --action allow --priority 100
8888
az network firewall network-rule create -g $RESOURCE_GROUP -f $FWNAME --collection-name 'aksfwnr' -n 'apitcp' --protocols 'TCP' --source-addresses '*' --destination-addresses "AzureCloud.$REGION_NAME" --destination-ports 9000
8989
az network firewall network-rule create -g $RESOURCE_GROUP -f $FWNAME --collection-name 'aksfwnr' -n 'time' --protocols 'UDP' --source-addresses '*' --destination-fqdns 'ntp.ubuntu.com' --destination-ports 123
9090

91-
# Add FW Application Rules
91+
#Add FW Application Rules
9292

9393
az network firewall application-rule create -g $RESOURCE_GROUP -f $FWNAME --collection-name 'aksfwar' -n 'fqdn' --source-addresses '*' --protocols 'http=80' 'https=443' --fqdn-tags "AzureKubernetesService" --action allow --priority 100
9494

95-
# Associate User defined route table (UDR) to AKS cluster where deployed BDC previsouly
95+
#Associate User defined route table (UDR) to AKS cluster where deployed BDC previsouly
9696
az network vnet subnet update -g $RESOURCE_GROUP --vnet-name $VNET_NAME --name $SUBNET_NAME --route-table $FWROUTE_TABLE_NAME
9797

9898

9999

100100

101101

102-
# Create SP and Assign Permission to Virtual Network
102+
#Create SP and Assign Permission to Virtual Network
103103

104104
az ad sp create-for-rbac -n "bdcaks-sp" --skip-assignment
105105

106106
export APPID=$sp_id
107107
export PASSWORD=$sp_pwd
108108
export VNETID=$(az network vnet show -g $RESOURCE_GROUP --name $VNET_NAME --query id -o tsv)
109109

110-
# Assign SP Permission to VNET
110+
#Assign SP Permission to VNET
111111

112112
az role assignment create --assignee $APPID --scope $VNETID --role "Network Contributor"
113113

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

118118

119-
# Create AKS Cluster
119+
#Create AKS Cluster
120120
az aks create \
121121
--resource-group $RESOURCE_GROUP \
122122
--location $REGION_NAME \

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

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

3-
# Define a set of environment variables to be used in resource creations.
3+
#Define a set of environment variables to be used in resource creations.
44

55
export REGION_NAME=northeurope
66
export RESOURCE_GROUP=private-bdc-aks-rg
@@ -9,10 +9,10 @@ export VNET_NAME=bdc-vnet
99
export AKS_NAME=bdcaksprivatecluster
1010

1111

12-
# Create Azure Resource Group
12+
#Create Azure Resource Group
1313
az group create -n $RESOURCE_GROUP -l $REGION_NAME
1414

15-
# Create Azure Virtual Network to host your AKS clus
15+
#Create Azure Virtual Network to host your AKS clus
1616
az network vnet create \
1717
--resource-group $RESOURCE_GROUP \
1818
--location $REGION_NAME \
@@ -27,7 +27,7 @@ SUBNET_ID=$(az network vnet subnet show \
2727
--name $SUBNET_NAME \
2828
--query id -o tsv)
2929

30-
# Create AKS Cluster
30+
#Create AKS Cluster
3131
az aks create \
3232
--resource-group $RESOURCE_GROUP \
3333
--name $AKS_NAME \

0 commit comments

Comments
 (0)