<?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 Unni P on Medium]]></title>
        <description><![CDATA[Stories by Unni P on Medium]]></description>
        <link>https://medium.com/@iamunnip?source=rss-b9ae4e01f552------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Unni P on Medium</title>
            <link>https://medium.com/@iamunnip?source=rss-b9ae4e01f552------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 23:44:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iamunnip/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[Uptime Kuma on Amazon EC2 — An Open-source Monitoring Tool]]></title>
            <link>https://iamunnip.medium.com/uptime-kuma-on-amazon-ec2-an-open-source-monitoring-tool-4fa1c73ad718?source=rss-b9ae4e01f552------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fa1c73ad718</guid>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[uptime-kuma]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[uptime-monitoring]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Unni P]]></dc:creator>
            <pubDate>Sun, 30 Apr 2023 15:51:52 GMT</pubDate>
            <atom:updated>2023-04-30T15:52:28.799Z</atom:updated>
            <content:encoded><![CDATA[<h3>Uptime Kuma on Amazon EC2 — An Open-source Monitoring Tool</h3><h4>In this article we will look how we can install and configure Uptime Kuma an open-source monitoring tool on Amazon EC2</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8itB6SzVefhoznH3lBK8xA.png" /></figure><h3>Introduction</h3><ul><li>An open-source self-hosted monitoring tool</li><li>Monitor uptime for HTTP, HTTPS, DNS etc</li><li>SSL certificate information</li><li>Notifications via Email, Slack, Discord etc</li><li>20 seconds interval</li><li>Support for proxy and multi factor authentication</li></ul><h3>Prerequisites</h3><ul><li>Setup an EC2 instance of type t2.micro</li><li>Ubuntu 22.04 LTS as AMI</li><li>10 GB of hard disk space</li><li>Open port 22 for SSH and 3001 for Uptime Kuma</li><li>Install and configure Docker</li><li>Need a temporary webpage with SSL enabled</li></ul><h3>Installation</h3><p>Login to your EC2 instance</p><pre>$ ssh -i uptime-kuma.pem ubuntu@54.234.8.87</pre><p>Create a Docker volume for Uptime Kuma</p><pre>$ docker volume create uptime-kuma<br><br>$ docker volume ls<br>DRIVER    VOLUME NAME<br>local     uptime-kuma</pre><p>Start the container and verify the status</p><pre>$ docker container run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1<br>Unable to find image &#39;louislam/uptime-kuma:1&#39; locally<br>1: Pulling from louislam/uptime-kuma<br>3689b8de819b: Pull complete<br>4178a276654a: Pull complete<br>b46162c13de5: Pull complete<br>4d3ac03f17d8: Pull complete<br>b935255dae7e: Pull complete<br>792f129a81f3: Pull complete<br>4110002867ba: Pull complete<br>390f8662c74f: Pull complete<br>9dd174cf6e30: Pull complete<br>4f4fb700ef54: Pull complete<br>703bad70ccf2: Pull complete<br>Digest: sha256:cf61d3262b29e1c48cc2ac284c9264227bbc46168f408e5f4c4d6301f0629e41<br>Status: Downloaded newer image for louislam/uptime-kuma:1<br>fcdfcc5a5d1470ca3b1dd1e23d29a4975d909e2a5ab2f53e1e2bef0fa4a58665</pre><pre>$ docker container ls -a<br>CONTAINER ID   IMAGE                    COMMAND                  CREATED              STATUS                        PORTS                                       NAMES<br>fcdfcc5a5d14   louislam/uptime-kuma:1   &quot;/usr/bin/dumb-init …&quot;   About a minute ago   Up About a minute (healthy)   0.0.0.0:3001-&gt;3001/tcp, :::3001-&gt;3001/tcp   uptime-kuma</pre><p>Open <a href="http://54.234.8.87:3001/">http://54.234.8.87:3001</a> in your browser<br>Initially we need to setup username and password for accessing the dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*sc2PKF0rEV1FCkMO6EEAOg.png" /></figure><p>Once done, we will redirect to the dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZLq7m1HfsFj-uoiVazuhIQ.png" /></figure><h3>Configuration</h3><p>I have already configured a Nginx website and enabled SSL using Let’s Encrypt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*QKrk3CM6xOwMoZZMML_f9A.png" /></figure><p>We need to setup <strong>Notifications</strong> in order to get notified whenever a host is down or a certificate is going to expire</p><p>If we are using Email (SMTP) as notification type then we need to do configuration in our Gmail account</p><ul><li>Enable multi factor authentication</li><li>Create app password</li></ul><p>From the dashboard, navigate to <strong>Settings</strong> → <strong>Notifications</strong> → <strong>Setup Notification</strong> and configure as below in order to receive email notifications</p><ul><li><strong>Notification Type</strong>: Email (SMTP)<br><strong>Friendly Name</strong>: Alerts<br><strong>Hostname</strong>: smtp.gmail.com<br><strong>Port</strong>: 587<br><strong>Security:</strong> None/STARTTLS (25, 587)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*vhXx0FwtLw8ndchTYKJwCw.png" /></figure><ul><li><strong>Username</strong>: &lt;your-email-id&gt;<br><strong>Password</strong>: &lt;app-password&gt;<br><strong>From Email</strong>: &lt;your-email-id&gt;<br><strong>To Email</strong>: &lt;your-email-id&gt;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*NW60xCDxRAzzc9exh3F-_Q.png" /></figure><ul><li><strong>Custom Subject</strong>: {{NAME}} {{STATUS}}<br><strong>Default enabled</strong>: Enable</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*I7U_0txgy5ICz8bKUesA0Q.png" /></figure><p>Once the required information is entered click <strong>Test</strong> and <strong>Save</strong> button and you will receive a test mail in your inbox</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wPOFgzq3lhyDeSjnQ12eag.png" /></figure><p>Lets add our URL to monitor by clicking the <strong>Add New Monitor</strong> button and fill the details and click <strong>Save</strong> button</p><ul><li><strong>Friendly Name</strong>: 158b5452c43c.mylabserver.com<br><strong>URL</strong>: <a href="https://158b5452c43c.mylabserver.com/">https://158b5452c43c.mylabserver.com</a><br><strong>Heartbeat Interval</strong>: 20<br><strong>Certificate Expiry Notification</strong>: Enable</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mbNUNfwji66pH5oO9TvULw.png" /></figure><p>From the dashboard we can see the uptime, response time of our URL and certificate expiry date</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5tBRohhj7tug_ASqFepMPw.png" /></figure><p>Now make a downtime by stopping the Nginx service and we can see our URL is showing status as DOWN and will receive an email in your inbox</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NA2M-LoQWHhrM3hDAkRvYw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ll9f6Z1AWu8zwLvJTMr90A.png" /></figure><p>Lets start the Nginx service and now our URL status is showing as UP and will receive an email in your inbox</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SnxNLzSaNt5c4yOgkQWoMw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GtpSmH5sWGp2WvHGwTcICA.png" /></figure><p>As you see from the above status, Let’s Encrypt certificate is going to expire in 89 days.<br>Lets configure Uptime Kuma to receive an alert for certificate expiry</p><p>Navigate to <strong>Settings</strong> → <strong>Notifications</strong> → <strong>TLS Certificate Expiry<br></strong>By default we will get certificate expiry notifications in 7, 14 and 21 days but we are going configure it as 89 days because my certificate will expire in 89 days and click <strong>Save</strong> button and wait for to receive an email in your inbox</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*f7KLDElaevnwXbZ7wHjtDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XzCYnmx0P5ReDXutqZVmZw.png" /></figure><h3>Reference</h3><p><a href="https://github.com/louislam/uptime-kuma">https://github.com/louislam/uptime-kuma</a></p><p><a href="https://mariushosting.com/synology-activate-gmail-smtp-for-docker-containers/">https://mariushosting.com/synology-activate-gmail-smtp-for-docker-containers/</a></p><h3>Special Thanks</h3><p>A Cloud Guru Cloud Sandbox (AWS) and Cloud Servers</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fa1c73ad718" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up IBM Db2 Community Edition on Amazon EC2 (Linux)]]></title>
            <link>https://iamunnip.medium.com/setting-up-ibm-db2-community-edition-on-amazon-ec2-linux-b1bedbe7edd0?source=rss-b9ae4e01f552------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1bedbe7edd0</guid>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[db2]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Unni P]]></dc:creator>
            <pubDate>Sun, 30 Apr 2023 12:34:54 GMT</pubDate>
            <atom:updated>2023-04-30T12:39:16.119Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this article we will look how we can install IBM Db2 community edition on Amazon EC2 Linux instance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zzqPU5PoprPMTcAVvymVEw.png" /></figure><h3>Introduction</h3><ul><li>Db2 is a cloud-native database</li><li>Low latency transactions and highly resilient</li><li>Supports structured and unstructured data</li><li>Entry-level edition of the Db2 data server for the developer and partner community</li><li>Available for Linux, Windows, AIX and also available as Docker image</li><li>Supports all core Db2 features</li><li>Up to 4 cores and 16 GB RAM</li><li>Always-on security</li><li>Db2 Community support</li></ul><h3>Prerequisites</h3><ul><li>Setup an EC2 instance of type t2.medium</li><li>Ubuntu 20.04 LTS as AMI</li><li>30 GB of hard disk space</li><li>Open port 22 for SSH and 25000 for Db2</li><li>Create an IBM account for downloading <a href="https://www.ibm.com/account/reg/signup?formid=urx-33669">Db2 community edition</a></li></ul><h3>Installation</h3><ul><li>Login to your EC2 instance and verify the distribution version</li></ul><pre>$ ssh -i ibm-db2.pem ubuntu@54.234.180.34</pre><pre>$ lsb_release -a<br>No LSB modules are available.<br>Distributor ID: Ubuntu<br>Description:    Ubuntu 20.04.6 LTS<br>Release:        20.04<br>Codename:       focalDownload and extract Db2 community edition tarball on EC2 instance<br>You can download the community edition from this URL</pre><ul><li>Download the latest IBM Db2 Linux (x64) version in your local machine</li><li>Once download is completed, copy the downloaded file to your EC2 instance</li></ul><pre>$ scp -i ibm-db2.pem v11.5.8_linuxx64_server_dec.tar.gz ubuntu@54.234.180.34:/home/ubuntu<br><br>$ pwd<br>/home/ubuntu<br><br>$ ls<br>v11.5.8_linuxx64_server_dec.tar.gz</pre><ul><li>Extract the tarball in your home directory</li></ul><pre>$ tar -xzvf v11.5.8_linuxx64_server_dec.tar.gz<br><br>$ ls<br>server_dec  v11.5.8_linuxx64_server_dec.tar.gz</pre><ul><li>Move to extracted directory and execute db2prereqcheck command<br>This will check the prerequisite requirements for installing Db2</li></ul><pre>$ cd server_dec<br><br>$ ls<br>db2  db2_deinstall  db2_install  db2checkCOL.tar.gz  db2checkCOL_readme.txt  db2ckupgrade  db2ls  db2prereqcheck  db2setup  installFixPack</pre><pre>$ sudo ./db2prereqcheck<br><br>==========================================================================<br><br>Sun Apr 30 04:51:27 2023<br>Checking prerequisites for DB2 installation. Version &quot;11.5.8.0&quot;. Operating system &quot;Linux&quot;<br><br>Validating &quot;kernel level &quot; ...<br>   Required minimum operating system kernel level: &quot;3.10.0&quot;.<br>   Actual operating system kernel level: &quot;5.15.0&quot;.<br>   Requirement matched.<br><br>Validating &quot;Linux distribution &quot; ...<br>   Required minimum &quot;UBUNTU&quot; version: &quot;16.04&quot;<br>   Actual version: &quot;20.04&quot;<br>   Requirement matched.<br><br>Validating &quot;ksh symbolic link&quot; ...<br>   WARNING : Requirement not matched.<br>ERROR:<br>   The &#39;strings&#39; utility that is used to detect prerequisite libraries<br>   is not present on this system.  Please use your package or software<br>   manager to install the GNU Binary Utilities.<br><br>Validating &quot;C++ Library version &quot; ...<br>   Required minimum C++ library: &quot;libstdc++.so.6&quot;<br>   Standard C++ library is located in the following directory: &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28&quot;.<br>DBT3512W  The db2prereqcheck utility failed to determine the currently-installed version of the C++ standard library, libstdc++.<br>   Requirement matched.<br><br>Validating &quot;libaio.so version &quot; ...<br>DBT3553I  The db2prereqcheck utility successfully loaded the libaio.so.1 file.<br>   Requirement matched.<br><br>Validating &quot;libnuma.so version &quot; ...<br>DBT3610I  The db2prereqcheck utility successfully loaded the libnuma.so.1 file.<br>   Requirement matched.<br><br>Validating &quot;/lib/i386-linux-gnu/libpam.so*&quot; ...<br>   DBT3514W  The db2prereqcheck utility failed to find the following 32-bit library file: &quot;/lib/i386-linux-gnu/libpam.so*&quot;.<br>   WARNING : Requirement not matched.<br>Requirement not matched for DB2 database &quot;Server&quot; . Version: &quot;11.5.8.0&quot;.<br>Summary of prerequisites that are not met on the current system:<br>   DBT3514W  The db2prereqcheck utility failed to find the following 32-bit library file: &quot;/lib/i386-linux-gnu/libpam.so*&quot;.<br><br><br>DBT3619W  The db2prereqcheck utility detected that ksh is not linked to ksh or ksh93. This is required for Db2 High Availability Feature with Tivoli SA MP.</pre><ul><li>From the above output we can see the requirement checks are failed and we need to fix them</li><li>Enable 32-bit architecture on your instance and install the required packages</li></ul><pre>$ sudo dpkg --add-architecture i386<br><br>$ sudo apt update<br><br>$ sudo apt install -y ksh ksh93 lib32stdc++6 libpam0g:i386 binutils</pre><ul><li>Once the required packages are installed, rerun the db2prereqcheck command again and verify all the requirements are matched</li></ul><pre>$ sudo ./db2prereqcheck<br><br>==========================================================================<br><br>Sun Apr 30 04:55:30 2023<br>Checking prerequisites for DB2 installation. Version &quot;11.5.8.0&quot;. Operating system &quot;Linux&quot;<br><br>Validating &quot;kernel level &quot; ...<br>   Required minimum operating system kernel level: &quot;3.10.0&quot;.<br>   Actual operating system kernel level: &quot;5.15.0&quot;.<br>   Requirement matched.<br><br>Validating &quot;Linux distribution &quot; ...<br>   Required minimum &quot;UBUNTU&quot; version: &quot;16.04&quot;<br>   Actual version: &quot;20.04&quot;<br>   Requirement matched.<br><br>Validating &quot;ksh symbolic link&quot; ...<br>   Requirement matched.<br><br>Validating &quot;C++ Library version &quot; ...<br>   Required minimum C++ library: &quot;libstdc++.so.6&quot;<br>   Standard C++ library is located in the following directory: &quot;/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28&quot;.<br>   Actual C++ library: &quot;CXXABI_1.3.1&quot;<br>   Requirement matched.<br><br><br>Validating &quot;32 bit version of &quot;libstdc++.so.6&quot; &quot; ...<br>   Found the 64 bit &quot;/lib/x86_64-linux-gnu/libstdc++.so.6&quot; in the following directory &quot;/lib/x86_64-linux-gnu&quot;.<br>   Found the 32 bit &quot;/lib32/libstdc++.so.6&quot; in the following directory &quot;/lib32&quot;.<br>   Requirement matched.<br><br>Validating &quot;libaio.so version &quot; ...<br>DBT3553I  The db2prereqcheck utility successfully loaded the libaio.so.1 file.<br>   Requirement matched.<br><br>Validating &quot;libnuma.so version &quot; ...<br>DBT3610I  The db2prereqcheck utility successfully loaded the libnuma.so.1 file.<br>   Requirement matched.<br><br>Validating &quot;/lib/i386-linux-gnu/libpam.so*&quot; ...<br>   Requirement matched.<br>DBT3533I  The db2prereqcheck utility has confirmed that all installation prerequisites were met.</pre><ul><li>Multiple installation methods available for Db2 for specific use cases</li><li>We are going to install Db2 using db2_install command as root user and wait for the installation to complete</li></ul><pre>$ sudo ./db2_install<br>Read the license agreement file in the db2/license directory.<br><br>***********************************************************<br>To accept those terms, enter &quot;yes&quot;. Otherwise, enter &quot;no&quot; to cancel the install process. [yes/no]<br>yes<br><br><br>Default directory for installation of products - /opt/ibm/db2/V11.5<br><br>***********************************************************<br>Install into default directory (/opt/ibm/db2/V11.5) ? [yes/no]<br>yes<br><br><br>Specify one of the following keywords to install DB2 products.<br><br>  SERVER<br>  CONSV<br>  CLIENT<br>  RTCL<br><br>Enter &quot;help&quot; to redisplay product names.<br><br>Enter &quot;quit&quot; to exit.<br><br>***********************************************************<br>SERVER<br>***********************************************************<br>Do you want to install the DB2 pureScale Feature? [yes/no]<br>no<br>DB2 installation is being initialized.</pre><ul><li>Once the installation is completed, you will see the below message and we can check the installation log file for post installation steps</li></ul><pre>The execution completed successfully.<br><br>For more information see the DB2 installation log at<br>&quot;/tmp/db2_install.log.5295&quot;.</pre><pre>$ cat /tmp/db2_install.log.5295<br>Post-installation instructions<br>-------------------------------<br><br>Required steps:<br>Set up a DB2 instance to work with DB2.<br><br>Optional steps:<br>Notification SMTP server has not been specified. Notifications cannot be sent to contacts in your contact list until this is specified. For more information see the DB2 administration documentation.<br><br>To validate your installation files, instance, and database functionality, run the Validation Tool, /opt/ibm/db2/V11.5/bin/db2val. For more information, see &quot;db2val&quot; in the DB2 Information Center.</pre><ul><li>Let’s validate our installation by executing the db2val command and verify the log file<br>We can see that everything is OK</li></ul><pre>$ sudo /opt/ibm/db2/V11.5/bin/db2val<br>DBI1379I  The db2val command is running. This can take several minutes.<br><br>DBI1335I  Installation file validation for the DB2 copy installed at<br>      /opt/ibm/db2/V11.5 was successful.<br><br>DBI1343I  The db2val command completed successfully. For details, see<br>      the log file /tmp/db2val-230430_051357.log.</pre><pre>$ cat /tmp/db2val-230430_051357.log<br>Installation file validation for the DB2 copy installed at &quot;/opt/ibm/db2/V11.5&quot; starts.<br><br>Task 1: Validating Installation file sets.<br>Status 1 : Success<br><br>Task 2: Validating embedded runtime path for DB2 executables and libraries.<br>Status 2 : Success<br><br>Task 3: Validating the accessibility to the installation path.<br>Status 3 : Success<br><br>Task 4: Validating the accessibility to the /etc/services file.<br>Status 4 : Success<br><br>DBI1335I  Installation file validation for the DB2 copy installed at<br>      /opt/ibm/db2/V11.5 was successful.<br><br>Installation file validation for the DB2 copy installed at &quot;/opt/ibm/db2/V11.5&quot; ends.<br><br>DBI1343I  The db2val command completed successfully. For details, see<br>      the log file /tmp/db2val-230430_051357.log.</pre><h3>Post Installation</h3><ul><li>Create required groups for Db2</li></ul><pre>$ sudo groupadd -g 998 db2iadm1<br><br>$ sudo groupadd -g 997 db2fsdm1<br><br>$ sudo groupadd -g 996 dasadm1</pre><ul><li>Create required users for Db2</li></ul><pre>$ sudo useradd -u 1004 -g db2iadm1 -m -d /home/db2inst1 db2inst1<br><br>$ sudo useradd -u 1003 -g db2fsdm1 -m -d /home/db2fenc1 db2fenc1<br><br>$ sudo useradd -u 1002 -g dasadm1 -m -d /home/dasusr1 dasusr1</pre><ul><li>Set password for users</li></ul><pre>$ sudo passwd db2inst1<br>New password:<br>Retype new password:<br>passwd: password updated successfully<br><br>$ sudo passwd db2fenc1<br>New password:<br>Retype new password:<br>passwd: password updated successfully<br><br>$ sudo passwd dasusr1<br>New password:<br>Retype new password:<br>passwd: password updated successfully</pre><ul><li>Create an instance for Db2 using db2icrt command and verify the log file for information about connecting to database</li></ul><pre>$ sudo /opt/ibm/db2/V11.5/instance/db2icrt -a server -u db2fenc1 db2inst1<br>DBI1446I  The db2icrt command is running.<br><br><br>DB2 installation is being initialized.<br><br> Total number of tasks to be performed: 4<br>Total estimated time for all tasks to be performed: 309 second(s)<br><br>Task #1 start<br>Description: Setting default global profile registry variables<br>Estimated time 1 second(s)<br>Task #1 end<br><br>Task #2 start<br>Description: Initializing instance list<br>Estimated time 5 second(s)<br>Task #2 end<br><br>Task #3 start<br>Description: Configuring DB2 instances<br>Estimated time 300 second(s)<br>Task #3 end<br><br>Task #4 start<br>Description: Updating global profile registry<br>Estimated time 3 second(s)<br>Task #4 end<br><br>The execution completed successfully.<br><br>For more information see the DB2 installation log at &quot;/tmp/db2icrt.log.85927&quot;.<br>DBI1070I  Program db2icrt completed successfully.</pre><pre>$ cat /tmp/db2icrt.log.85927<br><br>Required steps:<br>You can connect to the DB2 instance &quot;db2inst1&quot; using the port number &quot;25000&quot;. Record it for future reference.</pre><ul><li>Let’s start the database instance using the below commands</li></ul><pre>$ sudo su - db2inst1<br><br>$ db2ls<br><br>Install Path                       Level   Fix Pack   Special Install Number   Install Date                  Installer UID<br>---------------------------------------------------------------------------------------------------------------------<br>/opt/ibm/db2/V11.5               11.5.8.0        0                            Sun Apr 30 05:08:04 2023 UTC             0</pre><pre>$ . sqllib/userprofile<br><br>$ db2ilist<br>db2inst1<br><br>$ db2start<br>04/30/2023 05:36:30     0   0   SQL1063N  DB2START processing was successful.<br>SQL1063N  DB2START processing was successful.</pre><ul><li>Now the database instance is started and we can connect to the instance</li></ul><pre>$ db2<br>(c) Copyright IBM Corporation 1993,2007<br>Command Line Processor for DB2 Client 11.5.8.0<br><br>You can issue database manager commands and SQL statements from the command<br>prompt. For example:<br>    db2 =&gt; connect to sample<br>    db2 =&gt; bind sample.bnd<br><br>For general help, type: ?.<br>For command help, type: ? command, where command can be<br>the first few keywords of a database manager command. For example:<br> ? CATALOG DATABASE for help on the CATALOG DATABASE command<br> ? CATALOG          for help on all of the CATALOG commands.<br><br>To exit db2 interactive mode, type QUIT at the command prompt. Outside<br>interactive mode, all commands must be prefixed with &#39;db2&#39;.<br>To list the current command option settings, type LIST COMMAND OPTIONS.<br><br>For more detailed help, refer to the Online Reference Manual.<br><br>db2 =&gt;</pre><ul><li>Create a test database and connect to the database using the below commands</li></ul><pre>db2 =&gt; create database ibm<br>DB20000I  The CREATE DATABASE command completed successfully.<br><br>db2 =&gt; connect to ibm<br><br>   Database Connection Information<br><br> Database server        = DB2/LINUXX8664 11.5.8.0<br> SQL authorization ID   = DB2INST1<br> Local database alias   = IBM</pre><ul><li>Enable automatic start of database instance after reboot<br>Execute the below commands as db2inst1 user</li></ul><pre>$ db2greg -getinstrec instancename=&#39;db2inst1&#39;<br>Retrieved record:<br>   Service      = |DB2|<br>   Version      = |11.5.8.0|<br>   InstanceName = |db2inst1|<br>   InstancePath = |/home/db2inst1/sqllib|<br>   Usage        = |N/A|<br>   StartAtBoot  = 1<br>   Maintenance  = 0<br>   InstallPath  = |/opt/ibm/db2/V11.5|<br>   RemoteProf   = |N/A|<br>   Comment      = |N/A|<br><br>$ db2iauto -on db2inst1</pre><ul><li>Reboot the EC2 instance and verify the Db2 process</li></ul><pre>$ sudo su - db2inst1<br><br>$ ps -ef | grep -i db2<br>root         469       1  0 05:48 ?        00:00:00 /opt/ibm/db2/V11.5/bin/db2fmcd<br>root        1127    1096  0 05:48 pts/0    00:00:00 sudo su - db2inst1<br>root        1128    1127  0 05:48 pts/0    00:00:00 su - db2inst1<br>db2inst1    1129    1128  0 05:48 pts/0    00:00:00 -sh<br>root        1626       1  0 05:49 ?        00:00:00 db2wdog 0 [db2inst1]<br>db2inst1    1628    1626  1 05:49 ?        00:00:00 db2sysc 0<br>root        1635    1626  0 05:49 ?        00:00:00 db2ckpwd 0<br>root        1636    1626  0 05:49 ?        00:00:00 db2ckpwd 0<br>root        1637    1626  0 05:49 ?        00:00:00 db2ckpwd 0<br>db2inst1    1639    1626  0 05:49 ?        00:00:00 db2vend (PD Vendor Process - 1) 0<br>db2inst1    1647    1626  1 05:49 ?        00:00:00 db2acd 0 ,0,0,0,1,0,0,00000000,0,0,0000000000000000,0000000000000000,00000000,00000000,00000000,00000000,00000000,00000000,0000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000c3834000,0000000000000000,0000000000000000,1,0,0,,,,,a89f30,14,1e014,2,0,1,0000000000041fc0,0x240000000,0x240000000,1600000,2,2,13<br>db2inst1    1673    1129  0 05:49 pts/0    00:00:00 ps -ef<br>db2inst1    1674    1129  0 05:49 pts/0    00:00:00 grep -i db2</pre><pre>$ systemctl status db2fmcd<br>● db2fmcd.service - DB2 v11.5.8.0<br>     Loaded: loaded (/etc/systemd/system/db2fmcd.service; enabled; vendor preset: enabled)<br>     Active: active (running) since Sun 2023-04-30 05:48:42 UTC; 11min ago<br>   Main PID: 469 (db2fmcd)<br>      Tasks: 58 (limit: 4686)<br>     Memory: 1.0G<br>     CGroup: /system.slice/db2fmcd.service<br>             ├─ 469 /opt/ibm/db2/V11.5/bin/db2fmcd<br>             ├─1626 db2wdog 0 [db2inst1]<br>             ├─1628 db2sysc 0<br>             ├─1635 db2ckpwd 0<br>             ├─1636 db2ckpwd 0<br>             ├─1637 db2ckpwd 0<br>             ├─1639 db2vend (PD Vendor Process - 1) 0<br>             ├─1647 db2acd 0 ,0,0,0,1,0,0,00000000,0,0,0000000000000000,0000000000000000,00000000,00000000,00000000,00000000,00000000,00000000,0000,00000000,00000000,00000000,00000000,00000000&gt;<br>             └─2450 db2fmp ( ,1,0,0,0,0,0,00000000,0,0,0000000000000000,0000000000000000,00000000,00000000,00000000,00000000,00000000,00000000,0000,00000000,00000000,00000000,00000000,00000000&gt;</pre><ul><li>Connect to our test database and we can see everything is OK</li></ul><pre>$ db2<br>(c) Copyright IBM Corporation 1993,2007<br>Command Line Processor for DB2 Client 11.5.8.0<br><br>You can issue database manager commands and SQL statements from the command<br>prompt. For example:<br>    db2 =&gt; connect to sample<br>    db2 =&gt; bind sample.bnd<br><br>For general help, type: ?.<br>For command help, type: ? command, where command can be<br>the first few keywords of a database manager command. For example:<br> ? CATALOG DATABASE for help on the CATALOG DATABASE command<br> ? CATALOG          for help on all of the CATALOG commands.<br><br>To exit db2 interactive mode, type QUIT at the command prompt. Outside<br>interactive mode, all commands must be prefixed with &#39;db2&#39;.<br>To list the current command option settings, type LIST COMMAND OPTIONS.<br><br>For more detailed help, refer to the Online Reference Manual.<br><br>db2 =&gt; connect to ibm<br><br>   Database Connection Information<br><br> Database server        = DB2/LINUXX8664 11.5.8.0<br> SQL authorization ID   = DB2INST1<br> Local database alias   = IBM</pre><h3>Reference</h3><p><a href="https://www.dbi-services.com/blog/setting-up-ibm-db2-on-linux-root-installation/">https://www.dbi-services.com/blog/setting-up-ibm-db2-on-linux-root-installation/</a></p><p><a href="https://www.ibm.com/docs/en/db2/11.5">https://www.ibm.com/docs/en/db2/11.5</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1bedbe7edd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Upgrading a Kubernetes Cluster using kubeadm]]></title>
            <link>https://iamunnip.medium.com/upgrading-a-kubernetes-cluster-using-kubeadm-8dfa5f21711b?source=rss-b9ae4e01f552------2</link>
            <guid isPermaLink="false">https://medium.com/p/8dfa5f21711b</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Unni P]]></dc:creator>
            <pubDate>Wed, 26 Apr 2023 13:03:54 GMT</pubDate>
            <atom:updated>2023-04-26T13:03:54.536Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we will look how we can upgrade a Kubernetes cluster using kubeadm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ACwdFyS7GCiY49NRh70BA.png" /></figure><h3>Prerequisites</h3><ul><li>We need a working Kubernetes cluster created using kubeadm</li><li>If you haven’t createdmthe cluster, please check my previous article below<br>This will guide you to create a Kubernetes v1.27.0 cluster</li></ul><p><a href="https://iamunnip.medium.com/building-a-kubernetes-cluster-using-kubeadm-d72b0175f395">Building a Kubernetes Cluster using kubeadm</a></p><h3>Steps</h3><h4>Control Plane</h4><ul><li>Verify the version of our cluster by executing the below command in the <strong>[control-plane]</strong> instance</li></ul><pre>$ kubectl get nodes<br>NAME            STATUS   ROLES           AGE    VERSION<br>control-plane   Ready    control-plane   7m5s   v1.27.0<br>node-1          Ready    &lt;none&gt;          91s    v1.27.0<br>node-2          Ready    &lt;none&gt;          17s    v1.27.0</pre><ul><li>Update the package index and find the latest kubeadm patch available in the repository</li></ul><pre>$ sudo apt update<br><br>$ sudo apt-cache madison kubeadm</pre><ul><li>Unhold the kubeadm package for upgrading</li></ul><pre>$ sudo apt-cache unhold kubeadm</pre><ul><li>Upgrade the kubeadm package to version v1.27.1 and hold the package from automatic upgrading</li></ul><pre><br>$ sudo apt install -y kubeadm=1.27.1-00<br><br>$ sudo apt-mark hold kubeadm</pre><ul><li>Check the upgraded kubeadm version and verify the upgrade plan</li></ul><pre>$ sudo kubeadm version<br><br>$ sudo kubeadm upgrade plan</pre><ul><li>Once our plan is verified, we can upgrade the <strong>[control-plane]</strong> by executing the below command</li></ul><pre>$ sudo kubeadm upgrade apply v1.27.1</pre><ul><li>Prepare the <strong>[control-plane]</strong> node for maintenance by marking it unschedulable and evicting the workloads</li></ul><pre>$ kubectl drain control-plane --ignore-daemonsets</pre><ul><li>Unhold the kubelet and kubectl packages for upgrade</li></ul><pre>$ sudo apt-mark unhold kubelet kubectl</pre><ul><li>Upgrade kubelet and kubectl packages to version v1.27.1 and hold the packages from automatic upgrading</li></ul><pre>$ sudo apt install kubelet=1.27.1-00 kubectl=1.27.1-00<br><br>$ sudo apt-mark hold kubelet kubectl</pre><ul><li>Restart the kubelet on <strong>[control-plane]</strong></li></ul><pre>$ sudo systemctl daemon-reload<br><br>$ sudo systemctl restart kubelet</pre><ul><li>Uncordon the <strong>[control-plane]</strong> for marking it as schedulable</li></ul><pre>$ kubectl uncordon control-plane</pre><ul><li>Verify the nodes, now we can see <strong>[control-plane]</strong> is upgraded to v1.27.1</li></ul><pre>$ kubectl get nodes<br>NAME            STATUS   ROLES           AGE    VERSION<br>control-plane   Ready    control-plane   118m   v1.27.1<br>node-1          Ready    &lt;none&gt;          112m   v1.27.0<br>node-2          Ready    &lt;none&gt;          111m   v1.27.0</pre><h4>Nodes</h4><ul><li>Update the package index on <strong>[node-1]</strong> and unhold the kubeadm package for upgrading</li></ul><pre>$ sudo apt update<br><br>$ sudo apt-mark unhold kubeadm</pre><ul><li>Upgrade the kubeadm package to version v1.27.1 on <strong>[node-1]</strong> and hold the package from automatic upgrading</li></ul><pre>$ sudo apt install kubeadm=1.27.1-00<br><br>$ sudo apt-mark hold kubeadm</pre><ul><li>Upgrade the cluster configuration on <strong>[node-1]</strong> using the below command</li></ul><pre>$ sudo kubeadm upgrade node</pre><ul><li>Prepare the <strong>[node-1]</strong> for maintenance by marking it unschedulable and evicting the workloads<br>Execute the below drain command on <strong>[control-plane]</strong></li></ul><pre>$ kubectl drain node-1 --ignore-daemonsets --force</pre><ul><li>Unhold the kubelet and kubectl packages for upgrade</li></ul><pre>$ sudo apt-mark unhold kubelet kubectl</pre><ul><li>Upgrade kubelet and kubectl packages to version v1.27.1 and hold the packages from automatic upgrading</li></ul><pre>$ sudo apt install kubelet=1.27.1-00 kubectl=1.27.1-00<br><br>$ sudo apt-mark hold kubelet kubectl</pre><ul><li>Restart the kubelet on <strong>[node-1]</strong></li></ul><pre>$ sudo systemctl daemon-reload<br><br>$ sudo systemctl restart kubelet</pre><ul><li>Uncordon the <strong>[node-1]</strong> for marking it as schedulable<br>Execute the below uncordon command on <strong>[control-plane]</strong></li></ul><pre>$ kubectl uncordon node-1</pre><ul><li>Repeat the above steps for <strong>[node-2]</strong> also</li><li>Now our cluster is fully upgraded to v1.27.1<br>Verify the same by executing the below command on <strong>[control-plane]</strong></li></ul><pre>$ kubectl get nodes<br>NAME            STATUS   ROLES           AGE    VERSION<br>control-plane   Ready    control-plane   136m   v1.27.1<br>node-1          Ready    &lt;none&gt;          131m   v1.27.1<br>node-2          Ready    &lt;none&gt;          129m   v1.27.1</pre><h3>Reference</h3><p><a href="https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/">https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/</a></p><p><a href="https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/upgrading-linux-nodes/">https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/upgrading-linux-nodes/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dfa5f21711b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Kubernetes Cluster using kubeadm]]></title>
            <link>https://iamunnip.medium.com/building-a-kubernetes-cluster-using-kubeadm-d72b0175f395?source=rss-b9ae4e01f552------2</link>
            <guid isPermaLink="false">https://medium.com/p/d72b0175f395</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-native]]></category>
            <dc:creator><![CDATA[Unni P]]></dc:creator>
            <pubDate>Wed, 26 Apr 2023 06:12:50 GMT</pubDate>
            <atom:updated>2023-04-27T03:46:17.547Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this article, we will look how we can create a three node Kubernetes cluster using kubeadm</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L1yYgijblCujJ2cwICY3wQ.png" /></figure><h3>Introduction</h3><ul><li>kubeadm is a tool used to create Kubernetes clusters</li><li>It automates the creation of Kubernetes clusters by bootstrapping the control plane, joining the nodes etc</li><li>Follows Kubernetes release cycle</li><li>Open-source tool maintained by the Kubernetes community</li></ul><h3>Prerequisites</h3><ul><li>Create three Ubuntu 20.04 LTS instances <strong>[control-plane, node-1, node-2]</strong></li><li>Each instance has a minimum specification of 2 CPU and 2 GB RAM</li><li>Networking must be enabled between instances</li><li>Required ports must be allowed between instances</li><li>Swap must be disabled on instances</li></ul><h3>Steps</h3><ul><li>Set up unique hostnames on all instances <strong>[control-plane, node-1, node-2]</strong><br>Once the hostnames are set, logout from the current session and log back in to reflect the changes</li></ul><pre>$ sudo hostnamectl set-hostname control-plane</pre><pre>$ sudo hostnamectl set-hostname node-1</pre><pre>$ sudo hostnamectl set-hostname node-2</pre><ul><li>Update the hosts file on all instances <strong>[control-plane, node-1, node-2]</strong> to enable communication via hostnames</li></ul><pre>$ sudo vi /etc/hosts<br><br>172.31.12.122 control-plane<br>172.31.7.52  node-1<br>172.31.10.184 node-2</pre><ul><li>Disable swap on all instances<strong> [control-plane, node-1, node-2] </strong>and if swap entry is present in the fstab file then comment out the line</li></ul><pre>$ sudo swapoff -a<br><br>$ sudo vi /etc/fstab<br>  # comment out swap entry</pre><ul><li>Setup containerd as our container runtime on all instances <strong>[control-plane, node-1, node-2] </strong>and in order to do that, first we need to load some Kernel modules and modify system settings</li></ul><pre>$ cat &lt;&lt; EOF | sudo tee /etc/modules-load.d/containerd.conf<br>overlay<br>br_netfilter<br>EOF</pre><pre>$ sudo modprobe overlay<br><br>$ sudo modprobe br_netfilter</pre><pre>$ cat &lt;&lt; EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf<br>net.bridge.bridge-nf-call-iptables = 1<br>net.ipv4.ip_forward = 1<br>net.bridge.bridge-nf-call-ip6tables = 1<br>EOF</pre><pre>$ sudo sysctl --system</pre><ul><li>Once the Kernel modules are loaded and modified system settings, now we can install containerd on all instances <strong>[control-plane, node-1, node-2]</strong></li></ul><pre>$ sudo apt update<br><br>$ sudo apt install -y containerd</pre><ul><li>Once installed, generate a default configuration file for contained on all instances <strong>[control-plane, node-1, node-2]</strong> and restart the service</li></ul><pre>$ sudo mkdir -p /etc/containerd<br><br>$ sudo containerd config default | sudo tee /etc/containerd/config.toml</pre><pre>$ sudo systemctl restart containerd</pre><ul><li>Install some prerequisite packages on all instances <strong>[control-plane, node-1, node-2]</strong> for configuring Kubernetes apt repository</li></ul><pre>$ sudo apt update<br><br>$ sudo apt install -y apt-transport-https ca-certificates curl</pre><ul><li>Download the Google Cloud public signing key and configure Kubernetes apt repository on all instances <strong>[control-plane, node-1, node-2]</strong></li></ul><pre>$ sudo mkdir /etc/apt/keyrings<br><br>$ sudo curl -fsSLo /etc/apt/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg<br><br>$ echo &quot;deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main&quot; | sudo tee /etc/apt/sources.list.d/kubernetes.list</pre><ul><li>Install kubeadm, kubelet and kubectl tools and hold their version on all instances <strong>[control-plane, node-1, node-2]</strong></li></ul><pre>$ sudo apt update<br><br>$ sudo apt install -y kubeadm=1.27.0-00 kubelet=1.27.0-00 kubectl=1.27.0-00<br><br>$ sudo apt-mark hold kubeadm kubelet kubectl</pre><ul><li>Initialize the cluster by executing the below command on <strong>[control-plane]</strong> instance</li></ul><pre>$ sudo kubeadm init --pod-network-cidr 192.168.0.0/16 --kubernetes-version 1.27.0</pre><ul><li>Once the installation is completed, setup our access to the cluster on <strong>[control-plane]</strong> instance</li></ul><pre>$ mkdir -p $HOME/.kube<br><br>$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config<br><br>$ sudo chown $(id -u):$(id -g) $HOME/.kube/config</pre><ul><li>Verify our cluster by listing the nodes on <strong>[control-plane]</strong> instance<br>But our nodes are in NotReady state because we haven’t setup networking</li></ul><pre>$ kubectl get nodes<br>NAME            STATUS     ROLES           AGE   VERSION<br>control-plane   NotReady   control-plane   36s   v1.27.0</pre><ul><li>Install Calico network addon on <strong>[control-plane]</strong> instance and verify the status</li></ul><pre>$ kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.25.1/manifests/calico.yaml</pre><pre>$ kubectl get nodes<br>NAME            STATUS   ROLES           AGE     VERSION<br>control-plane   Ready    control-plane   2m51s   v1.27.0</pre><ul><li>Once the networking is enabled, join our workload nodes to the cluster<br>Get the join command from the <strong>[control-plane]</strong> instance</li></ul><pre>$ kubeadm token create --print-join-command<br>kubeadm join 172.31.12.122:6443 --token 6t3r2c.5zzsgtekwwltofwt --discovery-token-ca-cert-hash sha256:2f1c4115125ec62af8ae6ab2648277ace3a625ebc0281e85ca8145e0e9077ee4</pre><ul><li>Once the join command is copied from <strong>[control-plane] </strong>instance, execute them in the <strong>[node-1, node-2]</strong> instances</li></ul><pre>$ sudo kubeadm join 172.31.12.122:6443 --token 6t3r2c.5zzsgtekwwltofwt --discovery-token-ca-cert-hash sha256:2f1c4115125ec62af8ae6ab2648277ace3a625ebc0281e85ca8145e0e9077ee4</pre><ul><li>Verify our cluster from the <strong>[control-plane]</strong> instance, it should be in a READY state</li></ul><pre>$ kubectl get nodes<br>NAME            STATUS   ROLES           AGE    VERSION<br>control-plane   Ready    control-plane   7m5s   v1.27.0<br>node-1          Ready    &lt;none&gt;          91s    v1.27.0<br>node-2          Ready    &lt;none&gt;          17s    v1.27.0</pre><ul><li>Deploy a Nginx pod, expose it as ClusterIP from the <strong>[control-plane] </strong>instance and verify it’s status</li></ul><pre>$ kubectl run nginx --image=nginx --port=80 --expose<br>service/nginx created<br>pod/nginx created</pre><pre>$ kubectl get pod nginx -o wide<br>NAME    READY   STATUS    RESTARTS   AGE   IP               NODE     NOMINATED NODE   READINESS GATES<br>nginx   1/1     Running   0          30s   192.168.84.129   node-1   &lt;none&gt;           &lt;none&gt;<br><br>$ kubectl get svc nginx<br>NAME    TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE<br>nginx   ClusterIP   10.111.228.20   &lt;none&gt;        80/TCP    39s</pre><h3>Reference</h3><p><a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/">https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/</a></p><p><a href="https://acloudguru.com/course/introduction-to-kubernetes">https://acloudguru.com/course/introduction-to-kubernetes</a></p><h3>Checkout the next part</h3><p><a href="https://iamunnip.medium.com/upgrading-a-kubernetes-cluster-using-kubeadm-8dfa5f21711b">Upgrading a Kubernetes Cluster using kubeadm</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d72b0175f395" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Merging kubeconfig Files]]></title>
            <link>https://iamunnip.medium.com/merging-kubeconfig-files-c9e0f340a71c?source=rss-b9ae4e01f552------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9e0f340a71c</guid>
            <category><![CDATA[container-orchestration]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-native]]></category>
            <dc:creator><![CDATA[Unni P]]></dc:creator>
            <pubDate>Mon, 24 Apr 2023 13:38:05 GMT</pubDate>
            <atom:updated>2023-04-24T13:46:25.896Z</atom:updated>
            <content:encoded><![CDATA[<p>In this short article, we will look how we can merge a new kubeconfig file to an existing config file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0N4ueMHP42jF6zeIRdh07A.png" /></figure><h3>Introduction</h3><ul><li>Kubernetes is an open-source container orchestration tool to manage containerized applications</li><li>An important component of Kubernetes is kubeconfig, a configuration file used to connect to our clusters</li><li>A kubeconfig file contains cluster name and endpoint, user credentials and the context</li></ul><h3>Steps</h3><ul><li>Make a copy of your existing kubeconfig file</li></ul><pre>$ cp ~/.kube/config ~/.kube/config.bak</pre><ul><li>Merge the old and new kubeconfig files using the below command</li></ul><pre>$ KUBECONFIG=~/.kube/config:~/new-kubeconfig.yml \<br>             kubectl config view --flatten &gt; ~/merged-kubeconfig.yml</pre><ul><li>Replace your old config with new merged config file</li></ul><pre>$ cp ~/merged-kubeconfig.yml ~/.kube/config</pre><ul><li>List the contexts, now you can see our new cluster</li></ul><pre>$ kubectl config get-contexts</pre><h3>Reference</h3><p><a href="https://jacobtomlinson.dev/posts/2019/how-to-merge-kubernetes-kubectl-config-files/">https://jacobtomlinson.dev/posts/2019/how-to-merge-kubernetes-kubectl-config-files/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9e0f340a71c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[kind — Local Kubernetes Cluster — Part 7]]></title>
            <link>https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-7-d52fbc1fdd44?source=rss-b9ae4e01f552------2</link>
            <guid isPermaLink="false">https://medium.com/p/d52fbc1fdd44</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[kind]]></category>
            <dc:creator><![CDATA[Unni P]]></dc:creator>
            <pubDate>Fri, 21 Apr 2023 04:56:31 GMT</pubDate>
            <atom:updated>2023-04-21T04:56:31.700Z</atom:updated>
            <content:encoded><![CDATA[<h3>kind — Local Kubernetes Cluster — Part 7</h3><p>In this article we will look how we can configure our cluster to use Calico as CNI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*nzCO38pyKTeYN2Z-Ydh29A.png" /><figcaption>Image source — kind documentation</figcaption></figure><h3>Prerequisites</h3><ul><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-1-8e3b56c773cd">kind — Local Kubernetes Cluster — Part 1</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-2-c60c31754ef5">kind — Local Kubernetes Cluster — Part 2</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-3-50bc076ceece">kind — Local Kubernetes Cluster — Part 3</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-4-cf47c46c812e">kind — Local Kubernetes Cluster — Part 4</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-5-25844d448926">kind — Local Kubernetes Cluster — Part 5</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-6-775397fa060d">kind — Local Kubernetes Cluster — Part 6</a></li></ul><h3>Introduction</h3><ul><li>kind ships with a simple networking implementation called kindnetd</li><li>Based on standard CNI plugins (ptp, host-local) and simple netlink routes</li><li>It also handles IP masquerade</li><li>We can disable the default CNI in kind and use Calico as our CNI</li></ul><h3>Usage</h3><ul><li>Create a cluster using the below configuration file</li></ul><pre>$ cat kind.yml <br>apiVersion: kind.x-k8s.io/v1alpha4<br>kind: Cluster<br>name: dev<br>networking:<br>  disableDefaultCNI: true<br>nodes:<br>- role: control-plane<br>- role: worker<br>- role: worker</pre><pre>$ kind create cluster --config kind.yml <br>Creating cluster &quot;dev&quot; ...<br> ✓ Ensuring node image (kindest/node:v1.26.3) 🖼<br> ✓ Preparing nodes 📦 📦 📦  <br> ✓ Writing configuration 📜 <br> ✓ Starting control-plane 🕹️ <br> ✓ Installing StorageClass 💾 <br> ✓ Joining worker nodes 🚜 <br>Set kubectl context to &quot;kind-dev&quot;<br>You can now use your cluster with:<br><br>kubectl cluster-info --context kind-dev</pre><ul><li>Since we don’t have any CNI installed in the cluster and we can see the nodes are in NotReady state and CoreDNS pods are in pending state</li></ul><pre>$ kubectl get nodes<br>NAME                STATUS     ROLES           AGE   VERSION<br>dev-control-plane   NotReady   control-plane   65s   v1.26.3<br>dev-worker          NotReady   &lt;none&gt;          48s   v1.26.3<br>dev-worker2         NotReady   &lt;none&gt;          35s   v1.26.3</pre><pre>$ kubectl -n kube-system get pods<br>NAME                                        READY   STATUS    RESTARTS   AGE<br>coredns-787d4945fb-c5xfr                    0/1     Pending   0          115s<br>coredns-787d4945fb-mlphp                    0/1     Pending   0          115s<br>etcd-dev-control-plane                      1/1     Running   0          2m8s<br>kube-apiserver-dev-control-plane            1/1     Running   0          2m8s<br>kube-controller-manager-dev-control-plane   1/1     Running   0          2m7s<br>kube-proxy-74mrj                            1/1     Running   0          114s<br>kube-proxy-txj8v                            1/1     Running   0          101s<br>kube-proxy-xrqnn                            1/1     Running   0          115s<br>kube-scheduler-dev-control-plane            1/1     Running   0          2m8s</pre><ul><li>Install Calico CNI using the manifest file available from their documentation</li></ul><pre>$ kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.25.1/manifests/calico.yaml<br>poddisruptionbudget.policy/calico-kube-controllers created<br>serviceaccount/calico-kube-controllers created<br>serviceaccount/calico-node created<br>configmap/calico-config created<br>customresourcedefinition.apiextensions.k8s.io/bgpconfigurations.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/bgppeers.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/blockaffinities.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/caliconodestatuses.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/clusterinformations.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/felixconfigurations.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/globalnetworkpolicies.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/globalnetworksets.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/hostendpoints.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/ipamblocks.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/ipamconfigs.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/ipamhandles.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/ippools.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/ipreservations.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/kubecontrollersconfigurations.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/networkpolicies.crd.projectcalico.org created<br>customresourcedefinition.apiextensions.k8s.io/networksets.crd.projectcalico.org created<br>clusterrole.rbac.authorization.k8s.io/calico-kube-controllers created<br>clusterrole.rbac.authorization.k8s.io/calico-node created<br>clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers created<br>clusterrolebinding.rbac.authorization.k8s.io/calico-node created<br>daemonset.apps/calico-node created<br>deployment.apps/calico-kube-controllers created</pre><ul><li>Verify the status of the nodes and pods</li></ul><pre>$ kubectl get nodes<br>NAME                STATUS   ROLES           AGE     VERSION<br>dev-control-plane   Ready    control-plane   6m12s   v1.26.3<br>dev-worker          Ready    &lt;none&gt;          5m55s   v1.26.3<br>dev-worker2         Ready    &lt;none&gt;          5m42s   v1.26.3</pre><pre>$ kubectl -n kube-system get pods<br>NAME                                        READY   STATUS    RESTARTS   AGE<br>calico-kube-controllers-5857bf8d58-4kcbd    1/1     Running   0          4m14s<br>calico-node-8qrmb                           1/1     Running   0          4m14s<br>calico-node-v9mrj                           1/1     Running   0          4m14s<br>calico-node-vml2c                           1/1     Running   0          4m14s<br>coredns-787d4945fb-c5xfr                    1/1     Running   0          7m58s<br>coredns-787d4945fb-mlphp                    1/1     Running   0          7m58s<br>etcd-dev-control-plane                      1/1     Running   0          8m11s<br>kube-apiserver-dev-control-plane            1/1     Running   0          8m11s<br>kube-controller-manager-dev-control-plane   1/1     Running   0          8m10s<br>kube-proxy-74mrj                            1/1     Running   0          7m57s<br>kube-proxy-txj8v                            1/1     Running   0          7m44s<br>kube-proxy-xrqnn                            1/1     Running   0          7m58s<br>kube-scheduler-dev-control-plane            1/1     Running   0          8m11s</pre><ul><li>Deploy our Nginx application by creating a pod and exposing it as ClusterIP</li></ul><pre>$ kubectl run nginx --image=nginx --port=80 --expose<br>service/nginx created<br>pod/nginx created</pre><pre>$ kubectl get pods nginx<br>NAME    READY   STATUS    RESTARTS   AGE<br>nginx   1/1     Running   0          32s</pre><pre>$ kubectl get svc nginx<br>NAME    TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE<br>nginx   ClusterIP   10.96.106.155   &lt;none&gt;        80/TCP    34s</pre><ul><li>Verify our Nginx application</li></ul><pre>$ kubectl run busybox --image=busybox --restart=Never --rm -it -- wget -O- http://nginx<br>If you don&#39;t see a command prompt, try pressing enter.<br>warning: couldn&#39;t attach to pod/busybox, falling back to streaming logs: Internal error occurred: error attaching to container: failed to load task: no running task found: task 9268947ec3741ac1bad25fab9454c9c56e51131e7d65098993a87a96ed7ea7d7 not found: not found<br>Connecting to nginx (10.96.106.155:80)<br>writing to stdout<br>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;title&gt;Welcome to nginx!&lt;/title&gt;<br>&lt;style&gt;<br>html { color-scheme: light dark; }<br>body { width: 35em; margin: 0 auto;<br>font-family: Tahoma, Verdana, Arial, sans-serif; }<br>&lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;h1&gt;Welcome to nginx!&lt;/h1&gt;<br>&lt;p&gt;If you see this page, the nginx web server is successfully installed and<br>working. Further configuration is required.&lt;/p&gt;<br><br>&lt;p&gt;For online documentation and support please refer to<br>&lt;a href=&quot;http://nginx.org/&quot;&gt;nginx.org&lt;/a&gt;.&lt;br/&gt;<br>Commercial support is available at<br>&lt;a href=&quot;http://nginx.com/&quot;&gt;nginx.com&lt;/a&gt;.&lt;/p&gt;<br><br>&lt;p&gt;&lt;em&gt;Thank you for using nginx.&lt;/em&gt;&lt;/p&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br>-                    100% |********************************|   615  0:00:00 ETA<br>written to stdout<br>pod &quot;busybox&quot; deleted</pre><p>Cleanup</p><ul><li>Delete our cluster after use</li></ul><pre>$ kind delete cluster --name dev<br>Deleting cluster &quot;dev&quot; ...<br>Deleted nodes: [&quot;dev-control-plane&quot; &quot;dev-worker&quot; &quot;dev-worker2&quot;]</pre><h3>Reference</h3><p><a href="https://kind.sigs.k8s.io/">https://kind.sigs.k8s.io/</a><br><a href="https://docs.tigera.io/calico/latest/getting-started/kubernetes/self-managed-onprem/onpremises">https://docs.tigera.io/calico/latest/getting-started/kubernetes/self-managed-onprem/onpremises</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d52fbc1fdd44" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[kind — Local Kubernetes Cluster — Part 6]]></title>
            <link>https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-6-775397fa060d?source=rss-b9ae4e01f552------2</link>
            <guid isPermaLink="false">https://medium.com/p/775397fa060d</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[kind]]></category>
            <dc:creator><![CDATA[Unni P]]></dc:creator>
            <pubDate>Fri, 21 Apr 2023 04:09:10 GMT</pubDate>
            <atom:updated>2023-04-21T04:17:09.253Z</atom:updated>
            <content:encoded><![CDATA[<h3>kind — Local Kubernetes Cluster — Part 6</h3><h4>In this article we will look how we can get service type LoadBalancer in our cluster using MetalLB</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*nzCO38pyKTeYN2Z-Ydh29A.png" /><figcaption>Image source — kind documentation</figcaption></figure><h3>Prerequisites</h3><ul><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-1-8e3b56c773cd">kind — Local Kubernetes Cluster — Part 1</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-2-c60c31754ef5">kind — Local Kubernetes Cluster — Part 2</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-3-50bc076ceece">kind — Local Kubernetes Cluster — Part 3</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-4-cf47c46c812e">kind — Local Kubernetes Cluster — Part 4</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-5-25844d448926">kind — Local Kubernetes Cluster — Part 5</a></li></ul><h3>Introduction</h3><ul><li>MetalLB provides a network load balancer implementation in our cluster</li><li>Allows you to create Kubernetes services of type LoadBalancer in clusters that don’t run on a cloud provider</li><li>Sets up MetalLB using layer2 protocol</li><li>We can send traffic directly to the load balancer’s external IP if the IP space is within the Docker IP space</li></ul><h3>Usage</h3><ul><li>Create a simple cluster using the below configuration file</li></ul><pre>$ cat kind.yml <br>kind: Cluster<br>apiVersion: kind.x-k8s.io/v1alpha4<br>name: dev<br>nodes:<br>- role: control-plane<br>- role: worker<br>- role: worker</pre><pre>$ kind create cluster --config kind.yml <br>Creating cluster &quot;dev&quot; ...<br> ✓ Ensuring node image (kindest/node:v1.26.3) 🖼<br> ✓ Preparing nodes 📦 📦 📦  <br> ✓ Writing configuration 📜 <br> ✓ Starting control-plane 🕹️ <br> ✓ Installing CNI 🔌 <br> ✓ Installing StorageClass 💾 <br> ✓ Joining worker nodes 🚜 <br>Set kubectl context to &quot;kind-dev&quot;<br>You can now use your cluster with:<br><br>kubectl cluster-info --context kind-dev</pre><pre>$ kubectl get nodes<br>NAME                STATUS   ROLES           AGE   VERSION<br>dev-control-plane   Ready    control-plane   68s   v1.26.3<br>dev-worker          Ready    &lt;none&gt;          37s   v1.26.3<br>dev-worker2         Ready    &lt;none&gt;          37s   v1.26.3</pre><ul><li>Deploy MetalLB using the default manifests and verify the components are up and running</li></ul><pre>$ kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml<br>namespace/metallb-system created<br>customresourcedefinition.apiextensions.k8s.io/addresspools.metallb.io created<br>customresourcedefinition.apiextensions.k8s.io/bfdprofiles.metallb.io created<br>customresourcedefinition.apiextensions.k8s.io/bgpadvertisements.metallb.io created<br>customresourcedefinition.apiextensions.k8s.io/bgppeers.metallb.io created<br>customresourcedefinition.apiextensions.k8s.io/communities.metallb.io created<br>customresourcedefinition.apiextensions.k8s.io/ipaddresspools.metallb.io created<br>customresourcedefinition.apiextensions.k8s.io/l2advertisements.metallb.io created<br>serviceaccount/controller created<br>serviceaccount/speaker created<br>role.rbac.authorization.k8s.io/controller created<br>role.rbac.authorization.k8s.io/pod-lister created<br>clusterrole.rbac.authorization.k8s.io/metallb-system:controller created<br>clusterrole.rbac.authorization.k8s.io/metallb-system:speaker created<br>rolebinding.rbac.authorization.k8s.io/controller created<br>rolebinding.rbac.authorization.k8s.io/pod-lister created<br>clusterrolebinding.rbac.authorization.k8s.io/metallb-system:controller created<br>clusterrolebinding.rbac.authorization.k8s.io/metallb-system:speaker created<br>secret/webhook-server-cert created<br>service/webhook-service created<br>deployment.apps/controller created<br>daemonset.apps/speaker created<br>validatingwebhookconfiguration.admissionregistration.k8s.io/metallb-webhook-configuration created</pre><pre>$ kubectl -n metallb-system get pods<br>NAME                          READY   STATUS    RESTARTS   AGE<br>controller-577b5bdfcc-p7sb5   1/1     Running   0          76s<br>speaker-cgmm4                 1/1     Running   0          76s<br>speaker-gwfqr                 1/1     Running   0          76s<br>speaker-jk684                 1/1     Running   0          76s</pre><ul><li>As we said earlier in the introduction part, we are using layer2 protocol of MetalLB.<br>For completing the layer2 configuration, we need to provide MetalLB a range of IP addresses it controls. This IP address range need to be in the Docker kind network.</li></ul><pre>$ docker network inspect -f &#39;{{.IPAM.Config}}&#39; kind<br>[{172.18.0.0/16  172.18.0.1 map[]} {fc00:f853:ccd:e793::/64  fc00:f853:ccd:e793::1 map[]}]</pre><ul><li>Now we want our load balancer IP range to come from this subclass and we can configure MetalLB to use 172.19.255.200 to 172.19.255.250 by creating IPAddressPool and L2Advertisement resources.</li><li>Create the necessary MetalLB resources using the below manifest file.</li></ul><pre>$ cat metallb.yml <br>apiVersion: metallb.io/v1beta1<br>kind: IPAddressPool<br>metadata:<br>  name: kind<br>  namespace: metallb-system<br>spec:<br>  addresses:<br>  - 172.18.255.200-172.18.255.250<br><br>---<br>apiVersion: metallb.io/v1beta1<br>kind: L2Advertisement<br>metadata:<br>  name: kind<br>  namespace: metallb-system<br>spec:<br>  ipAddressPools:<br>  - kind</pre><pre>$ kubectl apply -f metallb.yml <br>ipaddresspool.metallb.io/kind unchanged<br>l2advertisement.metallb.io/kind created</pre><pre>$ kubectl -n metallb-system get ipaddresspools<br>NAME   AUTO ASSIGN   AVOID BUGGY IPS   ADDRESSES<br>kind   true          false             [&quot;172.18.255.200-172.18.255.250&quot;]<br><br>$ kubectl -n metallb-system get l2advertisements<br>NAME   IPADDRESSPOOLS   IPADDRESSPOOL SELECTORS   INTERFACES<br>kind   [&quot;kind&quot;]</pre><h3>Deploy our Application</h3><ul><li>Create a Nginx pod using the below manifest file and verify it’s status</li></ul><pre>$ cat nginx.yml <br>apiVersion: v1<br>kind: Pod<br>metadata:<br>  labels:<br>    run: nginx<br>  name: nginx<br>spec:<br>  containers:<br>  - image: nginx<br>    name: nginx<br>    ports:<br>    - containerPort: 80</pre><pre>$ kubectl apply -f nginx.yml <br>pod/nginx created</pre><pre>$ kubectl get pods nginx<br>NAME    READY   STATUS    RESTARTS   AGE<br>nginx   1/1     Running   0          23s</pre><ul><li>Expose the Nginx pod as a LoadBalancer service using the below manifest file</li></ul><pre>$ cat nginx-loadbalancer.yml <br>apiVersion: v1<br>kind: Service<br>metadata:<br>  labels:<br>    run: nginx<br>  name: nginx<br>spec:<br>  ports:<br>  - port: 80<br>    protocol: TCP<br>    targetPort: 80<br>  selector:<br>    run: nginx<br>  type: LoadBalancer</pre><pre>$ kubectl apply -f nginx-loadbalancer.yml <br>service/nginx created</pre><ul><li>Check the created nginx service and we can see a IP address in the EXTERNAL-IP section</li></ul><pre>$ kubectl get svc nginx <br>NAME    TYPE           CLUSTER-IP     EXTERNAL-IP      PORT(S)        AGE<br>nginx   LoadBalancer   10.96.43.161   172.18.255.200   80:30433/TCP   30s</pre><ul><li>Access the application using external IP and port</li></ul><pre>$ curl http://172.18.255.200:80<br>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;title&gt;Welcome to nginx!&lt;/title&gt;<br>&lt;style&gt;<br>html { color-scheme: light dark; }<br>body { width: 35em; margin: 0 auto;<br>font-family: Tahoma, Verdana, Arial, sans-serif; }<br>&lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;h1&gt;Welcome to nginx!&lt;/h1&gt;<br>&lt;p&gt;If you see this page, the nginx web server is successfully installed and<br>working. Further configuration is required.&lt;/p&gt;<br><br>&lt;p&gt;For online documentation and support please refer to<br>&lt;a href=&quot;http://nginx.org/&quot;&gt;nginx.org&lt;/a&gt;.&lt;br/&gt;<br>Commercial support is available at<br>&lt;a href=&quot;http://nginx.com/&quot;&gt;nginx.com&lt;/a&gt;.&lt;/p&gt;<br><br>&lt;p&gt;&lt;em&gt;Thank you for using nginx.&lt;/em&gt;&lt;/p&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h3>Cleanup</h3><ul><li>Delete the cluster after use</li></ul><pre>$ kind delete cluster --name dev<br>Deleting cluster &quot;dev&quot; ...<br>Deleted nodes: [&quot;dev-worker2&quot; &quot;dev-control-plane&quot; &quot;dev-worker&quot;]</pre><h3>Reference</h3><p><a href="https://kind.sigs.k8s.io/">https://kind.sigs.k8s.io/</a><br><a href="https://metallb.universe.tf/">https://metallb.universe.tf/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=775397fa060d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[kind — Local Kubernetes Cluster — Part 5]]></title>
            <link>https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-5-25844d448926?source=rss-b9ae4e01f552------2</link>
            <guid isPermaLink="false">https://medium.com/p/25844d448926</guid>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kind]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Unni P]]></dc:creator>
            <pubDate>Fri, 21 Apr 2023 01:55:25 GMT</pubDate>
            <atom:updated>2023-04-21T04:14:59.341Z</atom:updated>
            <content:encoded><![CDATA[<h3>kind — Local Kubernetes Cluster — Part 5</h3><p>In this article we will talk about how we can configure Ingress in our cluster</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*nzCO38pyKTeYN2Z-Ydh29A.png" /><figcaption>Image source — kind documentation</figcaption></figure><h3>Prerequisites</h3><ul><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-1-8e3b56c773cd">kind — Local Kubernetes Cluster — Part 1</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-2-c60c31754ef5">kind — Local Kubernetes Cluster — Part 2</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-3-50bc076ceece">kind — Local Kubernetes Cluster — Part 3</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-4-cf47c46c812e">kind — Local Kubernetes Cluster — Part 4</a></li></ul><h3>Ingress</h3><ul><li>An API object that manages external access to the cluster</li><li>Provides load balancing, SSL termination and name based virtual hosting</li><li>Ingress controller is responsible for fulfilling the ingress</li><li>An ingress does not expose arbitrary ports or protocols</li><li>ingress-nginx is a popular ingress controller</li></ul><h3>Configuration</h3><p>Create a cluster using below configuration file, where we have added extra port mappings and node labels.</p><p><strong>extraPortMappings</strong> allow the local host to make requests to the Ingress controller over ports 80 and 443.<br><strong>node-labels</strong> only allow the ingress controller to run on a specific node matching the label selector.</p><pre>$ cat kind.yml <br>apiVersion: kind.x-k8s.io/v1alpha4<br>kind: Cluster<br>name: dev<br>nodes:<br>- role: control-plane<br>  kubeadmConfigPatches:<br>  - |<br>    kind: InitConfiguration<br>    nodeRegistration:<br>      kubeletExtraArgs:<br>        node-labels: &quot;ingress-ready=true&quot;<br>  extraPortMappings:<br>  - containerPort: 80<br>    hostPort: 80<br>    protocol: TCP<br>  - containerPort: 443<br>    hostPort: 443<br>    protocol: TCP<br>- role: worker<br>- role: worker</pre><pre>$ kind create cluster --config kind.yml <br>Creating cluster &quot;dev&quot; ...<br> ✓ Ensuring node image (kindest/node:v1.26.3) 🖼<br> ✓ Preparing nodes 📦 📦 📦  <br> ✓ Writing configuration 📜 <br> ✓ Starting control-plane 🕹️ <br> ✓ Installing CNI 🔌 <br> ✓ Installing StorageClass 💾 <br> ✓ Joining worker nodes 🚜 <br>Set kubectl context to &quot;kind-dev&quot;<br>You can now use your cluster with:<br><br>kubectl cluster-info --context kind-dev</pre><p>Deploy Nginx ingress to our cluster using the manifest file.<br>This manifest contains kind specific patches to forward the hostPorts to the ingress controller, set taint tolerations and schedule it to the custom labelled node.</p><pre>$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml<br>namespace/ingress-nginx created<br>serviceaccount/ingress-nginx created<br>serviceaccount/ingress-nginx-admission created<br>role.rbac.authorization.k8s.io/ingress-nginx created<br>role.rbac.authorization.k8s.io/ingress-nginx-admission created<br>clusterrole.rbac.authorization.k8s.io/ingress-nginx created<br>clusterrole.rbac.authorization.k8s.io/ingress-nginx-admission created<br>rolebinding.rbac.authorization.k8s.io/ingress-nginx created<br>rolebinding.rbac.authorization.k8s.io/ingress-nginx-admission created<br>clusterrolebinding.rbac.authorization.k8s.io/ingress-nginx created<br>clusterrolebinding.rbac.authorization.k8s.io/ingress-nginx-admission created<br>configmap/ingress-nginx-controller created<br>service/ingress-nginx-controller created<br>service/ingress-nginx-controller-admission created<br>deployment.apps/ingress-nginx-controller created<br>job.batch/ingress-nginx-admission-create created<br>job.batch/ingress-nginx-admission-patch created<br>ingressclass.networking.k8s.io/nginx created<br>validatingwebhookconfiguration.admissionregistration.k8s.io/ingress-nginx-admission created</pre><p>Now verify our ingress controller pod is up and running</p><pre>$ kubectl -n ingress-nginx get pods --selector=app.kubernetes.io/component=controller<br>NAME                                        READY   STATUS    RESTARTS   AGE<br>ingress-nginx-controller-6bdf7bdbdd-gbdpc   1/1     Running   0          79s</pre><p>Create Nginx pod using the below manifest file and verify it’s status</p><pre>$ cat nginx.yml <br>apiVersion: v1<br>kind: Pod<br>metadata:<br>  labels:<br>    run: nginx<br>  name: nginx<br>spec:<br>  containers:<br>  - image: nginx<br>    name: nginx<br>    ports:<br>    - containerPort: 80</pre><pre>$ kubectl apply -f nginx.yml <br>pod/nginx created</pre><pre>$ kubectl get pods nginx<br>NAME    READY   STATUS    RESTARTS   AGE<br>nginx   1/1     Running   0          20s</pre><p>Expose our Nginx pod to as ClusterIP service using the below manifest file</p><pre>$ cat nginx-clusterip.yml <br>apiVersion: v1<br>kind: Service<br>metadata:<br>  labels:<br>    run: nginx<br>  name: nginx<br>spec:<br>  ports:<br>  - port: 80<br>    protocol: TCP<br>    targetPort: 80<br>  selector:<br>    run: nginx<br>  type: ClusterIP</pre><pre>$ kubectl apply -f nginx-clusterip.yml <br>service/nginx created</pre><pre>$ kubectl get svc nginx <br>NAME    TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE<br>nginx   ClusterIP   10.96.16.194   &lt;none&gt;        80/TCP    20s</pre><p>Now create an Ingress resource using the below manifest file</p><pre>$ cat nginx-ingress.yml <br>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: nginx<br>  annotations:<br>    nginx.ingress.kubernetes.io/rewrite-target: /$2<br>spec:<br>  ingressClassName: nginx<br>  rules:<br>  - http:<br>      paths:<br>      - pathType: Prefix<br>        path: /my-app<br>        backend:<br>          service:<br>            name: nginx<br>            port:<br>              number: 80</pre><pre>$ kubectl apply -f nginx-ingress.yml <br>ingress.networking.k8s.io/nginx created</pre><pre>$ kubectl get ingress nginx<br>NAME    CLASS   HOSTS   ADDRESS   PORTS   AGE<br>nginx   nginx   *                 80      21s</pre><p>Access our application from our local machine and it worked</p><pre>$ curl http://localhost/my-app<br>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;title&gt;Welcome to nginx!&lt;/title&gt;<br>&lt;style&gt;<br>html { color-scheme: light dark; }<br>body { width: 35em; margin: 0 auto;<br>font-family: Tahoma, Verdana, Arial, sans-serif; }<br>&lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;h1&gt;Welcome to nginx!&lt;/h1&gt;<br>&lt;p&gt;If you see this page, the nginx web server is successfully installed and<br>working. Further configuration is required.&lt;/p&gt;<br><br>&lt;p&gt;For online documentation and support please refer to<br>&lt;a href=&quot;http://nginx.org/&quot;&gt;nginx.org&lt;/a&gt;.&lt;br/&gt;<br>Commercial support is available at<br>&lt;a href=&quot;http://nginx.com/&quot;&gt;nginx.com&lt;/a&gt;.&lt;/p&gt;<br><br>&lt;p&gt;&lt;em&gt;Thank you for using nginx.&lt;/em&gt;&lt;/p&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h3>Cleanup</h3><p>Delete the cluster after use</p><pre>$ kind delete cluster --name dev<br>Deleting cluster &quot;dev&quot; ...<br>Deleted nodes: [&quot;dev-worker&quot; &quot;dev-worker2&quot; &quot;dev-control-plane&quot;]</pre><h3>Reference</h3><p><a href="https://kind.sigs.k8s.io/docs/user/ingress/">https://kind.sigs.k8s.io/</a></p><p><a href="https://kubernetes.io/docs/concepts/services-networking/ingress/">https://kubernetes.io/docs/concepts/services-networking/ingress/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25844d448926" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[kind — Local Kubernetes Cluster — Part 4]]></title>
            <link>https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-4-cf47c46c812e?source=rss-b9ae4e01f552------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf47c46c812e</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[kind]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Unni P]]></dc:creator>
            <pubDate>Thu, 20 Apr 2023 15:53:50 GMT</pubDate>
            <atom:updated>2023-04-21T02:02:37.500Z</atom:updated>
            <content:encoded><![CDATA[<h3>kind — Local Kubernetes Cluster — Part 4</h3><p>In this article we will talk about how we can configure extra port mappings and other networking features</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*nzCO38pyKTeYN2Z-Ydh29A.png" /><figcaption>Image source — kind documentation</figcaption></figure><h3>Prerequisites</h3><p>If you haven’t read my previous articles about kind, please check below</p><ul><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-1-8e3b56c773cd">kind — Local Kubernetes Cluster — Part 1</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-2-c60c31754ef5">kind — Local Kubernetes Cluster — Part 2</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-3-50bc076ceece">kind — Local Kubernetes Cluster — Part 3</a></li></ul><h3>Extra Port Mappings</h3><ul><li>Can be used to port forward to the kind nodes, an option to get traffic into the cluster</li><li>Useful if we are using NodePort services or daemonsets exposing host ports</li><li>To use port mappings with NodePort, the kind node containerPort and the service nodePort needs to be equal</li></ul><p>In the below configuration file containerPort is set as 30080, so we need to set nodePort in Kubernetes service as 30080</p><pre>$ cat kind.yml<br>apiVersion: kind.x-k8s.io/v1alpha4<br>kind: Cluster<br>name: dev<br>nodes:<br>- role: control-plane<br>  extraPortMappings:<br>  - containerPort: 30080<br>    hostPort: 30080<br>    listenAddress: &quot;0.0.0.0&quot;<br>    protocol: TCP<br>- role: worker<br>- role: worker</pre><p>Create the cluster using the above configuration file</p><pre>$ kind create cluster --config kind.yml <br>Creating cluster &quot;dev&quot; ...<br> ✓ Ensuring node image (kindest/node:v1.26.3) 🖼<br> ✓ Preparing nodes 📦 📦 📦  <br> ✓ Writing configuration 📜 <br> ✓ Starting control-plane 🕹️ <br> ✓ Installing CNI 🔌 <br> ✓ Installing StorageClass 💾 <br> ✓ Joining worker nodes 🚜 <br>Set kubectl context to &quot;kind-dev&quot;<br>You can now use your cluster with:<br><br>kubectl cluster-info --context kind-dev</pre><pre>$ kubectl get nodes<br>NAME                STATUS   ROLES           AGE   VERSION<br>dev-control-plane   Ready    control-plane   93s   v1.26.3<br>dev-worker          Ready    &lt;none&gt;          62s   v1.26.3<br>dev-worker2         Ready    &lt;none&gt;          62s   v1.26.3</pre><p>Generate a manifest file for creating an Nginx pod</p><pre>$ kubectl run nginx --image=nginx --port=80 --dry-run=client -o yaml &gt; nginx.yml</pre><pre>$ cat nginx.yml <br>apiVersion: v1<br>kind: Pod<br>metadata:<br>  creationTimestamp: null<br>  labels:<br>    run: nginx<br>  name: nginx<br>spec:<br>  containers:<br>  - image: nginx<br>    name: nginx<br>    ports:<br>    - containerPort: 80<br>    resources: {}<br>  dnsPolicy: ClusterFirst<br>  restartPolicy: Always<br>status: {}</pre><p>Apply the nginx.yml manifest file</p><pre>$ kubectl apply -f nginx.yml <br>pod/nginx created</pre><pre>$ kubectl get pods<br>NAME    READY   STATUS    RESTARTS   AGE<br>nginx   1/1     Running   0          19s</pre><p>Generate a manifest file for exposing Nginx service as NodePort</p><pre>$ kubectl expose pod nginx --name=nginx-nodeport --type=NodePort --port=80 --target-port=80 --dry-run=client -o yaml &gt; nginx-nodeport.yml</pre><p>Update the manifest file with nodePort value as 30080, which is equal to kind node containerPort</p><pre>$ cat nginx-nodeport.yml <br>apiVersion: v1<br>kind: Service<br>metadata:<br>  creationTimestamp: null<br>  labels:<br>    run: nginx<br>  name: nginx-nodeport<br>spec:<br>  ports:<br>  - port: 80<br>    protocol: TCP<br>    targetPort: 80<br>    nodePort: 30080<br>  selector:<br>    run: nginx<br>  type: NodePort<br>status:<br>  loadBalancer: {}</pre><p>Apply the nginx-nodeport.yml manifest file</p><pre>$ kubectl apply -f nginx-nodeport.yml <br>service/nginx-nodeport created</pre><pre>$ kubectl get svc nginx-nodeport <br>NAME             TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE<br>nginx-nodeport   NodePort   10.96.152.109   &lt;none&gt;        80:30080/TCP   43s</pre><p>Verify the Nginx default webpage from your local machine</p><pre>$ curl http://localhost:30080<br>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;title&gt;Welcome to nginx!&lt;/title&gt;<br>&lt;style&gt;<br>html { color-scheme: light dark; }<br>body { width: 35em; margin: 0 auto;<br>font-family: Tahoma, Verdana, Arial, sans-serif; }<br>&lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;h1&gt;Welcome to nginx!&lt;/h1&gt;<br>&lt;p&gt;If you see this page, the nginx web server is successfully installed and<br>working. Further configuration is required.&lt;/p&gt;<br><br>&lt;p&gt;For online documentation and support please refer to<br>&lt;a href=&quot;http://nginx.org/&quot;&gt;nginx.org&lt;/a&gt;.&lt;br/&gt;<br>Commercial support is available at<br>&lt;a href=&quot;http://nginx.com/&quot;&gt;nginx.com&lt;/a&gt;.&lt;/p&gt;<br><br>&lt;p&gt;&lt;em&gt;Thank you for using nginx.&lt;/em&gt;&lt;/p&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h3>IPv6 Networking</h3><ul><li>kind has support for IPv4, IPv6 and dual-stack networking</li><li>By default it uses IPv4</li><li>Most OS has IPv6 enabled by default but we can check it using the below command<br><em>sudo sysctl net.ipv6.conf.all.disable_ipv6</em></li></ul><p>Create a cluster using the below configuration file which uses IPv6 networking</p><pre>$ cat kind.yml <br>kind: Cluster<br>apiVersion: kind.x-k8s.io/v1alpha4<br>name: dev<br>networking:<br>  ipFamily: ipv6<br>nodes:<br>- role: control-plane<br>- role: worker<br>- role: worker</pre><pre>$ kind create cluster --config kind.yml <br>Creating cluster &quot;dev&quot; ...<br> ✓ Ensuring node image (kindest/node:v1.26.3) 🖼<br> ✓ Preparing nodes 📦 📦 📦  <br> ✓ Writing configuration 📜 <br> ✓ Starting control-plane 🕹️ <br> ✓ Installing CNI 🔌 <br> ✓ Installing StorageClass 💾 <br> ✓ Joining worker nodes 🚜 <br>Set kubectl context to &quot;kind-dev&quot;<br>You can now use your cluster with:<br><br>kubectl cluster-info --context kind-dev</pre><p>Once the cluster is up and running, we can see that the nodes having IPv6 address</p><pre>$ kubectl get nodes -o wide<br>NAME                STATUS   ROLES           AGE     VERSION   INTERNAL-IP             EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME<br>dev-control-plane   Ready    control-plane   10m     v1.26.3   fc00:f853:ccd:e793::4   &lt;none&gt;        Ubuntu 22.04.2 LTS   5.15.0-69-generic   containerd://1.6.19-46-g941215f49<br>dev-worker          Ready    &lt;none&gt;          10m     v1.26.3   fc00:f853:ccd:e793::2   &lt;none&gt;        Ubuntu 22.04.2 LTS   5.15.0-69-generic   containerd://1.6.19-46-g941215f49<br>dev-worker2         Ready    &lt;none&gt;          9m58s   v1.26.3   fc00:f853:ccd:e793::3   &lt;none&gt;        Ubuntu 22.04.2 LTS   5.15.0-69-generic   containerd://1.6.19-46-g941215f49</pre><p>Now let’s check it by creating a Nginx pod and exposing it as ClusterIP</p><pre>$ kubectl run nginx --image=nginx --port=80 --expose<br>service/nginx created<br>pod/nginx created</pre><pre>$ kubectl get pods -o wide<br>NAME    READY   STATUS    RESTARTS   AGE   IP                 NODE         NOMINATED NODE   READINESS GATES<br>nginx   1/1     Running   0          18s   fd00:10:244:1::2   dev-worker   &lt;none&gt;           &lt;none&gt;</pre><pre>$ kubectl get svc nginx<br>NAME    TYPE        CLUSTER-IP         EXTERNAL-IP   PORT(S)   AGE<br>nginx   ClusterIP   fd00:10:96::ca5a   &lt;none&gt;        80/TCP    3m23s</pre><h3>Cleanup</h3><p>Delete the cluster after use</p><pre>$ kind delete cluster --name dev<br>Deleting cluster &quot;dev&quot; ...<br>Deleted nodes: [&quot;dev-worker2&quot; &quot;dev-control-plane&quot; &quot;dev-worker&quot;]</pre><h3>Reference</h3><p><a href="https://kind.sigs.k8s.io/">https://kind.sigs.k8s.io/</a></p><h3>Checkout the next part</h3><p><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-5-25844d448926">kind — Local Kubernetes Cluster — Part 5</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf47c46c812e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[kind — Local Kubernetes Cluster — Part 3]]></title>
            <link>https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-3-50bc076ceece?source=rss-b9ae4e01f552------2</link>
            <guid isPermaLink="false">https://medium.com/p/50bc076ceece</guid>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[kind]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Unni P]]></dc:creator>
            <pubDate>Thu, 20 Apr 2023 09:39:17 GMT</pubDate>
            <atom:updated>2023-04-20T16:33:32.881Z</atom:updated>
            <content:encoded><![CDATA[<h3>kind — Local Kubernetes Cluster — Part 3</h3><p>In this article we will talk about how we can configure our kind cluster in a declarative way</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*nzCO38pyKTeYN2Z-Ydh29A.png" /><figcaption>Image source — kind documentation</figcaption></figure><h3>Prerequisites</h3><p>If you haven’t read my previous articles on setting up a kind cluster and loading Docker images to cluster, please check below</p><ul><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-1-8e3b56c773cd">kind — Local Kubernetes Cluster — Part 1</a></li><li><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-2-c60c31754ef5">kind — Local Kubernetes Cluster — Part 2</a></li></ul><h3>Introduction</h3><ul><li>kind cluster can be created and configured in a declarative way</li><li>We can define our desired state for kind cluster in a YAML file</li><li>YAML file follows Kubernetes conventions and versioning</li><li>Parameters passed in the CLI take precedence over their equivalent in config file</li></ul><h3>Usage</h3><h4>Simple Cluster</h4><p>Creating a simple cluster having one control plane and two worker nodes</p><pre>$ cat kind.yml<br>apiVersion: kind.x-k8s.io/v1alpha4<br>kind: Cluster<br>name: dev<br>nodes:<br>- role: control-plane<br>- role: worker<br>- role: worker</pre><pre>$ kind create cluster --config kind.yml <br>Creating cluster &quot;dev&quot; ...<br> ✓ Ensuring node image (kindest/node:v1.26.3) 🖼<br> ✓ Preparing nodes 📦 📦 📦  <br> ✓ Writing configuration 📜 <br> ✓ Starting control-plane 🕹️ <br> ✓ Installing CNI 🔌 <br> ✓ Installing StorageClass 💾 <br> ✓ Joining worker nodes 🚜 <br>Set kubectl context to &quot;kind-dev&quot;<br>You can now use your cluster with:<br><br>kubectl cluster-info --context kind-dev</pre><pre>$ kubectl get nodes <br>NAME                STATUS   ROLES           AGE   VERSION<br>dev-control-plane   Ready    control-plane   53s   v1.26.3<br>dev-worker          Ready    &lt;none&gt;          16s   v1.26.3<br>dev-worker2         Ready    &lt;none&gt;          29s   v1.26.3</pre><h4>HA Cluster</h4><p>Creating a cluster having multiple control planes for high availability</p><pre>$ cat kind.yml <br>apiVersion: kind.x-k8s.io/v1alpha4<br>kind: Cluster<br>name: dev<br>nodes:<br>- role: control-plane<br>- role: control-plane<br>- role: control-plane<br>- role: worker<br>- role: worker<br>- role: worker</pre><pre>$ kind create cluster --config kind.yml <br>Creating cluster &quot;dev&quot; ...<br> ✓ Ensuring node image (kindest/node:v1.26.3) 🖼<br> ✓ Preparing nodes 📦 📦 📦 📦 📦 📦  <br> ✓ Configuring the external load balancer ⚖️ <br> ✓ Writing configuration 📜 <br> ✓ Starting control-plane 🕹️ <br> ✓ Installing CNI 🔌 <br> ✓ Installing StorageClass 💾 <br> ✓ Joining more control-plane nodes 🎮 <br> ✓ Joining worker nodes 🚜 <br>Set kubectl context to &quot;kind-dev&quot;<br>You can now use your cluster with:<br><br>kubectl cluster-info --context kind-dev</pre><pre>$ kubectl get nodes<br>NAME                 STATUS   ROLES           AGE     VERSION<br>dev-control-plane    Ready    control-plane   2m32s   v1.26.3<br>dev-control-plane2   Ready    control-plane   2m18s   v1.26.3<br>dev-control-plane3   Ready    control-plane   74s     v1.26.3<br>dev-worker           Ready    &lt;none&gt;          56s     v1.26.3<br>dev-worker2          Ready    &lt;none&gt;          56s     v1.26.3<br>dev-worker3          Ready    &lt;none&gt;          68s     v1.26.3</pre><h4>Changing Kubernetes version</h4><p>We can change the Kubernetes version by setting the node’s container image and it’s mandatory to include sha256 value with image</p><pre>$ cat kind.yml<br>apiVersion: kind.x-k8s.io/v1alpha4<br>kind: Cluster<br>name: dev<br>nodes:<br>- role: control-plane<br>  image: kindest/node:v1.27.0@sha256:c6b22e613523b1af67d4bc8a0c38a4c3ea3a2b8fbc5b367ae36345c9cb844518<br>- role: worker<br>  image: kindest/node:v1.27.0@sha256:c6b22e613523b1af67d4bc8a0c38a4c3ea3a2b8fbc5b367ae36345c9cb844518<br>- role: worker<br>  image: kindest/node:v1.27.0@sha256:c6b22e613523b1af67d4bc8a0c38a4c3ea3a2b8fbc5b367ae36345c9cb844518</pre><pre>$ kind create cluster --config kind.yml <br>Creating cluster &quot;dev&quot; ...<br> ✓ Ensuring node image (kindest/node:v1.27.0) 🖼 <br> ✓ Preparing nodes 📦 📦 📦  <br> ✓ Writing configuration 📜 <br> ✓ Starting control-plane 🕹️ <br> ✓ Installing CNI 🔌 <br> ✓ Installing StorageClass 💾 <br> ✓ Joining worker nodes 🚜 <br>Set kubectl context to &quot;kind-dev&quot;<br>You can now use your cluster with:<br><br>kubectl cluster-info --context kind-dev</pre><pre>$ kubectl get nodes<br>NAME                STATUS   ROLES           AGE   VERSION<br>dev-control-plane   Ready    control-plane   61s   v1.27.0<br>dev-worker          Ready    &lt;none&gt;          42s   v1.27.0<br>dev-worker2         Ready    &lt;none&gt;          41s   v1.27.0</pre><h3>Cleanup</h3><p>Delete the cluster after use</p><pre>$ kind delete cluster --name dev<br>Deleting cluster &quot;dev&quot; ...<br>Deleted nodes: [&quot;dev-worker2&quot; &quot;dev-worker&quot; &quot;dev-control-plane&quot;]</pre><h3>Reference</h3><p><a href="https://kind.sigs.k8s.io/">https://kind.sigs.k8s.io/</a></p><h3>Checkout the next part</h3><p><a href="https://iamunnip.medium.com/kind-local-kubernetes-cluster-part-4-cf47c46c812e">kind — Local Kubernetes Cluster — Part 4</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50bc076ceece" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>