Home > Storage > PowerFlex > White Papers > Oracle in Docker Containers Managed by Kubernetes > Step 1: Set up the Kubernetes cluster
For Use Case 2, we show a basic Kubernetes installation to demonstrate how having the container orchestration system on our LAN provides greater performance and control as well as the ability to customize the configuration. The Kubernetes administrator performs a custom installation of Kubernetes before performing prerequisite tasks as described below. The Kubernetes cluster will facilitate the automation of the manual tasks of the Docker containers that were already described in Use Case 1.
Setting up the Kubernetes includes the following tasks:
Before setting up the Kubernetes cluster, complete the following prerequisite tasks:
The following sections provide the details for performing these tasks.
Setting SELinux to permissive mode enables containers to access the host file system, which is required by pod networks.
# /usr/sbin/setenforce 0
# sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
To configure the firewall, select one of the following options:
# firewall-cmd --add-masquerade --permanent
# firewall-cmd --add-port=10250/tcp --permanent
# firewall-cmd --add-port=8472/udp --permanent
# firewall-cmd --add-port=6443/tcp –permanent
All nodes must be able to receive traffic from all other nodes on every port on the network fabric that is used for the Kubernetes pods.
# systemctl disable firewalld
# systemctl stop firewalld
Ensure that the br_netfilter module exists and is loaded. This module is usually loaded, and it is unlikely that you would need to load this module manually.
# lsmod|grep br_netfilter
# modprobe br_netfilter
# echo "br_netfilter" > /etc/modules-load.d/br_netfilter.conf
# cat <<EOF > /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
# /sbin/sysctl -p /etc/sysctl.d/k8s.conf
Enter these commands to check for performance degradation.
# sed -i '/swap/d' /etc/fstab
# swapoff -a
In Use Case 2, we are using one master node and three worker nodes.
To install Kubernetes, follow these steps:
[root@docker ~] # systemctl status docker
To check the Docker version, enter this command:
[root@docker ~] #docker version
# cat <<EOF > /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
# yum install kubelet-1.14.9 kubectl-1.14.9 kubeadm-1.14.9
# systemctl enable kubelet
# systemctl start kubelet
Note: All these Kubernetes processes are described in earlier sections and depicted in Figure 12. Kubernetes is now loaded on all nodes and ready to be configured.
These steps help you initialize Kubernetes, set up a cluster, and test your Oracle 12c and 19c applications. The steps in this section verify the operability of the Kubernetes cluster and test the networking communications between the master and worker Kubernetes nodes.
# kubeadm init --pod-network-cidr=192.168.0.0/16 --kubernetes-version=1.14.9 --ignore-preflight-errors=Swap,FileContent--proc-sys-net-bridge-bridge-nf-call-iptables,SystemVerification
Where:
# 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://docs.projectcalico.org/v3.10/manifests/calico.yaml
#kubectl get pods --all-namespaces
# kubeadm join 10.230.87.241:6443 --token sntfta.wjsndor3q8zqrpjz --discovery-token-ca-cert-hash sha256:2e46cf8ffb2838bfee7d419d6bc27b27e0713f98741b84c8cb673bc34f49e017
Note: Synchronize the system time on the master node and worker nodes.
# kubectl get nodes