Install Single Master Kubernetes Using Kubectl On CentOS 7

WKubernetes is an Open Source Orchestration tool that helps in Automate deploying, Scaling & managing Container Applications. Kubernetes install on Single Node Master server using minikube but we will install kubectl on Centos.

Check Out: Kubernetes Repo: Problem with the SSL CA cert

Let’s Begin the installation,

It’s developed by Google and maintained by the Cloud Native Computing Foundation. You may also manage the docker container with Docker Swarm. It provides the same functionality as Kubernetes.

Install Single Master Kubernetes:

I’m going to create a Single Kubernetes Cluster here.

Check Out: How To Set Date and Time In Linux Using Command Line

Step 1: Before installing Kubernetes, You need to disable the SELinux

vim /etc/sysconfig/selinux

Install Single Master Kubernetes

We’ll have to reboot the machine to make it permanent.

Step 2: Now Create a Kubernetes repository

vim /etc/yum.repos.d/kuber.repo

install kubernetes on centos

Step 3: You need to open these ports for Kubernetes as shown in the figure below.

install kubernetes using minikube

Check Out: Install Single Master Kubernetes Using Kubectl On CentOS 7

Step 4: Disable Swap

swapoff -a

Also, comment on Swap entry in /etc/fstab

install single node kubernetes

Enable br_netfilter

vim /etc/sysctl.d/kub8.conf

sysctl -p

Now all the settings are done for Kubernetes

Check Out: How To Create Container In Docker-CE On CentOS 7

Step 5: Start the Installation now

yum install kubeadm kubelet kubectl docker -y
kubeadm: It’s used to create the cluster 
kubectl: Command-line utility to manage the cluster
kubelet: Runs on all the machines in the cluster

Now you need to start the services of both docker and kubelet

systemctl start docker && systemctl enable docker
systemctl start kubelet && systemctl enable kubelet

Kubernetes version: v1.14.1

Check Out: Create a Job For Maven Project(Java) In Jenkins Server

Step 6: Initialize the Kubernetes

kubeadm init -–apiserver-advertise address=

Follow the step given in the output of Kubernetes to start the cluster

mkdir -p $HOME/.kube 
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config 
sudo chown $(id -u):$(id -g) $HOME/.kube/config

Step 7: Now you can get a status of cluster and pods

kubectl get nodes

Note: Make sure Cluster status running and coredns is running

kubectl get pods –all-namespaces

Step 8: Now Add pod network to cluster, run the below commands,

export kubever=$(kubectl version | base64 | tr -d '\n')
kubectl apply -f "$kubever"

Check Out: Windows Screen lock Automatically Using Group Policy

Run the below command to check the status of Cluster

kubectl get nodes 
kubectl get nodes --all-namespaces

Everything has been done from the Kubernetes master node.

You’re done kubernetes on single server install single node kubernetes install kubernetes using minikube

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment