<?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 Osmar R Leão on Medium]]></title>
        <description><![CDATA[Stories by Osmar R Leão on Medium]]></description>
        <link>https://medium.com/@osmarrleao?source=rss-942d8e8327d9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*IEIdYiuYmHS6Y5KJotwRCw.jpeg</url>
            <title>Stories by Osmar R Leão on Medium</title>
            <link>https://medium.com/@osmarrleao?source=rss-942d8e8327d9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 09:21:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@osmarrleao/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[Zadara + ScaleGrid: An Alternative RDS Solution]]></title>
            <link>https://medium.com/@osmarrleao/zadara-scalegrid-an-alternative-rds-solution-6bbe97f90ffd?source=rss-942d8e8327d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bbe97f90ffd</guid>
            <category><![CDATA[zadara]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[cloud-services]]></category>
            <category><![CDATA[dbaas]]></category>
            <category><![CDATA[rds]]></category>
            <dc:creator><![CDATA[Osmar R Leão]]></dc:creator>
            <pubDate>Tue, 10 Jun 2025 18:03:38 GMT</pubDate>
            <atom:updated>2025-06-10T18:07:59.121Z</atom:updated>
            <content:encoded><![CDATA[<p>I constantly say that Zadara is an open and flexible cloud solution. Despite our portfolio’s lack of a ready-to-use solution, creating a Database as a Service (DBaaS) alternative is possible. You can use your creativity and brains like my WAF solution (<a href="https://medium.com/@osmarrleao/web-application-firewall-on-zadara-zcompute-3eb412f17794">here</a>) or use a certified partner.</p><p>My article is about an RDS alternative from our partner: ScaleGrid. Quoting the creator of RDS: “Relational Database Service (Amazon RDS) is <strong>an easy-to-manage relational database service optimized for total cost of ownership</strong>. It is simple to set up, operate, and scale with demand. RDS automates undifferentiated database management tasks, such as provisioning, configuring, backing up, and patching.”</p><p>I will demonstrate how to easily create a trial account and set up a MySQL Database.</p><h3>Instance Image Creation</h3><p>The environment of the ScaleGrid needs a specific image to create the instances. You must import the Alma Linux 8 image into your cloud before trying to create the solution. To solve this, follow these steps:</p><p>1. Go to the Machine Images → Images</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*5aHaA9oH0Ioc9cA1tCsvsw.png" /><figcaption>Creating the instance image</figcaption></figure><p>2. Click on “Create” to create a new image</p><p>3. Name your image as “Public — AlmaLinux 8”</p><p>4. The firmware type is BIOS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*Cdl7DJF0toF5_B8FYAikqQ.png" /><figcaption>Naming the image</figcaption></figure><p>4. On Setup, choose create image from URL and complete with this URL: <a href="https://repo.almalinux.org/almalinux/8/cloud/x86_64/images/AlmaLinux-8-GenericCloud-8.10-20240819.x86_64.qcow2">https://repo.almalinux.org/almalinux/8/cloud/x86_64/images/AlmaLinux-8-GenericCloud-8.10-20240819.x86_64.qcow2</a></p><p>5. Finish and wait until the image is ready</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*amzjgfcd9cGNeh60MlzARQ.png" /><figcaption>Alma Linux 8 image download to the cloud</figcaption></figure><h3>Create a Trial Account</h3><p>You must go to the account creation site: <a href="https://console.scalegrid.io/users/register">https://console.scalegrid.io/users/register</a></p><p><strong>Note:</strong> Read the terms and conditions of ScaleGrid before creating your account; you decide to follow from this step on.</p><h3>Create a Cloud Profile</h3><p>The next step is to create the Zadara Cloud Profile to be used with ScaleGrid Bring Your Own Cloud (BYOC) mode. This step is demonstrated below, but first, let’s gather all the necessary information:</p><p>On your Zadara Cloud, after logging in, click on “Access Keys” inside the “My Profile And Security”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rr2jN_qMe-ulSJS4oky3lg.png" /><figcaption>Cloud view</figcaption></figure><p>You must create an access key to be used on the ScaleGrid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c2iuwK-iUf8EQILvR1azHw.png" /><figcaption>creating the cloud access key</figcaption></figure><p>Another information needed is the API EndPoints. This information is in the API Endpoints, under “?” (cloud help) button:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HP3M2mYfI2J1HKpVEMvzvA.png" /><figcaption>accessing the API EndPoints</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F0OyBnPA_r7xrQIW6bzFjQ.png" /><figcaption>accessing the API EndPoints</figcaption></figure><p>The databases will always be created on public VPCs. It’s important to deploy this environment and write down the VPC ID, the Public Subnet ID, and the Security Group ID. These will also be needed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lFKVzrOyb1mbixJciMlsjw.png" /><figcaption>VPC ID</figcaption></figure><p>The ScaleGrid will create database backups inside an S3 container. The Zadara Cloud solution to S3 is called New Generation Object Storage (NGOS), and it is compatible with the S3 protocol.</p><p>You will need to provide access to one NGOS container (bucket) to store your DB backups. Inside the NGOS console, click on your account, then get your access information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qrj1JuWwW5s2btS8zr1KOw.png" /><figcaption>S3 access information</figcaption></figure><p>Create or use one container (bucket):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g3WHRrm4hqrD37IVLJx9Bw.png" /><figcaption>creating the container/bucket on NGOS</figcaption></figure><p>And that’s all. These are the Zadara steps to create an RDS Database demo.</p><p>Inside the ScaleGrid dashboard, now create a “Cloud profile” reflecting yours created previously:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Guw31fCUUX4Ky8xCyiodw.png" /><figcaption>Creating a cloud profile</figcaption></figure><p>Choose “New Cloud Profile” and the Zadara logo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qdma5L30kprm0O0BAgc-YQ.png" /><figcaption>Creating a cloud profile</figcaption></figure><p>Now it is time to fill in the form with your cloud information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sl6c5wtQLz_Ggrw7LQfsJg.png" /><figcaption>Creating a cloud profile</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XYfotm2nKJEOteCaBKBQug.png" /><figcaption>Creating a cloud profile</figcaption></figure><p>And the S3 information to backup:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x-2fiGbouvFaQJk13tLZoA.png" /><figcaption>Creating a cloud profile</figcaption></figure><p>Then name your profile to be used in the later step of creating the database:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZPXgH0WpEbNJDjR2tJrv4A.png" /><figcaption>Creating a cloud profile</figcaption></figure><h3>Create a MySQL Database</h3><p>You have provided the cloud credentials and the S3 credentials to backup your environment.</p><p>Now it is time to create your RDS example. The ScaleGrid provides you with 7 days of a free demo; after that, your RDS will be disabled. You can see your estimated cost when you are creating the Database:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XjNmmEy6BITiQ-xDDHE7bg.png" /><figcaption>creating a MySQL enviroment</figcaption></figure><p>To use Zadara Cloud is mandatory to create the cloud profile and choose the BYOC option like above.</p><p>The next option is the replication: choose between a standalone database and replication. When using replication, you can decide where your replica will reside, including a second cloud (you must create two cloud profiles):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TUjKE3P4nL1d5sBX1jeLCQ.png" /><figcaption>creating a MySQL enviroment</figcaption></figure><p>The advanced option updates your estimated cost (and you can also enable cryptography):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YuunrErFr-XLVvmcAJ4a7g.png" /><figcaption>creating a MySQL enviroment</figcaption></figure><p>Your environment will be created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_DcZTZD6O8s6uARDkBibsA.png" /><figcaption>creating a MySQL enviroment</figcaption></figure><h3>ScaleGrid Operations Details</h3><p>It is possible to create and operate multiple databases using ScaleGrid. The most common options are MongoDB, Redis, MySQL, and PostgreSQL.</p><p>In the console is possible to view different information about the environment, here some:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WIsMogG1FPJTcB0sAu574w.png" /><figcaption>MySQL clusters view</figcaption></figure><p>The credentials, connection endpoints, and options:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hT0nIdtcz44ZOUnNjgGySQ.png" /><figcaption>MySQL credentials and connection options</figcaption></figure><p>The databases and the instances running on the Zadara Cloud:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iQuA6Y3BW8R_wOnGmtmaxA.png" /><figcaption>MySQL instances on ScaleGrid</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JHrcmn8cBCR8VkJpggmV-w.png" /><figcaption>MySQL instances on Zadara</figcaption></figure><p>How to add and manage firewall rules and access to the RDS:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qYflSuOCGg5J1KR2pom_WA.png" /><figcaption>managing firewall rules</figcaption></figure><p>Operations counter on the instance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8VP3jqp6vVRXD49YoLwTQA.png" /><figcaption>operation counters</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jSO9yZsQEdSrbM32fyhutg.png" /><figcaption>operation counters</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-KgjIK4vDF3a5EkB_rLj7Q.png" /><figcaption>operation counters</figcaption></figure><h3>Conclusion</h3><p>Once again, the Zadara Cloud shows its power and flexibility to run a wide variety of solutions.</p><p>The Zadara Cloud runs from microservices to automated commercial databases. It is always a pleasure to bring new services and solutions</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bbe97f90ffd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Application Firewall on Zadara zCompute]]></title>
            <link>https://medium.com/@osmarrleao/web-application-firewall-on-zadara-zcompute-3eb412f17794?source=rss-942d8e8327d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3eb412f17794</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[waf]]></category>
            <category><![CDATA[zadara]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[web-application-firewall]]></category>
            <dc:creator><![CDATA[Osmar R Leão]]></dc:creator>
            <pubDate>Mon, 17 Feb 2025 14:39:53 GMT</pubDate>
            <atom:updated>2025-02-24T17:42:50.825Z</atom:updated>
            <content:encoded><![CDATA[<p>The Zadara compute stack is flexible and permits creativity and talent to create new solutions that are not necessarily ready from the cloud orchestrator. This article is my latest contribution to Zadara’s zCompute portfolio of solutions: Web Application Firewall.</p><p>One Web Application Firewall is an additional layer of defense against web attacks based on HTTP requests. It is a security system that sits in front of a web application to inspect, filter, and block malicious traffic. It acts as an intermediary between the internet and your website or web application, examining HTTP requests and responses for potential threats.</p><p>This article demonstrates a completely isolated web server inside a private subnet. The WAF will stay in front of a load balancer and the servers will be behind all of these:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jfunj_1TIx4H1pM2XlHWXg.png" /><figcaption>WAF cloud diagram</figcaption></figure><p>The creation of VPC with its subnets will not be shown, but the diagram above is self-explanatory. For this demonstration proposal, only 2 web servers were deployed, one load balance, and the WAF.</p><p>Starting from the web server installed: Linux with Apache, PHP, and a simple script to show the hostname when one request is made:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*5g9Ok5yqI1D4dirRuBICtA.png" /><figcaption>HTTP request to the first web server</figcaption></figure><p>Two of these web servers were deployed. The next step was to create a load balancer in a new isolated private subnet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*djdepUTrOipq3MELUVCrtA.png" /><figcaption>creating the load balancer</figcaption></figure><p>The load balancer must be an <strong>Application Load Balancer (ALB)</strong> to work inside a private subnet with the target group in another private subnet.</p><p>The next step is to create a target group pointing to the web servers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*ZA_Htf8SXRq5GZ6paVZ2fg.png" /><figcaption>creating the target group</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*bkyFgZLvbNyFjWmjVHikTw.png" /><figcaption>creating the target group</figcaption></figure><p>Then, inside the load balancer created, add a new listener pointing to this target group:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*vY6Mbs6b7QheMBsf_yFl6Q.png" /><figcaption>adding the target groupt to the load balancer</figcaption></figure><p>Do not forget to put the right HTTP port:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*GsO4Fnq_5ROxh4L7fr8dbg.png" /><figcaption>configuring the right port</figcaption></figure><p>The result is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*9Pr27cU20bJSrRHaDKh9nA.png" /><figcaption>the load balancer with the rule to deliver to the target group</figcaption></figure><p>The web access test:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*NqdqzAzMj_CbJD6L14LODw.png" /><figcaption>accessing the web servers via load balancer</figcaption></figure><p>Now the fun part of the story: Web Application Firewall installation.</p><h4>Web Application Firewall</h4><p>The solution I chose to create the WAF was SafeLine (<a href="https://waf.chaitin.com/">https://waf.chaitin.com/</a>). SafeLine is stable and it is also a simple solution. To more about SafeLine, consult this link: <a href="https://docs.waf.chaitin.com/">https://docs.waf.chaitin.com/</a></p><p>The first step is to create an instance with two network interfaces: one attached to the public subnet, and the other on the same subnet of the load balancer. Choose one Linux image compatible with the docker-ce package according to the SafeLine manual.</p><p>Attach one Elastic IP to the public interface of the instance, the result must be like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MHcBTMRFHzB_lnIV3Rra7g.png" /><figcaption>web application firewall instance</figcaption></figure><blockquote>NOTE: I will create a public image of this WAF solution to be used by Zadara MSP.</blockquote><p>Run the installation script on your Linux instance:</p><pre>[root@web-application-firewall ~]# bash -c &quot;$(curl -fsSLk https://waf.chaitin.com/release/latest/manager.sh)&quot; -- --en<br>  ______               ___           _____       _                        ____      ____       _        ________<br>.&#39; ____ \            .&#39; ..]         |_   _|     (_)                      |_  _|    |_  _|     / \      |_   __  |<br>| (___ \_|  ,--.    _| |_    .---.    | |       __    _ .--.    .---.      \ \  /\  / /      / _ \       | |_ \_|<br> _.____`.  `&#39;_\ :  &#39;-| |-&#39;  / /__\\   | |   _  [  |  [ `.-. |  / /__\\      \ \/  \/ /      / ___ \      |  _|<br>| \____) | // | |,   | |    | \__.,  _| |__/ |  | |   | | | |  | \__.,       \  /\  /     _/ /   \ \_   _| |_<br> \______.&#39; \&#39;-;__/  [___]    &#39;.__.&#39; |________| [___] [___||__]  &#39;.__.&#39;        \/  \/     |____| |____| |_____|<br><br>[INFO  11:25:28]: SafeLine is a self-hosted WAF(Web Application Firewall) to protect your web apps from attacks and exploits.<br>[INFO  11:25:28]: A web application firewall helps protect web apps by filtering and monitoring HTTP traffic between a web application and the Internet. It typically protects web apps from attacks such as SQL injection, XSS, code injection, os command injection, CRLF injection, ldap injection, xpath injection, RCE, XXE, SSRF, path traversal, backdoor, bruteforce, http-flood, bot abused, among others.<br><br>Choice what do you want to do  [ 1.INSTALL  2.UPGRADE  3.UNINSTALL  4.REPAIR  5.RESTART ]  (1/2/3/4/5): 1<br>[INFO  11:25:32]: Will be going to installing SafeLine WAF for you.<br>[INFO  11:25:32]: Checking docker version<br>[INFO  11:25:32]: Checking docker compose version<br>[INFO  11:25:32]: Installation environment check passed<br>Input the path to install SafeLine WAF  (Keep blank default to /data/safeline):<br>[INFO  11:25:34]: Disk capacity of &quot;/data/safeline&quot; has 13.65 GB avaiable<br>[INFO  11:25:34]: Downloading the docker-compose.yaml file<br>[INFO  11:25:35]: Updating .env configuration files<br>[INFO  11:25:41]: Getting SafeLine WAF latest version<br>[INFO  11:25:42]: target version: 7.6.2<br>[INFO  11:25:42]: Pulling Docker image<br>[+] Pulling 70/70<br> ✔ fvm Pulled                                                                                                                                                                                           40.5s<br> ✔ postgres Pulled                                                                                                                                                                                      41.7s<br> ✔ tengine Pulled                                                                                                                                                                                       41.0s<br> ✔ detect Pulled                                                                                                                                                                                        33.9s<br> ✔ mgt Pulled                                                                                                                                                                                           42.6s<br> ✔ luigi Pulled                                                                                                                                                                                         30.4s<br> ✔ chaos Pulled                                                                                                                                                                                         41.0s<br><br><br>[INFO  11:26:25]: Starting Docker containers<br>[INFO  11:26:34]: SafeLine WAF installation completed<br>[INFO  11:26:34]: Wait for mgt healthy<br>[INFO  11:26:39]: Wait for mgt healthy<br>[INFO  11:26:44]: Wait for mgt healthy<br>[INFO  11:26:49]: Wait for mgt healthy<br>[INFO  11:26:54]: Wait for mgt healthy<br>[INFO  11:26:59]: Wait for mgt healthy<br>[INFO  11:27:04]: Wait for mgt healthy<br>[INFO  11:27:09]: Setup admin<br>[INFO  11:27:13]:<br>[INFO] Initial username：admin<br>[INFO] Initial password：NwG2ObgI<br>[INFO] Done<br>[INFO  11:27:13]: SafeLine WAF management panel: https://10.0.0.13:9443/<br>[INFO  11:27:13]: SafeLine WAF management panel: https://0.0.0.0:9443/<br><br>https://discord.gg/SVnZGzHFvn<br><br>Join discord group for more informations of SafeLine by above address</pre><p>Then open the management panel using your EIP:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*JwjhrAX7OHJU9dxEjv-uOg.png" /><figcaption>WAF login screen</figcaption></figure><p>After the login, the dashboard is your main page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8DNcqjlFRdeSEru2FWZe4g.png" /><figcaption>the WAF dashboard</figcaption></figure><p>On the Applications tab is possible to create a new website to be protected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dUN3TZyEry5vzsxyjMTPeg.png" /><figcaption>how to add a web application (site) to be protected</figcaption></figure><p>Make sure your application FQDN points to your WAF, this must be filled in on the “Domain” field. For demo proposes, only the EIP address was deployed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*_rnNyvNm_sOjAldBDDQJVg.png" /><figcaption>configuring the application into the WAF</figcaption></figure><p>One SSL Certificate (HTTPS) is needed to work. In this demo, the SSL part of the configuration was excluded.</p><p>Click on submit and your first protected website will be running behind the SafeLine WAF:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uNXCH8FzNyX070GYMJmUQA.png" /><figcaption>basic details of the protected web site</figcaption></figure><p>It is possible to create thousands of http routings, and protection rules. This is not this article’s goal. But, some attacks are documented by SafeLine and were tested to hist demo:</p><p>The first attack was a code injection attempt ( <strong><em>http://100.64.18.177/?id=phpinfo();system(&#39;id&#39;)</em></strong> ):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pirY8Z16351ZZMwYipwvcw.png" /><figcaption>WAF message when an attack is detected</figcaption></figure><p>Into the WAF logs is possible to see and track all the attacks and attackers to the protected website:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xhO9GABXd2JAlKvpa6S6Nw.png" /><figcaption>complete log of detected attacks</figcaption></figure><p>And our attack detail information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xgmmbi1mU9z5ckIfFTgl4g.png" /><figcaption>detailing one attack</figcaption></figure><h4>Conclusion</h4><p>Zadara zCompute’s flexibility enables creative cloud solutions, as demonstrated in this article.</p><p>It’s worth noting that SafeLine WAF can be replaced with any other WAF solution — the options are completely open.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3eb412f17794" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zadara Cloud + EKS + DataDog: Transforming the Pacman Game into a Professional Kubernetes Platform]]></title>
            <link>https://medium.com/@osmarrleao/zadara-cloud-eks-datadog-transforming-the-pacman-game-into-a-professional-kubernetes-platform-2a79484c567a?source=rss-942d8e8327d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a79484c567a</guid>
            <category><![CDATA[datadog]]></category>
            <category><![CDATA[zadara]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[elastickubernetesservice]]></category>
            <dc:creator><![CDATA[Osmar R Leão]]></dc:creator>
            <pubDate>Thu, 19 Dec 2024 19:20:48 GMT</pubDate>
            <atom:updated>2024-12-19T19:20:48.810Z</atom:updated>
            <content:encoded><![CDATA[<p>Continuing the articles about Zadara Cloud and Kubernetes, this final(ish) article will demonstrate a professional observability tool for the professional EKS environment. I choose to work with DataDog but it could be any professional tool that integrates with Kubernetes.</p><p>The goal is to observe all the Kubernetes metrics to gather information and make decisions based on real data. Datadog is a handy and powerful tool for this. I look forward to an official partnership in the future.</p><p>After the integration, it will be possible to view metrics about your cluster(s) on the Zadara Cloud:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b2VytqitOhSixGBl32agtQ.png" /><figcaption>Cluster overview on DataDog</figcaption></figure><p>On the Explorer tab is possible to navigate through the Kubernetes resources:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TpI5QpiCorCbgTeSXa__mw.png" /><figcaption>Kubernetes pod overview</figcaption></figure><p>NOTE: observe the AWS Load Balancer Controller pods and the EBS CSI pods to allow AWS-compatible deployments to run on the Zadara Cloud (remember it’s an EKS Distribution).</p><h3>Configuration Process</h3><p>The installation and configuration process from the DataDog website is complete, but, to work with EKS on top of zCompute, is needed some adjustments:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*urGq731XbXZ4fCT-6dJcTg.png" /><figcaption>Agent Installation Instructions from DataDog website</figcaption></figure><p>The default YAML file from the agent installation wizard is:</p><pre>apiVersion: &quot;datadoghq.com/v2alpha1&quot;<br>kind: &quot;DatadogAgent&quot;<br>metadata:<br>  name: &quot;datadog&quot;<br>spec:<br>  global:<br>    clusterName: &quot;zadara-demo&quot;<br>    credentials:<br>      apiSecret:<br>        secretName: &quot;datadog-secret&quot;<br>        keyName: &quot;api-key&quot;</pre><p>And, to work with EKS on the zCloud must be like:</p><pre>apiVersion: &quot;datadoghq.com/v2alpha1&quot;<br>kind: &quot;DatadogAgent&quot;<br>metadata:<br>  name: &quot;datadog&quot;<br>spec:<br>  global:<br>    clusterName: &quot;zadara-demo&quot;<br>    credentials:<br>      apiSecret:<br>        secretName: &quot;datadog-secret&quot;<br>        keyName: &quot;api-key&quot;<br>    kubelet:<br>      tlsVerify: false<br>  override:<br>    nodeAgent:<br>      env:<br>        - name: DD_HOSTNAME<br>          valueFrom:<br>            fieldRef:<br>              fieldPath: spec.nodeName</pre><p>These modifications are <strong>important </strong>to get things working smoothly.</p><p>The agent pods will start and a few moments later should be running:</p><pre>$ kubectl get pods<br>NAME                                     READY   STATUS    RESTARTS   AGE<br>datadog-agent-44brf                      3/3     Running   0          47h<br>datadog-agent-cg6c5                      3/3     Running   0          47h<br>datadog-agent-s4d7q                      3/3     Running   0          47h<br>datadog-cluster-agent-648764f496-ztm28   1/1     Running   0          47h<br>datadog-operator-866c9f4cf6-bg5s4        1/1     Running   0          2d5h</pre><p>Now, all the work is using the DataDog web interface.</p><h3>Navigating the Interface</h3><p><strong>Pods:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kIrdX_2bV4zhToY0WV4sdg.png" /><figcaption>list of running pods</figcaption></figure><p><strong>Cluster:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Uq-tZd9OEEc8oTp8SidQA.png" /><figcaption>list of clusters</figcaption></figure><p><strong>Namespaces:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2qy8uFjcAbO0-Rswkd211g.png" /><figcaption>namespaces of the cluster</figcaption></figure><p><strong>Nodes:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VwpaDUHBUwop_dVGi30h8Q.png" /><figcaption>nodes of the Kubernetes</figcaption></figure><p><strong>Deployments:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3s8yPRX7pJtb5POsA-PmTA.png" /><figcaption>deployments done</figcaption></figure><p>These deployments included the Pacman game, one app using an SSL demo (showed in my first article about EKS on zCloud), the MongoDB for the Pacman game, the DataDog itself, and the Kubernetes and EKS deployments.</p><p><strong>Services:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zMJm-2BFmfj9AZJnVd2y8g.png" /><figcaption>services running</figcaption></figure><p>The MongoDB and Pacman Load Balancer from my second article.</p><p><strong>Ingresses:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jKvMiUBmfNQNsL_7Wl0iJw.png" /><figcaption>application load balancer</figcaption></figure><p>The ingress is integrated with zCloud, and using SSL certificate uploaded to the zCompute console. The class is ALB, so it is an Application Load Balancer (the creation was demonstrated in my first article).</p><p><strong>Storage (Persistent Volume Claims and Persistent Volumes):</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*plHBh8X59hDPoJqT8TjCKg.png" /><figcaption>active PVCs</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F1MK4DiHo0P04YRgNztfdQ.png" /><figcaption>volumes created</figcaption></figure><h3>Details and Dashboards</h3><p>It is possible to view all the details about each item listed above by clicking on it. The detail of the Mongo PV, for example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gOsQSevMiq04BSM4FXAj4g.png" /><figcaption>all the details of mongodb volume created</figcaption></figure><p>On the tab “Resource Utilization” it is possible to view CPU and Memory consumption by each item:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iQ3obzVWnHB_v_czyKZgmQ.png" /><figcaption>memory consumption of the pods</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fDR4bV3iaPYWy4CmdMBoMA.png" /><figcaption>CPU consumption of the pods</figcaption></figure><p><strong>Dashboards:</strong></p><p>The DataDog allows the creation of dashboards to monitor all aspects of the infrastructure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tZyiQvz8e5wPKytga44I6A.png" /><figcaption>list of pre-formatted dashboards</figcaption></figure><p>Here are some examples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DDfHB732fhlbXWXJr2VVYw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F_QVbl-jK1-EsW7wJgvygQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7yresfFHQMI06oA932ufQw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m8GLceGm4ueGoJFFOQdTbA.png" /></figure><p>It is possible to create a customized dashboard mixing information, below is an example of Pacman monitoring:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bu8azkWr1-ffNO3rKsQdtw.png" /><figcaption>Pacman monitoring 01</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kvgEE7KkNmHoW4BN3dmzQQ.png" /><figcaption>Pacman monitoring 02</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GIA6hj56IBbRp5vilVoeKA.png" /><figcaption>Pacman monitoring 03</figcaption></figure><h3>Conclusion</h3><p>The Zadara Compute Infrastructure, combined with EKS distribution and monitored by DataDog, creates a robust, professional Kubernetes platform.</p><p>Zadara Cloud’s key strength lies in its ability to combine powerful solutions with a tailor-made Federated Edge Cloud, delivering high performance and cost efficiency while staying close to customers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a79484c567a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pacman on the Cloud: how to deploy a Kubernetes application on zCloud using a fully integrated EKS…]]></title>
            <link>https://medium.com/@osmarrleao/pacman-on-the-cloud-how-to-deploy-a-kubernetes-application-on-zcloud-using-a-fully-integrated-eks-263ca1a6fb65?source=rss-942d8e8327d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/263ca1a6fb65</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[zadara]]></category>
            <category><![CDATA[pacman]]></category>
            <category><![CDATA[ek]]></category>
            <category><![CDATA[k8s]]></category>
            <dc:creator><![CDATA[Osmar R Leão]]></dc:creator>
            <pubDate>Tue, 10 Dec 2024 13:18:17 GMT</pubDate>
            <atom:updated>2024-12-10T13:33:46.729Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pacman on the Cloud: how to deploy a Kubernetes application on zCloud using a fully integrated EKS distribution</h3><p>This article is the second part of my first (<a href="https://medium.com/@osmarrleao/how-to-install-and-use-an-eks-distribution-on-the-zadara-cloud-519248d797f4">How to Install and Use an EKS Distribution on the Zadara Cloud</a>) showing how to deploy an application and how integrated the EKS is with Zadara’s Cloud Orchestrator.</p><p>My first step was finding one application that uses data persistence (storage) and a load balancer. I found one that uses all of these and is also fun: Pacman! This app is part of one GitHub repository of Kubernetes examples: <a href="https://github.com/font/k8s-example-apps">https://github.com/font/k8s-example-apps</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*mSamgxAxSzRIyvKElTg2_Q.png" /><figcaption>Node.js Pacman</figcaption></figure><p>In this repository, you can find how to download, build, and push your images of this application to one docker container registry.</p><p>The Node.js Pacman uses MongoDB to keep the game’s high scores and user data, one internal load balancer to be the MongoDB frontend, and another load balancer to be the frontend of the Pacman game itself. For this example, I will use MongoDB and 2 Pacman pods.</p><p>The First step is to create a namespace to be used:</p><pre>$ kubectl create namespace pacman</pre><p>Now, create the MongoDB PVC (using 8GB of storage):</p><pre>kind: PersistentVolumeClaim<br>apiVersion: v1<br>metadata:<br>  name: mongo-storage<br>spec:<br>  accessModes:<br>    - ReadWriteOnce<br>  resources:<br>    requests:<br>      storage: 8Gi</pre><pre>$ kubectl -n pacman apply -f mongo-pvc-new.yaml<br>persistentvolumeclaim/mongo-storage created</pre><p>The MongoDB service (load balancer):</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  labels:<br>    name: mongo<br>  name: mongo<br>spec:<br>  type: LoadBalancer<br>  ports:<br>    - port: 27017<br>      targetPort: 27017<br>  selector:<br>    name: mongo</pre><pre>$ kubectl -n pacman apply -f ../services/mongo-service.yaml<br>service/mongo created</pre><p>And the deployment of the MongoDB:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  labels:<br>    name: mongo<br>  name: mongo<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      name: mongo<br>  template:<br>    metadata:<br>      labels:<br>        name: mongo<br>    spec:<br>      containers:<br>      - image: mongo<br>        name: mongo<br>        ports:<br>        - name: mongo<br>          containerPort: 27017<br>        volumeMounts:<br>          - name: mongo-db<br>            mountPath: /data/db<br>      volumes:<br>        - name: mongo-db<br>          persistentVolumeClaim:<br>            claimName: mongo-storage</pre><p>Verify that the PV is mounted as /data/db inside the MongoDB pods.</p><pre>$ kubectl -n pacman apply -f mongo-deployment-new.yaml<br>deployment.apps/mongo created</pre><p>Now, checking the EKS integration with Zadara zCompute, storage:</p><pre>$ kubectl -n pacman get pv<br>NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                  STORAGECLASS   VOLUMEATTRIBUTESCLASS   REASON   AGE<br>pvc-d3a8b520-af36-41a1-95e0-d32cc071b6a1   8Gi        RWO            Delete           Bound    pacman/mongo-storage   ebs-sc         &lt;unset&gt;                          5h9m</pre><pre>$ kubectl -n pacman describe pv pvc-d3a8b520-af36-41a1-95e0-d32cc071b6a1<br>Name:              pvc-d3a8b520-af36-41a1-95e0-d32cc071b6a1<br>Labels:            &lt;none&gt;<br>Annotations:       pv.kubernetes.io/provisioned-by: ebs.csi.aws.comvolume.kubernetes.io/provisioner-deletion-secret-name:volume.kubernetes.io/provisioner-deletion-secret-namespace:<br>Finalizers:        [kubernetes.io/pv-protection external-attacher/ebs-csi-aws-com]<br>StorageClass:      ebs-sc<br>Status:            Bound<br>Claim:             pacman/mongo-storage<br>Reclaim Policy:    Delete<br>Access Modes:      RWO<br>VolumeMode:        Filesystem<br>Capacity:          8Gi<br>Node Affinity:<br>Required Terms:<br>Term 0:        topology.ebs.csi.aws.com/zone in [symphony]<br>Message:<br>Source:<br>Type:              CSI (a Container Storage Interface (CSI) volume source)<br>Driver:            ebs.csi.aws.com<br>FSType:            ext4<br>VolumeHandle:      vol-30ec110a21c94a929be9b76988c43ffd<br>ReadOnly:          false<br>VolumeAttributes:      storage.kubernetes.io/csiProvisionerIdentity=1732818873883-5119-ebs.csi.aws.com<br>Events:                &lt;none&gt;</pre><p>Showing the volume at the zCompute GUI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*acd1lCMO4k8tBiElFbGg_w.png" /><figcaption>The pvc-d3a8b520-af36–41a1–95e0-d32cc071b6a1 volume</figcaption></figure><p>And the load balancer:</p><pre>$ kubectl -n pacman get svc<br>NAME     TYPE           CLUSTER-IP     EXTERNAL-IP                                                             PORT(S)           AGE<br>mongo    LoadBalancer   10.102.59.17   elb-ce73483f-d64b-4f9f-aac3-bd5f0e45018e.zadara.demo                    27017:30376/TCP   5h22m</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5sq9hfr4Lq-mCc-zroSfRg.png" /><figcaption>The elb-ce73483f-d64b-4f9f-aac3-bd5f0e45018e.zadara.demo load balancer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8hWDsEh8RgIJOp2u7_w1zg.png" /><figcaption>The pods behind elb-ce73483f-d64b-4f9f-aac3-bd5f0e45018e.zadara.demo load balancer</figcaption></figure><p>And now, the Pacman part! First the service (internet facing):</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: pacman<br>  labels:<br>    name: pacman<br>  annotations:<br>    service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing<br>spec:<br>  type: LoadBalancer<br>  ports:<br>    - port: 80<br>      targetPort: 8080<br>      protocol: TCP<br>  selector:<br>    name: pacman</pre><p>The annotations part of this YAML is needed to signal to the Zadara Cloud Orchestrator to create a public load balancer.</p><pre>$ kubectl -n pacman apply -f pacman-service.yaml<br>service/pacman created</pre><p>It is possible to check the load balancer created in the Kubernetes and Zadara’s GUI:</p><pre>$ kubectl -n pacman get svc<br>NAME     TYPE           CLUSTER-IP     EXTERNAL-IP                                                             PORT(S)           AGE<br>mongo    LoadBalancer   10.102.59.17   elb-ce73483f-d64b-4f9f-aac3-bd5f0e45018e.zadara.demo                    27017:30376/TCP   8m20s<br>pacman   LoadBalancer   10.110.35.73   elb-3a3bfac2-7c58-46f6-87fc-0a5bdf1ebb92.elb.services.symphony.public   80:30510/TCP      2m11s</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6D0ZoxdsETeh_9ndiB53Hw.png" /><figcaption>The elb-3a3bfac2–7c58–46f6–87fc-0a5bdf1ebb92.elb.services.symphony.public load balancer</figcaption></figure><p>Now, the deployment of the Pacman app itself:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  labels:<br>    name: pacman<br>  name: pacman<br>spec:<br>  replicas: 2<br>  selector:<br>    matchLabels:<br>        name: pacman<br>  template:<br>    metadata:<br>      labels:<br>        name: pacman<br>    spec:<br>      containers:<br>      - image: zosmarleao/pacman-nodejs-app:latest<br>        name: pacman<br>        ports:<br>        - containerPort: 8080<br>          name: http-server</pre><p>The image is located on my account in the docker container registry. I had already uploaded into it.</p><p>Checking the pods:</p><pre>$ kubectl -n pacman get pods<br>NAME                      READY   STATUS             RESTARTS          AGE<br>mongo-57695f7544-5zl6n    1/1     Running            0                 21h<br>pacman-5555f97879-47b24   1/1     Running            0                 21h<br>pacman-5555f97879-wddjc   1/1     Running            0                 21h</pre><p>Refreshing the Internet Browser, the load balancer will change the backend pod:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*h82oBJiLHc4TINJ33FuwyQ.png" /><figcaption>The pod pacman-5555f97879–47b24</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*JQXl3cax9jJ--S4aespFCQ.png" /><figcaption>The pod pacman-5555f97879-wddjc</figcaption></figure><p>And, for the grand finale, the Pacman game! Enjoy!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*4fBHfhcyaaifL037r5nyjw.png" /><figcaption>The Node.js Pacman Game</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=263ca1a6fb65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Install and Use an EKS Distribution on the Zadara Cloud]]></title>
            <link>https://medium.com/@osmarrleao/how-to-install-and-use-an-eks-distribution-on-the-zadara-cloud-519248d797f4?source=rss-942d8e8327d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/519248d797f4</guid>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[zadara]]></category>
            <category><![CDATA[eks-distro]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[k8s-cluster-management]]></category>
            <dc:creator><![CDATA[Osmar R Leão]]></dc:creator>
            <pubDate>Thu, 21 Nov 2024 14:32:28 GMT</pubDate>
            <atom:updated>2025-02-24T17:09:03.088Z</atom:updated>
            <content:encoded><![CDATA[<p>This article demonstrates how to create a Kubernetes cluster on Zadara’s zCompute. The creation of all the virtual network infrastructure, access, and integration with the cloud orchestrator so that Kubernetes can use the resources automatically will be demonstrated in this document.</p><p>The requirements for access to zCompute and how to create an account on Zadara will not be discussed.</p><h3>Installation Steps</h3><ol><li>Project</li><li>User and Privileges</li><li>AWS Credentials (Access Keys)</li><li>Key Pair</li><li>Deployment Choices</li><li>File Downloading</li><li>Volume Type Choice</li><li>CNI Networking Provider Choice</li><li>Instance Image Choice</li><li>Installing EKS-D</li><li>Conclusion</li></ol><h3>1. Project</h3><p>After logging into the Cloud Panel, go to Identity &amp; Access and click on Accounts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*i0MpQyG3LVaYfNabYVuBAg.png" /></figure><p>Within Accounts, create a project in “Create Project”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*qCkWV_SqsreruaVU3Pygng.png" /></figure><p>Name the project and give it a description, choose the IP Pool, and click create, remember to choose the VPC option:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*oPQ7TK03m6eRZIMin42RTw.png" /></figure><h3>2. User and Privileges</h3><p>Create a user and assign it to the project you created. To do this, go to <em>Accounts</em> and the <em>Users</em> tab:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*i0MpQyG3LVaYfNabYVuBAg.png" /></figure><p>On the Users tab, click Create User:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*1xaUTCQm1AYf2f87UMQI7w.png" /></figure><p>Fill in the data for the user:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*W7QExOOe4xZMrW-7BKnmqw.png" /></figure><p>And then assign the MemberFullAccess and IAMFullAccess permissions (required by the terraform AWS provider) to the created project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*2sIaO1B42pgD955Ne18NcA.png" /></figure><h3>3. AWS Credentials (Access Keys)</h3><p>Access keys are required to use the Terraform <em>script</em>. To create an AWS-compatible access key, go to <em>My Profile and Security</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*dKiVKzJUqWXwh2SzX6WN0g.png" /></figure><p>Within Access Keys, click Create to create a new key:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*L1ksqzBsQ0tjhrkhHQXD2g.png" /></figure><p>Pay attention to the instructions, keep the key and the secret:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*sp9WgpbeIbV7NSnxktdjCA.png" /></figure><h3>4. Key Pairs</h3><p>You need at least one pair of access keys to be placed on the EKS-D <em>hosts</em> and one pair for the <em>bastion</em> (which can be the same). To do this, go to <em>Compute</em>, <em>Key Pairs</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*iI3C-VxNsaPNFKWBpfDrQg.png" /></figure><p>Within Key Pairs, click Create to create the key pair:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*cW1AmPzhTJJhmRaG7itXTA.png" /></figure><p>Name your key. It is possible to create a key pair and send the public key, but this will not be covered in this tutorial:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*lQpIaQA_6WWnh49HqT7TFQ.png" /></figure><p>Pay attention to the instructions, you need to save your private key:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*QaBPZh6_kxnaEJWCR_-BrQ.png" /></figure><p><strong>NOTE</strong>: Change the read permissions to your user only on the operating system, removing any other permissions.</p><h3>5. Deployment Workflow</h3><p>It is possible to create EKS-D on the Zadara cloud in two ways: (a) in a simple way; and (b) in more elaborate stages. This document will show a method that is more complex than the standard one.</p><h3>6. File Downloading</h3><p>The first step is to <em>download</em> the Terraform <em>scripts</em>:</p><pre>git clone &lt;https://github.com/zadarastorage/zadara-examples.git&gt;<br>cd zadara-examples/k8s/eksd/</pre><h3>7. Volume Type Choice</h3><p>The remaining steps are definitions of the EKS-D infrastructure. To define the types of volumes to be created (in the AWS standard), you need to check whether your <em>cloud</em> has the disk types and which is the standard for the EBS creation.</p><p>In the Symphony console, check the types:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*pNGjMzXxgNAsfhj6K7B_mQ.png" /></figure><p>The idea is to use the default type of your network (gp3 in the case below):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*RLMbyNWppjBlNC3pHU7Png.png" /></figure><p>The summary of both commands in one is:</p><pre>volume volume-types list -c name -c alias -c is_default -c is_provisioning_disabled</pre><h3>8. CNI Networking Provider Choice</h3><p>There are 3 different types of network providers to choose from: <a href="https://github.com/flannel-io/flannel">Flannel</a>, <a href="https://docs.tigera.io/">Calico</a>, or <a href="https://cilium.io/">Cilium</a>. The default is Flannel, Cilium has limited support.</p><h3>9. Instance Image Choice</h3><p>The instances to be created must be listed in your cloud’s image list. The default is <strong>Ubuntu 22.04 LTS</strong> for the bastion host and <strong>EKS-D 1.29</strong> for the EKS nodes. Go to Images under Machine Images in the Zadara dashboard:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*o3OVli6Tpd3F-hJcNt_sZg.png" /></figure><p>The images must be listed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eNS6PXuTL12n4RrC3uWaeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ACtSg31obHBVrMu94VQvGA.png" /></figure><p>If they are not listed, you can download the images from the Marketplace within Machine Images:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*llBkMDguBVxI5hrfPsvLtA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5tMMLX9ojlbvXt9nfMQbgA.png" /></figure><p>You need to collect the IDs in AWS format for the images. By clicking on the image you can check the ID:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*9AsAZawEAP2yhyGS4s-PeA.png" /></figure><p>With all the steps and choices made, the next step is to configure Terraform with the defined options, access keys, and passwords.</p><h3>10. Installing EKS-D</h3><p>To create the EKS-D infrastructure and create a <em>cluster</em> with the options defined in the previous step, you need to create a new options file based on the Zadara <em>GitHub</em> repository.</p><p>The method that will be used is more complete and complex than the standard one for demonstration environments. In a way, it is what should be done for production environments.</p><p>You need to edit and configure the EKS-D environment in phases, the first phase being the deployment of the infrastructure. To do this, you must go to the infra-terraform directory and copy and edit the terraform.auto.tfvars.template file:</p><p>Edit the terraform.auto.tfvars file by changing, or adding in some cases, the parameters below:</p><pre>api_endpoint                       = &quot;URL_Cloud_Zadara&quot;<br>cluster_access_key                 = &quot;Access_Key_Id&quot;<br>cluster_access_secret_id           = &quot;Secret_Access_Key&quot;<br>bastion_keyname                    = &quot;Key_Name&quot;<br>bastion_ami                        = &quot;AMI_ID&quot;<br>environment                        = &quot;ENV_Name&quot;</pre><p>Run the <strong>terraform init</strong> command to initialize terraform:</p><pre># terraform init<br>Initializing the backend...<br>Initializing provider plugins...<br>- Finding hashicorp/aws versions matching &quot;~&gt; 3.33.0&quot;...<br>- Finding latest version of hashicorp/cloudinit...<br>- Installing hashicorp/aws v3.33.0...<br>- Installed hashicorp/aws v3.33.0 (signed by HashiCorp)<br>- Installing hashicorp/cloudinit v2.3.5...<br>- Installed hashicorp/cloudinit v2.3.5 (signed by HashiCorp)<br>Terraform has created a lock file .terraform.lock.hcl to record the provider<br>selections it made above. Include this file in your version control repository<br>so that Terraform can guarantee to make the same selections by default when<br>you run &quot;terraform init&quot; in the future.<br><br>Terraform has been successfully initialized!<br><br>You may now begin working with Terraform. Try running &quot;terraform plan&quot; to see<br>any changes that are required for your infrastructure. All Terraform commands<br>should now work.<br><br>If you ever set or change modules or backend configuration for Terraform,<br>rerun this command to reinitialize your working directory. If you forget, other<br>commands will detect it and remind you to do so if necessary.</pre><p>Run a <strong>terraform plan</strong> to check everything that will be created as infrastructure:</p><pre># terraform plan<br>Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the<br>following symbols:<br>  + create<br>...<br>Note: You didn&#39;t use the -out option to save this plan, so Terraform can&#39;t guarantee to take exactly these actions if<br>you run &quot;terraform apply&quot; now.</pre><p>With everything settled, you need to apply the resources in Zadara with the <strong>terraform apply --auto-approve</strong> command:</p><pre># terraform apply --auto-approve<br>Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the<br>following symbols:<br>  + create<br>...<br>Apply complete! Resources: 28 added, 0 changed, 0 destroyed.<br><br>Outputs:<br><br>bastion_ip = &quot;IP&quot;<br>environment = &quot;ENV_Name&quot;<br>masters_load_balancer_id = &quot;NLB_ID&quot;<br>masters_load_balancer_internal_dns = &quot;LB_HOSTNAME&quot;<br>private_subnet_id = &quot;subnet-PRIV-ID&quot;<br>public_subnet_id = &quot;subnet-Pub-ID&quot;<br>security_group_id = &quot;sg-ID&quot;<br>vpc_id = &quot;vpc-ID&quot;<br>x_loadbalancer_script = &quot;./get_loadbalancer.sh IP LB_HOSTNAME &lt;access_key&gt; &lt;secret_key&gt; &lt;bastion_user&gt; &lt;bastion_key&gt;&quot;</pre><p>Run the command from the last line of the terraform apply output to get the private and public IPs of the <em>Load Balancer</em> or check the IPs in the <em>Load Balancers</em> option of the Zadara cloud interface:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*htNKzYEvvckpDCCf--aoPw.png" /></figure><p>Now is necessary to create the EKS-D (Kubernetes) infrastructure in the infrastructure created in the Zadara cloud. To build it, change to (eksd-terraform) directory and copy the terraform.auto.tfvars.template file to terraform.auto.tfvars:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eLYE4Y_R8XIs1uDUgpC1sA.png" /></figure><p>Fill in all the data relating to the created infrastructure:</p><pre>cluster_access_key                 = &quot;Access_Key_Id&quot;<br>cluster_access_secret_id           = &quot;Secret_Access_Key&quot;<br><br>api_endpoint                       = &quot;URL_Cloud_Zadara&quot;<br>bastion_ip                         = &quot;Bastion_IP&quot;<br>bastion_ami                        = &quot;AMI_ID&quot;<br>bastion_keyfile                    = &quot;PATH_to_Key&quot;<br>bastion_keyname                    = &quot;Key_Name&quot;<br>bastion_user                       = &quot;ubuntu&quot;<br>environment                        = &quot;ENV_Name&quot;<br>vpc_id                             = &quot;vpc-ID&quot;<br>public_subnet_id                   = &quot;subnet-PUB-ID&quot;<br>private_subnet_id                  = &quot;subnet-PRIV-ID&quot;<br>security_group_id                  = &quot;sg-ID&quot;<br>masters_load_balancer_id           = &quot;NLB-ID&quot;<br>masters_load_balancer_internal_dns = &quot;NLB-Hostname&quot;<br><br>masters_load_balancer_public_ip    = &quot;NLB-PUB-IP&quot;<br>masters_load_balancer_private_ip   = &quot;NLB-PRIV-IP&quot;<br><br>eksd_ami                           = &quot;ami-ID&quot;<br><br>masters_keyname                    = &quot;Key_Name&quot;<br>masters_keyfile                    = &quot;PATH_to_PEM&quot;<br>workers_keyname                    = &quot;Key_Name&quot;<br>workers_keyfile                    = &quot;PATH_to_PEM&quot;</pre><p>Some parameters are optional, the ones changed for this example are below with comments:</p><pre>masters_instance_type              = &quot;z4.large&quot;<br>workers_instance_type              = &quot;z8.large&quot;<br><br>masters_count                      = 3 # minimal recommended<br>manage_masters_using_asg           = false # do not use master nodes Auto Scaling<br>workers_count                      = 5 # there is no minimal<br><br>masters_volume_size                = &quot;50&quot;<br>workers_volume_size                = &quot;100&quot;<br>workers_addition                   = 3 # Max workers that will be added by ASG<br><br>ebs_csi_volume_type                = &quot;gp3&quot;<br>install_ebs_csi                    = true<br>install_lb_controller              = true<br>install_autoscaler                 = true<br>install_kasten_k10                 = false</pre><p>The instance type options (mainly workers) are sensitive to the Kubernetes pod usage load. They will be higher or lower based on usage. The masters_count option defines how many master nodes will be used in redundancy with the autoscale option disabled (recommended by the Zadara team). The option to not autoscale is linked to ETCD database corruption issues.</p><p>The workers_addition and workers_count options are important for defining cluster growth automatically by the zCompute cloud orchestrator. The workers_count is the initial (and minimum) number of workers in the Kubernetes cluster. The workers_addition informs how many extra nodes will be created automatically to meet the extra demand for computing capacity.</p><p>There are other values for backing up Kubernetes ETCD in a compatible S3 bucket (not covered in this tutorial and linked to the “install_kasten_k10” option):</p><pre>backup_access_key_id # access-key of user NGOS/S3<br>backup_secret_access_key # secret-key of the NGO/S3 user<br>backup_region # NGO/S3 region (or located in us-east-1)<br>backup_endpoint # NGO endpoint<br>backup_bucket # bucket name NGOS/S3<br>backup_rotation # maximum number of files to be stored (standard is 100)</pre><p>With the parameters configured, it’s time to initialize terraform, plan, and deploy EKS-D on the Zadara cloud:</p><pre># terraform init<br>Initializing the backend...<br>Initializing modules...<br>- master_instance_profile in modules\instance-profile<br>- masters_asg in modules\asg<br>- worker_instance_profile in modules\instance-profile<br>- workers_asg in modules\asg<br>Initializing provider plugins...<br>- Finding latest version of hashicorp/cloudinit...<br>- Finding hashicorp/aws versions matching &quot;~&gt; 3.33.0&quot;...<br>- Finding latest version of hashicorp/random...<br>- Installing hashicorp/cloudinit v2.3.5...<br>- Installed hashicorp/cloudinit v2.3.5 (signed by HashiCorp)<br>- Installing hashicorp/aws v3.33.0...<br>- Installed hashicorp/aws v3.33.0 (signed by HashiCorp)<br>- Installing hashicorp/random v3.6.3...<br>- Installed hashicorp/random v3.6.3 (signed by HashiCorp)<br>Terraform has created a lock file .terraform.lock.hcl to record the provider<br>selections it made above. Include this file in your version control repository<br>so that Terraform can guarantee to make the same selections by default when<br>you run &quot;terraform init&quot; in the future.<br><br>Terraform has been successfully initialized!<br><br>You may now begin working with Terraform. Try running &quot;terraform plan&quot; to see<br>any changes that are required for your infrastructure. All Terraform commands<br>should now work.<br><br>If you ever set or change modules or backend configuration for Terraform,<br>rerun this command to reinitialize your working directory. If you forget, other<br>commands will detect it and remind you to do so if necessary.</pre><pre># terraform plan<br><br>Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the<br>following symbols:<br>  + create<br>...<br>Note: You didn&#39;t use the -out option to save this plan, so Terraform can&#39;t guarantee to take exactly these actions if<br>you run &quot;terraform apply&quot; now.</pre><pre># terraform apply --auto-approve<br><br>Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the<br>following symbols:<br>  + create<br>...<br>Apply complete! Resources: 22 added, 0 changed, 0 destroyed.<br><br>Outputs:<br><br>apiserver_private = &quot;PRIV-IP&quot;<br>apiserver_public = &quot;PUB-IP&quot;<br>bastion_ip = &quot;PUB-IP&quot;<br>master_hostname = &quot;k8s-master-1&quot;<br>x_kubeconfig_script = &quot;./get_kubeconfig.sh k8s-master-1 PRIV-IP PUB-IP PUB-IP &lt;bastion_user&gt; &lt;bastion_keypair&gt; &lt;master_user&gt; &lt;master_keypair&gt;&quot;</pre><p>Run the final <strong>terraform apply</strong> script to get the <strong>kubeconfig</strong> file:</p><p><strong>NOTE</strong>: The new script has 9 parameters, but the example only shows 8 parameters.</p><pre># ./get_kubeconfig.sh k8s-master-1 BASTION_PRIV_IP BASTION_PUB_IP MASTER_IP ubuntu KEYPATH/KEY_FILE ubuntu KEYPATH/KEY_FILE PATH_TO_KUBECONFIG<br>eksd.pem                100% 1674   157.0KB/s   00:00<br>kubeconfig              100% 5653   267.2KB/s   00:00</pre><p>Using OpenLens (example) and with the downloaded kubeconfig file, you can access the cluster:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zPnaEByLRAcbbsKWVCL2nA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dZxTHsfpGQBN08YBZ-48Jg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hGAPYvRWrIhCJyddQLCwxw.png" /></figure><h3>11. Conclusion</h3><p>The installation is complete and you can use an EKS-D (AWS standard) Kubernetes cluster with a few master nodes and worker nodes to create and deploy applications.</p><p>You can define automatic growth based on load (<em>autoscale</em>) for Kubernetes workers integrated with the Zadara cloud. The default is to increase only 3 nodes, but you can increase this value by adding a workers_addition line in the previously edited terraform.auto.tfvars file.</p><p>The creation of access to applications with <em>Load Balancers</em> (<em>Network</em> and <em>Application</em>) and the creation of volumes (PV and PVC) automatically and integrated with zCompute was also done with the install_lb_controller and install_ebs_csi options. It is now possible to create PVC with the default StorageClass already defined for the cloud EBS and when access is requested with Ingress or Load Balancers, the respective ALB or NLB will also be created in the Zadara cloud to serve Kubernetes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=519248d797f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Add Amazon EC2 and EKS Clusters to Rancher]]></title>
            <link>https://medium.com/@osmarrleao/how-to-add-amazon-ec2-and-eks-clusters-to-rancher-c0cc9c92bfc7?source=rss-942d8e8327d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0cc9c92bfc7</guid>
            <category><![CDATA[ek]]></category>
            <category><![CDATA[rancher]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[amazon]]></category>
            <dc:creator><![CDATA[Osmar R Leão]]></dc:creator>
            <pubDate>Wed, 03 Jun 2020 18:39:42 GMT</pubDate>
            <atom:updated>2020-06-03T18:39:42.089Z</atom:updated>
            <content:encoded><![CDATA[<p>Este artigo técnico pode ser acessado em português neste <a href="https://osmarrleao.wordpress.com/2020/06/03/como-adicionar-clusters-amazon-ec2-e-eks-no-rancher/">link</a>.</p><p>This is a small article about how to add Amazon Kubernetes cluster to Rancher. I will show the steps with the EKS service and one made with VMs automatically on EC2.</p><p>The purpose is to show how you can expand your Kubernetes private services with public cloud providers keeping a single and easy management interface.</p><h3>Cloud Credentials on Rancher</h3><p>To deploy VMs and clusters on Amazon Cloud, you need to create a credential on Amazon&#39;s IAM. These steps will not be shown here in this article, and I will assume that you know what to do.</p><p>Using the access key and secret, you need to add these to the Rancher interface. Inside Rancher interface, on Global area, click on your avatar, then choose &quot;Cloud Credentials&quot;:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8C3ohrJUhCaqGHEHz75fBw.png" /><figcaption>picture 1: adding cloud credentials</figcaption></figure><p>Now define your credential name, choose Amazon on type, choose your deployment region, and put your access key and secret:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B0ZhIITquXNO0UxbNvgUCA.png" /><figcaption>picture 2: adding cloud credentials</figcaption></figure><p>Ok, your credential are ready to be used.</p><h3>Deploy EC2 Cluster</h3><p>Before you can deploy VMs to be used as nodes on your Kubernetes cluster, you need to define node templates. These node templates are based on Amazon&#39;s machine &quot;flavors&quot; and Ubuntu images pointed by Rancher.</p><p>Go to Global area, click on your avatar, and then choose &quot;Node Templates&quot;:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zrUQUkCrFa8EgohpVqXs2Q.png" /><figcaption>picture 3: adding node template</figcaption></figure><p>Choose Amazon EC2, and fill the form according to your needs. Then use your credential added earlier:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gEhbf7wS8wSU3ChhleD14g.png" /><figcaption>picture 4: adding node template</figcaption></figure><p>Now choose your availability zone, and a subnet to deploy your VMs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DPc18CtK5zAimwkso5Xmfg.png" /><figcaption>picture 5: adding node template</figcaption></figure><p>You can create a security group to be used, but you need to open all TCP and UDP ports according to Rancher needs or use choose &quot;Standard&quot; and let Rancher do all the work to you:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7IdnTjNjErLc4GAgYcLdOA.png" /><figcaption>picture 6: adding node template</figcaption></figure><p>Choose an instance among all instances options, and its options. Then name your template and your template is done:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-m4w825mRcxbIfmnGSrxkw.png" /><figcaption>picture 7: adding node template</figcaption></figure><p>Now it&#39;s time to create a cluster. Click &quot;Add Cluster&quot; inside Global area of Rancher:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MaHANI6oXj7cBZIhcDYtSw.png" /><figcaption>picture 8: adding an EC2 cluster</figcaption></figure><p>Choose the &quot;Amazon EC2&quot; type. After that, you need to choose your Kubernetes cluster settings. The Rancher requires 1, 3, or 5 administrators nodes, and at least one worker node. Fill the form accordingly to your needs, I will show using 3 master nodes and 2 worker nodes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bDiok4_MZcWLBhO68PuoNA.png" /><figcaption>picture 9: adding an EC2 cluster</figcaption></figure><p>You can choose different types of node templates for each type of Kubernetes node. To simplify, I chose the same for all node types. Now define your Kubernetes version and network provider (Canal is the default). Click on create and wait to Rancher deploy your cluster:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dvjVYSlBQOwc24QK-QlYJg.png" /><figcaption>picture 10: adding an EC2 cluster</figcaption></figure><p>You need to wait a few minutes. My wait time was 15 minutes. You can follow the steps on state messages:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rG2WgXZZmph9ODP8_KDsVw.png" /><figcaption>picture 11: adding an EC2 cluster</figcaption></figure><h3>Adding EKS Cluster</h3><p>Create an EKS cluster is simpler, choose your region and put your access key and secret:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qG4RDt95QPQE5yXAWJWERw.png" /><figcaption>picture 12: adding an EKS cluster</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lGCRv-VKt8Bop5d5RKBiKA.png" /><figcaption>picture 13: adding an EKS cluster</figcaption></figure><p>Choose one compatible version of Kubernetes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AUNPZALAhVcGtBeDhMxxXw.png" /><figcaption>picture 14: adding an EKS cluster</figcaption></figure><p>Now, choose the VPC:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qKxGz-I5748oDQdBqx9svg.png" /><figcaption>picture 15: adding an EKS cluster</figcaption></figure><p>And subnets:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8MkocHfBTWQ4YCkWqdQyfQ.png" /><figcaption>picture 16: adding an EKS cluster</figcaption></figure><p>The security group:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xz4z7sQEMJRYEOgrohWWEw.png" /><figcaption>picture 17: adding an EKS cluster</figcaption></figure><p>The instance options and your SSH key. Click on create and wait:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XYfj-ia_6KuWF4X91BEZ0Q.png" /><figcaption>picture 18: adding an EKS cluster</figcaption></figure><p>Now you need to wait about 15 minutes. You can follow the creation of cluster on Rancher and EKS page as well:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BvOzO-v_GLmc2Kev9I1T5w.png" /><figcaption>picture 19: adding an EKS cluster</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GzZiaN7Ja1auat2HPxkqww.png" /><figcaption>picture 20: adding an EKS cluster</figcaption></figure><p>Now you have a EKS cluster ready to be used:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8BlUQdOlqnBFTz4qpSfDjQ.png" /><figcaption>picture 21: adding an EKS cluster</figcaption></figure><p>I will use one of those to future examples.</p><p>See you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0cc9c92bfc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Rancher on RKE cluster]]></title>
            <link>https://medium.com/@osmarrleao/deploy-rancher-on-rke-cluster-e7415c199ef2?source=rss-942d8e8327d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7415c199ef2</guid>
            <category><![CDATA[openssl]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cncf]]></category>
            <category><![CDATA[rancher]]></category>
            <category><![CDATA[rke]]></category>
            <dc:creator><![CDATA[Osmar R Leão]]></dc:creator>
            <pubDate>Mon, 25 May 2020 20:16:48 GMT</pubDate>
            <atom:updated>2020-05-25T20:16:48.058Z</atom:updated>
            <content:encoded><![CDATA[<p>Este artigo técnico pode ser encontrado em português neste <a href="https://osmarrleao.wordpress.com/2020/05/25/instalando-rancher-num-cluster-rke/">link</a>.</p><p>This article is a sequel to my previous one about install the RKE Kubernetes cluster. The Rancher is a service to control CNCF certified Kubernetes clusters, and I will use my previously created RKE cluster to demonstrate it. You can access this article following this <a href="https://medium.com/@osmarrleao/installing-rke-cluster-on-enterprise-linux-d4cded73fa84">link</a>.</p><p>The Rancher structure can be detailed by this <a href="https://rancher.com/docs/rancher/v2.x/en/overview/">page</a>. In this article I will only show one method of on-premises installation.</p><h3>The Environment Setup Process</h3><p>Assuming that the RKE cluster is set, I will show other components and the reason why I made these choices.</p><p>The previous basic environment will be incremented by a load balancer and network gateway. The load balancer will guarantee the high availability of this setup. Only one modification was made to the previous RKE cluster: now all three nodes are master and workers. In this way, we will have a cluster in HA mode:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FYwYhnUSg5hfVfzsjo7IUA.png" /><figcaption>picture 1: the new architecture</figcaption></figure><p>The load balancer of this setup is HAProxy configured using TCP mode or layer 4 mode. This same host will be configured as the role of a gateway.</p><p>The domain information of this environment is (1) in.leao.pro.br as domain name; (2) the hosts will be named as node01 to node03, and gw, with these IP addresses respectively: 172.30.0.101 to 103 and 172.30.0.1. The rancher service will have the domain name of “rancher.in.leao.pro.br” pointing to HAProxy.</p><h3>The Gateway Installation</h3><p>I will not detail how to install the CentOS 8 for this setup. I will consider a CentOS 8 with no GUI and minimal configuration. This host will have two NICs, one connected to our environment, the other to the Internet.</p><p>The first step is to identify which NIC and separate them into the respective firewalld zone. Then apply firewall rules:</p><pre>[root@gw ~]# <strong>ip address show</strong><br>1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000<br>link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br>inet 127.0.0.1/8 scope host lo<br>valid_lft forever preferred_lft forever<br>inet6 ::1/128 scope host<br>valid_lft forever preferred_lft forever<br>2: <strong>enp0s3</strong>: mtu 1500 qdisc fq_codel state UP group default qlen 1000<br>link/ether 08:00:27:ea:e5:85 brd ff:ff:ff:ff:ff:ff<br>inet <strong>172.30.0.1/24</strong> brd 172.30.0.255 scope global noprefixroute enp0s3<br>valid_lft forever preferred_lft forever<br>inet6 fe80::a00:27ff:feea:e585/64 scope link<br>valid_lft forever preferred_lft forever<br>3: <strong>enp0s8</strong>: mtu 1500 qdisc fq_codel state UP group default qlen 1000<br>link/ether 08:00:27:14:86:f2 brd ff:ff:ff:ff:ff:ff<br>inet <strong>192.168.86.21/24</strong> brd 192.168.86.255 scope global dynamic noprefixroute enp0s8<br>valid_lft 86354sec preferred_lft 86354sec<br>inet6 fe80::a00:27ff:fe14:86f2/64 scope link<br>valid_lft forever preferred_lft forever<br><br>[root@gw ~]# <strong>firewall-cmd --get-default-zone</strong><br>public<br><br>[root@gw ~]# <strong>firewall-cmd --get-active-zones</strong><br>public<br>interfaces: enp0s3 enp0s8<br><br>[root@gw ~]# <strong>firewall-cmd --zone=internal --change-interface=enp0s3 --permanent</strong><br>The interface is under control of NetworkManager, setting zone to &#39;internal&#39;.<br>success<br><br>[root@gw ~]# <strong>firewall-cmd --get-active-zones</strong><br>internal<br>interfaces: enp0s3<br>public<br>interfaces: enp0s8<br><br>[root@gw ~]# <strong>firewall-cmd --zone=internal --list-all</strong><br>internal (active)<br>target: default<br>icmp-block-inversion: no<br>interfaces: enp0s3<br>sources:<br>services: cockpit dhcpv6-client mdns samba-client ssh<br>ports:<br>protocols:<br>masquerade: no<br>forward-ports:<br>source-ports:<br>icmp-blocks:<br>rich rules:<br><br>[root@gw ~]# <strong>firewall-cmd --zone=internal --remove-service=cockpit</strong> <strong>--permanent</strong><br>success<br><br>[root@gw ~]# <strong>firewall-cmd --zone=internal --remove-service=dhcpv6-client</strong> <strong>--permanent</strong><br>success<br><br>[root@gw ~]# <strong>firewall-cmd --zone=internal --remove-service=mdns</strong> <strong>--permanent</strong><br>success<br><br>[root@gw ~]# <strong>firewall-cmd --zone=internal --remove-service=samba-client</strong> <strong>--permanent</strong><br>success<br><br>[root@gw ~]# <strong>firewall-cmd --zone=internal --add-service=http</strong> <strong>--permanent</strong><br>success<br><br>[root@gw ~]# <strong>firewall-cmd --zone=internal --add-service=https --permanent</strong><br>success<br><br>[root@gw ~]# <strong>firewall-cmd --zone=public --list-all</strong><br>public (active)<br>target: default<br>icmp-block-inversion: no<br>interfaces: enp0s8<br>sources:<br>services: cockpit dhcpv6-client ssh<br>ports:<br>protocols:<br>masquerade: no<br>forward-ports:<br>source-ports:<br>icmp-blocks:<br>rich rules:<br><br>[root@gw ~]# <strong>firewall-cmd --zone=public --remove-service=cockpit --permanent</strong><br>success<br><br>[root@gw ~]# <strong>firewall-cmd --zone=public --remove-service=dhcpv6-client --permanent</strong><br>success<br><br>[root@gw ~]# <strong>firewall-cmd --zone=public --add-service=http --permanent<br>success</strong><br><br>[root@gw ~]# <strong>firewall-cmd --zone=public --add-service=https --permanent<br>success</strong><br><br>[root@gw ~]# <strong>firewall-cmd --reload</strong><br>success<br><br>[root@gw ~]# <strong>firewall-cmd --zone=internal --list-all</strong><br>internal (active)<br>target: default<br>icmp-block-inversion: no<br>interfaces: enp0s3<br>sources:<br>services: http https ssh<br>ports:<br>protocols:<br>masquerade: no<br>forward-ports:<br>source-ports:<br>icmp-blocks:<br>rich rules:<br><br>[root@gw ~]# <strong>firewall-cmd --zone=public --list-all</strong><br>public (active)<br>target: default<br>icmp-block-inversion: no<br>interfaces: enp0s8<br>sources:<br>services: http https ssh<br>ports:<br>protocols:<br>masquerade: no<br>forward-ports:<br>source-ports:<br>icmp-blocks:<br>rich rules:</pre><p>Now, I need to enable ip_forward kernel option and the NAT rule on the firewalld:</p><pre>[root@gw ~]# <strong>firewall-cmd --zone=public --add-masquerade --permanent</strong><br>success<br><br>[root@gw ~]# <strong>firewall-cmd --reload</strong><br>success<br><br>[root@gw ~]# <strong>firewall-cmd --zone=public --list-all</strong><br>public (active)<br>target: default<br>icmp-block-inversion: no<br>interfaces: enp0s8<br>sources:<br>services: http https ssh<br>ports:<br>protocols:<br>masquerade: <strong>yes</strong><br>forward-ports:<br>source-ports:<br>icmp-blocks:<br>rich rules:<br><br>[root@gw ~]# <strong>echo &quot;net.ipv4.ip_forward = 1&quot; &gt; /etc/sysctl.d/10-ip_forward.conf</strong><br><br>[root@gw ~]# <strong>sysctl -f</strong></pre><h3>The DNS and HAProxy Installation</h3><p>The DNS service is required by this setup, so I will show how to install and configure bind9 to serve our goal here.</p><p>First, how to install it on gateway host:</p><pre>[root@gw ~]# <strong>dnf -y install bind</strong><br>Last metadata expiration check: 0:18:42 ago on Sat 23 May 2020 12:06:10 PM -03.<br>Dependencies resolved.<br>...<br>Installed:<br>bind-32:9.11.4-26.P2.el8.x86_64 bind-libs-32:9.11.4-26.P2.el8.x86_64 bind-libs-lite-32:9.11.4-26.P2.el8.x86_64<br>bind-license-32:9.11.4-26.P2.el8.noarch<br>Complete!<br><br>[root@gw ~]# <strong>systemctl enable named</strong><br>Created symlink /etc/systemd/system/multi-user.target.wants/named.service → /usr/lib/systemd/system/named.service.</pre><p>Now, adding rules to firewalld to access named daemon and the two config files needed:</p><pre>[root@gw ~]# <strong>firewall-cmd --zone=internal --add-service=dns --permanent<br>success</strong><br><br>[root@gw ~]# <strong>firewall-cmd --zone=public --add-service=dns --permanent<br>success</strong><br><br>[root@gw ~]# <strong>firewall-cmd --reload</strong><br>success<br><br>[root@gw ~]# <strong>cat /etc/named.conf</strong><br>options {<br>        <strong>listen-on port 53 { 172.30.0.1; };</strong><br>        directory       &quot;/var/named&quot;;<br>        dump-file       &quot;/var/named/data/cache_dump.db&quot;;<br>        statistics-file &quot;/var/named/data/named_stats.txt&quot;;<br>        memstatistics-file &quot;/var/named/data/named_mem_stats.txt&quot;;<br>        secroots-file   &quot;/var/named/data/named.secroots&quot;;<br>        recursing-file  &quot;/var/named/data/named.recursing&quot;;<br>        <strong>allow-query     { any; };<br><br>        </strong><strong>forwarders { <br>                </strong><strong>192.168.86.1; <br>        </strong><strong>}; </strong><br><br>        recursion yes; <br><br>        dnssec-enable yes; <br>        dnssec-validation no; <br><br>        managed-keys-directory &quot;/var/named/dynamic&quot;; <br><br>        pid-file &quot;/run/named/named.pid&quot;; <br>        session-keyfile &quot;/run/named/session.key&quot;; <br><br>        include &quot;/etc/crypto-policies/back-ends/bind.config&quot;;<br>};<br><br>logging {<br>        channel default_debug {<br>                file &quot;data/named.run&quot;;<br>                severity dynamic;<br>        };<br>};<br><br>zone &quot;.&quot; IN {<br>        type hint;<br>        file &quot;named.ca&quot;;<br>};<br><br><strong>zone &quot;in.leao.pro.br&quot; IN {<br>        type master;<br>        file &quot;in.leao.pro.br&quot;;<br>};<br></strong><br>include &quot;/etc/named.rfc1912.zones&quot;;<br>include &quot;/etc/named.root.key&quot;;<br><br>[root@gw ~]# <strong>cat /var/named/in.leao.pro.br</strong><br>$ORIGIN in.leao.pro.br.<br>$TTL 86400<br>@        SOA      gw.in.leao.pro.br.       root.in.leao.pro.br. (<br>                  2020051802 ; serial<br>                  21600 ; refresh after 6 hours<br>                  3600 ; retry after 1 hour<br>                  604800 ; expire after 1 week<br>                  86400 ) ; minimum TTL of 1 day<br>;<br>;<br>         NS gw.in.leao.pro.br.<br><br>gw       A 172.30.0.1<br>node01   A 172.30.0.101<br>node02   A 172.30.0.102<br>node03   A 172.30.0.103<br><br>rancher  CNAME gw.in.leao.pro.br.<br><br>[root@gw ~]# <strong>systemctl start named</strong></pre><p>Now, these steps below will show how to install, configure, and enable HAProxy service on the gateway machine:</p><pre>[root@gw ~]# <strong>dnf -y install haproxy</strong><br>Last metadata expiration check: 0:51:26 ago on Sat 23 May 2020 12:06:10 PM -03.<br>Dependencies resolved.<br>...<br>Installed:<br>haproxy-1.8.15-6.el8_1.1.x86_64<br>Complete!<br><br>[root@gw ~]# <strong>cat /etc/haproxy/haproxy.cfg</strong><br>global<br>    log      127.0.0.1 local2<br>    chroot   /var/lib/haproxy <br>    pidfile  /var/run/haproxy.pid <br>    maxconn  4000 <br>    user     haproxy <br>    group    haproxy <br>    daemon <br><br>    stats socket /var/lib/haproxy/stats <br><br>    ssl-default-bind-ciphers PROFILE=SYSTEM <br>    ssl-default-server-ciphers PROFILE=SYSTEM<br><br>defaults<br>    mode     tcp<br>    log      global<br>    option   tcplog<br>    option   dontlognull<br>    option   forwardfor except 127.0.0.0/8 <br>    option   redispatch <br>    retries  3<br>    timeout  queue 1m <br>    timeout  connect 10s <br>    timeout  client 1m <br>    timeout  server 1m<br>    timeout  http-keep-alive 10s<br>    timeout  check 10s <br>    maxconn  3000<br><br>frontend main<br>    bind *:5000<br>    acl url_static path_beg -i /static /images /javascript /stylesheets<br>    acl url_static path_end -i .jpg .gif .png .css .js<br><br>    use_backend static if url_static <br>    default_backend app<br><br>backend static<br>    balance roundrobin<br>    server static 127.0.0.1:4331 check<br><br>backend app<br>    balance roundrobin<br>    server app1 127.0.0.1:5001 check<br>    server app2 127.0.0.1:5002 check<br>    server app3 127.0.0.1:5003 check<br>    server app4 127.0.0.1:5004 check<br><br><strong>frontend rancher_fe<br>    bind *:443<br>    default_backend rancher_be<br><br>backend rancher_be<br>    balance roundrobin<br>    mode tcp<br>    server rancher01 172.30.0.101:443 check<br>    server rancher02 172.30.0.102:443 check<br>    server rancher03 172.30.0.103:443 check</strong><br><br>[root@gw ~]# <strong>systemctl enable --now haproxy</strong><br>Created symlink /etc/systemd/system/multi-user.target.wants/haproxy.service → /usr/lib/systemd/system/haproxy.service.</pre><h3>Rancher Installation on the RKE Cluster</h3><p>Now that reverse proxy and load balancer are ready and pointing to the three nodes on our RKE cluster, we need to deploy the Rancher on it.</p><p>Remember that I will use the RKE installation mentioned in <a href="https://medium.com/@osmarrleao/installing-rke-cluster-on-enterprise-linux-d4cded73fa84">this</a> article.</p><p>First of all, we need to download and install the helm on the first node of the cluster. The same node that was RKE deployment host:</p><pre>[root@node01 ~]# <strong>dnf -y install wget</strong><br>CentOS-8 - AppStream                                                                                             6.7 kB/s | 4.3 kB     00:00<br>CentOS-8 - Base                                                                                                   10 kB/s | 3.9 kB     00:00<br>CentOS-8 - Extras                                                                                                3.4 kB/s | 1.5 kB     00:00<br>Docker CE Stable - x86_64                                                                                         10 kB/s | 3.5 kB     00:00<br>Extra Packages for Enterprise Linux Modular 8 - x86_64                                                            58 kB/s |  60 kB     00:01<br>Extra Packages for Enterprise Linux 8 - x86_64                                                                    55 kB/s |  61 kB     00:01<br>Kubernetes                                                                                                       324  B/s | 454  B     00:01<br>Dependencies resolved.<br>…<br>Installed:<br>  wget-1.19.5-8.el8_1.1.x86_64<br><br>Complete!<br><br>[root@node01 ~]# <strong>wget https://get.helm.sh/helm-v3.2.1-linux-amd64.tar.gz</strong><br>--2020-05-22 16:08:27--  https://get.helm.sh/helm-v3.2.1-linux-amd64.tar.gz<br>Resolving get.helm.sh (get.helm.sh)... 152.199.52.147, 2606:2800:157:3ac:1a2e:26c9:99c:8f9<br>Connecting to get.helm.sh (get.helm.sh)|152.199.52.147|:443... connected.<br>HTTP request sent, awaiting response... 200 OK<br>Length: 12927632 (12M) [application/x-tar]<br>Saving to: &#39;helm-v3.2.1-linux-amd64.tar.gz&#39;<br><br>helm-v3.2.1-linux-amd64.tar.gz       100%[===================================================================&gt;]  12.33M  6.98MB/s    in 1.8s<br><br>2020-05-22 16:08:30 (6.98 MB/s) - &#39;helm-v3.2.1-linux-amd64.tar.gz&#39; saved [12927632/12927632]<br><br>[root@node01 ~]# <strong>tar zxvf helm-v3.2.1-linux-amd64.tar.gz</strong><br>linux-amd64/<br>linux-amd64/README.md<br>linux-amd64/helm<br>linux-amd64/LICENSE<br><br>[root@node01 ~]# <strong>mv linux-amd64/helm /usr/local/bin/</strong></pre><p>Now, I will create the certificates to be used to deploy Rancher on the cluster.</p><p>I will set up as public key infrastructure (PKI), so, first I will create a Certificate Authority (CA), then I will create the server certificate and sign it.</p><p>The first step is to create a key and CA certificate (I will use an alternative openssl.cnf file to sign server certificate):</p><pre>[root@node01 ~]# <strong>mkdir -p /etc/pki/CA/{certs,private}</strong><br><br>[root@node01 ~]# <strong>openssl genrsa -aes128 -out /etc/pki/CA/private/myCA.key 2048</strong><br>Generating RSA private key, 2048 bit long modulus (2 primes)<br>..........................................................................................................+++++<br>.......+++++<br>e is 65537 (0x010001)<br>Enter pass phrase for /etc/pki/CA/private/myCA.key:<br>Verifying - Enter pass phrase for /etc/pki/CA/private/myCA.key:<br><br>[root@node01 ~]# <strong>openssl req -new -x509 -days 1825 -key /etc/pki/CA/private/myCA.key -out /etc/pki/CA/certs/myCA.crt</strong><br>Enter pass phrase for /etc/pki/CA/private/myCA.key:<br>You are about to be asked to enter information that will be incorporated<br>into your certificate request.<br>What you are about to enter is what is called a Distinguished Name or a DN.<br>There are quite a few fields but you can leave some blank<br>For some fields there will be a default value,<br>If you enter &#39;.&#39;, the field will be left blank.<br>-----<br>Country Name (2 letter code) [XX]:BR<br>State or Province Name (full name) []:Bahia<br>Locality Name (eg, city) [Default City]:Salvador<br>Organization Name (eg, company) [Default Company Ltd]:Leao Professional<br>Organizational Unit Name (eg, section) []:IT<br>Common Name (eg, your name or your server&#39;s hostname) []:ca.in.leao.pro.br<br>Email Address []:osmar@leao.pro.br<br><br>[root@node01 ~]# <strong>cat ca_openssl.cnf</strong><br>[req]<br>distinguished_name = req_distinguished_name<br>req_extensions = v3_req<br>prompt = no<br><br>[req_distinguished_name]<br>C = BR<br>ST = Bahia<br>L = Salvador<br>O = Leao Professional<br>OU = IT<br>CN = ca.in.leao.pro.br<br><br>[v3_req]<br>keyUsage = keyEncipherment, dataEncipherment<br>extendedKeyUsage = serverAuth<br>subjectAltName = @alt_names<br>[alt_names]<br>DNS.1 = rancher.in.leao.pro.br<br>DNS.2 = ingress.in.leao.pro.br</pre><p>Then, I will create a key and server certificate to be used by the Rancher server. I will sign this key using CA.</p><p>The Rancher requires &quot;Subject Alternative Names&quot; inside the server certificate to work properly. To do as required, I will create an alternate openssl.cnf file to server key and certificate as well:</p><pre>[root@node01 ~]# <strong>cat rancher_openssl.cnf</strong><br>[req]<br>default_bits = 2048<br>prompt = no<br>default_md = sha256<br>req_extensions = req_ext<br>distinguished_name = dn<br><br>[ dn ]<br>C=BR<br>ST=Bahia<br>L=Salvador<br>O=Leao Professional<br>OU=IT<br>emailAddress=osmar@leao.pro.br<br>CN = rancher.in.leao.pro.br<br><br>[ req_ext ]<br>subjectAltName = @alt_names<br><br>[ alt_names ]<br>DNS.1 = rancher.in.leao.pro.br<br>DNS.2 = ingress.in.leao.pro.br<br><br>[root@node01 ~]# <strong>openssl req -new -sha256 -nodes -out /etc/pki/tls/rancher.csr -newkey rsa:2048 -keyout /etc/pki/tls/private/rancher.key -config &lt;( cat openssl.cnf )</strong><br>Generating a RSA private key<br>........................+++++<br>..........................+++++<br>writing new private key to &#39;/etc/pki/tls/private/rancher.key&#39;<br>-----</pre><p>At last, I will sign the server certificate and copy the required files to the rke user home directory. Using RKE user I will import these files as secrets into Kubernetes:</p><pre>[root@node01 ~]# <strong>openssl x509 -req -in /etc/pki/tls/rancher.csr -CA /etc/pki/CA/certs/myCA.crt -CAkey /etc/pki/CA/private/myCA.key -CAcreateserial -out /etc/pki/tls/certs/rancher.crt -extfile ca_openssl.cnf -extensions v3_req -days 365</strong><br>Signature ok<br>subject=C = BR, ST = Bahia, L = Salvador, O = Leao Professional, OU = IT, CN = rancher.in.leao.pro.br, emailAddress = osmar@leao.pro.br<br>Getting CA Private Key<br>Enter pass phrase for /etc/pki/CA/private/myCA.key:<br><br>[root@node01 ~]# <strong>cp /etc/pki/tls/certs/rancher.crt /etc/pki/tls/private/rancher.key /etc/pki/CA/certs/myCA.crt /home/rke/</strong><br><br>[root@node01 ~]# <strong>chown rke. /home/rke/rancher.* /home/rke/myCA.crt</strong></pre><p>Now, as part of Rancher deployment, I will create the namespace and configure helm:</p><pre>[rke@node01 ~]$ <strong>kubectl create namespace cattle-system</strong><br>namespace/cattle-system created<br><br>[rke@node01 ~]$ <strong>helm repo add rancher-stable https://releases.rancher.com/server-charts/stable</strong><br>&quot;rancher-stable&quot; has been added to your repositories<br><br>[rke@node01 ~]$ <strong>helm repo update</strong><br>Hang tight while we grab the latest from your chart repositories...<br>...Successfully got an update from the &quot;rancher-stable&quot; chart repository<br>Update Complete. ⎈ Happy Helming!⎈</pre><p>Test the server certificate (optional) and create the Kubernetes secrets to be used by Rancher deployment using the key and certificates created earlier:</p><pre>[rke@node01 ~]$ <strong>openssl x509 -noout -in rancher.crt -text | grep DNS</strong><br>                DNS:<strong>rancher.in.leao.pro.br</strong>, DNS:ingress.in.leao.pro.br<br><br>[rke@node01 ~]$ <strong>kubectl -n cattle-system create secret tls tls-rancher-ingress --cert=rancher.crt --key=rancher.key</strong><br>secret/tls-rancher-ingress created<br><br>[rke@node01 ~]$ <strong>kubectl -n cattle-system create secret generic tls-ca --from-file=cacerts.pem=./myCA.crt</strong><br>secret/tls-ca created</pre><p>Now, deploy the Rancher server. Note the hostname parameter, it is very important to be the same as server certificate CN and SAN (rancher.in.leao.pro.br in my case):</p><pre>[rke@node01 ~]$ <strong>helm install rancher rancher-stable/rancher --namespace cattle-system --set hostname=rancher.in.leao.pro.br --set ingress.tls.source=secret --set privateCA=true<br>NAME: rancher</strong><br>LAST DEPLOYED: Mon May 25 12:43:30 2020<br>NAMESPACE: cattle-system<br>STATUS: deployed<br>REVISION: 1<br>TEST SUITE: None<br>NOTES:<br>Rancher Server has been installed.<br><br>NOTE: Rancher may take several minutes to fully initialize. Please standby while Certificates are being issued and Ingress comes up.<br><br>Check out our docs at https://rancher.com/docs/rancher/v2.x/en/<br><br>Browse to https://rancher.in.leao.pro.br<br><br>Happy Containering!<br><br>[rke@node01 ~]$ <strong>kubectl -n cattle-system rollout status deploy/rancher</strong><br>Waiting for deployment &quot;rancher&quot; rollout to finish: 0 of 3 updated replicas are available...<br>Waiting for deployment &quot;rancher&quot; rollout to finish: 1 of 3 updated replicas are available...<br>Waiting for deployment &quot;rancher&quot; rollout to finish: 2 of 3 updated replicas are available...<br>deployment &quot;rancher&quot; successfully rolled out<br><br>[rke@node01 ~]$ <strong>kubectl get pods -n cattle-system</strong><br>NAME                       READY   STATUS    RESTARTS   AGE<br>rancher-5cf4ff774f-c7mls   1/1     Running   0          5m51s<br>rancher-5cf4ff774f-l9wmp   1/1     Running   0          5m51s<br>rancher-5cf4ff774f-rl5w8   1/1     Running   1          5m51s<br><br>[rke@node01 ~]$ <strong>kubectl -n cattle-system get ingress</strong><br>NAME      HOSTS                    ADDRESS                                  PORTS     AGE<br>rancher   rancher.in.leao.pro.br   172.30.0.101,172.30.0.102,172.30.0.103   80, 443   6m28s</pre><p>Now, access the URL of the rancher and configure the admin password:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nGQ7umatSjcp_7XL7E7hFg.png" /><figcaption>picture 2: creating admin password</figcaption></figure><p>Confirm the rancher URL:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tCiKuTmFJ97ztsAVUdnZMA.png" /><figcaption>picture 3: confirm Rancher access URL</figcaption></figure><p>Check your server certificate clicking on the certificate icon on your browser. It will show your server URL, otherwise, your installation has failed. You can add your CA certificate to your browser or add your server certificate as an accepted certificate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*dL-LEhsyyBSdFL2QrWb6Wg.png" /><figcaption>picture 4: server certificate</figcaption></figure><p>Now, check if you have a rancher agent to each node of your RKE cluster and a cluster agent to manage the RKE cluster:</p><pre>[rke@node01 ~]$ <strong>kubectl get pods -n cattle-system -o wide</strong><br>NAME                                    READY   STATUS    RESTARTS   AGE   IP             NODE           NOMINATED NODE   READINESS GATES<br>cattle-cluster-agent-85c788ddb5-89df8   1/1     Running   0          43m   10.42.1.7      172.30.0.102   &lt;none&gt;           &lt;none&gt;<br>cattle-node-agent-hpq8x                 1/1     Running   0          43m   172.30.0.101   172.30.0.101   &lt;none&gt;           &lt;none&gt;<br>cattle-node-agent-js8h6                 1/1     Running   0          43m   172.30.0.103   172.30.0.103   &lt;none&gt;           &lt;none&gt;<br>cattle-node-agent-qnfp8                 1/1     Running   0          43m   172.30.0.102   172.30.0.102   &lt;none&gt;           &lt;none&gt;<br>rancher-5cf4ff774f-c7mls                1/1     Running   0          52m   10.42.1.6      172.30.0.102   &lt;none&gt;           &lt;none&gt;<br>rancher-5cf4ff774f-l9wmp                1/1     Running   0          52m   10.42.0.4      172.30.0.103   &lt;none&gt;           &lt;none&gt;<br>rancher-5cf4ff774f-rl5w8                1/1     Running   1          52m   10.42.2.6      172.30.0.101   &lt;none&gt;           &lt;none&gt;</pre><p>Well done! Now you have the Rancher server deployed on your RKE Kubernetes cluster.</p><p>According to the Rancher documentation, you need to use this cluster exclusively to Rancher and create other clusters to deploy your applications:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-GLmWcAOQxS5nTQJTI6DPg.png" /><figcaption>picture 5: Rancher running on RKE cluster</figcaption></figure><p>See you in my next article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7415c199ef2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing RKE Cluster on Enterprise Linux]]></title>
            <link>https://medium.com/@osmarrleao/installing-rke-cluster-on-enterprise-linux-d4cded73fa84?source=rss-942d8e8327d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4cded73fa84</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cluster]]></category>
            <category><![CDATA[rancher]]></category>
            <category><![CDATA[rke]]></category>
            <category><![CDATA[centos]]></category>
            <dc:creator><![CDATA[Osmar R Leão]]></dc:creator>
            <pubDate>Fri, 15 May 2020 22:37:59 GMT</pubDate>
            <atom:updated>2020-05-15T22:37:59.520Z</atom:updated>
            <content:encoded><![CDATA[<p>Este artigo técnico pode ser acessado em português neste <a href="https://osmarrleao.wordpress.com/2020/05/15/instalando-rke-num-enterprise-linux/">link</a>.</p><p>This article is about installing a Cloud Native Computing Foundation certified Kubernetes distribution. My first article about this. Rancher Kubernetes Engine (RKE) is a well-known distribution.</p><p>According to their site: &quot;Rancher Kubernetes Engine (RKE) is a CNCF-certified Kubernetes distribution that runs entirely within Docker containers. It works on bare-metal and virtualized servers. RKE solves the problem of installation complexity, a common issue in the Kubernetes community.&quot; You can read about them on this <a href="https://rancher.com/docs/rke/latest/en/">link</a>.</p><h3>Environment Set up</h3><p>For this moment on, I will always prefer to use Enterprise Linux distributions, to this article, I will use Community Enterprise Operating System version 8, also known as CentOS 8.</p><p>In this scenario, I have 3 nodes that will be used as Kubernetes nodes. The installation process of CentOS will not be shown here. I&#39;m considering a CentOS 8 with minimal installation without a graphical user interface.</p><p>Below are the schematics, the nodes, and their functions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DisOtRTQaUv7CbzsBD-ddg.png" /><figcaption>picture 01: basic schema</figcaption></figure><h3>Installation</h3><p>I will use my Ansible scripts&#39; order to install this environment. I will treat these scripts later on. All nodes must run these same commands, I will show when you need to run something specific to one node or user.</p><p>The first thing to do is to install chrony to synchronize the clocks:</p><pre>[root@node01 ~]# <strong>dnf -y install chrony</strong><br>CentOS-8 - AppStream            2.3 kB/s | 4.3 kB 00:01<br>CentOS-8 - Base                 3.4 kB/s | 3.9 kB 00:01<br>CentOS-8 - Extras               1.5 kB/s | 1.5 kB 00:01<br>Dependencies resolved.<br>...<br>Installed:<br>chrony-3.5-1.el8.x86_64 timedatex-0.5-3.el8.x86_64<br>Complete!<br>[root@node01 ~]# <strong>systemctl enable --now chronyd</strong></pre><p>Now, I will install Docker CE repository to install docker package and its dependencies:</p><pre>[root@node01 ~]# <strong>dnf -y install yum-utils</strong><br>Last metadata expiration check: 0:05:50 ago on Thu 14 May 2020 11:32:35 AM -03.<br>Dependencies resolved.<br>...<br>Installed:<br>yum-utils-4.0.8-3.el8.noarch<br>Complete!<br>[root@node01 ~]# <strong>yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo</strong><br>Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo</pre><p>And install the docker-ce compatible with RKE. To do that, I need to manually inform the packages and the versions exactly. Then enable docker service:</p><pre>[root@node01 ~]# <strong>dnf -y install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.13-3.2.el7.x86_64.rpm</strong><br>Last metadata expiration check: 0:13:54 ago on Fri 15 May 2020 09:27:02 AM -03.<br>containerd.io-1.2.13-3.2.el7.x86_64.rpm                 19 MB/s | 25 MB 00:01<br>Dependencies resolved.<br>...<br>Installed:<br>containerd.io-1.2.13-3.2.el7.x86_64 container-selinux-2:2.124.0-1.module_el8.1.0+298+41f9343a.noarch<br>checkpolicy-2.9-1.el8.x86_64 policycoreutils-python-utils-2.9-3.el8_1.1.noarch<br>python3-audit-3.0-0.13.20190507gitf58ec40.el8.x86_64 python3-libsemanage-2.9-1.el8.x86_64<br>python3-policycoreutils-2.9-3.el8_1.1.noarch python3-setools-4.2.2-1.el8.x86_64<br>Complete!<br>[root@node01 ~]# <strong>dnf -y --nobest install docker-ce-18.09.2-3.el7 docker-ce-cli-18.09.2-3.el7</strong><br>Last metadata expiration check: 0:15:08 ago on Fri 15 May 2020 09:27:02 AM -03.<br>Dependencies resolved.<br>...<br>Installed:<br>docker-ce-3:18.09.2-3.el7.x86_64 docker-ce-cli-1:18.09.2-3.el7.x86_64 libcgroup-0.41-19.el8.x86_64 libtool-ltdl-2.4.6-25.el8.x86_64<br>tar-2:1.30-4.el8.x86_64<br>Complete!<br>[root@node01 ~]# <strong>systemctl enable --now docker</strong><br>Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.<br>[root@node01 ~]# <strong>docker --version</strong><br>Docker version 18.09.2, build 6247962</pre><p>The root user can&#39;t run RKE because there is a known <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1527565">bug</a> of OpenSSH on Red Hat&#39;s Bugzilla about socket forwarding. Then, I will create a user to run RKE containers:</p><pre>[root@node01 ~]# <strong>useradd -g docker rke</strong><br>[root@node01 ~]# <strong>passwd rke</strong><br>Changing password for user rke.<br>New password:<br>Retype new password:<br>passwd: all authentication tokens updated successfully.</pre><p>Now, I will set up all parameters of operating system to a Kubernetes cluster. First is disable swap:</p><pre>[root@node01 ~]# <strong>swapoff -a</strong><br>[root@node01 ~]# <strong>sed -i &#39;/ swap / s/^(.*)$/#\1/g&#39; /etc/fstab</strong></pre><p>Then create a module configuration file to load all modules that are needed to run RKE containers. We will also add some new kernel parameters:</p><pre>[root@node01 ~]# <strong>echo -e &#39;br_netfilter\nip6_udp_tunnel\nip_set\nip_set_hash_ip\nip_set_hash_net\niptable_filter\niptable_nat\niptable_mangle\niptable_raw\nnf_conntrack_netlink\nnf_conntrack\nnf_conntrack_ipv4\nnf_defrag_ipv4\nnf_nat\nnf_nat_ipv4\nnf_nat_masquerade_ipv4\nnfnetlink\nudp_tunnel\nveth\nvxlan\nx_tables\nxt_addrtype\nxt_conntrack\nxt_comment\nxt_mark\nxt_multiport\nxt_nat\nxt_recent\nxt_set\nxt_statistic\nxt_tcpudp&#39; &gt; /etc/modules-load.d/rke.conf<br></strong>[root@node01 ~]# <strong>cat /etc/modules-load.d/rke.conf</strong><br>br_netfilter<br>ip6_udp_tunnel<br>ip_set<br>ip_set_hash_ip<br>ip_set_hash_net<br>iptable_filter<br>iptable_nat<br>iptable_mangle<br>iptable_raw<br>nf_conntrack_netlink<br>nf_conntrack<br>nf_conntrack_ipv4<br>nf_defrag_ipv4<br>nf_nat<br>nf_nat_ipv4<br>nf_nat_masquerade_ipv4<br>nfnetlink<br>udp_tunnel<br>veth<br>vxlan<br>x_tables<br>xt_addrtype<br>xt_conntrack<br>xt_comment<br>xt_mark<br>xt_multiport<br>xt_nat<br>xt_recent<br>xt_set<br>xt_statistic<br>xt_tcpudp<br>[root@node01 ~]# <strong>for module in br_netfilter ip6_udp_tunnel ip_set ip_set_hash_ip ip_set_hash_net iptable_filter iptable_nat iptable_mangle iptable_raw nf_conntrack_netlink nf_conntrack nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat nf_nat_ipv4 nf_nat_masquerade_ipv4 nfnetlink udp_tunnel veth vxlan x_tables xt_addrtype xt_conntrack xt_comment xt_mark xt_multiport xt_nat xt_recent xt_set xt_statistic xt_tcpudp; do modprobe $module; done</strong><br>[root@node01 ~]# <strong>echo &quot;net.bridge.bridge-nf-call-iptables = 1&quot; &gt;&gt; /etc/sysctl.d/rke.conf</strong><br>[root@node01 ~]# <strong>echo &quot;net.bridge.bridge-nf-call-ip6tables = 1&quot; &gt;&gt; /etc/sysctl.d/rke.conf</strong><br>[root@node01 ~]# <strong>echo &quot;</strong><strong>net.ipv4.ip_forward = 1&quot; &gt;&gt; /etc/sysctl.d/rke.conf</strong><br>[root@node01 ~]# <strong>sysctl -p /etc/sysctl.d/rke.conf</strong><br>net.bridge.bridge-nf-call-iptables = 1</pre><p>And add firewall rules considering the node role in the cluster (view picture 01 above). The node01 is a master node (etcd and control plane), the nodes 02 and 03 are workers nodes.</p><p>The firewall rules to node01:</p><pre>[root@node01 ~]# <strong>firewall-cmd --add-port=2376/tcp --permanent</strong><br>success<br>[root@node01 ~]# <strong>firewall-cmd --add-port=2379/tcp --permanent</strong><br>success<br>[root@node01 ~]#<strong> firewall-cmd --add-port=2380/tcp --permanent</strong><br>success<br>[root@node01 ~]# <strong>firewall-cmd --add-port=8472/udp --permanent</strong><br>success<br>[root@node01 ~]# <strong>firewall-cmd --add-port=9099/tcp --permanent</strong><br>success<br>[root@node01 ~]# <strong>firewall-cmd --add-port=10250/tcp --permanent</strong><br>success<br>[root@node01 ~]# <strong>firewall-cmd --add-port=80/tcp --permanent</strong><br>success<br>[root@node01 ~]# <strong>firewall-cmd --add-port=443/tcp --permanent</strong><br>success<br>[root@node01 ~]# <strong>firewall-cmd --add-port=6443/tcp --permanent</strong><br>success<br>[root@node01 ~]# <strong>firewall-cmd --add-port=10254/tcp --permanent</strong><br>success<br>[root@node01 ~]# <strong>firewall-cmd --add-port=30000-32767/tcp --permanent</strong><br>success<br>[root@node01 ~]# <strong>firewall-cmd --add-port=30000-32767/udp --permanent</strong><br>success<br>[root@node01 ~]# <strong>firewall-cmd --reload</strong><br>success</pre><p>And firewall rules to nodes 02 and 03:</p><pre>[root@node02 ~]# <strong>firewall-cmd --add-port=80/tcp --permanent</strong><br>success<br>[root@node02 ~]# <strong>firewall-cmd --add-port=443/tcp --permanent</strong><br>success<br>[root@node02 ~]#<strong> firewall-cmd --add-port=2380/tcp --permanent</strong><br>success<br>[root@node02 ~]# <strong>firewall-cmd --add-port=8472/udp --permanent</strong><br>success<br>[root@node02 ~]# <strong>firewall-cmd --add-port=9099/tcp --permanent</strong><br>success<br>[root@node02 ~]# <strong>firewall-cmd --add-port=10250/tcp --permanent</strong><br>success<br>[root@node02 ~]# <strong>firewall-cmd --add-port=10254/tcp --permanent</strong><br>success<br>[root@node02 ~]# <strong>firewall-cmd --add-port=30000-32767/tcp --permanent</strong><br>success<br>[root@node02 ~]# <strong>firewall-cmd --add-port=30000-32767/udp --permanent</strong><br>success<br>[root@node02 ~]# <strong>firewall-cmd --reload</strong><br>success</pre><p>And, at last, allow TCP forwarding on OpenSSH server config file (all nodes):</p><pre>[root@node01 ~]# <strong>echo &quot;AllowTcpForwarding yes&quot; &gt;&gt; /etc/ssh/sshd_config</strong><br>[root@node01 ~]# <strong>systemctl reload sshd</strong></pre><h3>Installing RKE</h3><p>Now that the operating system is ready to run the RKE cluster, I need to install the tools to deploy the cluster as planed. The node01 will be the host of the RKE tool and deployment host of our setup.</p><p>Is needed two steps: (1) download rke deployment tool; and (2) download the Kubernetes cluster manager tool:</p><pre>[root@node01 ~]# <strong>wget -O /usr/local/bin/rke https://github.com/rancher/rke/releases/download/v1.0.8/rke_linux-amd64</strong><br>--2020-05-14 16:13:50-- https://github.com/rancher/rke/releases/download/v1.0.8/rke_linux-amd64<br>Resolving github.com (github.com)… 18.228.52.138<br>Connecting to github.com (github.com)|18.228.52.138|:443… connected.<br>HTTP request sent, awaiting response… 302 Found<br>...<br>Length: 47325245 (45M) [application/octet-stream]<br>Saving to: &#39;/usr/local/bin/rke&#39;<br>/usr/local/bin/rke 100%[==================&gt;] 45.13M 12.4MB/s in 4.0s<br>2020-05-14 16:13:55 (11.2 MB/s) - &#39;/usr/local/bin/rke&#39; saved [47325245/47325245]<br>[root@node01 ~]# <strong>chmod +x /usr/local/bin/rke</strong><br>[root@node01 ~]# <strong>rke --version</strong><br>rke version v1.0.8<br>[root@node01 ~]# <strong>cat &lt; /etc/yum.repos.d/kubernetes.repo<br>[kubernetes]<br>name=Kubernetes<br>baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64<br>enabled=1<br>gpgcheck=1<br>repo_gpgcheck=1<br>gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg<br>EOF</strong><br>[root@node01 ~]# <strong>dnf -y install kubectl</strong><br>Kubernetes                          201 B/s | 454 B 00:02<br>...<br>Installed:<br>kubectl-1.18.2-0.x86_64<br>Complete!</pre><p>Now I will create a key-pair to be used on nodes communication. RKE will use ssh traffic between nodes with these keys. These steps will be made using the rke user created before and running on node01:</p><pre>[rke@node01 ~]$ <strong>ssh-keygen</strong><br>Generating public/private rsa key pair.<br>Enter file in which to save the key (/home/rke/.ssh/id_rsa):<br>Created directory &#39;/home/rke/.ssh&#39;.<br>Enter passphrase (empty for no passphrase):<br>Enter same passphrase again:<br>Your identification has been saved in /home/rke/.ssh/id_rsa.<br>Your public key has been saved in /home/rke/.ssh/id_rsa.pub.<br>The key fingerprint is:<br>SHA256:0qox9QYzObIFBQ5z3HJaQPUqoaFhyaj1uY74LW5YPbA rke@node01.in.leao.pro.br<br>The key&#39;s randomart image is:<br>+---[RSA 3072]----+<br>| oo==o |<br>|o .=o.+. |<br>|o+o += . |<br>|o+.+.+ + |<br>|o .+= @ S |<br>| E oB O |<br>| o =.. o |<br>|..o+ + . |<br>|.++.+ |<br>+----[SHA256]-----+<br>[rke@node01 ~]$ <strong>ssh-copy-id rke@node02</strong><br>/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: &quot;/home/rke/.ssh/id_rsa.pub&quot;<br>The authenticity of host &#39;node02 (172.30.0.102)&#39; can&#39;t be established.<br>ECDSA key fingerprint is SHA256:bYt+ueMLnvWZrAZrbHOJ/u5yIZUnoEsVyyNuC3CcyEs.<br>Are you sure you want to continue connecting (yes/no/[fingerprint])? yes<br>/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed<br>/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys<br>rke@node02&#39;s password:<br>Number of key(s) added: 1<br>Now try logging into the machine, with: &quot;ssh &#39;rke@node02&#39;&quot;<br>and check to make sure that only the key(s) you wanted were added.<br>[rke@node01 ~]$ <strong>ssh-copy-id rke@node03</strong><br>/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: &quot;/home/rke/.ssh/id_rsa.pub&quot;<br>The authenticity of host &#39;node03 (172.30.0.103)&#39; can&#39;t be established.<br>ECDSA key fingerprint is SHA256:bYt+ueMLnvWZrAZrbHOJ/u5yIZUnoEsVyyNuC3CcyEs.<br>Are you sure you want to continue connecting (yes/no/[fingerprint])? yes<br>/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed<br>/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys<br>rke@node03&#39;s password:<br>Number of key(s) added: 1<br>Now try logging into the machine, with: &quot;ssh &#39;rke@node03&#39;&quot;<br>and check to make sure that only the key(s) you wanted were added.</pre><p>The next step is run rke config command and create our cluster.yml file. The cluster.yml is the cluster creation file and rke will be invoked using interative mode. You can use your cluster.yml file, but the steps to create this file is not part of this article.</p><p>To avoid timeout erros, it&#39;s wise to change &quot;addon_job_timeout&quot; to 60 (seconds) inside cluster.yml file:</p><pre>[rke@node01 ~]$ <strong>rke config --name cluster.yml</strong><br>[+] Cluster Level SSH Private Key Path [~/.ssh/id_rsa]: <strong>/home/rke/.ssh/id_rsa</strong><br>[+] Number of Hosts [1]: <strong>3</strong><br>[+] SSH Address of host (1) [none]: <strong>node01</strong><br>[+] SSH Port of host (1) [22]:<br>[+] SSH Private Key Path of host (node01) [none]: <strong>/home/rke/.ssh/id_rsa</strong><br>[+] SSH User of host (node01) [ubuntu]: <strong>rke</strong><br>[+] Is host (node01) a Control Plane host (y/n)? [y]:<br>[+] Is host (node01) a Worker host (y/n)? [n]:<br>[+] Is host (node01) an etcd host (y/n)? [n]: <strong>y</strong><br>[+] Override Hostname of host (node01) [none]:<br>[+] Internal IP of host (node01) [none]:<br>[+] Docker socket path on host (node01) [/var/run/docker.sock]:<br>[+] SSH Address of host (2) [none]: <strong>node02</strong><br>[+] SSH Port of host (2) [22]:<br>[+] SSH Private Key Path of host (node02) [none]: <strong>/home/rke/.ssh/id_rsa</strong><br>[+] SSH User of host (node02) [ubuntu]: <strong>rke</strong><br>[+] Is host (node02) a Control Plane host (y/n)? [y]: <strong>n</strong><br>[+] Is host (node02) a Worker host (y/n)? [n]: <strong>y</strong><br>[+] Is host (node02) an etcd host (y/n)? [n]: <strong><br></strong>[+] Override Hostname of host (node02) [none]:<br>[+] Internal IP of host (node02) [none]:<br>[+] Docker socket path on host (node02) [/var/run/docker.sock]:<br>[+] SSH Address of host (3) [none]: <strong>node03</strong><br>[+] SSH Port of host (3) [22]:<br>[+] SSH Private Key Path of host (node03) [none]: <strong>/home/rke/.ssh/id_rsa</strong><br>[+] SSH User of host (node03) [ubuntu]: <strong>rke</strong><br>[+] Is host (node03) a Control Plane host (y/n)? [y]: <strong>n</strong><br>[+] Is host (node03) a Worker host (y/n)? [n]: <strong>y</strong><br>[+] Is host (node03) an etcd host (y/n)? [n]:<br>[+] Override Hostname of host (node03) [none]:<br>[+] Internal IP of host (node03) [none]:<br>[+] Docker socket path on host (node03) [/var/run/docker.sock]:<br>[+] Network Plugin Type (flannel, calico, weave, canal) [canal]:<br>[+] Authentication Strategy [x509]:<br>[+] Authorization Mode (rbac, none) [rbac]:<br>[+] Kubernetes Docker image [rancher/hyperkube:v1.17.5-rancher1]:<br>[+] Cluster domain [cluster.local]: <br>[+] Service Cluster IP Range [10.43.0.0/16]:<br>[+] Enable PodSecurityPolicy [n]:<br>[+] Cluster Network CIDR [10.42.0.0/16]:<br>[+] Cluster DNS Service IP [10.43.0.10]:<br>[+] Add addon manifest URLs or YAML files [no]:<br>[rke@node01 ~]$ <strong>rke up</strong><br>INFO[0000] Running RKE version: v1.0.8<br>INFO[0000] Initiating Kubernetes cluster<br>INFO[0000] [dialer] Setup tunnel for host [node03]<br>INFO[0000] [dialer] Setup tunnel for host [node01]<br>INFO[0000] [dialer] Setup tunnel for host [node02]<br>...<br>INFO[0379] [ingress] Setting up nginx ingress controller<br>INFO[0379] [addons] Saving ConfigMap for addon rke-ingress-controller to Kubernetes<br>INFO[0379] [addons] Successfully saved ConfigMap for addon rke-ingress-controller to Kubernetes<br>INFO[0379] [addons] Executing deploy job rke-ingress-controller<br>INFO[0384] [ingress] ingress controller nginx deployed successfully<br>INFO[0384] [addons] Setting up user addons<br>INFO[0384] [addons] no user addons defined<br>INFO[0384] Finished building Kubernetes cluster successfully</pre><p>Now, you can check your cluster using kubectl command and the kube-config file created by rke up.</p><p>These are some examples:</p><pre>[rke@node01 ~]$ <strong>ls</strong><br>cluster.rkestate cluster.yml kube_config_cluster.yml<br>[rke@node01 ~]$ <strong>kubectl --kubeconfig kube_config_cluster.yml get nodes</strong><br>NAME   STATUS ROLES                AGE   VERSION<br>node01 Ready  controlplane,etcd.   5m34s v1.17.5<br>node02 Ready  worker               5m30s v1.17.5<br>node03 Ready  worker               5m31s v1.17.5<br>[rke@node01 ~]$ <strong>kubectl --kubeconfig kube_config_cluster.yml get pods --all-namespaces</strong><br>NAMESPACE     NAME                                     READY STATUS    RESTARTS AGE<br>ingress-nginx default-http-backend-67cf578fc4-c67fx.   1/1   Running   0        5m14s<br>ingress-nginx nginx-ingress-controller-4rssc           1/1   Running   0        5m14s<br>ingress-nginx nginx-ingress-controller-fgjcq           1/1   Running   0        5m14s<br>kube-system   canal-4mng8                              2/2   Running   0        5m29s<br>kube-system   canal-gtxnx                              2/2   Running   0        5m29s<br>kube-system   canal-js5vw                              2/2   Running   0        5m30s<br>kube-system   coredns-7c5566588d-hp2f6                 0/1   Running   0        5m25s<br>kube-system   coredns-autoscaler-65bfc8d47d-nkh8p      1/1   Running   0        5m24s<br>kube-system   metrics-server-6b55c64f86-s7zk7          1/1   Running   3        5m20s<br>kube-system   rke-coredns-addon-deploy-job-6wnqc       0/1   Completed 0        5m27s<br>kube-system   rke-ingress-controller-deploy-job-z6n7x  0/1   Completed 0        5m17s<br>kube-system   rke-metrics-addon-deploy-job-jqhxt       0/1   Completed 0        5m22s<br>kube-system   rke-network-plugin-deploy-job-47mns      0/1   Completed 0        5m57s</pre><p>That&#39;s it! You now have an RKE cluster ready to be used!</p><p>I will show in future articles how to use this cluster with Rancher, importing it, or using it to deploy Rancher pods.</p><p>All the steps are automated by an Ansible script that I create to easy your installation.</p><p>You can find this Ansible script at my GitHub repository: <a href="https://github.com/osmarleao/rke_ansible_installer">https://github.com/osmarleao/rke_ansible_installer</a>.</p><p>Until our next article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4cded73fa84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Admirável Mundo Novo]]></title>
            <link>https://medium.com/@osmarrleao/admir%C3%A1vel-mundo-novo-f3e65984a0bc?source=rss-942d8e8327d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3e65984a0bc</guid>
            <category><![CDATA[aldous-huxley]]></category>
            <category><![CDATA[livros]]></category>
            <category><![CDATA[admirável-mundo-novo]]></category>
            <category><![CDATA[política]]></category>
            <category><![CDATA[filosofia]]></category>
            <dc:creator><![CDATA[Osmar R Leão]]></dc:creator>
            <pubDate>Fri, 03 Mar 2017 13:19:11 GMT</pubDate>
            <atom:updated>2017-03-03T13:19:11.945Z</atom:updated>
            <content:encoded><![CDATA[<p>As coincidências não mais me surpreendem, estamos inconscientemente a procura de informações, livros, filmes, quaisquer coisas que reforcem nossa forma de ver o mundo, que alinhem ou (no meu caso) questionem a forma de pensar. No entanto tive uma grata surpresa neste carnaval: recebi o livro “Admirável Mundo Novo” de Aldous Huxley.</p><p>O livro se passa num futuro distópico onde a sociedade é análoga ao sonho da relação perfeita entre a indústria e o mercado idealizado por Henry Ford. O autor criou uma sociedade baseada nos conceitos de linha de montagem e funções fordistas, um futuro metódico e dividido em castas que vão das mais baixas operárias chamadas Ípsilons até os “pensadores” Alfas. O interessante é que todos vivem numa harmonia controlada como abelhas que seguem os instintos impostos pela natureza e seguem, sem questionar (e poderia dizer felizes) o que determina o seu DNA.</p><p>O livro é rico na descrição dos mais absurdos detalhes com a função de impressionar e chocar quem o lê. O autor faz trocadilhos com nomes e usa ideologias encaixadas numa engrenagem de sociedade para mostrar, da forma mais sarcástica possível, que até aqueles que se julgam pensadores ou questionadores dos valores da sociedade, no fundo são movidos por sentimentos muito comuns à qualquer homem e que se satisfazem com o resultado que é também esperado por qualquer ser humano.</p><p>O leitor, enquanto ainda não é levado a compreender o sentido daquela sociedade, é espantado a cada ato, levado até a indignação seja pela total falta de livre pensamento dos cidadãos até a completa falta da moral dos seus moradores. Certamente surpreende diversas linhas de pensamentos contemporâneos, pois vai contra os fundamentos de uma linha ou de outra. Arrisco dizer que seriam pouquíssimos a desejar um mundo tão controladamente livre que é criado, tão descaradamente manipulado e sem crises e conflitos que é criado! Ninguém quer pagar o preço da liberdade, diria um dos seus personagens. Verdade, ninguém está disposto a se sacrificar por sua liberdade.</p><p>E então, como num filme hollywoodiano, surge o “selvagem”, alguém puro conforme a moral judaico-cristã (o livro é de 1931), alguém que “pensa livremente” e questiona o sistema a favor das “liberdades” dentro de um padrão moral, claro! Huxley é tão irônico na escolha dos nomes dos seus personagens que este selvagem é apenas John, o único somente com um pré-nome, que é trazido à sociedade por Bernard Marx, o primeiro questionador e que se perde para sua vaidade (uma mera coincidência?).</p><p>O ponto alto do livro é o diálogo do Selvagem, leitor de Shakespeare, com o Administrador Geral da Europa Ocidental. A cada questionamento daquela sociedade sem graça que é feito pelo Selvagem, o Administrador Geral o faz pensar no alto preço que é pago por todos quando o mundo é livre para pensar por si só os seus caminhos. Tudo aquilo que desvia o homem e gera fortes emoções é abolido em prol da felicidade constante e, como diria, a estabilidade. A religião, as paixões, a política, a família e o amor são abolidos, pois, com eles se atingem a virtude da alma (também abolida), porém o preço a ser pago é alto e a instabilidade inerente é prejudicial à sociedade.</p><p>Ao contrário dos finais de Hollywood, no entanto, o Selvagem “engole” a sociedade (nas suas próprias palavras), a digestão é difícil, a ressaca absurda. O Bom Selvagem então é corrompido pelo sistema.</p><p>A sociedade distópica descrita no livro não é complicada de compreender e, se observarmos o mundo atual, é desejada por todos os lados, porém sem o alto preço a ser pago. Observamos detalhes descritos no livro diariamente: pessoas “pobres” e com pouca ou nenhuma instrução sorriem mais do que aqueles que realmente estudam e compreendem o mundo a sua volta. No mundo descrito no livro, os Ípsilons estão livres do desejo de ser Alfas e estão condicionados a felicidade de tarefas simples nos quais eles executam com alegria enquanto os instruídos não aguentariam nem por um instante.</p><p>Se engana que é um conto para justificar a pobreza ou encarcerar os “pobres”. O preço do conhecimento ou de ser um “Alfa” não é pago em dinheiro, até mesmo a Rainha da Inglaterra é mais moralmente aprisionada do que um feliz plebeu. Quem acha que isso é mole não sabe o que é seguir regras e faz justamente o mundo ser o caos que ele é hoje. Infelizmente mais comum e justificado a cada dia…</p><p>Todos aqueles que desejam um mundo onde todos são iguais esquecem de como precisamos dos diferentes para executar as tarefas que igualmente ninguém deseja mais executar. Aqueles que pregam o discurso moralista religioso também não avaliam as possíveis consequências da luta que é manter-se no caminho, o alto preço que é necessário para se manter em virtude. A sociedade do livro liberta o homem destas obrigações ao preço de viverem como abelhas: com tarefas bem definidas e o prazer reduzido a um estímulo químico qualquer.</p><p>Nós desejamos sem consequências, queremos o que não é possível ter, sonhamos com o impossível a cada instante e nos destruímos uns aos outros na ânsia de poder alcançar as graças (sejam elas financeiras ou divinas).</p><p>Algumas observações modernas que podemos fazer acerca do livro: [1] engraçado é que estamos caminhando, enquanto sociedade, para um futuro onde iremos conseguir transferir as pequenas obrigações para seres como os Ípsilons semialeijões. Estes seres já estão entre nós e em desenvolvimento, foi algo não pensado por Aldous Huxley: os robôs; [2] estes “seres” de metal e circuitos integrados podem ser a nossa redenção enquanto sociedade (que ainda precisa de um limite moral) ou nossa completa extinção se atingirem a consciência. Assim como descrito no livro, os Ípsilons são fabricados pela sociedade e os Alfas se destruiriam uns aos outros se somente fossem eles no mundo…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3e65984a0bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Relações Modernas ou O Efeito Colmeia]]></title>
            <link>https://medium.com/@osmarrleao/rela%C3%A7%C3%B5es-modernas-ou-o-efeito-colmeia-493cbd2a27f7?source=rss-942d8e8327d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/493cbd2a27f7</guid>
            <category><![CDATA[comportamento]]></category>
            <category><![CDATA[politica]]></category>
            <dc:creator><![CDATA[Osmar R Leão]]></dc:creator>
            <pubDate>Fri, 01 Jul 2016 19:10:09 GMT</pubDate>
            <atom:updated>2016-07-01T19:11:45.333Z</atom:updated>
            <content:encoded><![CDATA[<p>Estava lendo esta semana o livro “Modernidade Líquida” do sociólogo polonês Zygmunt Bauman (que vive na Inglaterra desde 1971 após ser expulso pelos comunistas da sua terra natal). O livro não é algo simples, direto, fácil de ler. A sua construção do conceito do “líquido” é elaborada através de diversas transformações da humanidade ao longo do tempo, sendo estas explicadas ao longo do seu texto.</p><p>Não sou sociólogo ou coisa assim, não me arrisco sequer dizer que entendo das relações humanas e sociais após a leitura deste grande autor, porém algo me surgiu inquietante a partir da sua construção de sociedade moderna (líquida?): nós estamos nos separando como pessoas porque não somos iguais num mundo onde todos têm que viver como iguais. É um paradoxo que não é entendido por quase nenhum e, apesar de estar escrevendo sobre, creio que não o compreendi e me arrisco até a dizer que erro ao tentar descrevê-lo! Mas, num mundo de pessoas cheias de razão, posso ter a minha contribuição de dúvida a ser pensada…</p><p>No seu texto, Bauman fala dos espaços comuns e das relações entre estranhos nas cidades modernas. De frases comumente escutadas por nós nasce a sua teoria (não apenas desta fonte) sobre a nossa modernidade e consequências que estamos encarando atualmente: (1) “ninguém sabe mais falar com ninguém”, frase que mostra uma indignação por falta de educação ou respeito ao próximo é uma justificativa para a criação de comunidades, guetos, bairros, etc. Bauman cita e usa outros autores para falar das comunidades étnicas, onde criamos um refúgio de segurança contra os demais que não nos entende ou não são como nós. É comum assistirmos este tipo de movimento no mundo, inclusive com isolamento entre essas comunidades e a sensação de medo de umas em relação as outras. Citando-o:</p><blockquote>Não surpreende, pois, que a etnicidade, mais que qualquer outra espécie de identidade postulada, seja a primeira escolha quando se trata de fugir do assustador espaço polifônico onde “ninguém sabe falar com ninguém” para o “nicho seguro” onde “todos são parecidos com todos” — e onde, assim há pouco sobre o que falar e a fala é fácil.</blockquote><p>Ele ainda completa que estas comunidades então criam história comum, cultura comum, justificativas de passado e futuro comuns para se auto justificarem:</p><blockquote>Tampouco surpreende que, sem muita consideração pela lógica, outras comunidades postuladas, enquanto reivindicam seus próprios “nichos de sociedade”, queiram tirar sua lasquinha da etnicidade e inventem cuidadosamente suas próprias raízes, tradições, história compartilhada e futuro comum — mas, antes e acima de tudo, sua cultura separada e singular, que por causa de sua genuína ou putativa singularidade merece ser considerada “um valor em si mesma”.</blockquote><p>Com as comunidades formadas, há então a formação da sua lógica de pensamento e justificativa de decisões coletivas (públicas). O seu próprio tipo de racionalidade. A crise do “espaço público” é então respondida com os significados dados por estas racionalidades.</p><p>A medida que estas comunidades se fortalecem em si e se isolam das demais, há um esforço para não aceitar o “estranho”. É seguro não falar com estranhos. “Não fale com estranhos” passa de aviso de pais cuidadosos com os seus filhos para um “preceito estratégico da normalidade adulta”, segundo Bauman.</p><p>É seguro inserir na equação a falta de segurança comum do mundo atual, seja por terrorismos com razões religiosas, seja por assaltos e violências urbanas na nossa realidade sul americana ou qualquer outra comum no nosso mundo moderno (líquido?). Este é um elemento que fortalece e é usado como mais uma justificativa para a criação destas “comunidades” (sejam étnicas ou não). É neste ponto que chegamos à patologia social, onde Bauman cita Georges Benko, economista e doutor em geografia econômica e humana:</p><blockquote>Há Outros que são mais Outros do que os Outros, os estrangeiros. Excluir os Outros como estrangeiros porque não somos mais capazes de conceber o Outro indica uma patologia social.</blockquote><p>Patologia esta que Bauman diz ser política. Perdemos a capacidade política de nos relacionarmos. Cabe uma explicação para a capacidade política neste âmbito: ser político é aceitar as diferenças e negociarmos as diferenças para uma convivência tolerável entre pessoas diferentes.</p><p>Este tipo de patologia PODE ser a patologia que vivemos hoje no mundo: saída do Reino Unido da União Europeia, Donald Trumph, movimentos de afirmações étnicas, sexuais e afins, divisões mundiais em ideologias, etc. Não é algo que defina alguém como “mau” ou “bom”, é algo patológico no qual todos estamos sofrendo, sem exceções. Então, como corrigir esta doença? Há os que acredite que nos reduzir para uma comunidade única, integrada, onde todos são iguais, uma colmeia, é a solução. A ideia de não haver níveis ou classes que nos diferenciem é algo que parece bastante tentador, porém, nem as colmeias são feitas de abelhas iguais. Até na colmeia há a diferença e “privilégios” (ou funções sociais e econômicas definidas).</p><p>A resposta à patologia mundial é algo que não sei responder, no entanto não é preciso muito estudo para perceber que não somos iguais e não seremos jamais. As escolhas individuais, por mais que um “coletivo” tente a sobrepor, é soberana. Na colmeia, as abelhas seguem o instinto, não há o pensar e elas tem apenas um propósito de vida. Os homens não são assim, nem 2 entre 3 são iguais.</p><p>Eu acredito que o respeito aos indivíduos e suas liberdades individuais deva ser mantida (não escondo isso de ninguém), acredito também que a liberdade individual deva ser limitada pelo espaço do outro logo ao seu lado até o amplo aspecto geral. Colocar estas regras em âmbitos mundiais determina que nações devem respeitar as liberdades individuais de outras nações, a sua liberdade deve ser limitada pela nação ao seu lado e até o amplo aspecto mundial. Isto deveria ser o que chamamos de democracia, onde interesses comuns (negociados politicamente) determinem as regras gerais. O paradoxo mundial é que, à medida que retiramos as fronteiras a procura de uma grande comunidade mundial única e negociada, estas diferenças são ainda mais acirradas e os sistemas democráticos tendem a ruir. A incapacidade de controlar os seus próprios rumos determinou a saída do Reino Unido da União Europeia, vendo em escala global. Os conflitos locais também se acirraram e, ao invés de expandirmos as sociedades, estamos cada vez mais divididos em pequenos mundos ou pequeníssimas comunidades de pensamentos comuns. Mesmo sofrendo influências de ideias externas e gerais, a interpretação é sempre única e local. O homem então deixa de ser um ser sociável para um indivíduo de pensamento único.</p><p>Quando iremos nos entender novamente? Ou será que algum dia nos entendemos realmente?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=493cbd2a27f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>