<?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 Mr.Zik on Medium]]></title>
        <description><![CDATA[Stories by Mr.Zik on Medium]]></description>
        <link>https://medium.com/@mrzik?source=rss-e4633cbb7b57------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vDqwikT9m6QeQR7FFUUsgA.png</url>
            <title>Stories by Mr.Zik on Medium</title>
            <link>https://medium.com/@mrzik?source=rss-e4633cbb7b57------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 14:53:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mrzik/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[Zoning Configuration in Traditional SAN Architecture]]></title>
            <link>https://mrzik.medium.com/zoning-configuration-in-traditional-san-architecture-f03cd67121c0?source=rss-e4633cbb7b57------2</link>
            <guid isPermaLink="false">https://medium.com/p/f03cd67121c0</guid>
            <category><![CDATA[brocade]]></category>
            <category><![CDATA[fabric]]></category>
            <category><![CDATA[datacenter-solutions]]></category>
            <category><![CDATA[switch]]></category>
            <category><![CDATA[storage-solutions]]></category>
            <dc:creator><![CDATA[Mr.Zik]]></dc:creator>
            <pubDate>Mon, 06 Sep 2021 15:33:02 GMT</pubDate>
            <atom:updated>2021-09-06T15:33:02.260Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s datacenter modernization era, there are still some companies that adopt 3 tier Fabric architecture technology (Compute, FC Network, FC Storage) , in that architecture there are devices that play an important role, namely FC switch / SAN Switch. almost most san switches from various vendors use brocade os, ok let’s learn more</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hot5u05pvKAhJUNnCh-IdQ.png" /></figure><p>First of all make sure the server is installed os and power on as well as storage, and after that console or ssh to FC switch and do this configuration</p><p><strong>View WWPN</strong></p><pre><strong>#List WWPN On FC Switch1</strong></pre><pre>fcswitch1&gt; switchshow<br>Index Port Address  Media Speed   State       Proto<br>==================================================<br>   0   0   010000   id    N16     Online      FC  F-Port  10:00:00:10:9a:c3:2e:e7<br>   1   1   010100   id    N16     Online      FC  F-Port  10:00:00:10:9a:c3:2e:f3<br>   2   2  010a00   id    N16     Online      FC  F-Port  20:70:00:c0:ff:f1:c4:20<br>   3   3  010b00   id    16G     Online      FC  F-Port  24:70:00:c0:ff:f1:c4:20</pre><pre><strong>#List WWPN On FC Switch2</strong></pre><pre>fcswitch1&gt; switchshow<br>Index Port Address  Media Speed   State       Proto<br>==================================================<br>   0   0   010000   id    N16     Online      FC  F-Port  10:00:00:10:9a:c3:2e:e8<br>   1   1   010100   id    N16     Online      FC  F-Port  10:00:00:10:9a:c3:2e:f4<br>   2   2  010a00   id    N16     Online      FC  F-Port  21:70:00:c0:ff:f1:c4:20<br>   3   3  010b00   id    16G     Online      FC  F-Port  25:70:00:c0:ff:f1:c4:20</pre><p><strong>Create Alias</strong></p><pre><strong>#On FC Switch 1<br></strong>alicreate &quot;Server1-1&quot;,&quot;10:00:00:10:9a:c3:2e:e7&quot;<br>alicreate &quot;Server2-1&quot;,&quot;10:00:00:10:9a:c3:2e:f3&quot;<br>alicreate &quot;STRG-Ctrl-A1&quot;,&quot;20:70:00:c0:ff:f1:c4:20&quot;<br>alicreate &quot;STRG-Ctrl-B1&quot;,&quot;24:70:00:c0:ff:f1:c4:20&quot;</pre><pre><strong>#On FC Switch 2<br></strong>alicreate &quot;Server1-2&quot;,&quot;10:00:00:10:9a:c3:2e:e8&quot;<br>alicreate &quot;Server2-2&quot;,&quot;10:00:00:10:9a:c3:2e:f4&quot;<br>alicreate &quot;STRG-Ctrl-A2&quot;,&quot;21:70:00:c0:ff:f1:c4:20&quot;<br>alicreate &quot;STRG-Ctrl-B2&quot;,&quot;25:70:00:c0:ff:f1:c4:20&quot;</pre><p><strong>Create Zoning</strong></p><pre><strong>#On FC Switch 1<br></strong>zonecreate &quot;ZONE1&quot;,&quot;Server1-1;STRG-Ctrl-A1;STRG-Ctrl-B1&quot;<br>zonecreate &quot;ZONE2&quot;,&quot;Server2-1;STRG-Ctrl-A1;STRG-Ctrl-B1&quot;</pre><pre><strong>#On FC Switch 2<br></strong>zonecreate &quot;ZONE1&quot;,&quot;Server1-2;STRG-Ctrl-A2;STRG-Ctrl-B2&quot;<br>zonecreate &quot;ZONE2&quot;,&quot;Server2-2;STRG-Ctrl-A2;STRG-Ctrl-B2&quot;</pre><p><strong>Create CFG</strong></p><pre><strong>#On FC Switch 1<br></strong>cfgcreate &quot;cfg-fcswitch1&quot;,&quot;ZONE1;ZONE2&quot;</pre><pre><strong>#On FC Switch 2<br></strong>cfgcreate &quot;cfg-fcswitch2&quot;,&quot;ZONE1;ZONE2&quot;</pre><p><strong>Enable CFG</strong></p><pre><strong>#On FC Switch 1<br></strong>cfgenable &quot;cfg-fcswitch1&quot;</pre><pre><strong>#On FC Switch 2<br></strong>cfgenable &quot;cfg-fcswitch2&quot;</pre><blockquote>Thats all we need to do zoning configuration on brocade os, now you can doit yourself . cheers</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f03cd67121c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Configure Private Registry for Kubernetes cluster running with containerd]]></title>
            <link>https://mrzik.medium.com/how-to-configure-private-registry-for-kubernetes-cluster-running-with-containerd-cf74697fa382?source=rss-e4633cbb7b57------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf74697fa382</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[containerd]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Mr.Zik]]></dc:creator>
            <pubDate>Thu, 12 Aug 2021 05:15:03 GMT</pubDate>
            <atom:updated>2021-08-12T05:15:03.864Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>When using containerd as a runtime container, we can still use the docker registry for pod images in kubernetes because basically docker images use OCI format so they are compatible with containerd.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*47dk10_QhMDlCzEg9rk_YA.png" /></figure><p>For creating kubernetes cluster with containerd you can learn on previous post “<a href="https://medium.com/@mrzik/how-to-create-kubernetes-cluster-with-containerd-90399ec3b810">How To Create Kubernetes Cluster With Containerd</a> ”.<br>I will use the same kubernetes cluster from previous and add 1 more server for Registry Server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*Zjnq02Mz6EJqAnQctpRo3w.png" /></figure><h4>Step 1. Prepare Registry Server</h4><p>Do this configuration on private registry server</p><pre>apt update<br>apt -y install docker.io docker-registry apache2-utils</pre><p>Enable basic authentication on docker registry</p><pre>sudo vi /etc/docker/registry/config.yml</pre><pre>#change htpasswd path</pre><pre>htpasswd:<br>    realm: basic-realm<br>    path: /etc/docker/registry/.htpasswd</pre><p>Enable insecure registry on docker daemon</p><pre>sudo vi /etc/docker/daemon.json</pre><pre>{<br>  &quot;insecure-registries&quot;:<br>    [&quot;172.16.4.93:5000&quot;]<br>}</pre><p>Restart docker and registry service</p><pre>sudo systemctl restart docker<br>sudo systemctl restart docker-registry</pre><p>Enable private registry port on firewall</p><pre>sudo ufw allow 5000/tcp</pre><p>Create User for Docker Registry Auth</p><pre>#you can change regadmin with your user admin</pre><pre>sudo htpasswd -Bc /etc/docker/registry/.htpasswd <strong>regadmin</strong></pre><p>Try to pull images</p><pre>sudo docker pull nginx</pre><p>Tag image before push images to private registry</p><pre>sudo docker image ls<br>sudo docker tag nginx 172.16.4.93:5000/nginx:1.0</pre><p>Login to private registry and push tagged image</p><pre>sudo docker login 172.16.4.93:5000<br>sudo docker push 172.16.4.93:5000/nginx:1.0</pre><p>View the login auth with base 64 encode, this is necessary to added in containerd config.toml</p><pre>sudo cat /root/.docker/config.json</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*lcnT7WKdg7B89T6k-bQIFw.png" /></figure><p>Note the auth code</p><h4>Step 2. Enable Private Registry on Kubernetes Nodes</h4><p>Do this configuration on master nodes and worker nodes</p><p>Configure containerd config.toml</p><pre>sudo vi /etc/containerd/config.toml</pre><pre>#find  [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry] and add the following configuration</pre><pre>[plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry]<br>  config_path = &quot;&quot;<br>  [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.auths]<br>  [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.configs]<br>    <strong>[plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.configs.&quot;172.16.4.93:5000&quot;.tls]<br>      insecure_skip_verify = true<br>    [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.configs.&quot;172.16.4.93:5000&quot;.auth]<br>      auth = &quot;cmVnYWRtaW46QzBtcG4zdCE=&quot;</strong><br>  [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.headers]<br>  [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.mirrors]<br>    <strong>[plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.mirrors.&quot;172.16.4.93:5000&quot;]<br>      endpoint = [&quot;</strong><a href="http://172.16.4.93:5000/"><strong>http://172.16.4.93:5000</strong></a><strong>&quot;]</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yNN-i_8gMaw74kE4hopM8w.png" /></figure><p>Save and exit<br>next restart containerd service</p><pre>sudo systemctl restart containerd<br>sudo containerd config dump</pre><h4>Step 3. Test private registry</h4><p>Do this on master nodes</p><p>Test Pull Images with crictl to make sure our containerd configuration is working</p><pre>sudo crictl -r /run/containerd/containerd.sock pull 172.16.4.93:5000/nginx:1.0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hi15LD6sc-bZ_XyyX8ukng.png" /></figure><p>Create Pod with private registry images</p><pre>kubectl run private-pod --image=172.16.4.93:5000/nginx:1.0 --restart=Always</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dKyPtlhr-a4e3PaJG8ealA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf74697fa382" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Configure Kubernetes Multimaster Cluster for High Availability]]></title>
            <link>https://mrzik.medium.com/how-to-configure-kubernetes-multimaster-cluster-for-high-availability-950cf0660b66?source=rss-e4633cbb7b57------2</link>
            <guid isPermaLink="false">https://medium.com/p/950cf0660b66</guid>
            <category><![CDATA[kubeadm]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Mr.Zik]]></dc:creator>
            <pubDate>Sun, 01 Aug 2021 21:39:03 GMT</pubDate>
            <atom:updated>2021-08-01T21:44:38.988Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S7iAmJ-6IiSZZnkSfgK8iw.png" /></figure><blockquote>Creating high availability in a Kubernetes environment is critical to ensuring robust and highly available applications in the event of a disaster or hardware failure. One solution to this problem is to use multiple control planes or masters nodes in a cluster.</blockquote><p>In the previous post it has been explained to install a kubernetes cluster using containerd. this time we will use containerd as the runtime container because kubernetes support for docker is about to end.<br>The following is a list of servers used:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*stB586XJSf0Vr96zgm40EA.png" /><figcaption>Table IP Address</figcaption></figure><p>And the topology used as follows :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I70DEdcLhQlLmDWKOZExlQ.png" /><figcaption>Topology</figcaption></figure><p>I will skip the containerd configuration, you can see how to configure containerd in here <a href="https://medium.com/@mrzik/how-to-create-kubernetes-cluster-with-containerd-90399ec3b810"><em>https://medium.com/@mrzik/how-to-create-kubernetes-cluster-with-containerd-90399ec3b810</em></a></p><h4>Step 1. Configure /etc/hosts</h4><p>Do this configuration on all master nodes.</p><p>Add the following list to hosts files so each node can communicate with names</p><pre>root@kubmaster1:~# vi /etc/hosts<br>127.0.0.1 localhost<br>127.0.1.1 kubmaster1</pre><pre><strong>#Kubernetes Nodes</strong><br><strong>172.16.4.74 kubmaster1.mylab.local kubmaster1<br>172.16.4.75 kubmaster2.mylab.local kubmaster2<br>172.16.4.76 kubmaster3.mylab.local kubmaster3<br>172.16.4.77 kubworker1.mylab.local kubworker1<br>172.16.4.78 kubworker2.mylab.local kubworker2<br>172.16.4.79 kubworker3.mylab.local kubworker3</strong></pre><pre><strong>#Keepalived Virtual IP<br>172.16.4.80 kubvip.mylab.local kubvip</strong></pre><pre><strong>#Kubectl Client<br>172.16.4.81 kubclient.mylab.local kubclient</strong></pre><pre># The following lines are desirable for IPv6 capable hosts<br>::1     ip6-localhost ip6-loopback<br>fe00::0 ip6-localnet<br>ff00::0 ip6-mcastprefix<br>ff02::1 ip6-allnodes<br>ff02::2 ip6-allrouters<br>root@kubmaster1:~#</pre><h4>Step 2. Configure keepalived</h4><p>Do this configuration on all master nodes</p><p>Install keepalived package</p><pre>sudo apt -y install keepalived</pre><p>Create check script for keepalived</p><pre>sudo vi /etc/keepalived/check_apiserver.sh</pre><pre>#!/bin/sh<br>errorExit() {<br>echo &quot;*** $*&quot; 1&gt;&amp;2<br>exit 1<br>}<br>curl --silent --max-time 2 --insecure <a href="https://localhost:8443/">https://localhost:8443/</a> -o /dev/null ||<br>errorExit &quot;Error GET <a href="https://localhost:8443/">https://localhost:8443/</a>&quot;<br>if ip addr | grep -q 172.16.4.80; then<br>curl --silent --max-time 2 --insecure <a href="https://172.16.4.80:8443/">https://172.16.4.80:8443/</a> -o<br>/dev/null || errorExit &quot;Error GET <a href="https://172.16.4.80:8443/">https://172.16.4.80:8443/</a>&quot;<br>fi</pre><p>Add permisson for executing check script</p><pre>sudo chmod +x /etc/keepalived/check_apiserver.sh</pre><p>Create file configuration for keepalived</p><pre>sudo vi /etc/keepalived/keepalived.conf</pre><pre>#Configuration File for keepalived<br>global_defs {<br>        router_id LVS_DEVEL<br>        enable_script_security<br>}<br>vrrp_script check_apiserver {<br>        script &quot;/etc/keepalived/check_apiserver.sh&quot;<br>        interval 3<br>        weight -2<br>        fall 3<br>        rise 2<br>}<br>vrrp_instance VI_1 {<br>        state MASTER<br>        interface ens160 #costumized this with your interface<br>        virtual_router_id 100<br>        priority 255 #change priority for other node<br>        authentication {<br>        auth_type PASS<br>        auth_pass password #define your password<br>}<br>virtual_ipaddress {<br>        172.16.4.80/24<br>}<br>track_script {<br>        check_apiserver<br>}<br>}</pre><p>Enable and start keepalived service</p><pre>systemctl enable --now keepalived<br>systemctl status keepalived</pre><p>Repeat this step for other nodes ( kubmaster2 and kubmaster3 ), for kubmaster2 and kubmaster3 there are some changes that need to be adjusted ( <em>state to BACKUP , priority to 254 and 253</em>)</p><h4>Step 3. Configure haproxy</h4><p>Do this configuration on all master nodes</p><p>Install haproxy package</p><pre>sudo apt -y install haproxy</pre><p>Add the following lines to the end of haproxy.cfg</p><pre>sudo vi /etc/haproxy/haproxy.cfg</pre><pre>#Kubernetes APIServer Frontend<br>frontend apiserver<br>        bind 172.16.4.80:8443<br>        mode tcp<br>        option tcplog<br>        default_backend apiserver</pre><pre>#Kubernetes APIServer Backend<br>backend apiserver<br>        option httpchk GET /healtz<br>        http-check expect status 200<br>        mode tcp<br>        option tcp-check<br>        balance roundrobin<br>                server kubmaster1.mylab.local:6443 check<br>                server kubmaster2.mylab.local:6443 check<br>                server kubmaster3.mylab.local:6443 check</pre><p>Start and enable haproxy service</p><pre>sudo systemctl enable --now haproxy<br>sudo systemctl status haproxy</pre><p>Repeat step for other master nodes</p><h4>Step 4. Configure kubernetes requirement</h4><p>Do this configuration on control plane/master nodes and worker nodes</p><p>Disable swap</p><pre>sudo swapoff -a<br>sudo vi /etc/fstab#comment swap disk<br>#/swap.img       none    swap    sw      0       0</pre><pre>#save and exit :wq</pre><p>Configure sysctl</p><pre>cat &lt;&lt;EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf<br>net.bridge.bridge-nf-call-iptables  = 1<br>net.ipv4.ip_forward                 = 1<br>net.bridge.bridge-nf-call-ip6tables = 1<br>EOF</pre><pre>sudo sysctl --system</pre><p>Allow required port for kubernetes or Disable Firewall</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/0*l5JELYybnTza_z0_.png" /><figcaption>port requirement</figcaption></figure><pre>sudo ufw disable</pre><p>Setup iptables backend to use iptables-legacy</p><pre>sudo update-alternatives --config iptablesThere are 2 choices for the alternative iptables (providing /usr/sbin/iptables).Selection    Path                       Priority   Status<br>------------------------------------------------------------<br>  0            /usr/sbin/iptables-nft      20        auto mode<br>* 1            /usr/sbin/iptables-legacy   10        manual mode<br>  2            /usr/sbin/iptables-nft      20        manual modePress &lt;enter&gt; to keep the current choice[*], or type selection number:</pre><p>Add kubernetes repository</p><pre>sudo wget <a href="https://packages.cloud.google.com/apt/doc/apt-key.gpg">https://packages.cloud.google.com/apt/doc/apt-key.gpg</a></pre><pre>sudo mv apt-key.gpg /etc/apt/trusted.gpg.d/sudo cat &lt;&lt;EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list<br>deb <a href="https://apt.kubernetes.io/">https://apt.kubernetes.io/</a> kubernetes-xenial main<br>EOF</pre><pre>sudo apt update<br>sudo apt install -y kubeadm kubelet</pre><p>Enable kubelet service but dont start yet</p><pre>sudo systemctl enable kubelet</pre><h4>Step 5. Kubeadm Cluster Init</h4><p>Do this configuration on kubmaster1</p><p>kubeadm init with external endpoint and use containerd as container runtime</p><pre>sudo kubeadm init --control-plane-endpoint &quot;kubvip.mylab.local:8443&quot; --upload-certs --cri-socket /run/containerd/containerd.sock</pre><p>Note final result of kubeadm init cause we will use it for join another control plane and worker</p><pre>Your Kubernetes control-plane has initialized successfully!</pre><pre>To start using your cluster, you need to run the following as a regular user:</pre><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><pre>Alternatively, if you are the root user, you can run:</pre><pre>export KUBECONFIG=/etc/kubernetes/admin.conf</pre><pre>You should now deploy a pod network to the cluster.<br>Run &quot;kubectl apply -f [podnetwork].yaml&quot; with one of the options listed at:<br>  <a href="https://kubernetes.io/docs/concepts/cluster-administration/addons/">https://kubernetes.io/docs/concepts/cluster-administration/addons/</a></pre><pre>You can now join any number of the control-plane node running the following command on each as root:</pre><pre><strong>kubeadm join kubvip.mylab.local:8443 --token x65nj4.l2vi5s9r8cmqofj5 \<br>        --discovery-token-ca-cert-hash sha256:859cf17f33574ad60b67b3694b2348c2c27d292ca597a1f3d5dba84948ac2b6b \<br>        --control-plane --certificate-key c999c6807438d200627b7d3b5d6e247441814949360226f6d5837dae4e6139a6</strong></pre><pre>Please note that the certificate-key gives access to cluster sensitive data, keep it secret!<br>As a safeguard, uploaded-certs will be deleted in two hours; If necessary, you can use<br>&quot;kubeadm init phase upload-certs --upload-certs&quot; to reload certs afterward.</pre><pre>Then you can join any number of worker nodes by running the following on each as root:</pre><pre><strong>kubeadm join kubvip.mylab.local:8443 --token x65nj4.l2vi5s9r8cmqofj5 \<br>        --discovery-token-ca-cert-hash sha256:859cf17f33574ad60b67b3694b2348c2c27d292ca597a1f3d5dba84948ac2b6b</strong></pre><p>On kubmaster2 and kubmaster3 run this command to joining cluster as control plane nodes and add containerd as container runtime</p><pre>sudo kubeadm join kubvip.mylab.local:8443 --token x65nj4.l2vi5s9r8cmqofj5 \<br>        --discovery-token-ca-cert-hash sha256:859cf17f33574ad60b67b3694b2348c2c27d292ca597a1f3d5dba84948ac2b6b \<br>        --control-plane --certificate-key c999c6807438d200627b7d3b5d6e247441814949360226f6d5837dae4e6139a6 --cri-socket /run/containerd/containerd.sock</pre><p>On kubworker1–3 run this command to joining cluster as worker nodes and add containerd as container runtime</p><pre>sudo kubeadm join kubvip.mylab.local:8443 --token x65nj4.l2vi5s9r8cmqofj5 \<br>        --discovery-token-ca-cert-hash sha256:859cf17f33574ad60b67b3694b2348c2c27d292ca597a1f3d5dba84948ac2b6b --cri-socket /run/containerd/containerd.sock</pre><h4>Step 6. Add Calico CNI</h4><p>Do this configuration on kubclient node</p><p>Before add calico cni we need to install and configure kubectl on kubclient node</p><pre>sudo wget <a href="https://packages.cloud.google.com/apt/doc/apt-key.gpg">https://packages.cloud.google.com/apt/doc/apt-key.gpg</a></pre><pre>sudo mv apt-key.gpg /etc/apt/trusted.gpg.d/sudo cat &lt;&lt;EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list<br>deb <a href="https://apt.kubernetes.io/">https://apt.kubernetes.io/</a> kubernetes-xenial main<br>EOF</pre><pre>sudo apt update<br>sudo apt -y install kubectl</pre><p>Create .kube directory on home directory</p><pre>mkdir -p $HOME/.kube</pre><p>SSH to kubmaster1 and scp kubernetes admin.conf to kubclient as config file</p><pre>sudo scp /etc/kubernetes/admin.conf youradminuser@kubclient:/$HOME/.kube/config</pre><p>Back to kubclient change ownership of config file</p><pre>sudo chown $(id -u):$(id -g) $HOME/.kube/config</pre><p>Now download calico manifest</p><pre>curl <a href="https://docs.projectcalico.org/manifests/calico.yaml">https://docs.projectcalico.org/manifests/calico.yaml</a> -O</pre><p>Apply the manifest using following command</p><pre>kubectl apply -f calico.yaml</pre><p>Check all pod and wait until all pod is running</p><pre>kubectl get pods --all-namespaces</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PoH6Rx_d2PVObxBS0gKh4w.png" /><figcaption>pod kube-system deployment</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nIf0IKVbTF3mKTswULzxRw.png" /><figcaption>pod kube-system deployment</figcaption></figure><p><em>Your HighAvailability cluster now ready to use.<br>Its important on production grade enterprise implementation to build kubernetes cluster with High Availability infrastructure so no single point of failure.</em></p><p><em>Cheers</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=950cf0660b66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Create Kubernetes Cluster With Containerd]]></title>
            <link>https://medium.com/devopssquare/how-to-create-kubernetes-cluster-with-containerd-90399ec3b810?source=rss-e4633cbb7b57------2</link>
            <guid isPermaLink="false">https://medium.com/p/90399ec3b810</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[containerd]]></category>
            <dc:creator><![CDATA[Mr.Zik]]></dc:creator>
            <pubDate>Thu, 29 Jul 2021 01:56:42 GMT</pubDate>
            <atom:updated>2021-08-06T11:03:41.629Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>At the end of 2021 kubernetes (release v1.22) plans to end support with docker, as can be seen on the kubernetes website <a href="https://kubernetes.io/blog/2020/12/02/dont-panic-kubernetes-and-docker/">https://kubernetes.io/blog/2020/12/02/dont-panic-kubernetes-and-docker/</a></blockquote><p>Here we can use an alternative runtime container, namely<br>- CRI-O<br>- containerda<br>here I will show how to configure the Kubernetes cluster to use <em>containerd</em> as the container runtime<br>in this lab iam using 3 server as follows</p><p>my lab using 3 server as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*tGoAbDe1AGeJD7Iok7RoFw.png" /><figcaption>Server List</figcaption></figure><h3><strong>Step 1. Install and Configure Containerd</strong></h3><p>Do this configuration on all node</p><p>Setup host files so node can communicate each other with names</p><pre>sudo vi /etc/hosts</pre><pre>#Add the following list in the end of line<br>172.16.4.90 kubmaster.demo<br>172.16.4.91 kubworker1.demo<br>172.16.4.92 kubworker2.demo</pre><pre>#save and exit with :wq</pre><p>configure modules required by containerd</p><pre>sudo modprobe overlay<br>sudo modprobe br_netfilter<br>cat &lt;&lt;EOF | sudo tee /etc/modules-load.d/containerd.conf<br>overlay<br>br_netfilter<br>EOF</pre><p>Install containerd service</p><pre>sudo apt-get update<br>sudo apt-get install -y containerd</pre><p>Configure containerd to use systemd as cgroup driver</p><pre>sudo mkdir -p /etc/containerd<br>sudo containerd config default | sudo tee /etc/containerd/config.toml<br>sudo vi /etc/containerd/config.toml</pre><pre>#find the [plugins.&quot;io.containerd.grpc.v1.cri&quot;.containerd.runtimes.runc.options] section and change systemdcgroup to true</pre><pre>SystemdCgroup = true</pre><pre>#save and exit with :wq</pre><p>Restart and enable containerd service</p><pre>sudo systemctl restart containerd<br>sudo systemctl enable containerd</pre><p>Verify containerd configuration</p><pre>sudo containerd config dump</pre><h3>Step 2. install Kubernetes</h3><p>Do this configuration on all nodes</p><p>Configure sysctl</p><pre>cat &lt;&lt;EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf<br>net.bridge.bridge-nf-call-iptables  = 1<br>net.ipv4.ip_forward                 = 1<br>net.bridge.bridge-nf-call-ip6tables = 1<br>EOF</pre><pre>sudo sysctl --system</pre><p>Disable Swap</p><pre>sudo swapoff -a<br>sudo vi /etc/fstab</pre><pre>#comment swap disk<br>#/swap.img       none    swap    sw      0       0</pre><pre>#save and exit :wq</pre><p>Allow required port for kubernetes or Disable Firewall</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*wFMrKzVoFNWTeBxuB-YbEw.png" /></figure><pre>sudo ufw disable</pre><p>Setup iptables backend to use iptables-legacy</p><pre>sudo update-alternatives --config iptables</pre><pre>There are 2 choices for the alternative iptables (providing /usr/sbin/iptables).</pre><pre>Selection    Path                       Priority   Status<br>------------------------------------------------------------<br>  0            /usr/sbin/iptables-nft      20        auto mode<br>* 1            /usr/sbin/iptables-legacy   10        manual mode<br>  2            /usr/sbin/iptables-nft      20        manual mode</pre><pre>Press &lt;enter&gt; to keep the current choice[*], or type selection number:</pre><p>Add kubernetes repository</p><pre>sudo wget <a href="https://packages.cloud.google.com/apt/doc/apt-key.gpg">https://packages.cloud.google.com/apt/doc/apt-key.gpg</a><br>sudo mv apt-key.gpg /etc/apt/trusted.gpg.d/</pre><pre>sudo cat &lt;&lt;EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list<br>deb <a href="https://apt.kubernetes.io/">https://apt.kubernetes.io/</a> kubernetes-xenial main<br>EOF</pre><pre>sudo apt update<br>sudo apt install -y kubeadm kubelet kubectl</pre><p>Enable kubelet service but dont start yet</p><pre>sudo systemctl enable kubelet</pre><h3>Step 3. Kubernetes Cluster Init</h3><p>Do this configuration only on master nodes</p><p>Initialize cluster using containerd as container runtime</p><pre>sudo kubeadm init --pod-network-cidr 192.168.0.0/16 --cri-socket /run/containerd/containerd.sock</pre><p>Note the final result cause we will use it for join worker nodes</p><pre>Your Kubernetes control-plane has initialized successfully!</pre><pre>To start using your cluster, you need to run the following as a regular user:</pre><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><pre>Alternatively, if you are the root user, you can run:</pre><pre>export KUBECONFIG=/etc/kubernetes/admin.conf</pre><pre>You should now deploy a pod network to the cluster.<br>Run &quot;kubectl apply -f [podnetwork].yaml&quot; with one of the options listed at:<br>  <a href="https://kubernetes.io/docs/concepts/cluster-administration/addons/">https://kubernetes.io/docs/concepts/cluster-administration/addons/</a></pre><pre>Then you can join any number of worker nodes by running the following on each as root:</pre><pre>kubeadm join 172.16.4.90:6443 --token 7i34jm.q8enu8wxvfic9s8k \<br>        --discovery-token-ca-cert-hash sha256:202117e62f133323eff707919ec512eef466a59a29454c4ee320a0626ff42c05</pre><p>Create kubeconfig file to use kubectl command</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><h3>Step 4. Join Worker Nodes</h3><p>Do this configuration only on worker nodes</p><p>Paste kubeadm join from the previous result of cluster init and dont forget to use containerd as container runtime</p><pre>sudo kubeadm join 172.16.4.90:6443 --token 7i34jm.q8enu8wxvfic9s8k \<br>        --discovery-token-ca-cert-hash sha256:202117e62f133323eff707919ec512eef466a59a29454c4ee320a0626ff42c05 --cri-socket /run/containerd/containerd.sock</pre><h3>Step 5. Install Calico CNI</h3><p>Do this configuration on master nodes</p><p>install calico cni</p><pre>kubectl apply -f calico.yaml</pre><p>Verify pod status</p><pre>sysadmin@kubmaster:~$ kubectl get pods -n kube-system<br>NAMESPACE     NAME                                      READY   STATUS              RESTARTS   AGE<br>kube-system   calico-kube-controllers-d7c67954f-n5cms   0/1     ContainerCreating   0          74s<br>kube-system   calico-node-c888q                         0/1     PodInitializing     0          74s<br>kube-system   calico-node-llmjp                         0/1     PodInitializing     0          74s<br>kube-system   calico-node-lq8hc                         0/1     Running             0          74s<br>kube-system   coredns-558bd4d5db-4c7gz                  0/1     ContainerCreating   0          20m<br>kube-system   coredns-558bd4d5db-tg5t2                  0/1     ContainerCreating   0          20m<br>kube-system   etcd-kubmaster.demo                       1/1     Running             0          20m<br>kube-system   kube-apiserver-kubmaster.demo             1/1     Running             0          20m<br>kube-system   kube-controller-manager-kubmaster.demo    1/1     Running             0          20m<br>kube-system   kube-proxy-d7cqg                          1/1     Running             0          20m<br>kube-system   kube-proxy-m7pfg                          1/1     Running             1          17m<br>kube-system   kube-proxy-q596m                          1/1     Running             0          5m<br>kube-system   kube-scheduler-kubmaster.demo             1/1     Running             0          20m</pre><p>Wait until all pod running</p><pre>sysadmin@kubmaster:~$ kubectl get pods -n kube-system<br>NAME                                      READY   STATUS    RESTARTS   AGE<br>calico-kube-controllers-d7c67954f-n5cms   1/1     Running   0          2m31s<br>calico-node-c888q                         1/1     Running   0          2m31s<br>calico-node-llmjp                         1/1     Running   0          2m31s<br>calico-node-lq8hc                         1/1     Running   0          2m31s<br>coredns-558bd4d5db-4c7gz                  1/1     Running   0          21m<br>coredns-558bd4d5db-tg5t2                  1/1     Running   0          21m<br>etcd-kubmaster.demo                       1/1     Running   0          21m<br>kube-apiserver-kubmaster.demo             1/1     Running   0          21m<br>kube-controller-manager-kubmaster.demo    1/1     Running   0          22m<br>kube-proxy-d7cqg                          1/1     Running   0          21m<br>kube-proxy-m7pfg                          1/1     Running   1          18m<br>kube-proxy-q596m                          1/1     Running   0          6m17s<br>kube-scheduler-kubmaster.demo             1/1     Running   0          21m<br>sysadmin@kubmaster:~$</pre><p>Verify node status and cluster info</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*kqpZtIREWZsUVUKo7i1kSg.png" /><figcaption>verify cluster</figcaption></figure><p><em>Thats all the basic configuration cluster using containerd as container runtime, in next article i will share how to configure multimaster kubernetes cluster for high availability using containerd as a container runtime.</em></p><p><em>cheers</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90399ec3b810" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devopssquare/how-to-create-kubernetes-cluster-with-containerd-90399ec3b810">How To Create Kubernetes Cluster With Containerd</a> was originally published in <a href="https://medium.com/devopssquare">DevopSquare</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>