<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nikita Kokitkar on Medium]]></title>
        <description><![CDATA[Stories by Nikita Kokitkar on Medium]]></description>
        <link>https://medium.com/@nikkikokitkar?source=rss-d18e29675dbe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ZZaiKNWSpkWg8Gcy</url>
            <title>Stories by Nikita Kokitkar on Medium</title>
            <link>https://medium.com/@nikkikokitkar?source=rss-d18e29675dbe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 11:18:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nikkikokitkar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Creating Kubernetes clusters using kubeadm]]></title>
            <link>https://medium.com/@nikkikokitkar/creating-kubernetes-clusters-using-kubeadm-f46d331a2405?source=rss-d18e29675dbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/f46d331a2405</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubeadm]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Nikita Kokitkar]]></dc:creator>
            <pubDate>Mon, 30 Jul 2018 07:45:00 GMT</pubDate>
            <atom:updated>2018-08-01T16:59:17.952Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*JLj6qvILdKWBFjt1sxE7rQ.jpeg" /></figure><p>In this article, we will learn to create a single master Kubernetes (k8s) cluster using kubeadm.</p><p><strong>What is kubeadm ?</strong><br>Kubeadm is a tool that helps you bootstrap a simple Kubernetes cluster and simplifies the deployment process. It performs the actions necessary to get a minimum viable cluster up and running such that it passes Kubernetes Conformance tests.<br>A typical Kubernetes cluster set-up with kubeadm consists of a single Kubernetes master, which is the machine coordinating the cluster, and multiple Kubernetes nodes, which are the machines running the actual workload.</p><p><strong>Setting up the machines</strong><br>We will deploy our k8s cluster on Amazon EC2 instances.<br>While launching the EC2 instance, select Ubuntu Server 16.04 LTS as the Machine Image.<br>Select type of instance as t2.medium because kubeadm needs 2 or more CPUs as well as minimum 2 GB RAM.<br>Enter the number of instances required.<br>Add following Inbound rules to the instances respectively.</p><p><em>Master node(s)</em></p><ul><li>TCP Inbound 6443</li><li>TCP Inbound 2379–2380</li><li>TCP Inbound 10250</li><li>TCP Inbound 10251</li><li>TCP Inbound 10252</li></ul><p><em>Worker node(s)</em></p><ul><li>TCP Inbound -10250</li><li>TCP Inbound 30000–32767</li></ul><p><strong><em>Install Docker on the instances</em></strong><br>From Docker’s repositories for Ubuntu:</p><pre>apt-get update</pre><pre>apt-get install -y apt-transport-https ca-certificates curl software-properties-common</pre><pre>curl -fsSL <a href="https://download.docker.com/linux/ubuntu/gpg">https://download.docker.com/linux/ubuntu/gpg</a> | apt-key add -</pre><pre>add-apt-repository “deb <a href="https://download.docker.com/linux/$(.">https://download.docker.com/linux/$(.</a> /etc/os-release; echo “$ID”) $(lsb_release -cs) stable”</pre><pre>apt-get update </pre><pre>apt-get install -y docker-ce</pre><p><strong><em>Installing kubeadm, kubelet and kubectl on the instances</em></strong></p><pre>apt-get update &amp;&amp; apt-get install -y apt-transport-https curl</pre><pre>curl -s <a href="https://packages.cloud.google.com/apt/doc/apt-key.gpg">https://packages.cloud.google.com/apt/doc/apt-key.gpg</a> | apt-key add -</pre><pre>cat &lt;&lt;EOF &gt;/etc/apt/sources.list.d/kubernetes.list<br>deb <a href="http://apt.kubernetes.io/">http://apt.kubernetes.io/</a> kubernetes-xenial main<br>EOF</pre><pre>apt-get update</pre><pre>apt-get install -y kubelet kubeadm kubectl</pre><pre>apt-mark hold kubelet kubeadm kubectl</pre><p><strong><em>Configure cgroup driver used by kubelet on Master Node</em></strong><br>When using Docker, kubeadm will automatically detect the cgroup driver for the kubelet and set it in the /var/lib/kubelet/kubeadm-flags.env file during runtime.<br>If you are using a different CRI, you have to modify the file /etc/default/kubelet with your cgroup-driver value, like so:<br> KUBELET_KUBEADM_EXTRA_ARGS= — cgroup-driver=&lt;value&gt;<br>Restarting the kubelet is required:</p><pre>systemctl daemon-reload</pre><pre>systemctl restart kubelet</pre><p>Please bear in mind, that you only have to do that if the cgroup driver of your CRI is not cgroupfs.</p><p><strong>Initializing your master</strong><br>The master is the machine where the control plane components run, including etcd (the cluster database) and the API server (which the kubectl CLI communicates with).<br> <br>We have to install a pod network so that our pods can communicate with each other. Kubeadm only supports Container Network Interface (CNI) based networks.<br>We use Calico as our pod network add-on and install it using following commands</p><pre>kubectl apply -f <a href="https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml">https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml</a></pre><pre>kubectl apply -f <a href="https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml">https://docs.projectcalico.org/v3.1/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml</a></pre><p>Then run</p><pre>kubeadm init — kubernetes-version=1.11.0 — apiserver-advertise-address=&lt;master_ip-address&gt; — pod-network-cidr=192.168.0.0/16</pre><p>Installs specified version of k8s and uses the network interface to advertise the master’s IP.<br>kubeadm init first runs a series of prechecks to ensure that the machine is ready to run Kubernetes. These prechecks expose warnings and exit on errors. It then downloads and installs the cluster control plane components.</p><p>To make kubectl work for your non-root user, run these commands</p><pre>mkdir -p $HOME/.kube<br>sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config<br>sudo chown $(id -u):$(id -g) $HOME/.kube/config</pre><p>Alternatively, if you are the root user, you can run:<br>export KUBECONFIG=/etc/kubernetes/admin.conf<br> Make a record of the kubeadm init command’s output. You need this command to join the worker nodes to your cluster.</p><p><strong>Joining worker nodes</strong><br> Nodes are where your workloads (containers and pods, etc) run.<br> Run the following commands on each worker machine by first SSH-ing into it and become root (sudo -i)</p><pre>kubeadm join — token &lt;token&gt; &lt;master-ip&gt;:&lt;master-port&gt; — discovery-token-ca-cert-hash sha256:&lt;hash&gt;</pre><p>(This command is the output of the kubeadm init command run on the master node)</p><p><strong>Teardown</strong><br> To undo what kubeadm did, you should first drain the node and make sure that the node is empty before shutting it down.<br> On the master run:</p><pre>kubectl drain &lt;node name&gt; — delete-local-data — force — ignore-daemonsets</pre><pre>kubectl delete node &lt;node name&gt;</pre><p>Then, on the node being removed, reset all kubeadm installed state:</p><pre>kubeadm reset</pre><p>Now you can start over by simply running kubeadm init again.</p><p>That’s it folks. You now have your first k8s cluster deployed using kubeadm :) In the next post, we will be creating Highly Available clusters with kubeadm.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f46d331a2405" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>