Skip to content

Commit 4a56b1d

Browse files
committed
2 parents ca9a1a2 + fd91cad commit 4a56b1d

4 files changed

Lines changed: 69 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Creating a Kubernetes cluster for SQL Server 2019 big data cluster
2+
SQL Server 2019 big data cluster is deployed as docker containers on a Kubernetes cluster. These samples provide scripts that can be used to provision a Kubernetes cluster using different methods.
3+
4+
5+
## Create a Kubernetes cluster using Kubeadm
6+
In this example, we will deploy Kubernetes over multiple Linux machines (physical or virtualized) using kubeadm utility. These instructions have been tested primarily with Ubuntu 16.04 LTS version. If you are using Ubuntu 18.04 LTS then some of the steps may need to be changed depending on your configuration.
7+
8+
### Pre-requisites
9+
1. Multiple Linux machines or virtual machines. Recommended configuration is 8 CPUs, 32 GB memory each for each machine. Minimum number of machines required is three machines
10+
1. Designate one machine as the Kubernetes master
11+
1. Rest of the machine will be used as the Kubernetes agents
12+
13+
#### Useful resources
14+
[Deploy SQL Server 2019 big data cluster on Kubernetes](https://docs.microsoft.com/en-us/sql/big-data-cluster/deployment-guidance?view=sqlallproducts-allversions)
15+
[Creating a cluster using kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/)
16+
[Troubleshooting kubeadm](https://kubernetes.io/docs/setup/independent/troubleshooting-kubeadm/)
17+
18+
#### Instructions
19+
1. Execute [kubeadm/setup-k8s-prereqs.sh](kubeadm/setup-k8s-prereqs.sh/) script on each machine
20+
1. Execute [kubeadm/setup-k8s-master.sh](kubeadm/setup-k8s-master.sh/) script on the machine designated as Kubernetes master
21+
1. After successful initialization of the Kubernetes master, follow the kubeadm join commands output by the script on each agent machine
22+
1. Now, you can deploy SQL Server 2019 big data cluster using instructions [here](https://docs.microsoft.com/en-us/sql/big-data-cluster/deployment-guidance?view=sqlallproducts-allversions)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: rbac.authorization.k8s.io/v1beta1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: default-rbac
5+
subjects:
6+
- kind: ServiceAccount
7+
name: default
8+
namespace: default
9+
roleRef:
10+
kind: ClusterRole
11+
name: cluster-admin
12+
apiGroup: rbac.authorization.k8s.io
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh -x
2+
3+
# Initialize a kubernetes cluster on the current node.
4+
#
5+
KUBE_VERSION=1.11.3
6+
sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --kubernetes-version=$KUBE_VERSION
7+
mkdir -p $HOME/.kube
8+
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
9+
sudo chown $(id -u):$(id -g) $HOME/.kube/config
10+
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
11+
helm init
12+
kubectl apply -f rbac.yaml
13+
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
14+
kubectl create clusterrolebinding kubernetes-dashboard --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh -x
2+
3+
# Setup the kubernetes preprequisites
4+
#
5+
sudo -i
6+
echo $(hostname -i) $(hostname) >> /etc/hosts
7+
sed -i "/ swap / s/^/#/" /etc/fstab
8+
swapoff -a
9+
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
10+
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
11+
deb http://apt.kubernetes.io/ kubernetes-xenial main
12+
EOF
13+
14+
KUBE_DPKG_VERSION=1.11.3-00
15+
apt-get update
16+
apt-get install -y ebtables ethtool
17+
apt-get install -y docker.io
18+
apt-get install -y apt-transport-https
19+
apt-get install -y kubelet=$KUBE_DPKG_VERSION kubeadm=$KUBE_DPKG_VERSION kubectl=$KUBE_DPKG_VERSION
20+
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
21+
sysctl net.bridge.bridge-nf-call-iptables=1

0 commit comments

Comments
 (0)