<?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 Sanan Shahverdiyev on Medium]]></title>
        <description><![CDATA[Stories by Sanan Shahverdiyev on Medium]]></description>
        <link>https://medium.com/@ssnaan?source=rss-f829a3757b90------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Y3SPQZ_Q1ey9-Hcq989_CQ.jpeg</url>
            <title>Stories by Sanan Shahverdiyev on Medium</title>
            <link>https://medium.com/@ssnaan?source=rss-f829a3757b90------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 17:49:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ssnaan/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[Difference between Docker and Containerd]]></title>
            <link>https://medium.com/@ssnaan/difference-between-docker-and-containerd-106826e4fb7a?source=rss-f829a3757b90------2</link>
            <guid isPermaLink="false">https://medium.com/p/106826e4fb7a</guid>
            <dc:creator><![CDATA[Sanan Shahverdiyev]]></dc:creator>
            <pubDate>Sat, 02 Nov 2024 10:44:29 GMT</pubDate>
            <atom:updated>2024-11-02T10:44:29.018Z</atom:updated>
            <content:encoded><![CDATA[<p>Docker and Containerd are both tools used to manage containers, but they serve different roles in the container ecosystem. Here’s a comparison:</p><h3>1. Purpose and Layer in the Container Stack</h3><ul><li><strong>Docker</strong>: Docker is a comprehensive platform that offers end-to-end solutions for building, shipping, and running containers. It includes high-level APIs and user-friendly commands to manage images, networks, volumes, and the entire lifecycle of containers.</li><li><strong>Containerd</strong>: Containerd is a lightweight, lower-level container runtime that specifically handles container execution and lifecycle management (start, stop, pause, etc.). It was initially developed as a component within Docker, but it is now a separate project under the Cloud Native Computing Foundation (CNCF).</li></ul><h3>2. Functionality</h3><ul><li><strong>Docker</strong>: Includes multiple components, such as:</li><li><strong>CLI</strong> for users to interact with containers.</li><li><strong>Docker Daemon</strong> to manage and create containers.</li><li><strong>Build and Image Management</strong> tools for creating images and managing registries.</li><li><strong>Containerd</strong>: Focuses solely on runtime tasks for managing container lifecycle. It doesn’t handle image building (though it can pull and push images from registries) or have its own CLI (it’s typically used indirectly via tools like Docker or Kubernetes).</li></ul><h3>3. Relationship with Kubernetes</h3><ul><li><strong>Docker</strong>: Docker was initially used as a runtime in Kubernetes clusters. However, Kubernetes deprecated Docker as a direct container runtime in favor of using <strong>Containerd</strong> directly. This change was due to the Kubernetes move towards more specialized, lower-level runtimes that are compatible with the Container Runtime Interface (CRI).</li><li><strong>Containerd</strong>: Fully compatible with Kubernetes as a container runtime due to its adherence to the CRI, making it a preferred choice for Kubernetes setups.</li></ul><h3>4. Performance and Overhead</h3><ul><li><strong>Docker</strong>: Adds some overhead due to additional components (such as the Docker daemon) which are not strictly necessary for running containers in environments like Kubernetes.</li><li><strong>Containerd</strong>: Has a smaller footprint and less overhead since it’s designed to focus purely on container runtime functions. It’s lightweight and efficient for high-scale environments.</li></ul><h3>5. Ecosystem and Community</h3><ul><li><strong>Docker</strong>: Has a broad user base, especially in development and deployment, with robust tooling for managing and orchestrating containers. It’s widely used in non-Kubernetes setups.</li><li><strong>Containerd</strong>: Adopted by Kubernetes and major cloud providers for its simplicity, stability, and efficiency. It’s also used as the foundation in container platforms like Amazon EKS, Google GKE, and Azure AKS.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Gx77Rt1TMRdumVL2.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TNApr_GQH1tjVBGK.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=106826e4fb7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up on-premise Kubernetes cluster (Ubuntu 22.04)]]></title>
            <link>https://medium.com/@ssnaan/setting-up-on-premise-kubernetes-cluster-ubuntu-22-04-d1dafab4ce25?source=rss-f829a3757b90------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1dafab4ce25</guid>
            <category><![CDATA[setup-kubernetes-cluster]]></category>
            <dc:creator><![CDATA[Sanan Shahverdiyev]]></dc:creator>
            <pubDate>Thu, 11 Apr 2024 13:09:45 GMT</pubDate>
            <atom:updated>2024-04-11T13:09:45.305Z</atom:updated>
            <content:encoded><![CDATA[<p>Firstly, create 3 Ubuntu VM in any hypervisor (preferred: Workstation). You should give them hostnames: k8s-master, k8s-worker1, k8s-worker2 (edit /etc/hostname). Run this commands in all VMs:</p><pre>sudo apt update<br>sudo apt upgrade -y<br>sudo reboot</pre><p>master node:</p><pre>sudo hostnamectl set-hostname &quot;k8s-master.kubernetes.local&quot;</pre><p>worker 1</p><pre>sudo hostnamectl set-hostname &quot;k8s-worker1.kubernetes.local&quot;</pre><p>worker 2</p><pre>sudo hostnamectl set-hostname &quot;k8s-worker2.kubernetes.local&quot;</pre><p>In all nodes add this to /etc/hosts file:</p><pre>[master Node IP]     k8s-master.kubernetes.local k8s-master<br>[Worker 1 Node IP]   k8s-worker1.kubernetes.local k8s-worker1<br>[Worker 2 Node IP]   k8s-worker2.kubernetes.local k8s-worker2</pre><p>disable swap and comment swap partition in /etc/fstab in all nodes:</p><pre>sudo swapoff -a<br>sudo nano /etc/fstab<br>#/swap.img       none       swap       sw       0       0<br><br>sudo mount -a</pre><p>Load the following kernel modules on all the nodes:</p><pre>sudo tee /etc/modules-load.d/containerd.conf &lt;&lt;EOF<br>overlay<br>br_netfilter<br>EOF</pre><pre>sudo modprobe overlay<br>sudo modprobe br_netfilter</pre><p>Set the following Kernel parameters for Kubernetes:</p><pre>sudo tee /etc/sysctl.d/kubernetes.conf &lt;&lt;EOF<br>net.bridge.bridge-nf-call-ip6tables = 1<br>net.bridge.bridge-nf-call-iptables = 1<br>net.ipv4.ip_forward = 1<br>EOF<br><br>sudo sysctl --system</pre><p>Install repo from docker.com and install containerd:</p><pre>sudo apt install -y curl gnupg2 software-properties-common apt-transport-https ca-certificates<br>sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/docker.gpg<br>sudo add-apt-repository &quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&quot;<br>sudo apt update<br>sudo apt install -y containerd.io</pre><p>Setup containerd service:</p><pre>containerd config default | sudo tee /etc/containerd/config.toml &gt;/dev/null 2&gt;&amp;1<br>sudo sed -i &#39;s/SystemdCgroup \= false/SystemdCgroup \= true/g&#39; /etc/containerd/config.toml<br>sudo systemctl restart containerd<br>sudo systemctl enable containerd</pre><p>Install kubelet, kubeadm and kubectl:</p><pre>curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg<br>echo &#39;deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /&#39; | sudo tee /etc/apt/sources.list.d/kubernetes.list<br>sudo apt update<br>sudo apt install -y kubeadm=1.28.1-1.1 kubelet=1.28.1-1.1 kubectl=1.28.1-1.1<br>sudo apt-mark hold kubelet kubeadm kubectl</pre><p>Set your pod CIDR, DO THIS IN MASTER NODE:</p><pre>sudo kubeadm init \<br>  --pod-network-cidr=10.10.0.0/16 \<br>  --control-plane-endpoint=k8s-master.kubernetes.local</pre><p>At the output of this command you will get a command that you need to apply in worker nodes to join them to cluster. The command is similar to this: ( This is just example, you should use your own one, as the tokens are different)</p><pre>kubeadm join k8s-master.nvtienanh.local:6443 --token daii9y.g4dq24u6irkz4pt0 \<br>        --discovery-token-ca-cert-hash sha256:58b9cc96ed57a5797fddea653756dbda830efbff55b720a10cffb3948d489148</pre><p>Set your user to be admin IN MASTER NODE:</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>It is needed to download Callico to manage networking in cluster. So in MASTER NODE:</p><pre>curl https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/calico.yaml -O</pre><p>You will get a yaml file. Open it with using any editor, for example nano. Search for ( CTRL + W) “<em>CALICO_IPV4POOL_CIDR” , you will get a result like this:</em></p><pre># The default IPv4 pool to create on startup if none exists. Pod IPs will be<br># chosen from this range. Changing this value after installation will have<br># no effect. This should fall within `--cluster-cidr`.<br># - name: CALICO_IPV4POOL_CIDR<br>#   value: &quot;192.168.0.0/16&quot;<br># Disable file logging so `kubectl logs` works.<br>- name: CALICO_DISABLE_FILE_LOGGING<br>  value: &#39;true&#39;</pre><p>We need to uncomment IPV4POOL section here and add our IPv4 pod CIDR for kubernetes that we declared before, which was 10.10.0.0/16. It should look like this after editing:</p><pre># The default IPv4 pool to create on startup if none exists. Pod IPs will be<br># chosen from this range. Changing this value after installation will have<br># no effect. This should fall within `--cluster-cidr`.<br>- name: CALICO_IPV4POOL_CIDR<br>  value: &#39;10.10.0.0/16&#39;<br># Disable file logging so `kubectl logs` works.<br>- name: CALICO_DISABLE_FILE_LOGGING<br>  value: &#39;true&#39;</pre><p>Save and exit. Then apply this yaml file:</p><pre>kubectl apply -f calico.yaml</pre><p>Wait for some time. Check status of the calico pods in kube-system namespace until they are in running state:</p><pre>kubectl get pods -n kube-system</pre><p>When they are in running state, it is over, your kubernetes cluster is ready to use, check the status of the nodes:</p><pre>kubectl get nodes</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1dafab4ce25" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>