Simple KUBE Cluster
Just a simple KUBE cluster procedure that seems to be repeatable……….
SET UP THE REPOSITORY
sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
Add Docker’s official GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
, by searching for the last 8 characters of the fingerprint.
$ sudo apt-key fingerprint 0EBFCD88
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) <docker@docker.com>
sub rsa4096 2017-02-22 [S]
Stable Repo
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
INSTALL DOCKER ENGINE
Update the
apt
package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:$ sudo apt-get update $ sudo apt-get install docker-ce docker-ce-cli containerd.io allow to install
To install a specific version of Docker Engine, list the available versions in the repo, then select and install:
a. List the versions available in your repo:
apt-cache madison docker-ce
Install a specific version using the version string from the second column, for example, 5:18.09.1~3-0~ubuntu-xenial
.
$ sudo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io
I went ahead and installed the 18.06.1 version, base dont he tutorial I was following./
sudo apt-get install docker-ce=18.06.1~ce~3-0~ubuntu
let that unpack and install
Verify that Docker Engine is installed correctly by running the hello-world
image.
$ sudo docker run hello-world
Install THe KUBE
I am installign this on Ubuntu
sudo apt-get update && sudo apt-get install -y apt-transport-https curl curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list deb https://apt.kubernetes.io/ kubernetes-xenial main EOF sudo apt-get update sudo apt-get install -y kubelet kubeadm kubectl sudo apt-mark hold kubelet kubeadm kubectl
Check Kubeadm version
$kubeadm version
Create CLuster
On the Kube master node, initialize the cluster:sudo kubeadm init --pod-network-cidr=10.244.0.0/16
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
Check kubectl version to verify server versiona and we are talkign to the API- with a repsonse from KUBECTL
Copy and Paste Join command to worker nodes
Use text editor to remove breaks
sudo kubeadm join 172.31.110.171:6443 --token 26ne6u.wnyj4ktndando9hv --discovery-token-ca-cert-hash sha256:4d8979ba8080e527d38740d855c2efd1a49ebd010e0273252ece815368e25f5b
return to master
kubectl get nodes
in not ready ststaus until we setup networking
setup networking using FLannel https://coreos.com/flannel/docs/latest/
echo "net.bridge.bridge-nf-call-iptables=1" | sudo tee -a /etc/sysctl.confsudo sysctl -p
permanently sets the value in etc on master
sudo sysctl -p
repeat these on worker nodes
Only on Control Node instyall Flannel
Install Flannel in the cluster by running this only on the Master node:
Pass in file from the internet download.
sudo kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
kubectl get nodes
It may take a few moments for all nodes to enter the Ready status, so if they are not all Ready, wait a few moments andtry again.It is also a good idea to verify that the Flannel pods are up and running. Run this command to get a list of system pods:kubectl get pods -n kube-systemYou should have three pods with flannel in the name, and all three should have a status of Running.kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/bc79dd1505b0c8681ece4de4c0d86c5cd2643275/Do