It’s undeniably true that everybody is looking for moving to the cloud technologies, and container orchestration is playing a major role in every aspects of the cloud technologies, so I just wanted to play around with Kubernetes and I started building my lab on Oracle Ravello Cloud which was given as a benefit to the VMware vExpert and this article explains the steps of deploying Kubernetes Cluster On Oracle Ravello Cloud with CentOS 7. Again, thank you Oracle for giving me a such opportunity.
I previously, wrote about an article about building a lab on Oracle Ravello Cloud and you can read it here. I wanted to start from the very beginning, otherwise I could have used some other cloud technology such as Google Kubernetes Engine to play around with.
Setting Up Virtual Machines To Deploy Kubernetes Cluster On Oracle Ravello
I started creating my Virtual Machines dragging and dropping empty Virtual Machine containers to setup the cluster and 8GB RAM and 2 vCPUs used as the resources.
I opened ssh, http and https services to the public access because of the future deployments

Application optimized for performance and US Central 1 is used to deploy the application.

For IP address assignments I used the Oracle Ravello Cloud DHCP server as I don’t wan’t to worry about the static IP address management

I opened the console and proceed with the OS installation. One thing I noticed that there is a greater improvement of the VNC console user experience and previously I experienced differences in the actual mouse pointer and the VNC pointer. It is completely resolved and it was a really great experience.

I completed the Operating System Installation on all four Nodes and let’s see the configuration
Deploying Kubernetes Cluster On CentOS 7
I experienced network connectivity issues and to fix the issue I set the “ONBOOT=yes” in the network interface

Changing parameter and restarting the networking services resolved the networking issue and make sure to update the Operating System with “yum -y update” command
Turn off swap on all servers
sudo swapoff -a
Make sure to edit the fstab located in /etc/fstab to permanently disable the swap to do that comment with a “#” the swap line

Install docker
sudo yum -y install docker

Enable docker
sudo systemctl enable dockersudo systemctl start docker

Add the Kubernetes repo
cat << EOF | sudo tee /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg EOF

Turn off selinux
sudo setenforce 0 sudo vi /etc/selinux/config

Set the selinux status to permissive, it prints warnings only

Install Kubernetes Components
sudo yum install -y kubelet kubeadm kubectl sudo systemctl enable kubelet sudo systemctl start kubelet
Configure sysctl
cat << EOF | sudo tee /etc/sysctl.d/k8s.conf net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 EOF

Initialize the Kube Master below configuration should only be run on the Master node, do not run on the worker nodes.
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

Make sure to take note of the “kubeadm join” command which we use to connect the worker nodes to the Master

Install the flannel networking
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/bc79dd1505b0c8681ece4de4c0d86c5cd2643275/Documentation/kube-flannel.yml

Now execute”kubectl get nodes” command and see the status of the node status, roles, age and version

Errors Appeared In This Kubernetes Cluster Deployment
Make sure to swapoff and permanently disable Otherwise you might see below error message.
The connection to the server 10.0.0.3:6443 was refused – did you specify the right host or port?

When issuing the “kubeadm join” command below error might appear with the swap on
[preflight] Running pre-flight checks
[preflight] Some fatal errors occurred:
[ERROR Swap]: running with swap on is not supported. Please disable swap
[preflight] If you know what you are doing, you can make a check non-fatal with `–ignore-preflight-errors=…`

I had to disable the “firewalld” in order to Worker Nodes connect to the Master Node. Below error message appeared before disable the firewalld
[preflight] Running pre-flight checks
[discovery] Trying to connect to API Server “10.0.0.3:6443”
[discovery] Created cluster-info discovery client, requesting info from “https://10.0.0.3:6443”
[discovery] Failed to request cluster info, will try again: [Get https://10.0.0.3:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: dial tcp 10.0.0.3:6443: connect: no route to host]
[discovery] Failed to request cluster info, will try again: [Get https://10.0.0.3:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: dial tcp 10.0.0.3:6443: connect: no route to host]

Disable firewalld using below command
systemctl disable firewalld

I have published my application blueprint in Oracle Ravello Repo and if you need you can copy it to your library. Here it is.
Article Short Link: https://tcrum.net/KubernetesOnRavello
If You Found This Post As Useful Please Rate The Post And Share It!