Skip to main content

Installing Kubernetes on Centos 7/ RHEL7 with Kubeadm.

Installing Kubernetes on Centos 7/RHEL7 with kubeadm

Overview

Kubeadm is utility which is currently is in alpha which provides kubernetes very easily.

Prerequisites

1. One or more physical and virtual machines running CentOS 7 or RHEL 7.
2. 1GB or more of RAM per machine .
3. Network connectivity between machines in the cluster.
4. Good internet connectivity.

Installation Steps:

Kindly follow below steps on on every nodes.

#setenforce 0
1. Set system hostname:
(You can change hostname according to you nodes.)
1.# hostnamectl set-hostname node10.dockerhunt.com
2. Install and activate iptables and disbale firewalld (as kubernetes and docker uses iptables.)
01.# yum install iptables-services.x86_64 -y
02.# systemctl stop firewalld.service
03.# systemctl disable firewalld.service
04.# systemctl mask firewalld.service
05.# systemctl start iptables
06.# systemctl enable iptables
07.# systemctl unmask iptables
08.# iptables -F
09.# service iptables save
3. Install docker latest stable rpm provided by Docker.
1.# yum install -y yum-utils
3.# yum makecache fast
4.# yum install -y docker-engine
4. Inatll Kubernetes lates stable rpm provided kubernetes.
01.# cat <<EOF > /etc/yum.repos.d/kubernetes.repo
02.[kubernetes]
03.name=Kubernetes
05.enabled=1
06.gpgcheck=1
07.repo_gpgcheck=1
10.EOF
11. 
12.# yum install -y docker kubelet kubeadm kubectl kubernetes-cni
5. Enable and start kubernetes and docker services.
1.# systemctl enable docker &amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp; systemctl start docker
2.# systemctl enable kubelet &amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp; systemctl start kubelet
6. Kindly follow below steps on Kubernetes master Host:
1.# kubeadm init –pod-network-cidr=10.244.0.0/16
7. Below will be the output of kubeadm command:
01.[kubeadm] WARNING: kubeadm is in alpha, please do not use it for production clusters.
02.[preflight] Running pre-flight checks
03.[init] Using Kubernetes version: v1.5.2
04.[tokens] Generated token: "4e4f80.fb6c903e351fb64c"
05.[certificates] Generated Certificate Authority key and certificate.
06.[certificates] Generated API Server key and certificate
07.[certificates] Generated Service Account signing keys
08.[certificates] Created keys and certificates in "/etc/kubernetes/pki"
09.[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/kubelet.conf"
10.[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/admin.conf"
11.[apiclient] Created API client, waiting for the control plane to become ready
12.[apiclient] All control plane components are healthy after 550.795507seconds
13.[apiclient] Waiting for at least one node to register and become ready
14.[apiclient] First node is ready after 3.002701 seconds
15.[apiclient] Creating a test deployment
16.[apiclient] Test deployment succeeded
17.[token-discovery] Created the kube-discovery deployment, waiting for it to become ready
18.[token-discovery] kube-discovery is ready after 533.505279 seconds
19.[addons] Created essential addon: kube-proxy
20.[addons] Created essential addon: kube-dns
21.Your Kubernetes master has initialized successfully!
22.You should now deploy a pod network to the cluster.
23.Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
25.You can now join any number of machines by running the following on each node:
26.kubeadm join --token=4e4f80.fb6c903e351fb64192.168.43.199
Above token is important as it will be used for joining other nodes in cluster.
8. By default Kubernetes will not start pods on master nodes for security reason you can remove this security if you are going to use single node.
1.# kubectl taint nodes --all dedicated-
9. Run below command for flannel networking services:
1.# export ARCH=amd64
2.# curl -sSL "https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml?raw=true" | sed "s/amd64/${ARCH}/g" | kubectl create -f -
10. Now wait for some more minutes and check all pods status.
1.# kubectl get pods --all-namespaces

Comments

  1. Hi Admin..As you are coping things from our website syshunt.com, Please give our reference.

    ReplyDelete

Post a Comment

Popular posts from this blog

Troubleshooting Tomcat using Catalina log

Troubleshooting Tomcat using Catalina log We can get the  catalina  logs in  $CATALINA_HOME/logs Here we'll have a  catalina.out We can see some huge info in that log file. If we want to what exactly happens since the start of tomcat then we need to log that into a new file. By default we have log rotation enabled on this logs. For now let us stop tomcat and nullify the catalina.out file and then start tomcat to have some new info in the catalina.out # service tomcat stop # cd $CATALINA_HOME/logs # :> catalina.out (or) cat /dev/null > catalina.out # ll catalina.out -rw-r----- 1 root root 0 Feb 18 16:19 catalina.out # service tomcat start # ll catalina.out -rw-r----- 1 root root 17341 Feb 18 16:21 catalina.out We can see the log being written after the start of tomcat. Now we can notice the instance giving some information about the starting of tomcat, about the configuration for the startup, path of the servlet instance for which the log is re...

Ansible Installation Steps Red Hat Enterprise Linux 7

Ansible is a simple IT automation engine that automates provisioning, configuration management, application deployment and many other IT needs.  Designed for multi-tier deployments, ansible models your IT infrastructure by describing how all of your systems interrelate, rather than just managing one system at a time. In this Article we are going to learn Ansible Installation Steps Red Hat Enterprise Linux 7 – RHEL 7. It uses no agents and no additional custom security infrastructure, so it’s easy to deploy – and most importantly, it uses a very simple language YAML that allow you to describe your automation jobs in a way that approaches plain English. Ansible Architecture Ansible works by connecting to your nodes and pushing out small programs, called “Ansible modules” to them. These programs are written to be resource models of the desired state of the system. Ansible then executes these modules using SSH Protocol, and removes them when finished. Your library of modul...

RHVH 4.1 Installation Steps for Red Hat Virtualization Host

Red Hat Virtualization Host (RHVH 4.1) is installed using a special build ( Download Link )of Red Hat Enterprise Linux with only the packages required to host virtual machines. It uses an Anaconda installation interface based on the one used by Red Hat Enterprise Linux hosts, and can be updated through the Red Hat Virtualization Manager or via yum. Using the yum command is the only way to install additional packages and have them persist after an upgrade. In this article we are going to see RHVH 4.1 installation RHVH features a Web interface for monitoring the host’s resources and performing administrative tasks. Direct access to RHVH via SSH or console is not supported, so the Cockpit user interface provides a graphical user interface for tasks that are performed before the host is added to the Red Hat Virtualization Manager, such as configuring networking and deploying a self-hosted engine, and can also be used to run terminal commands via the  Tools > Terminal. Access t...