<?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 Rakesh Jain on Medium]]></title>
        <description><![CDATA[Stories by Rakesh Jain on Medium]]></description>
        <link>https://medium.com/@rakeshjain-devops?source=rss-5eeb75480ec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YCVL5OUoFtMfNJ_6vZBRjQ.jpeg</url>
            <title>Stories by Rakesh Jain on Medium</title>
            <link>https://medium.com/@rakeshjain-devops?source=rss-5eeb75480ec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 18:12:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rakeshjain-devops/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[ Securing Your GitHub Code and Repository]]></title>
            <link>https://rakeshjain-devops.medium.com/securing-your-github-code-and-repository-86574cf0a74f?source=rss-5eeb75480ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/86574cf0a74f</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Rakesh Jain]]></dc:creator>
            <pubDate>Tue, 09 Jan 2024 15:24:01 GMT</pubDate>
            <atom:updated>2024-01-09T15:24:01.792Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*CWbYR410z4WN3JntDHlU-w.png" /></figure><p>In this blog post, I will discuss the necessary measures one should implement to ensure the security of your GitHub code and repository.</p><p>1/ ⚙️ Enable Two-Factor Authentication (2FA):</p><p>Strengthen your GitHub account security by enabling 2FA. Go to Settings &gt; Security &gt; Two-factor authentication. Use an authentication app for an added layer of protection.</p><p>2/ 🛑 Avoid Hardcoding Secrets:</p><p>Never hardcode sensitive information like API keys or passwords in your code. Use environment variables or secure vaults.</p><p>3/ 🚨 Private Repositories:</p><p>For sensitive projects, use private repositories. Public repositories are visible to everyone; private ones restrict access.</p><p>4/ 🚥 Branch Protection Rules:</p><p>Set up branch protection rules to prevent force pushes and ensure a clean history. This adds a layer of control and security.</p><p>5/ 🚫 Limit Access:</p><p>Grant access only to necessary collaborators. Use team permissions wisely, and regularly review and revoke access for inactive members.</p><p>6/ 🛡️ Code Scanning and Dependabot:</p><p>GitHub provides tools like Code Scanning and Dependabot to identify and fix vulnerabilities in your code and dependencies. Enable them in your repository settings.</p><p>7/ 📅 Regularly Update Dependencies:</p><p>Keep your dependencies up-to-date to patch vulnerabilities. Dependabot can automate this process for you.</p><p>8/ 📜 License Management:</p><p>Use licenses to control how others can use, modify, and distribute your code. Choose a license that aligns with your project goals.</p><p>9/ 🔄 Regular Backups:</p><p>Periodically backup your repositories. GitHub provides an “Export repository” feature in your repository settings.</p><p>10/ 🔄 Regular Security Audits:</p><p>Conduct regular security audits of your codebase. Tools like GitHub Security Advisories can help track and resolve vulnerabilities.</p><p>11/ 🚀 Use Webhooks for Monitoring:</p><p>Set up webhooks to monitor repository activities. Receive alerts for any suspicious activity.</p><p>12/ 🤖 Automated Testing:</p><p>Implement automated testing for your code. Continuous Integration (CI) tools like GitHub Actions can help ensure code quality and security.</p><p>13/ 🌐 Use HTTPS:</p><p>Clone repositories using HTTPS rather than SSH for added security. HTTPS uses your GitHub credentials, while SSH uses SSH keys.</p><p>14/ 🧑‍💻 Educate Collaborators:</p><p>Train your collaborators on security best practices. Awareness is key in maintaining a secure development environment.</p><p>15/ 🌐 Monitor Third-Party Integrations:</p><p>Review and monitor third-party applications and integrations connected to your GitHub account. Revoke access for any unnecessary or unused integrations.</p><p>16/ 🚦 Security Advisories:</p><p>Keep an eye on GitHub Security Advisories for any reported vulnerabilities in the libraries or tools you use.</p><p>Stay secure and happy coding! 🔒👩‍💻👨‍💻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86574cf0a74f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Kubernetes v1.27 on RHEL]]></title>
            <link>https://rakeshjain-devops.medium.com/installing-kubernetes-v1-27-on-rhel-e2b68acd8500?source=rss-5eeb75480ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2b68acd8500</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[redhat-linux]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Rakesh Jain]]></dc:creator>
            <pubDate>Fri, 26 May 2023 13:21:23 GMT</pubDate>
            <atom:updated>2023-05-26T13:21:23.398Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CzPEUkYfM9z-V-FR" /></figure><p>Here is a step-by-step process of installing Kubernetes 1.27 via Kubeadm on RHEL.</p><p><strong>1:</strong> <strong>Installing Kubeadm Dependencies to start —</strong></p><p>To start, make sure you have a RHEL machine ready. Install the necessary dependencies:</p><pre>$ sudo yum install -y docker kubelet kubeadm<br>$ sudo systemctl enable docker &amp;&amp; sudo systemctl start docker<br>$ sudo systemctl enable kubelet &amp;&amp; sudo systemctl start kubelet</pre><p><strong>2: Initializing the Master Node<br></strong>On the master node, initialize Kubernetes using Kubeadm:</p><pre>$ sudo kubeadm init</pre><p>This command will generate a token that you’ll need to join worker nodes to the cluster.</p><p><strong>3: Configuring the Master Node<br></strong>Once the initialization completes, follow the on-screen instructions to configure the Kubernetes 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><strong>4: Deploying a Pod Network<br></strong>Next, choose a pod network add-on. Popular options are Calico, Flannel, and Weave. Let’s use Calico:</p><pre>$ kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml</pre><p>Wait for the Calico pod network to be deployed and ready.</p><p><strong>5: Joining Worker Nodes<br></strong>On each worker node, join the cluster using the generated token from step2 :</p><pre>$ sudo kubeadm join &lt;master-node-ip&gt;:&lt;master-node-port&gt; --token &lt;token&gt; --discovery-token-ca-cert-hash &lt;hash&gt;</pre><p><strong>6: Verifying Cluster Status</strong><br>Back on the master node, run the following command to check the cluster’s health:</p><pre>$ kubectl get nodes</pre><p>You should see all the nodes in the “Ready” state.</p><p><strong>7: Managing the Cluster as a Regular User<br></strong>By default, you cannot manage the cluster as a regular user. To change that, run:</p><pre>$ kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=&lt;your-username&gt;</pre><p><strong>8: Configuring Network Routes (Optional)<br></strong>If you encounter issues with network routing, you may need to adjust the network configuration. Consult your network admin or refer to Kubernetes documentation for guidance.</p><p><strong>9: Scaling the Cluster (Optional)<br></strong>To add more worker nodes later, use the same join command from step 5 on each new node.</p><p><strong>10: Congratulations!</strong></p><p>You’ve successfully installed Kubernetes 1.27 via Kubeadm on RHEL. Enjoy managing your cluster and deploying applications!</p><h4><strong>Here are a few additional steps you can include after Step 10:</strong></h4><p><strong>11: Exposing the Kubernetes API Server</strong></p><p>By default, the Kubernetes API server is only accessible on the master node. If you want to expose it externally, you can configure a load balancer or use a tool like Nginx to proxy requests to the API server. Consult the Kubernetes documentation for detailed instructions.</p><p><strong>12: Securing the Cluster<br> </strong><br>To enhance the security of your cluster, consider implementing RBAC (Role-Based Access Control), enabling audit logging, and enforcing network policies. These measures help protect your Kubernetes environment from unauthorized access and potential security breaches.</p><p><strong>13: Upgrading Kubernetes</strong></p><p>As new versions of Kubernetes are released, you might want to upgrade your cluster. Before proceeding, review the upgrade documentation provided by the Kubernetes project. Upgrading involves updating the Kubeadm tool and following a specific procedure to ensure a smooth transition to the new version.</p><p>Remember, these additional steps are optional and depend on your specific requirements.</p><h4><strong>Firewall Considerations:</strong></h4><p>Adjusting firewall rules is an important step when installing Kubernetes on RHEL. By default, RHEL has a firewall (iptables or firewalld) enabled that may block certain network traffic required for Kubernetes to function properly. Here’s what you need to consider:</p><p><strong>1: Master Node Firewall Rules:</strong></p><p>Allow inbound traffic on specific ports:</p><ul><li>API Server: TCP port 6443 (kube-apiserver)</li><li>etcd Server: TCP port 2379 (etcd), 2380 (etcd peer communication)</li><li>Kubelet API: TCP port 10250</li><li>Control Plane: TCP port range 10251–10252 (kube-scheduler, kube-controller-manager)</li></ul><p>Optionally, allow inbound traffic for any other services you want to expose externally, such as load balancers or ingress controllers.</p><p><strong>2: Worker Node Firewall Rules:</strong></p><p>Allow inbound traffic on specific ports:</p><ul><li>Node Port Services: TCP port range 30000–32767 (configured in Kubernetes service definitions)</li><li>Kubelet API: TCP port 10250</li></ul><p>Optionally, allow inbound traffic for any other services required by your applications.</p><p><strong>3: Inter-Node Communication:</strong></p><ul><li>Allow internal communication between nodes. This usually involves opening ports for the CNI (Container Network Interface) plugin you’re using, such as Calico, Flannel, or Weave.</li></ul><p><strong>4: DNS Resolution:</strong></p><ul><li>Ensure DNS resolution is allowed for cluster components to communicate with each other. By default, DNS uses TCP/UDP port 53.</li></ul><p><strong>It’s important to note</strong> that the specific firewall configuration depends on your network setup and security policies. Consult your network administrator or security team for guidance on configuring firewall rules in your environment.</p><p>By adjusting the firewall rules appropriately, you ensure that the necessary network communication between Kubernetes components and your applications can occur without any interruptions.</p><p>That’s all! Let me know if there’s anything else I can assist you with!</p><p>Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2b68acd8500" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connect with GitHub using SSH]]></title>
            <link>https://rakeshjain-devops.medium.com/connect-with-github-using-ssh-bb1aeb48e869?source=rss-5eeb75480ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb1aeb48e869</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ssh]]></category>
            <dc:creator><![CDATA[Rakesh Jain]]></dc:creator>
            <pubDate>Fri, 01 Oct 2021 19:27:23 GMT</pubDate>
            <atom:updated>2021-10-04T06:09:24.234Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3EiizumdPvnYBJqPwP8BZg.png" /></figure><p>You can connect to GitHub using the Secure Shell Protocol (SSH), which provides a secure channel over an unsecured network.</p><p>This is a step by step guide to configure ssh connection with your GitHub account.</p><h3>STEP 1 — Check if you already have SSH keys</h3><p>Before generating a new SSH key, you should check if you have any existing SSH keys.</p><pre>root@lco-linux-worker1:~# ls -la .ssh/<br>total 24<br>drwx------ 2 root root 4096 Oct  1 17:52 .<br>drwx------ 9 root root 4096 Oct  1 18:11 ..<br>-rw------- 1 root root  993 Apr 13 12:18 authorized_keys<br>-rw-r--r-- 1 root root 1326 Oct  1 17:58 known_hosts</pre><p>Check the .ssh directory listing to see if you already have a public SSH key. By default, the filenames of the public keys are one of the following:</p><ul><li><em>id_rsa.pub</em></li><li><em>id_ecdsa.pub</em></li><li><em>id_ed25519.pub</em></li></ul><p>As we can see above we don’t have any existing ssh keys available to connect to GitHub. So we will have to generate a new one.</p><h3>STEP 2— Generating a new SSH key</h3><p>Run the following command to generate the new ssh key pair.</p><pre>root@lco-linux-worker1:~/.ssh# ssh-keygen</pre><pre>root@lco-linux-worker1:~/.ssh# ls<br>authorized_keys  id_rsa  id_rsa.pub</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*U24GjQ_euzBGFOIk45edtw.png" /></figure><blockquote>To generate RSA 4096 bit key (as it provides a reasonable increase in strength over a 2048 bit key) run the following command:</blockquote><blockquote>ssh-keygen -t rsa -b 4096</blockquote><p>Now you can see see a public and private key pair listed (`<em>id_rsa.pub`</em> and `<em>id_rsa`</em>) that you would like to use to connect to GitHub.</p><h3>STEP 3 — Adding your SSH key to the ssh-agent</h3><p><strong>First you need to start the ssh-agent in the background:</strong></p><pre># eval &quot;$(ssh-agent -s)&quot;<br>Agent pid 2020</pre><p><strong>Add your SSH private key to the ssh-agent:</strong></p><pre># ssh-add /root/.ssh/id_rsa</pre><p><strong>Verify the key fingerprint added:</strong></p><pre># ssh-add -l -E sha256</pre><pre># ssh-keygen -l -f id_rsa</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nO3G7DZg4TcajwAPrRAwlg.png" /></figure><h3>STEP 4 — Add the SSH key to your account on GitHub</h3><ul><li>First Copy the SSH public key to your clipboard</li><li>In the upper-right corner of any page, click your profile photo, then click Settings.</li><li>In the user settings sidebar, click SSH and GPG keys.</li><li>Click New SSH key or Add SSH key.</li><li>In the “Title” field, add a descriptive label for the new key for example here I’ve added the system hostname “lco-linux-worker1” and then Click Add SSH key.</li><li>If prompted, confirm your GitHub password.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AnPrYyOIoZ82Q01g22XkwQ.png" /></figure><h3>STEP 5 — Verify the SSH connectivity from the client system</h3><p>Run the following command to verify the Git SSH connectivity.</p><pre># ssh -T <a href="/service/mailto:git@github.com">git@github.com</a></pre><p>You may see a warning like this:</p><pre>&gt; The authenticity of host &#39;github.com (IP ADDRESS)&#39; can&#39;t be established.<br>&gt; RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.<br>&gt; Are you sure you want to continue connecting (yes/no)?</pre><p>Verify that the fingerprint in the message you see matches GitHub’s RSA public key fingerprint. If it does, then type yes and that’s all!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N1S-b3DsodNrdWW4ymbZUw.png" /></figure><p>Now you can perform various Git operations like cloning, push, pull, commit etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rGrOjdDDCUhLq9WfLv84Rg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*TYBogiwHMWWuv9ANcI_jjw.png" /></figure><h3>Using SSH over the HTTPS port</h3><p>Sometimes, firewalls refuse to allow SSH connections entirely. If using HTTPS cloning with credential caching is not an option, you can attempt to clone using an SSH connection made over the HTTPS port. Most firewall rules should allow this, but proxy servers may interfere.</p><p>To test if SSH over the HTTPS port is possible, run this SSH command:</p><pre># ssh -T -p 443 git@ssh.github.com</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mjmRUt5jzwPCbUxJrL3Pow.png" /></figure><h3>Enabling SSH connections over HTTPS</h3><p>If you are able to SSH into git@ssh.github.com over port 443, you can override your SSH settings to force any connection to GitHub to run through that server and port.</p><p><strong>To set this in your ssh config, edit the file at </strong><strong>~/.ssh/config, and add this section:</strong></p><pre># touch .ssh/config<br># chmod 600 .ssh/config<br></pre><pre># cat &gt; .ssh/config<br>Host github.com<br>Hostname ssh.github.com<br>Port 443<br>User git</pre><pre># ssh -T git@github.com</pre><p><strong>You can test this by connecting once more to GitHub:</strong></p><pre>$ ssh -T git@github.com<br>Hi DevopsVlogger! You&#39;ve successfully authenticated, but GitHub does not provide shell access</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rv1JFKnugGzASxWwyCL6VA.png" /></figure><h3>Known Errors</h3><p><strong>Error — <br>Github permission denied: ssh add agent has no identities:</strong></p><p><strong>Reason — </strong><br>When ssh-add -l returns “The agent has no identities”, it means that keys used by ssh (stored in files such as ~/.ssh/id_rsa, ~/.ssh/id_dsa, etc.) are either missing, they are not known to ssh-agent, which is the authentication agent, or that their permissions are set incorrectly (for example, world writable).</p><p><strong>Solution — </strong><br>If your keys are missing or if you have not generated any, use ssh-keygen -t rsa, then ssh-add to add them.<br>If keys exist but are not known to ssh-agent (like if they are in a non-standard folder), use ssh-add /path/to/my-non-standard-ssh-folder/id_rsa to add them.</p><p>That is all!</p><p>Hope you like the tutorial. Stay tuned and don’t forget to provide your feedback in the response section.</p><p>Happy Learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb1aeb48e869" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to install and use homebrew! A Mac OSX Package Manager]]></title>
            <link>https://rakeshjain-devops.medium.com/how-to-install-and-use-homebrew-a-mac-osx-package-manager-5e4fbb2a4aaa?source=rss-5eeb75480ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e4fbb2a4aaa</guid>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[package-management]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Rakesh Jain]]></dc:creator>
            <pubDate>Wed, 22 Sep 2021 09:08:31 GMT</pubDate>
            <atom:updated>2021-09-22T09:08:31.801Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_v0N20iyYg9cKGMTb1LV2w.png" /></figure><h3><strong><em>What is Homebrew?</em></strong></h3><p><strong><em>homebrew</em></strong> is known as “The Missing Package Manager for macOS”.</p><p>It is used to install the UNIX tools Apple didn’t include with macOS in an extremely easy and flexible manner.</p><h3>Prerequisites</h3><ul><li>A 64-bit Intel CPU or Apple Silicon CPU</li><li>macOS Mojave (10.14) (or higher)</li><li>Command Line Tools (CLT) for Xcode: xcode-select --install, <a href="https://developer.apple.com/downloads"><strong>developer.apple.com/downloads</strong></a> or <a href="https://itunes.apple.com/us/app/xcode/id497799835"><strong>Xcode</strong></a> <a href="https://docs.brew.sh/Installation#3"><strong>3</strong></a></li></ul><h3>How to install it on MacOSX?</h3><p>Install <strong>xcode</strong> developer tools.</p><pre>rakesh_jain@my-mac ~ % xcode-select --install</pre><p>Now install homebrew:</p><pre>rakesh_jain@my-mac ~ % /bin/bash -c &quot;$(curl -fsSL <a href="https://raw.githubusercontent.com/Homebrew/install/master/install.sh">https://raw.githubusercontent.com/Homebrew/install/master/install.sh</a>)&quot;</pre><p>You will be prompted to enter sudo password a few times during the installation process.</p><p><strong>Verify the installation:</strong></p><pre>rakesh_jain@my-mac ~ % brew --version</pre><pre>Homebrew 3.2.13</pre><pre>Homebrew/homebrew-core (git revision 753dedc193; last commit 2021-09-22)</pre><h3>Homebrew Shell Completion — BASH / ZSH</h3><p>Homebrew comes with completion definitions for the brew command.</p><p>zsh, bash and fish are currently supported.</p><h4>If you have zsh shell -&gt;</h4><pre>rakesh_jain@my-mac ~ % echo $SHELL<br>/bin/zsh</pre><p>To make Homebrew’s completions available in zsh, you must get the Homebrew-managed zsh site-functions on your FPATH before initialising zsh’s completion facility. Add the following to your ~/.zshrc file:</p><pre>rakesh_jain@my-mac ~ % cat .zshrc <br>if type brew &amp;&gt;/dev/null<br>then<br>  FPATH=&quot;$(brew --prefix)/share/zsh/site-functions:${FPATH}&quot;</pre><pre>autoload -Uz compinit<br>  compinit<br>fi</pre><h4>If you have bash shell -&gt;</h4><p>To make Homebrew’s completions available in bash, you must source the definitions as part of your shell’s startup. Add the following to your ~/.bash_profile (or, if it doesn’t exist, ~/.profile):</p><pre>rakesh_jain@my-mac ~ % cat .bash_profile</pre><pre><strong>if </strong>type brew &amp;&gt;/dev/null<br><strong>then<br>  </strong>HOMEBREW_PREFIX<strong>=</strong>&quot;$(brew --prefix)&quot;<br>  <strong>if</strong> <strong>[[</strong> -r &quot;<strong>${</strong>HOMEBREW_PREFIX<strong>}</strong>/etc/profile.d/bash_completion.sh&quot; <strong>]]</strong><br>  <strong>then<br>    </strong>source &quot;<strong>${</strong>HOMEBREW_PREFIX<strong>}</strong>/etc/profile.d/bash_completion.sh&quot;<br>  <strong>else<br>    for </strong>COMPLETION <strong>in</strong> &quot;<strong>${</strong>HOMEBREW_PREFIX<strong>}</strong>/etc/bash_completion.d/&quot;<strong>*</strong><br>    <strong>do</strong><br>      <strong>[[</strong> -r &quot;<strong>${</strong>COMPLETION<strong>}</strong>&quot; <strong>]]</strong> <strong>&amp;&amp;</strong> source &quot;<strong>${</strong>COMPLETION<strong>}</strong>&quot;<br>    <strong>done<br>  fi<br>fi</strong></pre><p>If you install the bash-completion formula, this will automatically source the completions’ initialisation script (so you do not need to follow the instructions in the caveats).</p><h3>How to install unix tools with homebrew ?</h3><p>The homebrew is now installed on you system and you can use it to install various unix tools.</p><p><strong>Syntax:</strong></p><pre>rakesh_jain@my-mac ~ % brew install &lt;package_name&gt;</pre><p>For example here I will be installing <strong><em>ansible</em></strong> configuration management tool on my Mac Book:</p><pre>rakesh_jain@my-mac ~ % brew install ansible</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ajPKkAa9_9EG9VWgT6ix3A.png" /></figure><h3>How to search package with homebrew?</h3><p>You can search or list available packages by running following commands :</p><p><strong>Syntax:</strong></p><pre>rakesh_jain@my-mac ~ % brew search &lt;package_name&gt;</pre><p><strong>Example:</strong></p><pre>rakesh_jain@my-mac ~ % brew search docker<br>==&gt; Formulae<br>docker                              docker-credential-helper-ecr        docker-machine-driver-vmware        docker-squash<br>docker-clean                        docker-gen                          docker-machine-driver-vultr         docker-swarm<br>docker-completion                   docker-ls                           docker-machine-driver-xhyve         docker2aci<br>docker-compose                      docker-machine                      docker-machine-nfs                  dockerize<br>docker-compose-completion           docker-machine-completion           docker-machine-parallels            lazydocker<br>docker-credential-helper            docker-machine-driver-hyperkit      docker-slim                         mockery<br>==&gt; Casks<br>homebrew/cask-versions/docker-edge              homebrew/cask/docker                            homebrew/cask/docker-toolbox</pre><p>That’s all!</p><p>Hope you like the tutorial. Stay tuned and don’t forget to provide your feedback in the response section.</p><p>Happy Learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e4fbb2a4aaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configure Automatic DB Backups with email alert notifications]]></title>
            <link>https://rakeshjain-devops.medium.com/configure-automatic-db-backups-and-email-notifications-d8299f8d32d1?source=rss-5eeb75480ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8299f8d32d1</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[backup]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Rakesh Jain]]></dc:creator>
            <pubDate>Thu, 24 Jun 2021 14:29:35 GMT</pubDate>
            <atom:updated>2021-06-25T13:06:50.090Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nWq8YPBG0wSEa7lu5E1y9A.jpeg" /></figure><p>We all know the importance of highly available databases. The DB downtime can lead to unimaginable losses in revenue and reputation as well.</p><p>This guide will demonstrate the easiest way to configure database backups locally and sending alert notification after each run. Ideally we should always backup mission critical databases on to remote servers.</p><h3>My setup:</h3><p><strong>OS:</strong> Ubuntu 20.04 LTS Server <br><strong>DB:</strong> Postgres psql (PostgreSQL) 12.6 (Ubuntu 12.6–0ubuntu0.20.04.1)<br><strong>Application: </strong>Running an open-source IPAM/DCIM application called NetBox.<br><strong>DB Name:</strong> netbox</p><h3>Backup Script</h3><p>Following is my backup script which will take the netboxdatabase backup and save the sql dump file locally at /opt/netbox/dumps/ location.</p><blockquote><strong>PostgreSQL</strong> provides the <strong>pg_dump</strong> utility to back up databases.</blockquote><pre>#!/bin/bash</pre><pre># You should eventually backup remotely</pre><pre># Backup Folder name<br><strong>backupfolder</strong>=/opt/netbox/dumps</pre><pre># Notification email address<br><strong>recipient_email</strong>=test_user@example.com</pre><pre># MySQL user<br><strong>user</strong>=postgres</pre><pre>sudo -u $user /usr/bin/pg_dump netbox &gt; $backupfolder/netbox.$(date +%Y%m%d-%H%M%S).sql</pre><pre>if [[ $? -eq &quot;0&quot; ]]; then</pre><pre>echo -e  &quot;NetBox Data backup is successful&quot; | mail -s &quot;NetBox db backup is successful&quot; $recipient_email</pre><pre>else</pre><pre>echo &quot;Failed to produce NetBox data backup&quot; | mail -s &quot;Please have a look. NetBox db backup task failed!&quot; $recipient_email</pre><pre>fi</pre><blockquote>To backup all the databases you can use <strong>pg_dumpall</strong> command.</blockquote><h3>Configure Email Alerting</h3><p>To send email notifications we need to configure <strong>Postfix on a null client.</strong></p><blockquote>A null client is a machine that can only send mail. It receives no mail from the network, and it does not deliver any mail locally. A null client typically uses POP, IMAP or NFS for mailbox access.</blockquote><h4>Steps to configure Alerting:</h4><ol><li>Install mailutils and postfixpackage.</li></ol><pre>apt-get install mailutils postfix</pre><p>2. Configure /etc/postfix/main.cf</p><p>Configure following parameters in postfix main.cf file.</p><pre><strong>myhostname = labs-netbox.example.com</strong><br>alias_maps = hash:/etc/aliases<br>alias_database = hash:/etc/aliases<br><strong>myorigin = example.com<br>mydestination =</strong><br><strong>relayhost = smtp.example.com</strong><br>mailbox_size_limit = 0<br>recipient_delimiter = +<br><strong>inet_interfaces = loopback-only<br>inet_protocols = all</strong></pre><p>3. Restart the postfix service</p><pre>systemctl restart postfix</pre><p>Below is the email alert notification sample.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eYESBsq6b5-F50Ah6JESoA.png" /></figure><h3>Schedule the backup task to run daily at midnight</h3><pre>root@labs-netbox:/opt/netbox# crontab -l<br>@daily /opt/netbox/backup.sh</pre><p>The above crontab entry make sure that the backup script runs every midnight.</p><h3><strong>Delete old backups</strong></h3><p>Along with the above I have scheduled a <strong>backup retention task </strong>as well. All the database backup files older than 30 days will be deleted.</p><pre>root@labs-netbox:/opt/netbox# crontab -l<br>@daily /opt/netbox/backup.sh</pre><pre><strong>0 0 * * 0 /usr/bin/find /opt/netbox/dumps/ -type f -mtime +30 -exec rm -rf {} +</strong></pre><p>That’s all!</p><p>Hope you like the tutorial. Stay tuned and don’t forget to provide your feedback in the response section.</p><p>Happy Learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8299f8d32d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Multi-cloud and why it is getting so much attention?]]></title>
            <link>https://rakeshjain-devops.medium.com/what-is-multi-cloud-and-why-it-is-getting-so-much-attention-61f8c470e5f0?source=rss-5eeb75480ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/61f8c470e5f0</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloud-services]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Rakesh Jain]]></dc:creator>
            <pubDate>Wed, 19 May 2021 10:20:49 GMT</pubDate>
            <atom:updated>2021-05-19T11:05:02.558Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0zc578_L7fHVOK8ZNkQ6iA.png" /><figcaption>PS: Oracle Blogs</figcaption></figure><p>It’s been a long time I’ve written a story on Medium. Here I am back again.</p><p>Today we will discuss about a new cloud adoption approach (not that new by the way) I would say not much experienced.</p><p>The Multi-Cloud!</p><h3>What is Multi-Cloud?</h3><p>As name suggests the Multi-cloud is a strategy where we use two or more cloud computing services from any number of different cloud vendors in a single unified network architecture.</p><p>It’s different then hybrid cloud where we integrate public and private clouds in order to achieve optimal performance, security and flexibility.</p><p>Multi-cloud is when an organizations selects different cloud providers for their various infrastructure and application needs.</p><h3>Why it is getting so much attention?</h3><p>There are multiple reasons to this.</p><ul><li>Cost effectiveness / Competitive Pricing</li><li>Eliminate the reliance on any single cloud provider (avoid lock-ins)</li><li>Ensures high availability!</li><li>Enhanced Risk Management (in case of an attack on one vendor we can always switch to another vendor without any disruption)</li><li>Global compliance can be achieved</li><li>Improved user experience</li><li>Optimal Performance</li><li>Lower Latency</li></ul><h3>What challenges it brings in?</h3><p>Not everything is green here. This strategy comes up with a unique set of challenges which organizations have to face.</p><ul><li><strong>Security</strong><br>We can have additional security concerns here as we know the traditional security tools aren’t that mature to protect you from all potential threats. Considering the type of attacks we are seeing these days are very sophisticated in nature. The multi-cloud approach increases the risk with having complex application deployed over multiple cloud vendors. It opens up a larger attack surface. To counter this one should have a multi-layered security approach and a mix set of vendor experts.</li><li><strong>Management Overhead<br></strong>It’s obvious that when you use services from more than one cloud vendors it will increase your management complexity. <br>few such examples are like: OS patching, Application and service monitoring, Log management spread across multiple environments, backups etc..</li><li><strong>Competent Staffing<br></strong>Finding people having expertise in multi-cloud is very very difficult as of today. There has to be mix of people experts in development on multiple cloud platforms, the security specialists and one who can manage and operate across multiple clouds.</li><li><strong>Migration takes time!</strong></li><li><strong>Complex Cost estimation process<br></strong>There again you need to have proper talent who can plan and strategize the costing part of your project. Though multi-cloud approach can save you money but it becomes complex at times.</li></ul><h3>What it takes to move to Multi-Cloud?</h3><p>If your company has decided to adopt Multi-cloud approach for your heterogeneous infrastructure following are the things which you need to take care of.</p><ul><li>Bring in individual cloud experts together</li><li>Plan the whole infrastructure in advance</li><li>Do cost estimations in prior</li><li>Build DevOps pipelines</li><li>Cloud Performance Monitoring</li></ul><p>As far I understand Multi-Cloud has a huge market scope given we together overcome the disadvantages and make most out of this approach.</p><p>That’s all for this small article.</p><p>Thank you All!</p><p>Hope you like the article. Don’t forget to like, share and follow my handle for more updates.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61f8c470e5f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[List of Mail Servers of Popular Online email providers]]></title>
            <link>https://rakeshjain-devops.medium.com/list-of-mail-servers-of-popular-online-email-providers-555d5dc17f46?source=rss-5eeb75480ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/555d5dc17f46</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[mail]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Rakesh Jain]]></dc:creator>
            <pubDate>Sat, 10 Apr 2021 08:24:20 GMT</pubDate>
            <atom:updated>2021-04-10T09:32:22.753Z</atom:updated>
            <content:encoded><![CDATA[<h3>List of Mail Servers of all Popular Online email providers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*feD9x-ELZkkJOyYNdDEjEw.png" /></figure><p>A DevOps aspirant who is learning about Continuous Integration and Continuous Deployment using Jenkins. There may be someone who is learning about Monitoring with Prometheus and Alert Manager.</p><p>While learning all these tools and technologies the most important thing is <strong>“how you are going to send out notifications to users regarding your jobs/builds status (failed or successful).”</strong> The recommended way is to send out an email notification to a Project/Team’s distribution list (DL) or to the maintainer of the project. In companies you might have your own SMTP servers and clients configured and can get access to the information by quickly asking your admin teams.</p><p>The problem comes when you are practicing these things at you own lab setups, you need to rely on the Public Online email providers such as Google’s Gmail, Yahoo Mail, Outlook and so on.</p><p>And you can’t go to their portals every time to read &amp; send emails. You are going to use a local email client such as Outlook Express, Microsoft Outlook, Thunderbird etc..</p><p>To configure such a setup, your email software should be configured with the incoming and outgoing mail servers of your email provider (Gmail, Outlook, Office365, Yahoo! Mail etc.).</p><h3>A Brief intro about the terms involved here</h3><h3>SMTP</h3><p>The Simple Mail Transfer Protocol is an internet standard communication protocol for electronic mail transmission. Most of the internet systems use <strong>SMTP</strong> as a method to transfer mail from one user to another.</p><h3>POP vs. IMAP</h3><p>POP (Post Office Protocol) and IMAP (Internet Message Access Protocol) are two different ways to get email in your email program.</p><h3>Port Numbers</h3><p>Your email port is how email moves from one email server to another.</p><h3>List of SMTP, IMAP, POP3 Email Ports and Servers of these popular Online email providers</h3><h4>Standard/Default Mail server Ports</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3OqIgLJNF6RX3Y3SbZVZTQ.png" /></figure><h4>Outlook.com</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8m-TBzwkFqZMyGpo_Fp0pA.png" /></figure><h4>Google’s Gmail</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SfQvsanCPkx2UYEPQQrcuQ.png" /></figure><h4>Office365.com</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PM03OjqNWoO3nDaaYMNCPQ.png" /></figure><h4>Yahoo Mail</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QRp4cK4SIaeqPL1zkBBuMA.png" /></figure><h4>Mail.com</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m5hGVRe_kwLePzlbCzi1ug.png" /></figure><h4>Hotmail</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lVrHRpuaajVrE3KKLOHHTA.png" /></figure><h4>AOL.com</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z2M3S-kU4-jtSLipE9wmMg.png" /></figure><h4>Comcast</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*78Y1DDRe1KKZ90FAMW94FA.png" /></figure><h3>Email Notification Settings in my Jenkins Server</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6YHcjFahz6fdwZQMYLeHzw.png" /></figure><p>That’s all!</p><p>Thanks for reading.</p><p>Hope you like the article. Please let me know your feedback in the response section.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=555d5dc17f46" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configure Bash Auto Completion (Tab Completion) on Linux]]></title>
            <link>https://faun.pub/configure-bash-auto-completion-tab-completion-on-linux-db0d9310818b?source=rss-5eeb75480ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/db0d9310818b</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[centos]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Rakesh Jain]]></dc:creator>
            <pubDate>Fri, 02 Apr 2021 09:58:11 GMT</pubDate>
            <atom:updated>2021-04-08T14:18:07.843Z</atom:updated>
            <content:encoded><![CDATA[<h3>Configure Bash Auto-Completion (Tab Completion) on Linux</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*31i-c6_ScmVNRsPLSQIoqA.png" /></figure><p>What to do when the auto-completion of bash shell commands are not working. It’s something which we expect these days to happen by default.</p><p>In this short tutorial, I will demonstrate how we can enable auto-completion on Ubuntu and CentOS systems.</p><h3>Enable Bash Auto Completion on CentOS Linux</h3><p>Please follow the below steps one by one to enable Auto completion.</p><h4>Step 1: Enable/Install EPEL repository</h4><pre>yum -y install epel-release</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hIo8QBP5IN1NeGj1wuAjMQ.png" /></figure><h4>Step 2: Install bash-completion packages</h4><pre>yum install bash-completion bash-completion-extras -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kjZSN3wqS4HewiaBvNSygw.png" /></figure><h4>Step 3: Locate and Enable bash-completion</h4><pre>locate bash_completion.sh</pre><pre>updatedb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qPmmbIQdIZbZLwfEXORkNw.png" /></figure><pre>source /etc/profile.d/bash_completion.sh</pre><pre>logout</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ETF_-bzWa-8vGno8BA1lIQ.png" /></figure><p>Now the <strong>auto-completion</strong> should be working on your server.</p><h4>Step 4: Verify the working</h4><p>Press starting characters of any command and press tab you will see command completions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bX09Aqo2haSbXj-qufYNwQ.png" /></figure><h3>Enable Bash Auto Completion on Ubuntu Linux</h3><p>Please follow the below steps one by one to enable Auto completion on Ubuntu.</p><h4>Step 1: Install bash-completion package</h4><pre>apt-get install bash-completion -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Oqp5LVNOKqbB5V2e6VR-g.png" /></figure><h4>Step 2: Update .bashrc file</h4><p>By now you will have `/etc/profile.d/bash_completion.sh` file in your system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QEWZKId9Ot2tFu-EdkxcNA.png" /></figure><p>Source this file from either <em>~/.bashrc or ~/.bash_profile.</em></p><pre>echo &quot;source /etc/profile.d/bash_completion.sh&quot; &gt;&gt; ~/.bashrc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJaf5Y3fJXlcvPaPotbhwQ.png" /></figure><h4>Step 3: Logout and Login Back to experience it</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X5twe8fhqB3A8ePiMPrtrw.png" /></figure><p>If you want this to be enabled in the current session you can source it directly from the command line.</p><pre>source /etc/profile.d/bash_completion.sh</pre><p>That’s all!</p><p>Thanks for reading.</p><p>Hope you like the article. Please let me know your feedback in the response section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p>👋 <a href="https://faun.dev/join"><strong>Join FAUN today and receive similar stories each week in your inbox!</strong></a><strong> </strong>️ <strong>Get your weekly dose of the must-read tech stories, news, and tutorials.</strong></p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db0d9310818b" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/configure-bash-auto-completion-tab-completion-on-linux-db0d9310818b">Configure Bash Auto Completion (Tab Completion) on Linux</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Download files and directories from web using curl and wget]]></title>
            <link>https://rakeshjain-devops.medium.com/download-files-and-directories-from-web-using-curl-and-wget-9217bc2e34c9?source=rss-5eeb75480ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/9217bc2e34c9</guid>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[download]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[wget]]></category>
            <dc:creator><![CDATA[Rakesh Jain]]></dc:creator>
            <pubDate>Tue, 09 Feb 2021 12:58:37 GMT</pubDate>
            <atom:updated>2021-02-10T09:12:04.131Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vg9gQMAn8KemK5cVklPevA.png" /></figure><p>This is one thing which everyone of us might have faced difficulty with or are still struggling to get a simple and exact answer.</p><p>FYI both <em>curl</em> and <em>wget </em>support HTTP, HTTPS, and FTP protocols.</p><p>Let’s get our hands dirty.</p><h3>Downloading Files and Directories from web with WGET</h3><h4><strong>Our first target is to download directories and underneath files from below location</strong></h4><p><a href="http://mirror.myfahim.com/centos/7.9.2009/updates/x86_64/">Index of /centos/7.9.2009/updates/x86_64</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*TK1TuFKD2O_Ovfd5d3QW3Q.png" /></figure><pre>wget $ wget -np -P . -r -R &quot;index.html*&quot; --cut-dirs=4 http://mirror.myfahim.com/centos/7.9.2009/updates/x86_64/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Plr8u9uCA_5SfyG6nvQhIg.png" /></figure><p>Let us understand this command in detail.</p><p><strong>- -no-parent or -np<br></strong>Do not ever ascend to the parent directory when retrieving recursively. This is a useful option, since it guarantees that only the files <em>below</em> a certain hierarchy will be downloaded.</p><blockquote><strong><em>Note</em></strong><em> that, for HTTP (and HTTPS), the trailing slash is very important to “</em><em>— -no-parent”. HTTP has no concept of a “directory”. Wget relies on you to indicate what’s a directory and what isn’t. In ‘http://foo/bar/’, Wget will consider ‘bar’ to be a directory, while in ‘http://foo/bar’ (no trailing slash), ‘bar’ will be considered a filename (so ‘ </em><em>— -no-parent’ would be meaningless, as its parent is ‘/’).</em></blockquote><p><strong>-P prefix or - -directory-prefix=prefix<br></strong>Set directory prefix to prefix. The <em>directory prefix</em> is the directory where all other files and subdirectories will be saved to, i.e. the top of the retrieval tree. The default is ‘.’ (the current directory).</p><p><strong>-r or - -recursive<br></strong>Turn on recursive retrieving. The default maximum depth is 5.</p><p><strong>‘-R rejlist or - -reject rejlist’<br></strong>Specify comma-separated lists of file name suffixes or patterns to accept or reject. Note that if any of the wildcard characters, ‘*’, ‘?’, ‘[’ or ‘]’, appear in an element of acclist or rejlist, it will be treated as a pattern, rather than a suffix. In this case, you have to enclose the pattern into quotes to prevent your shell from expanding it, like in ‘-A “*.mp3”’ or ‘-A ‘*.mp3’’.</p><p>Like we have done for all “index.html” files -&gt; <strong>-R “index.html*”</strong></p><p><strong>cut_dirs = n<br></strong>If you do not want the first few directories you can Ignore n remote directory components. Equivalent to - -cut-dirs=n.</p><p>Once run you will have the directory structure like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*L7BreLoz7EEg-PfXGQyYbQ.png" /></figure><h4><strong>Now download files only from here</strong></h4><p><a href="http://mirror.myfahim.com/centos/7.9.2009/updates/x86_64/repodata/">http://mirror.myfahim.com/centos/7.9.2009/updates/x86_64/repodata/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*XoKiSEd_ICY25-yAOgQydg.png" /></figure><p>Here is the command.</p><pre>wget $ wget -nd -np -P . -r -R &quot;index.html*&quot; <a href="http://mirror.myfahim.com/centos/7.9.2009/updates/x86_64/repodata/">http://mirror.myfahim.com/centos/7.9.2009/updates/x86_64/repodata/</a></pre><p>Here we have used one additional parameter — -nd.</p><p><strong>-nd or - -no-directories</strong></p><p>Do not create a hierarchy of directories when retrieving recursively. With this option turned on, all files will get saved to the current directory, without clobbering (if a name shows up more than once, the filenames will get extensions ‘.n’).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KdUYfqZeGEDkcREn-sXaZw.png" /></figure><p>This command will download the files on the same directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TC_jXFd3tjMT2znRsFA2KQ.png" /></figure><blockquote><strong><em>wget is the go to solution for us as it only supports a small number of protocols.</em></strong><em> Its very effective for downloading files and can also be used to download directory structures recursively.<br>For more information on various other arguments please go </em><a href="https://www.gnu.org/software/wget/manual/wget.html"><em>here</em></a><em>.</em></blockquote><h3>Downloading Files from web with CURL</h3><p><em>curl </em>does not provide recursive download. So we can only use it for downloading files.</p><p><strong>Download a single file with curl</strong></p><pre>curl $ curl -O <a href="http://mirror.myfahim.com/centos/7.9.2009/updates/x86_64/repodata/repomd.xml">http://mirror.myfahim.com/centos/7.9.2009/updates/x86_64/repodata/repomd.xml</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fv5jH2z5m3OFDi1q2HM9QQ.png" /></figure><p><strong>Download multiple files with curl</strong></p><p>To download multiple files at the same time, use <strong>–O</strong> followed by the URL to the file that you wish to download.</p><p>Use the following syntax for this purpose:</p><pre>curl -O [url1] -O [url2]</pre><p>You can also make use of double quoting the URL to avoid copying it multiple times:</p><p>curl -O &quot;http://domain/path/to/{file1,file2}&quot;</p><pre>curl $ curl -O “http://mirror.myfahim.com/centos/7.9.2009/updates/x86_64/repodata/{http://mirror.myfahim.com/centos/7.9.2009/updates/x86_64/repodata/repomd.xml, http://mirror.myfahim.com/centos/7.9.2009/updates/x86_64/repodata/repomd.xml.asc}&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gjS6Fz5As8wajo6VRNjSmQ.png" /></figure><blockquote><em>If you </em><em>curl without any options except for the URL, the content of the URL (whether it&#39;s a webpage, or a binary file, such as an image or a zip file) will be printed out to screen. So better you either save it with </em><em>-o option or download with the original with </em><em>-O option.</em></blockquote><h3>Downloading and Uploading files over FTP using CURL and WGET</h3><p><em>curl</em> and <em>wget</em> can be used to download files using the FTP protocol:</p><pre>wget --user=ftpuser --password=&#39;ftpuserpassword&#39; ftp://mywebsite.com/testdoc.pdf<br>curl -u ftpuser:ftpuserpassword &#39;ftp://mywebsite.com/testdoc.pdf&#39; -o testdoc.pdf</pre><h3>CURL vs WGET — few differences</h3><p>The main differences are:</p><ul><li>wgetcan download files recursively whereas curl can not.</li><li>wget is a CLI utility and no libraries associated with it whereas curl is part of feature rich library libcurl.</li><li>curl supports FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, POP3, IMAP, SMTP, RTMP and RTSP. wget supports HTTP, HTTPS and FTP.</li><li>curl offers upload and sending capabilities. wget only offers plain HTTP POST support.</li></ul><p>That’s all!</p><p>Thanks for reading.</p><p>Hope you like the article. Please let me know your feedback in the response section.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9217bc2e34c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s new in Kubernetes Version 1.20 and How to upgrade to 1.20.x?]]></title>
            <link>https://faun.pub/whats-new-in-kubernetes-version-1-20-and-how-to-upgrade-to-1-20-x-5ea72f904e7d?source=rss-5eeb75480ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ea72f904e7d</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Rakesh Jain]]></dc:creator>
            <pubDate>Wed, 13 Jan 2021 10:30:46 GMT</pubDate>
            <atom:updated>2021-03-23T09:43:39.222Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qKVfRuY3FZXwX3oe9JVEBw.png" /></figure><p><a href="https://kubernetes.io/blog/2020/12/08/kubernetes-1-20-release-announcement/">Kubernetes 1.20</a> was released on Dec 8, 2020! They call it <strong>“The Raddest Release”.</strong></p><p>Kubernetes as a Technology as a Platform and as a Business Model growing by leaps and bounds. Kubernetes team is continuing to work on improving user experience by enhancing the feature sets.</p><p>This was a much-awaited release this year.</p><h3>What this release brings to you?</h3><p>As per their official <a href="https://kubernetes.io/blog/2020/12/08/kubernetes-1-20-release-announcement/">announcement </a>“<em>This release consists of 42 enhancements: 11 enhancements have graduated to stable, 15 enhancements are moving to beta, and 16 enhancements are entering alpha.”</em></p><blockquote><strong>For those who are not aware of these Development Stages:</strong><br><strong>Pre Alpha:</strong> all activities performed during the software project before formal testing. These activities can include requirements analysis, software design, software development, and unit testing.</blockquote><blockquote><strong>Alpha:</strong> The alpha phase of the release life cycle is the first phase of software testing. Can be described as an early <strong>version </strong>(typically unstable) of a program or application.</blockquote><blockquote><strong>Beta: </strong>A Beta phase generally begins when the software is feature complete but likely to contain a number of known or unknown bugs. It further has few stages like Perpetual beta, Open and closed beta etc.</blockquote><blockquote><strong>Release candidate: </strong>A <em>release candidate</em> (<em>RC</em>), also known as “going silver”, is a beta version with potential to be a stable product, which is ready to release unless significant bugs emerge.</blockquote><blockquote><strong>Stable release: </strong>Also called <em>production release</em>, the <em>stable release</em> is the last <em>release candidate</em> (<em>RC</em>) which has passed all verifications / tests.</blockquote><h3>Major Highlights from v1.20</h3><h4>A heads up towards Docker Deprecation</h4><p>Dockershim, the container runtime interface (CRI) shim for Docker is being deprecated. Support for Docker is deprecated and will be removed in a future release (planned for version 1.22 next year).</p><p>It doesn’t affect the Kubernetes environments running on different cloud platforms such as EKS on AWS, AKS on Azure, RedHat Open shift, and so on as they have already moved to default to other container runtimes such as containerd and CRI-O, respectively.</p><p>Please note that the Docker-produced images will continue to work in your clusters with all CRI compliant runtimes as Docker images follow the Open Container Initiative (OCI) image specification.</p><p>For more details on this go through my article- <a href="https://rakeshjain-devops.medium.com/kubernetes-deprecated-docker-5610c0f99be0">Kubernetes deprecated docker!</a> or <a href="https://blog.k8s.io/2020/12/02/dont-panic-kubernetes-and-docker/">Kubernetes community Blog</a>.</p><h4>Exec Probe Timeout Handling</h4><p>A longstanding bug regarding exec probe timeouts that may impact existing pod definitions has been fixed. Prior to this fix, the field timeoutSeconds was not respected for exec probes. Instead, probes would run indefinitely, even past their configured deadline, until a result was returned. With this change, the default value of 1 second will be applied if a value is not specified and existing pod definitions may no longer be sufficient if a probe takes longer than one second.</p><p>If you just want to continue with previous behavior set the <strong>newly added </strong>feature gateExecProbeTimeout to false.</p><p>More details can be found <a href="https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/1972-kubelet-exec-probe-timeouts">here</a>.</p><h4>Volume Snapshot Operations are now stable</h4><p>This feature provides a standard way to trigger volume snapshot operations and allows users to incorporate snapshot operations in a portable manner on any Kubernetes environment and supported storage providers.</p><h4>Kubectl Debug Graduates to Beta</h4><p>From now on you can use kubectl debug command for common debugging.<br>You should now use kubectl debug instead of kubectl alpha debug`</p><p>For more information on this go <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/debug-running-pod/">here</a>.</p><h4>GA: Process PID Limiting for Stability</h4><p>This feature now adds support for configuring the kubelet to limit the number of PIDs a pod can utilize. This limits their potential impact on other pods on a node.</p><p>For more details go <a href="https://github.com/kubernetes/enhancements/issues/757">here</a>.</p><h4>Alpha: Graceful node shutdown</h4><p>Currently, when a node shuts down, pods do not follow the expected pod termination lifecycle and are not terminated gracefully which can cause issues for some workloads. The GracefulNodeShutdown feature is now in Alpha. GracefulNodeShutdown makes the kubelet aware of node system shutdowns, enabling graceful termination of pods during a system shutdown.</p><h4>Alpha with updates: IPV4/IPV6</h4><p>This allows both IPv4 and IPv6 service cluster IP addresses to be assigned to a single service and also enables a service to be transitioned from single to dual IP stack and vice versa.</p><h4>Beta: API Priority and Fairness</h4><p>Kubernetes 1.20 now enables API Priority and Fairness (APF) by default. This allows kube-apiserver to categorize incoming requests by priority levels.</p><h4>CronJobs (previously ScheduledJobs)</h4><p>CronJobs (previously ScheduledJobs) are meant for performing all time-related actions, namely backups, report generation, and the like. Each of these tasks should be allowed to run repeatedly (once a day/month, etc.) or once at a given point in time.</p><p>To try this feature out you will need to enable the CronJobControllerV2 feature flag.</p><h3>How to upgrade your Kubernetes cluster to v1.20?</h3><p>Now let’s start the demonstration of upgrading your Kubernetes cluster from 1.19.x version to 1.20.x.</p><h4>Prerequisites</h4><p>A working Kubernetes cluster with at least one master and one worker node.</p><h4>My Environment</h4><p><strong>Kubernetes Master Node -&gt;<br></strong>172.42.42.200 kmaster-rj.example.com/kmaster-rj, Ubuntu 18.04 LTS</p><p><strong>Kubernetes Worker Nodes -&gt;<br></strong>172.42.42.201 kworker-rj1.example.com/kworker-rj1, Ubuntu 18.04 LTS<br>172.42.42.202 kworker-rj2.example.com/kworker-rj2, Ubuntu 18.04 LTS</p><h4><strong>Check the newest version available (</strong>On Master/Control plane node)</h4><p><strong>Update the package cache first.</strong></p><pre>root@kmaster-rj:~# apt update<br>Hit:2 <a href="http://ppa.launchpad.net/bashtop-monitor/bashtop/ubuntu">http://ppa.launchpad.net/bashtop-monitor/bashtop/ubuntu</a> bionic InRelease<br>Hit:3 <a href="http://security.ubuntu.com/ubuntu">http://security.ubuntu.com/ubuntu</a> bionic-security InRelease<br>Hit:4 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic InRelease<br>Hit:5 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic-updates InRelease<br>Hit:1 <a href="https://packages.cloud.google.com/apt">https://packages.cloud.google.com/apt</a> kubernetes-xenial InRelease<br>Hit:6 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic-backports InRelease<br>Reading package lists... Done<br>Building dependency tree<br>Reading state information... Done<br>142 packages can be upgraded. Run &#39;apt list --upgradable&#39; to see them.</pre><p>You will find the latest version 1.20 in the list, it should look like 1.20.x-00.</p><pre>root@kmaster-rj:~# apt-cache madison kubeadm<br>   kubeadm |  1.20.1-00 | <a href="http://apt.kubernetes.io/">http://apt.kubernetes.io</a> kubernetes-xenial/main amd64 Packages<br>   kubeadm |  1.20.0-00 | <a href="http://apt.kubernetes.io/">http://apt.kubernetes.io</a> kubernetes-xenial/main amd64 Packages<br>   kubeadm |  1.19.6-00 | <a href="http://apt.kubernetes.io/">http://apt.kubernetes.io</a> kubernetes-xenial/main amd64 Packages<br>   kubeadm |  1.19.5-00 | <a href="http://apt.kubernetes.io/">http://apt.kubernetes.io</a> kubernetes-xenial/main amd64 Packages<br>   kubeadm |  1.19.4-00 | <a href="http://apt.kubernetes.io/">http://apt.kubernetes.io</a> kubernetes-xenial/main amd64 Packages<br>   kubeadm |  1.19.3-00 | <a href="http://apt.kubernetes.io/">http://apt.kubernetes.io</a> kubernetes-xenial/main amd64 Packages<br>   kubeadm |  1.19.2-00 | <a href="http://apt.kubernetes.io/">http://apt.kubernetes.io</a> kubernetes-xenial/main amd64 Packages<br>   kubeadm |  1.19.1-00 | <a href="http://apt.kubernetes.io/">http://apt.kubernetes.io</a> kubernetes-xenial/main amd64 Packages<br>   kubeadm |  1.19.0-00 | <a href="http://apt.kubernetes.io/">http://apt.kubernetes.io</a> kubernetes-xenial/main amd64 Packages</pre><h3>Upgrading control plane nodes</h3><p>The upgrade procedure on control plane nodes should be executed one node at a time.</p><h4><strong>Step 1: upgrade kubeadm (On Master/Control plane node)</strong></h4><pre>root@kmaster-rj:~# apt-get update &amp;&amp; apt-get install -y --allow-change-held-packages kubeadm=1.20.1-00<br>Hit:2 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic InRelease<br>Hit:3 <a href="http://ppa.launchpad.net/bashtop-monitor/bashtop/ubuntu">http://ppa.launchpad.net/bashtop-monitor/bashtop/ubuntu</a> bionic InRelease<br>Hit:4 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic-updates InRelease<br>Hit:5 <a href="http://security.ubuntu.com/ubuntu">http://security.ubuntu.com/ubuntu</a> bionic-security InRelease<br>Hit:6 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic-backports InRelease<br>Hit:1 <a href="https://packages.cloud.google.com/apt">https://packages.cloud.google.com/apt</a> kubernetes-xenial InRelease<br>Reading package lists... Done<br>Reading package lists... Done<br>Building dependency tree<br>Reading state information... Done<br>The following held packages will be changed:<br>  kubeadm<br>The following packages will be upgraded:<br>  kubeadm<br>1 upgraded, 0 newly installed, 0 to remove and 141 not upgraded.<br>Need to get 7,708 kB of archives.<br>After this operation, 160 kB of additional disk space will be used.<br>Get:1 <a href="https://packages.cloud.google.com/apt">https://packages.cloud.google.com/apt</a> kubernetes-xenial/main amd64 kubeadm amd64 1.20.1-00 [7,708 kB]<br>Fetched 7,708 kB in 1s (5,350 kB/s)<br>(Reading database ... 75793 files and directories currently installed.)<br>Preparing to unpack .../kubeadm_1.20.1-00_amd64.deb ...<br>Unpacking kubeadm (1.20.1-00) over (1.19.6-00) ...<br>Setting up kubeadm (1.20.1-00) ...</pre><h4>Step 2: <strong>Verify the kubeadm version </strong>(On Master/Control plane node)</h4><pre>root@kmaster-rj:~# kubeadm version<br>kubeadm version: &amp;version.Info{Major:&quot;1&quot;, Minor:&quot;20&quot;, GitVersion:&quot;v1.20.1&quot;, GitCommit:&quot;c4d752765b3bbac2237bf87cf0b1c2e307844666&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-12-18T12:07:13Z&quot;, GoVersion:&quot;go1.15.5&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}</pre><h4>Step 3: <strong>Verify the upgrade plan </strong>(On Master/Control plane node)</h4><pre>root@kmaster-rj:~# kubeadm upgrade plan<br>[upgrade/config] Making sure the configuration is correct:<br>[upgrade/config] Reading configuration from the cluster...<br>[upgrade/config] FYI: You can look at this config file with &#39;kubectl -n kube-system get cm kubeadm-config -o yaml&#39;<br>[preflight] Running pre-flight checks.<br>[upgrade] Running cluster health checks<br>[upgrade] Fetching available versions to upgrade to<br>[upgrade/versions] Cluster version: v1.19.6<br>[upgrade/versions] kubeadm version: v1.20.1<br>[upgrade/versions] Latest stable version: v1.20.1<br>[upgrade/versions] Latest stable version: v1.20.1<br>[upgrade/versions] Latest version in the v1.19 series: v1.19.6<br>[upgrade/versions] Latest version in the v1.19 series: v1.19.6</pre><pre>Components that must be upgraded manually after you have upgraded the control plane with &#39;kubeadm upgrade apply&#39;:<br>COMPONENT   CURRENT       AVAILABLE<br>kubelet     3 x v1.19.6   v1.20.1</pre><pre>Upgrade to the latest stable version:</pre><pre>COMPONENT                 CURRENT    AVAILABLE<br>kube-apiserver            v1.19.6    v1.20.1<br>kube-controller-manager   v1.19.6    v1.20.1<br>kube-scheduler            v1.19.6    v1.20.1<br>kube-proxy                v1.19.6    v1.20.1<br>CoreDNS                   1.7.0      1.7.0<br>etcd                      3.4.13-0   3.4.13-0</pre><pre>You can now apply the upgrade by executing the following command:</pre><pre>kubeadm upgrade apply v1.20.1</pre><pre>_____________________________________________________________________</pre><pre>The table below shows the current state of component configs as understood by this version of kubeadm.<br>Configs that have a &quot;yes&quot; mark in the &quot;MANUAL UPGRADE REQUIRED&quot; column require manual config upgrade or<br>resetting to kubeadm defaults before a successful upgrade can be performed. The version to manually<br>upgrade to is denoted in the &quot;PREFERRED VERSION&quot; column.</pre><pre>API GROUP                 CURRENT VERSION   PREFERRED VERSION   MANUAL UPGRADE REQUIRED<br>kubeproxy.config.k8s.io   v1alpha1          v1alpha1            no<br>kubelet.config.k8s.io     v1beta1           v1beta1             no<br>____________________________________________________________________</pre><p>Above command checks that your cluster can be upgraded, and fetches the versions you can upgrade to. It also shows a table with the component config version states.</p><h4>Step 4: <strong>Choose a version to upgrade to </strong>(On Master/Control plane node)</h4><pre>root@kmaster-rj:~# kubeadm upgrade apply v1.20.1<br>[upgrade/config] Making sure the configuration is correct:<br>[upgrade/config] Reading configuration from the cluster...<br>[upgrade/config] FYI: You can look at this config file with &#39;kubectl -n kube-system get cm kubeadm-config -o yaml&#39;<br>[preflight] Running pre-flight checks.<br>[upgrade] Running cluster health checks<br>[upgrade/version] You have chosen to change the cluster version to &quot;v1.20.1&quot;<br>[upgrade/versions] Cluster version: v1.19.6<br>[upgrade/versions] kubeadm version: v1.20.1<br>[upgrade/confirm] Are you sure you want to proceed with the upgrade? [y/N]: y<br>[upgrade/prepull] Pulling images required for setting up a Kubernetes cluster<br>[upgrade/prepull] This might take a minute or two, depending on the speed of your internet connection<br>[upgrade/prepull] You can also perform this action in beforehand using &#39;kubeadm config images pull&#39;<br>[upgrade/apply] Upgrading your Static Pod-hosted control plane to version &quot;v1.20.1&quot;...<br>Static pod: kube-apiserver-kmaster-rj hash: ca19d1a3c534805e8f47381caf3063f4<br>Static pod: kube-controller-manager-kmaster-rj hash: b5e37ec64802ad1ee865a41314ccd01f<br>Static pod: kube-scheduler-kmaster-rj hash: 092bf93ace9b8cbbba45a9126334ea19<br>[upgrade/etcd] Upgrading to TLS for etcd<br>Static pod: etcd-kmaster-rj hash: 4a2056f053f1ca1909b86404eb65cd11<br>[upgrade/staticpods] Preparing for &quot;etcd&quot; upgrade<br>[upgrade/staticpods] Renewing etcd-server certificate<br>[upgrade/staticpods] Renewing etcd-peer certificate<br>[upgrade/staticpods] Renewing etcd-healthcheck-client certificate<br>[upgrade/staticpods] Moved new manifest to &quot;/etc/kubernetes/manifests/etcd.yaml&quot; and backed up old manifest to &quot;/etc/kubernetes/tmp/kubeadm-backup-manifests-2021-01-13-09-58-27/etcd.yaml&quot;<br>[upgrade/staticpods] Waiting for the kubelet to restart the component<br>[upgrade/staticpods] This might take a minute or longer depending on the component/version gap (timeout 5m0s)<br>Static pod: etcd-kmaster-rj hash: 4a2056f053f1ca1909b86404eb65cd11<br>Static pod: etcd-kmaster-rj hash: 4a2056f053f1ca1909b86404eb65cd11<br>Static pod: etcd-kmaster-rj hash: 4a2056f053f1ca1909b86404eb65cd11<br>Static pod: etcd-kmaster-rj hash: 94417d36c0e48fdf5c03655da9543034<br>[apiclient] Found 1 Pods for label selector component=etcd<br>[upgrade/staticpods] Component &quot;etcd&quot; upgraded successfully!<br>[upgrade/etcd] Waiting for etcd to become available<br>[upgrade/staticpods] Writing new Static Pod manifests to &quot;/etc/kubernetes/tmp/kubeadm-upgraded-manifests629701940&quot;<br>[upgrade/staticpods] Preparing for &quot;kube-apiserver&quot; upgrade<br>[upgrade/staticpods] Renewing apiserver certificate<br>[upgrade/staticpods] Renewing apiserver-kubelet-client certificate<br>[upgrade/staticpods] Renewing front-proxy-client certificate<br>[upgrade/staticpods] Renewing apiserver-etcd-client certificate<br>[upgrade/staticpods] Moved new manifest to &quot;/etc/kubernetes/manifests/kube-apiserver.yaml&quot; and backed up old manifest to &quot;/etc/kubernetes/tmp/kubeadm-backup-manifests-2021-01-13-09-58-27/kube-apiserver.yaml&quot;<br>[upgrade/staticpods] Waiting for the kubelet to restart the component<br>[upgrade/staticpods] This might take a minute or longer depending on the component/version gap (timeout 5m0s)<br>Static pod: kube-apiserver-kmaster-rj hash: ca19d1a3c534805e8f47381caf3063f4<br>Static pod: kube-apiserver-kmaster-rj hash: e1eb6ececa489105263c8f38b2ad3d85<br>[apiclient] Found 1 Pods for label selector component=kube-apiserver<br>[upgrade/staticpods] Component &quot;kube-apiserver&quot; upgraded successfully!<br>[upgrade/staticpods] Preparing for &quot;kube-controller-manager&quot; upgrade<br>[upgrade/staticpods] Renewing controller-manager.conf certificate<br>[upgrade/staticpods] Moved new manifest to &quot;/etc/kubernetes/manifests/kube-controller-manager.yaml&quot; and backed up old manifest to &quot;/etc/kubernetes/tmp/kubeadm-backup-manifests-2021-01-13-09-58-27/kube-controller-manager.yaml&quot;<br>[upgrade/staticpods] Waiting for the kubelet to restart the component<br>[upgrade/staticpods] This might take a minute or longer depending on the component/version gap (timeout 5m0s)<br>Static pod: kube-controller-manager-kmaster-rj hash: b5e37ec64802ad1ee865a41314ccd01f<br>Static pod: kube-controller-manager-kmaster-rj hash: 68d79396812e09a48466beaec532705f<br>[apiclient] Found 1 Pods for label selector component=kube-controller-manager<br>[upgrade/staticpods] Component &quot;kube-controller-manager&quot; upgraded successfully!<br>[upgrade/staticpods] Preparing for &quot;kube-scheduler&quot; upgrade<br>[upgrade/staticpods] Renewing scheduler.conf certificate<br>[upgrade/staticpods] Moved new manifest to &quot;/etc/kubernetes/manifests/kube-scheduler.yaml&quot; and backed up old manifest to &quot;/etc/kubernetes/tmp/kubeadm-backup-manifests-2021-01-13-09-58-27/kube-scheduler.yaml&quot;<br>[upgrade/staticpods] Waiting for the kubelet to restart the component<br>[upgrade/staticpods] This might take a minute or longer depending on the component/version gap (timeout 5m0s)<br>Static pod: kube-scheduler-kmaster-rj hash: 092bf93ace9b8cbbba45a9126334ea19<br>Static pod: kube-scheduler-kmaster-rj hash: 9be8cb4627e7e5ad4c3f8acabd4b49b3<br>[apiclient] Found 1 Pods for label selector component=kube-scheduler<br>[upgrade/staticpods] Component &quot;kube-scheduler&quot; upgraded successfully!<br>[upgrade/postupgrade] Applying label node-role.kubernetes.io/control-plane=&#39;&#39; to Nodes with label node-role.kubernetes.io/master=&#39;&#39; (deprecated)<br>[upload-config] Storing the configuration used in ConfigMap &quot;kubeadm-config&quot; in the &quot;kube-system&quot; Namespace<br>[kubelet] Creating a ConfigMap &quot;kubelet-config-1.20&quot; in namespace kube-system with the configuration for the kubelets in the cluster<br>[kubelet-start] Writing kubelet configuration to file &quot;/var/lib/kubelet/config.yaml&quot;<br>[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to get nodes<br>[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials<br>[bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token<br>[bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster<br>[addons] Applied essential addon: CoreDNS<br>[addons] Applied essential addon: kube-proxy</pre><pre>[upgrade/successful] SUCCESS! Your cluster was upgraded to &quot;v1.20.1&quot;. Enjoy!</pre><p>To upgrade the other control plane nodes you need to follow the same steps we followed above.</p><h4>Step 5: Drain the node (On Master/Control plane node)</h4><p>Prepare the node for maintenance by marking it unable to schedule and evicting the workloads:</p><pre>root@kmaster-rj:~# kubectl drain kmaster-rj --ignore-daemonsets<br>node/kmaster-rj cordoned<br>WARNING: ignoring DaemonSet-managed Pods: kube-system/calico-node-2vs9l, kube-system/kube-proxy-kmj6b<br>evicting pod kube-system/coredns-f9fd979d6-fr4fr<br>pod/coredns-f9fd979d6-fr4fr evicted<br>node/kmaster-rj evicted</pre><h4><strong>Step 6: Upgrade kubelet and kubectl </strong>(On Master/Control plane node)</h4><pre>root@kmaster-rj:~# apt-get update &amp;&amp; apt-get install -y --allow-change-held-packages kubelet=1.20.1-00 kubectl=1.20.1-00<br>Hit:2 <a href="http://ppa.launchpad.net/bashtop-monitor/bashtop/ubuntu">http://ppa.launchpad.net/bashtop-monitor/bashtop/ubuntu</a> bionic InRelease<br>Hit:3 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic InRelease<br>Hit:4 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic-updates InRelease<br>Hit:5 <a href="http://security.ubuntu.com/ubuntu">http://security.ubuntu.com/ubuntu</a> bionic-security InRelease<br>Hit:6 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic-backports InRelease<br>Hit:1 <a href="https://packages.cloud.google.com/apt">https://packages.cloud.google.com/apt</a> kubernetes-xenial InRelease<br>Reading package lists... Done<br>Reading package lists... Done<br>Building dependency tree<br>Reading state information... Done<br>The following held packages will be changed:<br>  kubectl kubelet<br>The following packages will be upgraded:<br>  kubectl kubelet<br>2 upgraded, 0 newly installed, 0 to remove and 139 not upgraded.<br>Need to get 26.8 MB of archives.<br>After this operation, 1,353 kB of additional disk space will be used.<br>Get:1 <a href="https://packages.cloud.google.com/apt">https://packages.cloud.google.com/apt</a> kubernetes-xenial/main amd64 kubectl amd64 1.20.1-00 [7,948 kB]<br>Get:2 <a href="https://packages.cloud.google.com/apt">https://packages.cloud.google.com/apt</a> kubernetes-xenial/main amd64 kubelet amd64 1.20.1-00 [18.9 MB]<br>Fetched 26.8 MB in 4s (6,837 kB/s)<br>(Reading database ... 75793 files and directories currently installed.)<br>Preparing to unpack .../kubectl_1.20.1-00_amd64.deb ...<br>Unpacking kubectl (1.20.1-00) over (1.19.6-00) ...<br>Preparing to unpack .../kubelet_1.20.1-00_amd64.deb ...<br>Unpacking kubelet (1.20.1-00) over (1.19.6-00) ...<br>Setting up kubelet (1.20.1-00) ...<br>Setting up kubectl (1.20.1-00) ...</pre><h4>Step 7: <strong>Restart the kubelet </strong>(On Master/Control plane node)</h4><pre>root@kmaster-rj:~# systemctl daemon-reload<br>root@kmaster-rj:~# systemctl restart kubelet</pre><h4>Step 8: Uncordon the node (On Master/Control plane node)</h4><pre>root@kmaster-rj:~# kubectl uncordon kmaster-rj<br>node/kmaster-rj uncordoned</pre><h4>Step 9: <strong>Verify the version </strong>(On Master/Control plane node)</h4><pre>root@kmaster-rj:~# kubectl get nodes<br>NAME          STATUS   ROLES                  AGE    VERSION<br>kmaster-rj    Ready    control-plane,master   163d   v1.20.1<br>kworker-rj1   Ready    &lt;none&gt;                 163d   v1.19.6<br>kworker-rj2   Ready    &lt;none&gt;                 163d   v1.19.6</pre><h3>Upgrade worker nodes</h3><h4>Step 1: Upgrade kubeadm: (On worker node)</h4><pre>root@kworker-rj2:~# apt-get update &amp;&amp; \<br>&gt; apt-get install -y --allow-change-held-packages kubeadm=1.20.1-00<br>Get:2 <a href="http://security.ubuntu.com/ubuntu">http://security.ubuntu.com/ubuntu</a> bionic-security InRelease [88.7 kB]<br>Hit:3 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic InRelease<br>Hit:4 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic-updates InRelease<br>Hit:5 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic-backports InRelease<br>Hit:1 <a href="https://packages.cloud.google.com/apt">https://packages.cloud.google.com/apt</a> kubernetes-xenial InRelease<br>Fetched 88.7 kB in 1s (114 kB/s)<br>Reading package lists... Done<br>Reading package lists... Done<br>Building dependency tree<br>Reading state information... Done<br>The following packages will be upgraded:<br>  kubeadm<br>1 upgraded, 0 newly installed, 0 to remove and 140 not upgraded.<br>Need to get 7,708 kB of archives.<br>After this operation, 602 kB disk space will be freed.<br>Get:1 <a href="https://packages.cloud.google.com/apt">https://packages.cloud.google.com/apt</a> kubernetes-xenial/main amd64 kubeadm amd64 1.20.1-00 [7,708 kB]<br>Fetched 7,708 kB in 2s (4,422 kB/s)<br>(Reading database ... 74981 files and directories currently installed.)<br>Preparing to unpack .../kubeadm_1.20.1-00_amd64.deb ...<br>Unpacking kubeadm (1.20.1-00) over (1.18.8-00) ...<br>Setting up kubeadm (1.20.1-00) ...</pre><h4><strong>Step 2: upgrades the local kubelet configuration </strong>(On worker node)</h4><pre>root@kworker-rj2:~# kubeadm upgrade node<br>[upgrade] Reading configuration from the cluster...<br>[upgrade] FYI: You can look at this config file with &#39;kubectl -n kube-system get cm kubeadm-config -o yaml&#39;<br>[preflight] Running pre-flight checks<br>[preflight] Skipping prepull. Not a control plane node.<br>[upgrade] Skipping phase. Not a control plane node.<br>[kubelet-start] Writing kubelet configuration to file &quot;/var/lib/kubelet/config.yaml&quot;<br>[upgrade] The configuration for this node was successfully updated!<br>[upgrade] Now you should go ahead and upgrade the kubelet package using your package manager.</pre><h4><strong>Step 3: Drain the node </strong>(On Master/Control plane node)</h4><pre>root@kmaster-rj:~# kubectl drain kworker-rj2  --ignore-daemonsets<br>node/kworker-rj2 cordoned</pre><h4>Step 4: Upgrade kubelet and kubectl (On worker node)</h4><pre>root@kworker-rj2:~# apt-get update &amp;&amp; apt-get install -y --allow-change-held-packages kubelet=1.20.1-00 kubectl=1.20.1-00<br>Hit:2 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic InRelease<br>Get:3 <a href="http://security.ubuntu.com/ubuntu">http://security.ubuntu.com/ubuntu</a> bionic-security InRelease [88.7 kB]<br>Hit:4 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic-updates InRelease<br>Hit:1 <a href="https://packages.cloud.google.com/apt">https://packages.cloud.google.com/apt</a> kubernetes-xenial InRelease<br>Hit:5 <a href="http://archive.ubuntu.com/ubuntu">http://archive.ubuntu.com/ubuntu</a> bionic-backports InRelease<br>Fetched 88.7 kB in 1s (125 kB/s)<br>Reading package lists... Done<br>Reading package lists... Done<br>Building dependency tree<br>Reading state information... Done<br>The following packages will be upgraded:<br>  kubectl kubelet<br>2 upgraded, 0 newly installed, 0 to remove and 138 not upgraded.<br>Need to get 26.8 MB of archives.<br>After this operation, 1,353 kB of additional disk space will be used.<br>Get:1 <a href="https://packages.cloud.google.com/apt">https://packages.cloud.google.com/apt</a> kubernetes-xenial/main amd64 kubectl amd64 1.20.1-00 [7,948 kB]<br>Get:2 <a href="https://packages.cloud.google.com/apt">https://packages.cloud.google.com/apt</a> kubernetes-xenial/main amd64 kubelet amd64 1.20.1-00 [18.9 MB]<br>Fetched 26.8 MB in 4s (6,575 kB/s)<br>(Reading database ... 74981 files and directories currently installed.)<br>Preparing to unpack .../kubectl_1.20.1-00_amd64.deb ...<br>Unpacking kubectl (1.20.1-00) over (1.19.6-00) ...<br>Preparing to unpack .../kubelet_1.20.1-00_amd64.deb ...<br>Unpacking kubelet (1.20.1-00) over (1.19.6-00) ...<br>Setting up kubelet (1.20.1-00) ...<br>Setting up kubectl (1.20.1-00) ...</pre><h4>Step 5: Restart the kubelet (On worker node)</h4><pre>root@kworker-rj2:~# systemctl daemon-reload<br>root@kworker-rj2:~# systemctl restart kubelet</pre><h4>Step 6: Uncordon the node (On Master/Control plane node)</h4><pre>root@kmaster-rj:~# kubectl uncordon kworker-rj2<br>node/kworker-rj2 uncordoned</pre><h4>Step 7: Verify the status of the cluster (On Master/Control plane node)</h4><p>After the kubelet is upgraded on all nodes verify that all nodes are available again by running the following command from anywhere kubectl can access the cluster:</p><pre>root@kmaster-rj:~# kubectl get nodes<br>NAME          STATUS   ROLES                  AGE    VERSION<br>kmaster-rj    Ready    control-plane,master   163d   v1.20.1<br>kworker-rj1   Ready    &lt;none&gt;                 163d   v1.20.1<br>kworker-rj2   Ready    &lt;none&gt;                 163d   v1.20.1</pre><p>Great! Our cluster has been upgraded to the newer version v1.20.1.</p><p>That’s all!</p><p>Hope you like the article. Please let me know your feedback in the response section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p>👋 <a href="https://faun.dev/join"><strong>Join FAUN today and receive similar stories each week in your inbox!</strong></a><strong> </strong>️ <strong>Get your weekly dose of the must-read tech stories, news, and tutorials.</strong></p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ea72f904e7d" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/whats-new-in-kubernetes-version-1-20-and-how-to-upgrade-to-1-20-x-5ea72f904e7d">What’s new in Kubernetes Version 1.20 and How to upgrade to 1.20.x?</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>