<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kubernetes Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/kubernetes/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Thu, 10 Dec 2020 22:33:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How To Install Kubernetes Cluster On Ubuntu 20.04 Using K3s</title>
		<link>https://www.osradar.com/how-to-install-kubernetes-cluster-on-ubuntu-20-04-using-k3s/</link>
					<comments>https://www.osradar.com/how-to-install-kubernetes-cluster-on-ubuntu-20-04-using-k3s/#respond</comments>
		
		<dc:creator><![CDATA[sabi]]></dc:creator>
		<pubDate>Sun, 13 Dec 2020 01:40:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[how to install kubernetes]]></category>
		<category><![CDATA[How To Install Kubernetes Cluster On Ubuntu 20.04 Using K3s]]></category>
		<category><![CDATA[how to tutorials]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<category><![CDATA[Ubuntu 20.04 tutorials]]></category>
		<category><![CDATA[ubuntu k3s kubernetes]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=25995</guid>

					<description><![CDATA[<p>Today we are going to learn that how to install Kubernetes Cluster on Ubuntu 20.04 using K3s. Before proceeding towards the installation process, let&#8217;s have a short introduction about the today article. Introduction: Kubernetes used to manage the docker containers across multiple cloud &#38; virtualization platform. Kubernetes was designed by the Google. And k3s is [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-kubernetes-cluster-on-ubuntu-20-04-using-k3s/">How To Install Kubernetes Cluster On Ubuntu 20.04 Using K3s</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Today we are going to learn that how to install Kubernetes Cluster on Ubuntu 20.04 using K3s. Before proceeding towards the installation process, let&#8217;s have a short introduction about the today article.</p>



<h2>Introduction:</h2>



<p>Kubernetes used to manage the docker containers across multiple cloud &amp; virtualization platform. Kubernetes was designed by the Google. And k3s is used to reduce the higher load of k8sdeployment. So, here we&#8217;ll cover the installation of Kubernetes on Ubuntu 20.04 using k3s.</p>



<h3>Setup Requirements:</h3>



<p>We&#8217;ll need one Master node &amp; the 2 worker nodes in order to perform our installation.</p>



<h4>Master Node:</h4>



<p>It handles the cluster, API calls and other process.</p>



<h4>Workers Node:</h4>



<p>Used to control the workloads, where pods deployed &amp; applications run.</p>



<p>So, here we&#8217;ll be using one Master node &amp; two worker nodes in order to complete our installation guide.</p>



<h3>Step 1: Update Your System</h3>



<p>As usual we do, update your system to have the latest updates installed.</p>



<pre class="wp-block-preformatted">sudo apt update &amp;&amp; sudo apt upgrade -y</pre>



<p>Once the update finished, reboot your system.</p>



<pre class="wp-block-preformatted">sudo systemctl reboot</pre>



<h3>Step 2: Mapping the Hosts On Ubuntu 20.04</h3>



<p>Now, map the master and worker nodes on each host. To do this edit the file <strong>/etc/hosts/</strong>. And update according to hosts IP&#8217;s.</p>



<pre class="wp-block-preformatted">sudo nano /etc/hosts
172.16.10.3 master
172.16.10.4 worker01
172.16.10.10 worker02</pre>



<h3>Step 3: Install Docker On Ubuntu 20.04</h3>



<p>Fire the below commands in your terminal to install docker on Ubuntu 20.04 as needed to use the Kubernetes. So, make sure docker is installed and running properly.</p>



<pre class="wp-block-preformatted">sudo apt update<br>sudo apt install apt-transport-https ca-certificates curl software-properties-common -y<br>curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -<br>sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"<br>sudo apt update<br>sudo apt install docker-ce -y</pre>



<p><strong>Note</strong>: Make sure to perform this action(docker installation) on all hosts.</p>



<p>And then start &amp; enable docker services.</p>



<pre class="wp-block-preformatted">sudo systemctl start docker<br>sudo systemctl enable docker</pre>



<p>Verify the status of docker by typing</p>



<pre class="wp-block-preformatted">sabi@ubuntu:~$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-11-30 08:30:39 CET; 19s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 9275 (dockerd)
Tasks: 8
Memory: 35.6M
CGroup: /system.slice/docker.service
└─9275 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Nov 30 08:30:39 ubuntu dockerd[9275]: time="2020-10-30T08:30:39.460569874+01:00" level=warning msg="Your kernel does not support cgroup rt runtime"
Nov 30 08:30:39 ubuntu dockerd[9275]: time="2020-10-30T08:30:39.460672730+01:00" level=warning msg="Your kernel does not support cgroup blkio weight"
Nov 30 08:30:39 ubuntu dockerd[9275]: time="2020-10-30T08:30:39.460820506+01:00" level=warning msg="Your kernel does not support cgroup blkio weight_device"
Nov 30 08:30:39 ubuntu dockerd[9275]: time="2020-10-30T08:30:39.461286028+01:00" level=info msg="Loading containers: start."
Nov 30 08:30:39 ubuntu dockerd[9275]: time="2020-10-30T08:30:39.620849970+01:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0&gt;
Nov 30 08:30:39 ubuntu dockerd[9275]: time="2020-10-30T08:30:39.717281156+01:00" level=info msg="Loading containers: done."
Nov 30 08:30:39 ubuntu dockerd[9275]: time="2020-10-30T08:30:39.754253372+01:00" level=info msg="Docker daemon" commit=4484c46d9d graphdriver(s)=overlay2 version&gt;
Nov 30 08:30:39 ubuntu dockerd[9275]: time="2020-10-30T08:30:39.755461813+01:00" level=info msg="Daemon has completed initialization"
Nov 30 08:30:39 ubuntu systemd[1]: Started Docker Application Container Engine.</pre>



<p>In order to avoid using sudo whenever you type docker commands, simply add your user to docker group. This can be done by typing.</p>



<pre class="wp-block-preformatted">sudo usermod -aG docker ${USER}<br>newgrp docker</pre>



<h3>Step 4: Setup the Master K3s Node</h3>



<p>First of all we&#8217;ll setup the master node. On this node we&#8217;ll install the k3s sevice. To install k3s hit the given command in your terminal.</p>



<pre class="wp-block-preformatted">curl -sfL https://get.k3s.io | sh -s - --docker</pre>



<p>You&#8217;ll see the similar output:</p>



<pre class="wp-block-preformatted">[INFO] Finding release for channel stable
[INFO] Using v1.18.9+k3s1 as release
[INFO] Downloading hash https://github.com/rancher/k3s/releases/download/v1.18.9+k3s1/sha256sum-amd64.txt
[INFO] Downloading binary https://github.com/rancher/k3s/releases/download/v1.18.9+k3s1/k3s
[INFO] Verifying binary download
[INFO] Installing k3s to /usr/local/bin/k3s
[INFO] Creating /usr/local/bin/kubectl symlink to k3s
[INFO] Creating /usr/local/bin/crictl symlink to k3s
[INFO] Skipping /usr/local/bin/ctr symlink to k3s, command exists in PATH at /usr/bin/ctr
[INFO] Creating killall script /usr/local/bin/k3s-killall.sh
[INFO] Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO] env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO] systemd: Creating service file /etc/systemd/system/k3s.service
[INFO] systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
[INFO] systemd: Starting k3s</pre>



<p>Make sure the installation is successfull.</p>



<pre class="wp-block-preformatted">sudo systemctl status k3s
● k3s.service - Lightweight Kubernetes
Loaded: loaded (/etc/systemd/system/k3s.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-11-30 08:32:46 CET; 53s ago
Docs: https://k3s.io
Process: 11151 ExecStartPre=/sbin/modprobe br_netfilter (code=exited, status=0/SUCCESS)
Process: 11152 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUCCESS)
Main PID: 11153 (k3s-server)
Tasks: 0
Memory: 420.9M
CGroup: /system.slice/k3s.service
└─11153 /usr/local/bin/k3s server --docker
Nov 30 08:33:32 ubuntu k3s[11153]: I1030 08:33:32.532935 11153 reconciler.go:196] operationExecutor.UnmountVolume started for volume "helm-traefik-token-dmfz6"&gt;
Nov 30 08:33:32 ubuntu k3s[11153]: I1030 08:33:32.533481 11153 reconciler.go:196] operationExecutor.UnmountVolume started for volume "values" (UniqueName: "kub&gt;
Nov 30 08:33:32 ubuntu k3s[11153]: W1030 08:33:32.533849 11153 empty_dir.go:453] Warning: Failed to clear quota on /var/lib/kubelet/pods/d1fae0b1-f3ac-481a-b6a&gt;
Nov 30 08:33:32 ubuntu k3s[11153]: I1030 08:33:32.538649 11153 operation_generator.go:782] UnmountVolume.TearDown succeeded for volume "kubernetes.io/configmap&gt;
Nov 30 08:33:32 ubuntu k3s[11153]: I1030 08:33:32.555370 11153 operation_generator.go:782] UnmountVolume.TearDown succeeded for volume "kubernetes.io/secret/d1&gt;
Nov 30 08:33:32 ubuntu k3s[11153]: I1030 08:33:32.653113 11153 reconciler.go:319] Volume detached for volume "helm-traefik-token-dmfz6" (UniqueName: "kubernete&gt;
Nov 30 08:33:32 ubuntu k3s[11153]: I1030 08:33:32.653137 11153 reconciler.go:319] Volume detached for volume "values" (UniqueName: "kubernetes.io/configmap/d1f&gt;
Nov 30 08:33:33 ubuntu k3s[11153]: W1030 08:33:33.978774 11153 pod_container_deletor.go:77] Container "23d34e0acde3f4ab7e41d99e9cff16e7ba8cd76122158dfc18b64ae0&gt;
Nov 30 08:33:33 ubuntu k3s[11153]: W1030 08:33:33.997821 11153 pod_container_deletor.go:77] Container "a52fe91aa3e7b137ebe4dd993e358c382f96b5df342cb1c098acadb6&gt;
Nov 30 08:33:35 ubuntu k3s[11153]: W1030 08:33:35.022454 11153 pod_container_deletor.go:77] Container "2b9f302427059276bc2e1d012db5cbcaeb72ed373cb52218edb6eb4b</pre>



<p>Make sure that Master node is running properly.</p>



<pre class="wp-block-preformatted">sudo kubectl get nodes -o wide</pre>



<p>Output:</p>



<pre class="wp-block-preformatted">sabi@ubuntu20:~$ sudo kubectl get nodes -o wide<br>NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME<br>master Ready master 3m2s v1.18.9+k3s1 172.16.10.3 Ubuntu 20.04.1 LTS 5.4.0-52-generic docker://19.3.8</pre>



<h3>Step 5: Allow Firewall Access</h3>



<p>Allow the firewall access to the <strong>443</strong> and <strong>6443</strong> ports in order to start the communication b/w the master &amp; worker nodes.</p>



<pre class="wp-block-preformatted">sudo ufw allow 6443/tcp<br>sudo ufw allow 443/tcp</pre>



<p>Now, run the below command in your terminal to get a tocken from the master node that will be later used on worker node to join the master node.</p>



<pre class="wp-block-preformatted">sudo cat /var/lib/rancher/k3s/server/node-token</pre>



<p>Output:</p>



<pre class="wp-block-preformatted">K1078f2861628c95aa328595484e77f831adc3b58041e9ba9a8b2373926c8b034a3::server:417a7c6f46330b601954d0aaaa1d0f5b</pre>



<h3>Step 6: Install K3s Service On Worker Nodes</h3>



<p>Now, install the k3s service on worker nodes &amp; connect them to the master node.</p>



<pre class="wp-block-preformatted">curl -sfL http://get.k3s.io | K3S_URL=https://&lt;master_IP&gt;:6443 K3S_TOKEN=&lt;join_token&gt; sh -s - --docker</pre>



<p><strong>master_IP</strong>: IP of Master Node<br><strong>join_token</strong>: Token generated on Master Node in above step.</p>



<pre class="wp-block-preformatted">curl -sfL http://get.k3s.io | K3S_URL=https://172.16.10.3:6443 K3S_TOKEN=K1078f2861628c95aa328595484e77f831adc3b58041e9ba9a8b2373926c8b034a3::server:417a7c6f46330b601954d0aaaa1d0f5b sh -s - --docker</pre>



<p>Make sure that k3s-agent is running properly on worker nodes by typing.</p>



<pre class="wp-block-preformatted">sudo systemctl status k3s-agent</pre>



<p>Fire the given command to verify that worker nodes are added to cluster.</p>



<pre class="wp-block-preformatted">sudo kubectl get nodes</pre>



<p>You&#8217;ll see the similar output upon success.</p>



<pre class="wp-block-preformatted">sabi@ubuntu20:~$ kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
master Ready master 14m v1.18.9+k3s1 172.16.10.3 Ubuntu 20.04.1 LTS 5.4.0-52-generic docker://19.3.8
worker02 Ready 90s v1.18.9+k3s1 172.16.10.10 Ubuntu 20.04.1 LTS 5.4.0-52-generic docker://19.3.8
worker01 Ready 41s v1.18.9+k3s1 172.16.10.4 Ubuntu 18.04.5 LTS 4.15.0-122-generic docker://19.3.6</pre>



<h4>Install Helm CLI Tool On k3s</h4>



<p>Visit the <a href="https://github.com/helm/helm/releases" target="_blank" rel="noreferrer noopener">link</a> to download the latest version of Helm.</p>



<p>And extract the <strong>downloaded file</strong> with the help of tar.</p>



<pre class="wp-block-preformatted">tar -xvcf &lt;downloaded-file&gt;</pre>



<p>Then move the binary file to <strong>/usr/local/bin/helm</strong></p>



<pre class="wp-block-preformatted">mv linux-amd64/helm /usr/local/bin/helm</pre>



<p>Verify the version</p>



<pre class="wp-block-preformatted">heml version</pre>



<p>Finally add helm repo in order to allow installation with helm.</p>



<pre class="wp-block-preformatted">helm repo add stable https://charts.helm.sh/stable<br>helm repo update</pre>



<h4>Deploy Application On K3s</h4>



<p>Here we&#8217;ll add Nginx as test purposes.</p>



<p>Run the below command to install nginx using helm</p>



<pre class="wp-block-preformatted">helm install nginx-ingress stable/nginx-ingress --namespace kube-system \<br>--set defaultBackend.enabled=false</pre>



<p>Verify the added application by typing</p>



<pre class="wp-block-preformatted">kubectl get pods -n kube-system -l app=nginx-ingress -o wide</pre>



<pre class="wp-block-preformatted">sabi@ubuntu20:~$<strong> kubectl get pods -n kube-system -l app=nginx-ingress -o wide
</strong>NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
nginx-ingress-controller-56547fb57-vsjdm 1/1 Running 0 28s 10.42.2.6 worker01</pre>



<p>So, it shows that we&#8217;ve successfully deployed nginx on k3s.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="845" height="71" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/12/2020-11-30_22h47_27.png" alt="How To Install Kubernetes Cluster On Ubuntu 20.04 Using K3s" class="wp-image-26215" srcset="https://www.osradar.com/wp-content/uploads/2020/12/2020-11-30_22h47_27.png 845w, https://www.osradar.com/wp-content/uploads/2020/12/2020-11-30_22h47_27-300x25.png 300w, https://www.osradar.com/wp-content/uploads/2020/12/2020-11-30_22h47_27-768x65.png 768w, https://www.osradar.com/wp-content/uploads/2020/12/2020-11-30_22h47_27-696x58.png 696w" sizes="(max-width: 845px) 100vw, 845px" /></figure>



<h3>Removing K3s</h3>



<p>In order to remove k3s on the worker nodes, hit</p>



<pre class="wp-block-preformatted">sudo /usr/local/bin/k3s-agent-uninstall.sh<br>sudo rm -rf /var/lib/rancher</pre>



<p>To remove k3s on master node, type</p>



<pre class="wp-block-preformatted">sudo /usr/local/bin/k3s-uninstall.sh<br>sudo rm -rf /var/lib/rancher</pre>



<p>So, this is how you can install kubernetes on Ubuntu 20.04 using k3s.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-kubernetes-cluster-on-ubuntu-20-04-using-k3s/">How To Install Kubernetes Cluster On Ubuntu 20.04 Using K3s</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-install-kubernetes-cluster-on-ubuntu-20-04-using-k3s/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Kubernetes 1.14 is available</title>
		<link>https://www.osradar.com/kubernetes-1-14-is-available/</link>
					<comments>https://www.osradar.com/kubernetes-1-14-is-available/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Fri, 29 Mar 2019 06:07:37 +0000</pubDate>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<category><![CDATA[New version]]></category>
		<category><![CDATA[server]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=11629</guid>

					<description><![CDATA[<p>In the technological world, few projects are as well known as Kubernetes. This powerful container orchestrator has been true innovation in the Linux cloud. Thanks to Kubernetes the deployment, adjustment, and scalability of the containers in Linux are done in a masterful way. Of course, it is compatible with another technology quite known as Docker [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/kubernetes-1-14-is-available/">Kubernetes 1.14 is available</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In the technological world, few projects are as well known as <a href="https://www.osradar.com/install-kubernetes-centos-7/">Kubernetes</a>. This powerful container orchestrator has been true innovation in the Linux cloud. Thanks to Kubernetes the deployment, adjustment, and scalability of the containers in Linux are done in a masterful way. Of course, it is compatible with another technology quite known as Docker and together form a dupla that many Sysadmin uses for their daily work. Well, the recent news is that Kubernetes 1.14 is available with many new features. So, there is even talk that it is the best to date.</p>
<p><a href="https://kubernetes.io">Kubernetes</a> is a revolution in the world of containers. Since Google donated the project to the Cloud Native Computing Foundation, the number of contributors to the source code has increased overwhelmingly. In addition to all this, the big companies behind the world&#8217;s major Linux distributions constantly support Kubernetes. So Canonical, Red Hat, Suse, and others must be very pleased with this release.</p>
<h2>Kubernetes 1.14 is available: The features</h2>
<p>There are many novelties that make this launch something important however, it is good to highlight three:</p>
<ul>
<li>Add support for <strong>Windows nodes</strong>. This allows you to add them as working nodes and program containers for them.</li>
<li><strong>Kubectl</strong> is now much more powerful than before. It now supports complements allowing developers to take full advantage of this tool. On the other hand, the kubectl documentation has been completely rewritten.</li>
<li><strong>Persistent local volumes</strong>. With this, local storage is favored, which in many cases works better with remote storage, saving costs and improving performance. For example, local storage on an SSD is much faster than on a local disk.</li>
</ul>
<p>In total, there are many improvements that come with this version. For example, Kubernetes 1.14 includes at least 30 new features. Of which 7 are completely new and 10 transformed to stable and 12 with beta support. So in effect, we are talking about a completely important version and the best that has been published.</p>
<p>Evidently, these are the main novelties, there are many more that can be consulted through the official announcement. On the other hand, the code of this new version is now available in <a href="https://github.com/kubernetes/kubernetes/releases/tag/v1.14.0">Github</a> so you can download it there.</p>
<h2>Conclusion</h2>
<p>As you can see, Kubernetes is an important technology in the Linux cloud. This version must be called the most important yet because it adds compatibility with Windows nodes and adds the functionality of Kubectl. In addition large Linux companies are under the development of this tool.</p>
<p>Please share this post with your friends.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/kubernetes-1-14-is-available/">Kubernetes 1.14 is available</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/kubernetes-1-14-is-available/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to install Kubernetes on CentOS 7?</title>
		<link>https://www.osradar.com/install-kubernetes-centos-7/</link>
					<comments>https://www.osradar.com/install-kubernetes-centos-7/#comments</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Wed, 17 Oct 2018 01:00:03 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Containers]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=6395</guid>

					<description><![CDATA[<p>Kubernetes (k8s) is a technology for the orchestration of Docker containers. If you&#8217;ve heard of or used Docker, you probably also know about Kubernetes. In this tutorial, I will show you how to install Kubernetes on CentOS 7. In short, Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. The most [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-kubernetes-centos-7/">How to install Kubernetes on CentOS 7?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Kubernetes (k8s) is a technology for the orchestration of Docker containers. If you&#8217;ve heard of or used Docker, you probably also know about Kubernetes. In this tutorial, I will show you how to install Kubernetes on CentOS 7.</p>
<p>In short, <a href="https://kubernetes.io/" rel="noopener">Kubernetes</a> is an open-source system for automating deployment, scaling, and management of containerized applications. The most important factor that sets Kubernetes apart from other cloud computing solutions is that it was built to work with Docker. That&#8217;s why it&#8217;s the most used tool to deploy Dockers applications.</p>
<p>Now, I will show you how to install it on CentOS 7.</p>
<h2>0. Prerequisites</h2>
<p>The installation is not as complicated as it seems, however, you should have a little knowledge about Terminal and commands. Also required is a computer that will serve as a server and another that will serve as a node. The central idea is to add them in a cluster.</p>
<p>Both computers run CentOS 7 and it&#8217;s on a local network. Let&#8217;s start.</p>
<h2>1. Install Kubernetes on the server</h2>
<p>As I said before the idea is to make a cluster, for it, first we must configure the server where you will run Kubernetes. First, you have to disable SELinux and apply various rules in the Firewall for everything to work well. Note: all commands must be run as root user.</p>
<pre class="">:~# hostnamectl set-hostname osradar
:~# exec bash
:~# setenforce 0
:~# sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux</pre>
<p><figure id="attachment_6473" aria-describedby="caption-attachment-6473" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="wp-image-6473 size-full" src="https://www.osradar.com/wp-content/uploads/2018/10/1-12-e1539634898867.png" alt="1.- Preparing the enviroment" width="1366" height="713" srcset="https://www.osradar.com/wp-content/uploads/2018/10/1-12-e1539634898867.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/1-12-e1539634898867-300x157.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/1-12-e1539634898867-768x401.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/1-12-e1539634898867-1024x534.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/1-12-e1539634898867-696x363.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/1-12-e1539634898867-1068x557.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/1-12-e1539634898867-805x420.png 805w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6473" class="wp-caption-text">1.- Preparing the environment</figcaption></figure></p>
<p>Next, set the firewall rules:</p>
<pre class="">:~# firewall-cmd --permanent --add-port=6443/tcp
:~# firewall-cmd --permanent --add-port=2379-2380/tcp
:~# firewall-cmd --permanent --add-port=10250/tcp
:~# firewall-cmd --permanent --add-port=10251/tcp
:~# firewall-cmd --permanent --add-port=10252/tcp
:~# firewall-cmd --permanent --add-port=10255/tcp
:~# firewall-cmd --reload
:~# modprobe br_netfilter
:~# echo '1' &gt; /proc/sys/net/bridge/bridge-nf-call-iptables</pre>
<p><figure id="attachment_6476" aria-describedby="caption-attachment-6476" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6476" src="https://www.osradar.com/wp-content/uploads/2018/10/4-9.png" alt="2.- Setting Firewall rules" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/4-9.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/4-9-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/4-9-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/4-9-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/4-9-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/4-9-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/4-9-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6476" class="wp-caption-text">2.- Setting Firewall rules</figcaption></figure></p>
<p>In case you don&#8217;t have a DNS server configured. Edit the file <code>/etc/hosts</code> and add the information of your node and server.</p>
<pre class="">:~# nano /etc/hosts</pre>
<p>And add the following:</p>
<pre class="">192.168.1.8 osradar
192.168.1.9 node1
</pre>
<p><figure id="attachment_6474" aria-describedby="caption-attachment-6474" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6474" src="https://www.osradar.com/wp-content/uploads/2018/10/2-12.png" alt="2.- Editing hosts file" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/2-12.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/2-12-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/2-12-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/2-12-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/2-12-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/2-12-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/2-12-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6474" class="wp-caption-text">3.- Editing hosts file</figcaption></figure></p>
<p>Of course, replace the configuration with yours depending on the IP addresses and hostname chosen.</p>
<h2>2. Install Kubernetes</h2>
<p>In order to install Kubernetes on CentOS 7, you must add its repository. With this, the installation will be quick and easy. Run</p>
<pre class="">:~# nano /etc/yum.repos.d/kubernetes.repo</pre>
<p>And put the following:</p>
<pre class="">[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</pre>
<p><figure id="attachment_6477" aria-describedby="caption-attachment-6477" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6477" src="https://www.osradar.com/wp-content/uploads/2018/10/3-13.png" alt="4.- Adding the Kubernetes repository" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/3-13.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/3-13-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/3-13-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/3-13-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/3-13-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/3-13-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/3-13-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6477" class="wp-caption-text">4.- Adding the Kubernetes repository</figcaption></figure></p>
<p>Then, you can install it. Also, you have to install docker:</p>
<pre class="">:~# yum install kubeadm docker</pre>
<p><figure id="attachment_6478" aria-describedby="caption-attachment-6478" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6478" src="https://www.osradar.com/wp-content/uploads/2018/10/5-9.png" alt="5.- Install Kubernetes" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/5-9.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/5-9-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/5-9-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/5-9-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/5-9-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/5-9-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/5-9-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6478" class="wp-caption-text">5.- Install Kubernetes</figcaption></figure></p>
<p>Then, start and enable both <code>docker</code> and <code>kubectl</code> services:</p>
<pre class="">:~# systemctl enable docker
:~# systemctl start docker
:~# systemctl enable kubelet
:~# systemctl start kubelet</pre>
<p><figure id="attachment_6479" aria-describedby="caption-attachment-6479" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6479" src="https://www.osradar.com/wp-content/uploads/2018/10/6-8.png" alt="6.- Enabling the required services" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/6-8.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/6-8-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/6-8-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/6-8-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/6-8-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/6-8-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/6-8-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6479" class="wp-caption-text">6.- Enabling the required services</figcaption></figure></p>
<h2>3. Initialize Kubernetes in CentOS 7</h2>
<p>Now you can start Kubernetes with the next command:</p>
<pre class="">.~# kubeadm init</pre>
<p>If you see something like this, everything is OK.</p>
<p><figure id="attachment_6480" aria-describedby="caption-attachment-6480" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6480" src="https://www.osradar.com/wp-content/uploads/2018/10/7-8.png" alt="7.- Kubernetes is running!" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/7-8.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/7-8-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/7-8-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/7-8-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/7-8-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/7-8-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/7-8-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6480" class="wp-caption-text">7.- Kubernetes is running!</figcaption></figure></p>
<p>As you can see from the image, you must now execute these commands:</p>
<pre class="">:~# mkdir -p $HOME/.kube
:~# cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
:~# chown $(id -u):$(id -g) $HOME/.kube/config</pre>
<p><figure id="attachment_6481" aria-describedby="caption-attachment-6481" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="wp-image-6481 size-full" src="https://www.osradar.com/wp-content/uploads/2018/10/8-8-e1539648131965.png" alt="8.- Creating the cluster folders" width="1366" height="741" srcset="https://www.osradar.com/wp-content/uploads/2018/10/8-8-e1539648131965.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/8-8-e1539648131965-300x163.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/8-8-e1539648131965-768x417.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/8-8-e1539648131965-1024x555.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/8-8-e1539648131965-696x378.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/8-8-e1539648131965-1068x579.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/8-8-e1539648131965-774x420.png 774w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6481" class="wp-caption-text">8.- Creating the cluster folders</figcaption></figure></p>
<p>The next step is to check the status of the clusters and pods</p>
<pre class="">:~# kubectl get nodes
:~# kubectl get pods --all-namespaces</pre>
<p>To ensure that there is communication between the nodes of the cluster, you have to run the following:</p>
<pre class="">:~# export kubever=$(kubectl version | base64 | tr -d '\n')
:~# kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$kubever"</pre>
<p><figure id="attachment_6482" aria-describedby="caption-attachment-6482" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6482" src="https://www.osradar.com/wp-content/uploads/2018/10/9-9.png" alt="9.- Configuring Kubernetes" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/9-9.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/9-9-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/9-9-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/9-9-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/9-9-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/9-9-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/9-9-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6482" class="wp-caption-text">9.- Configuring Kubernetes</figcaption></figure></p>
<p>Now, re-run the command to show all the pods.</p>
<pre class="">:~# kubectl get pods --all-namespaces</pre>
<p><figure id="attachment_6483" aria-describedby="caption-attachment-6483" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6483" src="https://www.osradar.com/wp-content/uploads/2018/10/10-8.png" alt="10.- All pods running" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/10-8.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/10-8-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/10-8-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/10-8-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/10-8-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/10-8-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/10-8-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6483" class="wp-caption-text">10.- All pods running</figcaption></figure></p>
<p>Everything is going OK.</p>
<h2>4.- Working on the node or nodes</h2>
<p>In this step, you must work on the number of nodes you want to configure. In this case, it will be only one, but remember that they can be more.</p>
<p>At each node, run the following. First, change the hostname and set the firewall rules:</p>
<pre class="">:~# setenforce 0
:~# sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
:~# firewall-cmd --permanent --add-port=10250/tcp
:~# firewall-cmd --permanent --add-port=10255/tcp
:~# firewall-cmd --permanent --add-port=30000-32767/tcp
:~# firewall-cmd --permanent --add-port=6783/tcp
:~# firewall-cmd  --reload</pre>
<p><figure id="attachment_6484" aria-describedby="caption-attachment-6484" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6484" src="https://www.osradar.com/wp-content/uploads/2018/10/11-8.png" alt="11.- Setting Firewall rules on Node1" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/11-8.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/11-8-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/11-8-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/11-8-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/11-8-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/11-8-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/11-8-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6484" class="wp-caption-text">11.- Setting Firewall rules on Node1</figcaption></figure></p>
<p>Next, install Kubernetes.</p>
<pre class="">:~# cat &lt;&lt;EOF &gt; /etc/yum.repos.d/kubernetes.repo</pre>
<p>And add the following:</p>
<pre class="">&gt; [kubernetes]
&gt; name=Kubernetes
&gt; baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
&gt; enabled=1
&gt; gpgcheck=1
&gt; repo_gpgcheck=1
&gt; gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
&gt;         https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
&gt; EOF</pre>
<p><figure id="attachment_6485" aria-describedby="caption-attachment-6485" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6485" src="https://www.osradar.com/wp-content/uploads/2018/10/12-7.png" alt="12.- adding the kubernetes repository" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/12-7.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/12-7-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/12-7-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/12-7-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/12-7-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/12-7-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/12-7-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6485" class="wp-caption-text">12.- adding the kubernetes repository</figcaption></figure></p>
<p>Next, install it:</p>
<pre class="">:~# yum install kubeadm docker</pre>
<p><figure id="attachment_6486" aria-describedby="caption-attachment-6486" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6486" src="https://www.osradar.com/wp-content/uploads/2018/10/13-3.png" alt="13.- Installing Docker and kubernetes on Node1" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/13-3.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/13-3-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/13-3-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/13-3-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/13-3-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/13-3-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/13-3-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6486" class="wp-caption-text">13.- Installing Docker and kubernetes on Node1</figcaption></figure></p>
<p>Then, enable and start the services:</p>
<pre class="">:~# systemctl enable docker
:~# systemctl start docker
:~# systemctl enable kubelet
:~# systemctl start kubelet</pre>
<p><figure id="attachment_6487" aria-describedby="caption-attachment-6487" style="width: 1366px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-6487" src="https://www.osradar.com/wp-content/uploads/2018/10/14-2.png" alt="14.- Enabling the required services" width="1366" height="768" srcset="https://www.osradar.com/wp-content/uploads/2018/10/14-2.png 1366w, https://www.osradar.com/wp-content/uploads/2018/10/14-2-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2018/10/14-2-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2018/10/14-2-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2018/10/14-2-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2018/10/14-2-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2018/10/14-2-747x420.png 747w" sizes="(max-width: 1366px) 100vw, 1366px" /><figcaption id="caption-attachment-6487" class="wp-caption-text">14.- Enabling the required services</figcaption></figure></p>
<p>Finally, join to the master node.</p>
<pre class="">:~# kubeadm join --token xnxlx4.k6qupcvb9g7tq2ti 192.168.1.8</pre>
<h2>Conclusion</h2>
<p>As you can see, the process of installing Kubernetes on CentOS 7 is simple and we are talking about a very powerful tool in the Linux world.</p>
<p>We want to know about you, have you used Kubernetes? do you use Docker?</p>
<p>Please spread this article on your social networks</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-kubernetes-centos-7/">How to install Kubernetes on CentOS 7?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-kubernetes-centos-7/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
