Added instructions for setting up kubeadm cluster

This commit is contained in:
Umachandar Jayachandran
2018-10-12 12:16:00 -07:00
parent 904711c6a1
commit 148ce33980
4 changed files with 69 additions and 0 deletions
@@ -0,0 +1,22 @@
# Creating a Kubernetes cluster for SQL Server 2019 big data cluster
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.
## Create a Kubernetes cluster using Kubeadm
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.
### Pre-requisites
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
1. Designate one machine as the Kubernetes master
1. Rest of the machine will be used as the Kubernetes agents
#### Useful resources
[Deploy SQL Server 2019 big data cluster on Kubernetes](https://docs.microsoft.com/en-us/sql/big-data-cluster/deployment-guidance?view=sqlallproducts-allversions)
[Creating a cluster using kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/)
[Troubleshooting kubeadm](https://kubernetes.io/docs/setup/independent/troubleshooting-kubeadm/)
#### Instructions
1. Execute [kubeadm/setup-k8s-prereqs.sh](kubeadm/setup-k8s-prereqs.sh/) script on each machine
1. Execute [kubeadm/setup-k8s-master.sh](kubeadm/setup-k8s-master.sh/) script on the machine designated as Kubernetes master
1. After successful initialization of the Kubernetes master, follow the kubeadm join commands output by the script on each agent machine
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)
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: default-rbac
subjects:
- kind: ServiceAccount
name: default
namespace: default
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
@@ -0,0 +1,14 @@
#!/bin/sh -x
# Initialize a kubernetes cluster on the current node.
#
KUBE_VERSION=1.11.3
sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --kubernetes-version=$KUBE_VERSION
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
helm init
kubectl apply -f rbac.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
kubectl create clusterrolebinding kubernetes-dashboard --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard
@@ -0,0 +1,21 @@
#!/bin/sh -x
# Setup the kubernetes preprequisites
#
sudo -i
echo $(hostname -i) $(hostname) >> /etc/hosts
sed -i "/ swap / s/^/#/" /etc/fstab
swapoff -a
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
KUBE_DPKG_VERSION=1.11.3-00
apt-get update
apt-get install -y ebtables ethtool
apt-get install -y docker.io
apt-get install -y apt-transport-https
apt-get install -y kubelet=$KUBE_DPKG_VERSION kubeadm=$KUBE_DPKG_VERSION kubectl=$KUBE_DPKG_VERSION
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
sysctl net.bridge.bridge-nf-call-iptables=1