<?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 Sezgin Erdem, Ph.D. on Medium]]></title>
        <description><![CDATA[Stories by Sezgin Erdem, Ph.D. on Medium]]></description>
        <link>https://medium.com/@serdem?source=rss-a8430c79acd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DewJPrfjdUqGm5P3EYn_yQ.jpeg</url>
            <title>Stories by Sezgin Erdem, Ph.D. on Medium</title>
            <link>https://medium.com/@serdem?source=rss-a8430c79acd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 18:31:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@serdem/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[How Can You Build Your Docker Image on MacOs with GitHub Actions CI Pipeline?]]></title>
            <link>https://faun.pub/how-can-you-build-your-docker-image-on-macos-with-github-actions-ci-pipeline-75ec9ad16057?source=rss-a8430c79acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/75ec9ad16057</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[workflow]]></category>
            <dc:creator><![CDATA[Sezgin Erdem, Ph.D.]]></dc:creator>
            <pubDate>Wed, 05 Jan 2022 12:43:28 GMT</pubDate>
            <atom:updated>2022-01-10T17:54:48.414Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EpXEtWIvsVcKwg5ePmXOIQ.png" /></figure><p>In this article, I will show how to use the GitHub Actions to:</p><ul><li><strong>Lint and test the code</strong> when new <strong>commits are pushed</strong> to GitHub</li><li><strong>Build and push a Docker image to the Docker Hub</strong> when a <strong>release</strong> is published</li></ul><h4>Getting Started With GitHub Actions</h4><h4>Prerequisites</h4><ol><li>Working knowledge of Git and Docker.</li><li>A basic understanding of the YAML syntax is also required. You can learn YAML from its <a href="https://yaml.org/">official website</a>, or this <a href="https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html">basic tutorial</a> kindly provided by the Ansible people.</li><li><a href="https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/fork-a-repo">Fork</a> my <a href="https://github.com/sezginerdem/p13-MacOS_CI_github_actions">application repository</a> and <em>remove all files under</em> .github/workflows/ to practice with the code in this article.</li><li>A valid user account on the <a href="https://hub.docker.com/">Docker Hub</a> is required.</li></ol><h4><strong>What is GitHub Actions?</strong></h4><p>GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build, test, and deploy your code right from GitHub. Make code reviews, branch management, and issue triaging work the way you want.</p><h4><strong>GitHub Action is just another tool?</strong></h4><p>GitHub Actions offer a complete and powerful set of functionalities, a lot of extensions are available on the Marketplace and GitHub offers a generous <a href="https://github.com/pricing">free tier</a> also for private repositories (at the time of writing).</p><ul><li>Use the same tool instead of third-party integration</li><li>Setup the pipeline is easy</li><li>Tool for developers</li><li>Integration with other technologies is important and hard to manage but you don’t need this in the GitHub action CI/CD pipeline.</li></ul><h4>How Do I Create a Workflow on GitHub Actions?</h4><p>I logged into <a href="https://github.com/sezginerdem">my GitHub</a> account and created a public repository named <a href="https://github.com/sezginerdem/p13-MacOS_CI_github_actions">p13-MacOS_CI_github_actions</a>.</p><p>I pushed my java project using from my local to <a href="https://github.com/sezginerdem/p13-MacOS_CI_github_actions">GitHub repository</a> with git commands.</p><p>On <a href="https://github.com/sezginerdem/p13-MacOS_CI_github_actions/blob/main/.github/workflows/ci.yml">my GitHub repository</a>, I clicked on the Actions tab. On this page, you can see the workflows of additional very popular services. To use these, you can build your application without having to write a workflow from scratch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gwfGwMDA_lll1jpEiGBHww.png" /></figure><p>I have chosen the workflow template named Java with Gradle here. Automatically created .github/workflows/gradle.yml file under my project.</p><p>Java with Gradle template is like this:</p><pre># This workflow uses actions that are not certified by GitHub.<br># They are provided by a third-party and are governed by<br># separate terms of service, privacy policy, and support<br># documentation.<br># This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time<br># For more information see: <a href="https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle">https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle</a></pre><pre>name: Java CI with Gradle</pre><pre>on:<br>  push:<br>    branches: [ main ]<br>  pull_request:<br>    branches: [ main ]</pre><pre>jobs:<br>  build:</pre><pre>runs-on: ubuntu-latest</pre><pre>steps:<br>    - uses: actions/checkout@v2<br>    - name: Set up JDK 11<br>      uses: actions/setup-java@v2<br>      with:<br>        java-version: &#39;11&#39;<br>        distribution: &#39;adopt&#39;<br>    - name: Build with Gradle<br>      uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021<br>      with:<br>        arguments: build</pre><p>I have configured this template for my own project.</p><p>Firstly, I have changed my workflows default gradle.yml name to ci.yml.</p><p>nameis the name of the project. My project name is Java CI with Gradle On MacOS.</p><pre>name: Java CI with Gradle</pre><p>The on part required. Specifies how the workflow will be triggered. I have organized my workflow so that it will be triggered when a push or pull request is made to the main branch.</p><pre>on: #which events trigger the pipeline   <br>  push: #pushing the master branch    <br>    branches: [ main ]  <br>  pull_request: #pull request from the master branch    <br>    branches: [ main ]</pre><p>The jobs part shows the events that will run when the workflow is triggered. I also named my job as build-java. I set the operating system that my job will run on as macOS-latest.</p><pre>jobs: <br>  build-java: #job name <br>    runs-on: macOS-latest #OS</pre><p>I have checked out my repository with this syntax. You can see these action details on this <a href="https://github.com/actions/checkout">link.</a></p><pre>    steps:    <br>    - uses: actions/checkout@v2 #pull repository</pre><p>This action performs the installation of the java environment by looking at the version I have specified here.</p><pre>    - name: Set up JDK 1.8<br>      uses: actions/setup-java@v1 #install java env<br>      with:<br>        java-version: 1.8 #java version</pre><p>Unlike the others, this is a Linux command. With this command, I have granted execute permission for my gradlew file.</p><pre>    - name: Grant execute permission for gradlew<br>      run: chmod +x gradlew</pre><p>I have built my application with ./gradlew build command.</p><pre>    - name: Build with Gradle<br>      run: ./gradlew build</pre><p>I performed the installation of the Docker environment with the following actions. If you want to access the details of the commands running behind these actions, you can access the <a href="https://github.com/docker-practice/actions-setup-docker">link</a>.</p><p><em>You can also </em><a href="https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/publishing-actions-in-github-marketplace#publishing-an-action"><em>share your own Actions with the community</em></a><em> on the Marketplace.</em></p><pre>    - uses: docker-practice/actions-setup-docker@master<br>    - run: set -x</pre><p>I have built my java application with my <a href="https://github.com/sezginerdem/p13-MacOS_CI_github_actions/blob/main/Dockerfile">Dockerfile</a> which I wrote before, and I create the docker image of my java application. After that, I made my actions authenticate with docker hub and then sent my image to my Docker Hub. I performed all of these operations with the following actions.</p><pre>    - name: Build and Push Docker Image      <br>      uses: mr-smithers-excellent/docker-build-push@v4      <br>      with:        <br>        image: drerdemsezgin/flask-app        <br>        registry: docker.io        <br>        username: ${{ secrets.DOCKER_USERNAME }}        <br>        password: ${{ secrets.DOCKER_PASSWORD }}</pre><p>I have written whole my ci.yaml. You can see this below and also in my <a href="https://github.com/sezginerdem/p13-MacOS_CI_github_actions/blob/main/.github/workflows/ci.yml">repository</a>.</p><pre># This workflow will build a Java project with Gradle<br># For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle <br>name: Java CI with Gradle On MacOS </pre><pre>on: # which events trigger the pipeline   <br>  push: # pushing the master branch    <br>    branches: [ main ]  <br>  pull_request: # pull request from the master branch    <br>    branches: [ main ] <br>jobs:  <br>  build-java: # job name     <br>    runs-on: macOS-latest # OS         <br>    steps:    <br>    - uses: actions/checkout@v2 # pull repository <br>    <br>    - name: Set up JDK 1.8      <br>      uses: actions/setup-java@v1 # install java env      <br>      with:        <br>        java-version: 1.8     </pre><pre>    - name: Grant execute permission for gradlew      <br>      run: chmod +x gradlew<br>     <br>    - name: Build with Gradle      <br>      run: ./gradlew build          </pre><pre>     - uses: docker-practice/actions-setup-docker@master    <br>     - run: set -x     </pre><pre>     - name: Build and Push Docker Image      <br>       uses: mr-smithers-excellent/docker-build-push@v4      <br>       with:        <br>         image: drerdemsezgin/flask-app        <br>         registry: docker.io        <br>         username: ${{ secrets.DOCKER_USERNAME }}        <br>         password: ${{ secrets.DOCKER_PASSWORD }}</pre><p>Before I have triggered GitHub Actions, I defined the credentials to Git Hub Actions so that I can authenticate with Docker Hub. Thus, I increased the security of my workflow by not writing my secrets as hardcode.</p><p>For adding secrets to my repository Repository &gt; Settings &gt; Secrets &gt; New repository</p><ul><li>Name=DOCKER_USERNAME, Value=drerdemsezgin</li><li>Name=DOCKER_PASSWORD, value=&lt;MyPassword&gt;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L7PLOl0KGrI2C-xPtbamSw.png" /></figure><p>I have committed to the master branch of my repo and this commit triggered GitHub actions workflow. Thus, my continuous integration has begun to run.</p><p>I clicked on the Actions tab and when I clicked on my ongoing workflow, I can see its details. A list of all the steps will be presented, named as in the name elements in the Action code below. Each “step” line can be expanded to get its output. Also, the command lines can be furtherly expanded to get some more useful information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JhdT7T5s4KPYgiJNnaYG9w.png" /></figure><p>If the workflow execution was successfully completed, the image should also be listed in the Docker Hub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*roP_eWlAV-MSD1Mr9uJw8A.png" /></figure><p><strong>Congratulations! You have just created your Action.</strong></p><h3>Resources:</h3><ul><li><a href="https://github.com/sezginerdem/p13-MacOS_CI_github_actions">GitHub - sezginerdem/p13-MacOS_CI_github_actions</a></li><li><a href="https://docs.github.com/en/actions">GitHub Actions documentation - GitHub Docs</a></li></ul><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75ec9ad16057" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/how-can-you-build-your-docker-image-on-macos-with-github-actions-ci-pipeline-75ec9ad16057">How Can You Build Your Docker Image on MacOs with GitHub Actions CI Pipeline?</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[User Management in Ansible-Playbook via Jenkins Pipeline-2]]></title>
            <link>https://faun.pub/user-management-in-ansible-playbook-via-jenkins-pipeline-2-317cb7f31fd7?source=rss-a8430c79acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/317cb7f31fd7</guid>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Sezgin Erdem, Ph.D.]]></dc:creator>
            <pubDate>Wed, 20 Oct 2021 08:16:07 GMT</pubDate>
            <atom:updated>2021-10-20T19:34:21.621Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k94x6ndQQAYeKu7r.jpg" /></figure><p>In this second article of my user management scenario, I explained the Jenkins configuration and the stages of running the Ansible-Playbook, I created in the previous article, in the Jenkins pipeline.</p><p><strong>Step 3: Jenkins Installation and Configuration</strong></p><p>Firstly, add the repository key to the system:</p><pre>$ wget -q -O — <a href="https://pkg.jenkins.io/debian-stable/jenkins.io.key">https://pkg.jenkins.io/debian-stable/jenkins.io.key</a> | sudo apt-key add -</pre><p>After the key is added the output will return with:</p><pre>$ OK</pre><p>Next, let’s append the Debian package repository address to the server’s sources list:</p><pre>$ sudo sh -c ‘echo deb <a href="http://pkg.jenkins.io/debian-stable">http://pkg.jenkins.io/debian-stable</a> binary/ &gt; /etc/apt/sources.list.d/jenkins.list’</pre><p>After both commands have been entered, I run update so thatapt used the new repository.</p><pre>$ sudo apt-get update</pre><p>Finally, I have installed Jenkins and its dependencies.</p><p>Let’s start Jenkins by using systemctl:</p><pre>$ sudo systemctl start jenkins</pre><p>Since systemctl doesn’t display status output, we’ll use the status command to verify that Jenkins started successfully:</p><pre>$ sudo systemctl status jenkins</pre><p>If everything went well, the beginning of the status output shows that the service is active and configured to start at boot:</p><pre>$ `● jenkins.service — LSB: Start Jenkins at boot time</pre><pre>Loaded: loaded (/etc/init.d/jenkins; generated)</pre><pre>Active: active (exited) since Fri 2020–06–05 21:21:46 UTC; 45s ago</pre><pre>Docs: man:systemd-sysv-generator(8)</pre><pre>Tasks: 0 (limit: 1137)</pre><pre>CGroup: /system.slice/jenkins.service`</pre><p>Go to <a href="http://localhost:8080/">http://localhost:8080</a> (8080 is the default port for Jenkins server unless you haven’t provided any specific port by yourself) or <a href="http://myServer:8080.">http://myServer:8080.</a></p><p>Copy password:</p><pre>$ sudo cat /var/lib/jenkins/secrets/initialAdminPassword</pre><p>Paste it the Jenkins. Then click on the Install suggested plugins button.</p><p>I have installed Ansible Plugin to build Ansible tasks in Jenkins pipeline as well.</p><p>Click Manage Jenkins &gt; Manage Plugins &gt; Available &gt; Search &gt; Ansible Plugin &gt; Install without restart.</p><p>I have installedExtended Choice Parameter Plug-In for multi server and group variable selection.</p><p>Click Manage Jenkins &gt; Manage Plugins &gt; Available &gt; Search &gt; Extended Choice Parameter Plugin &gt; Install without restart.</p><p>I have installed the Parameterized Trigger Plugin so that I can get parameters in the Pipeline.</p><p>Click Manage Jenkins &gt; Manage Plugins &gt; Available &gt; Search &gt; Parameterized Trigger Plugin &gt; Install without restart.</p><p>For Ansible commands to run in Jenkins:</p><p>Manage Jenkins &gt; Global Tool Configuration &gt; Ansible installations... &gt; Add Ansible.</p><p>Wrote ansible to the Name space, and /usr/bin/ to the Path to ansible executables directory space. Then click Save button.</p><h4><strong>Create Jenkins Pipeline</strong></h4><p>Click Dashboard &gt; New Item &gt; Enter your pipeline name &gt; Pipeline &gt; Ok.</p><p>In the Description field, I wrote the description and function of my job. This field is optional.</p><p>In this pipeline, I received the ADD_USER , GROUP_NAME , SERVER_NAME , USER_PUBLIC_KEY and REMOVE_USER variables from the user with Jenkins as input and placed these variables into the pipeline and used them in playbooks.</p><p>For this, I marked This project is parameterisedfield. Here I have defined these variables.</p><p>I got the name of the user I want to create with the variable ADD_USER. For this:</p><p>Click String Parameter&gt; Name: ADD_USER.</p><p>I got the username of the user I want to create with the GROUP_NAME variable. Ised Extended Choice Parameter to assign/remove a user to more than one group. For this:</p><p>Click Add Parameter &gt; Extended Choice Parameter &gt; Name: GROUP_NAME. Mark Basic Parameter Types &gt; Check Boxes &gt; Number of Visible Items: 8 &gt; Mark Value: backend, devops, security, ai, uxui, mobile, frontend, qa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bg3P4IKiQfgTZozY2zkqvw.png" /></figure><p>Here, the values written in the value section must be the same as the values in the GROUP_NAMEdefined in playbook_add_user.yml.</p><p>I got the username of the user I want to create with the SERVER_NAME variable. I used Extended Choice Parameter to assign/remove a user to more than one server. For this:</p><p>Click Add Parameter &gt; Extended Choice Parameter &gt; Name: SERVER_NAME. Mark Basic Parameter Types &gt; Check Boxes &gt; Number of Visible Items: 2 &gt; Mark Value: server_name_1, server_name_2.</p><p>Here, the values written in the value section must be the same as the values in the defined in /etc/ansible/hosts file.</p><p>I assigned the public key to the variable named USER_PUBLIC_KEY in order to create the public key of the user in the authorized_key on the servers. For this:</p><p>Click String Parameter &gt; Name: USER_PUBLIC_KEY.</p><p>I got the name of the user I want to remove with the variable REMOVE_USER. For this:</p><p>Click String Parameter &gt; Name: REMOVE_USER.</p><p>Click Pipeline &gt; Pipeline Script.</p><p>Jenkins pipeline consists of 4 stages:</p><p>- Pull Playbook from SCM,</p><p>- Assign Variables into the Playbook,</p><p>- Run Playbook,</p><p>- Cleaning Workspace.</p><p>In the first stage, I pulled my playbooks from github.</p><pre>pipeline {<br>  agent any<br>  stages {<br>    stage(&quot;Pull Playbook from SCM&quot;) {<br>      steps {<br>        git &#39;https://github.com/sezginerdem/playbook_user_management.git&#39;<br>      }<br>    }</pre><p>The second stage consists of 2 steps. In the first step, if a value is entered in the ADD_USER variable, the actions to be taken are seen. If a user will be deleted, that is, the ADD_USER field will be left blank, this stage will be skipped. This script sed -i &#39;s/var_server_name/${SERVER_NAME}/&#39; playbook_add_user.yml is a linux command. It’s function, on the other hand, replaces all fields with var_server_name in the playbook_add_user.yml file with the variable ${SERVER_NAME} and saves the file again. So I assigned my variables that I got with Jenkins to playbook_add_user.yml. I wrote this command to assign all the variables I received with Jenkins to playbook_add_user.yml. With &quot;&quot;&quot;cat &gt; user_public_key.pub &lt;&lt; EOF ${USER_PUBLIC_KEY}&quot;&quot;&quot; command I created a file named user_public_key.pub and placed the public key I received from the user. Because I defined the module in the playbook to get the public key from this file.</p><pre>    stage(“Assign Variables into the Playbook”) {<br>      steps {<br>        script {<br>          if (params.ADD_USER != “”){<br>            sh &quot;&quot;&quot;sed -i ‘s/var_server_name/${SERVER_NAME}/’ playbook_add_user.yml&quot;&quot;&quot;<br>            sh &quot;&quot;&quot;sed -i ‘s/var_add_user/${ADD_USER}/’ playbook_add_user.yml&quot;&quot;&quot;<br>            sh &quot;&quot;&quot;sed -i ‘s/var_group_name/${GROUP_NAME}/’ playbook_add_user.yml&quot;&quot;&quot;<br>            sh &quot;&quot;&quot;cat &gt; user_public_key.pub &lt;&lt;EOF<br>            ${USER_PUBLIC_KEY}<br>            &quot;&quot;&quot;<br>          }</pre><p>The second step will run if a value is entered in the REMOVE_USER field, otherwise it will be skipped. In other words, it will only work when the user is wanted to delete. This script sed -i &#39;s/var_remove_user/${REMOVE_USER}/&#39; playbook_remove_user.yml is a linux command. It’s function, replaces all fields with var_remove_user in the playbook_remove_user.yml file with the variable ${REMOVE_USER} and saves the file again. So I assigned my variables that I got with Jenkins to playbook_remove_user.yml. I wrote this command to assign all the variables I received with Jenkins to playbook_remove_user.yml.</p><pre>          if(params.REMOVE_USER != “”){<br>            sh “””sed -i ‘s/var_server_name/${SERVER_NAME}/’ playbook_remove_user.yml”””<br>            sh “””sed -i ‘s/var_remove_user/${REMOVE_USER}/’ playbook_remove_user.yml”””<br>          }<br>        }<br>      }<br>    }</pre><p>In this stage, if a value is entered to ADD_USER, playbook_add_user.yml will be executed. If a value is entered to REMOVE_USER, playbook_remove_user.yml will be executed.</p><pre>    stage(“Run Playbook”) {<br>      steps {<br>        script {<br>          if (params.ADD_USER != “”){<br>            ansiblePlaybook disableHostKeyChecking: true, installation: ‘ansible’, playbook: ‘./playbook_add_user.yml’<br>          }<br>          if(params.REMOVE_USER != “”){<br>            ansiblePlaybook disableHostKeyChecking: true, installation: ‘ansible’, playbook: ‘./playbook_remove_user.yml’<br>          }<br>        }<br>      }<br>    }</pre><p>At this stage, I cleaned the workspace so that the files downloaded and created from GitHub do not take up unnecessary space on disk space.</p><pre>    stage(“Cleaning Workspace”) {<br>      steps {<br>        sh ‘rm -rf ./*’<br>      }<br>    }<br>  }<br>}</pre><p>The entire Jenkins pipeline is as follows.</p><pre>pipeline {<br>  agent any<br>  stages {<br>    stage(“Pull Playbook from SCM”) {<br>      steps {<br>        git ‘https://github.com/sezginerdem/playbook_user_management.git&#39;<br>      }<br>    }<br>    stage(“Assign Variables into the Playbook”) {<br>      steps {<br>        script {<br>          if (params.ADD_USER != “”){<br>            sh &quot;&quot;&quot;sed -i ‘s/var_server_name/${SERVER_NAME}/’ playbook_add_user.yml&quot;&quot;&quot;<br>            sh &quot;&quot;&quot;sed -i ‘s/var_add_user/${ADD_USER}/’ playbook_add_user.yml&quot;&quot;&quot;<br>            sh &quot;&quot;&quot;sed -i ‘s/var_group_name/${GROUP_NAME}/’ playbook_add_user.yml&quot;&quot;&quot;<br>            sh &quot;&quot;&quot;cat &gt; user_public_key.pub &lt;&lt;EOF<br>            ${USER_PUBLIC_KEY}<br>            &quot;&quot;&quot;<br>          }<br>          if(params.REMOVE_USER != “”){<br>            sh &quot;&quot;&quot;sed -i ‘s/var_server_name/${SERVER_NAME}/’ playbook_remove_user.yml&quot;&quot;&quot;<br>            sh &quot;&quot;&quot;sed -i ‘s/var_remove_user/${REMOVE_USER}/’ playbook_remove_user.yml&quot;&quot;&quot;<br>          }<br>        }<br>      }<br>    }<br>    stage(“Run Playbook”) {<br>      steps {<br>        script {<br>           if (params.ADD_USER != “”){<br>             ansiblePlaybook disableHostKeyChecking: true, installation: ‘ansible’, playbook: ‘./playbook_add_user.yml’<br>           }<br>           if(params.REMOVE_USER != “”){<br>             ansiblePlaybook disableHostKeyChecking: true, installation: ‘ansible’, playbook: ‘./playbook_remove_user.yml’<br>           }<br>         }<br>       }<br>     }<br>     stage(“Cleaning Workspace”) {<br>       steps {<br>         sh ‘rm -rf ./*’<br>       }<br>     }<br>   }<br>}</pre><p>Click on the SAVE and BUILDyour project.</p><h3>Resources</h3><ul><li><a href="https://github.com/sezginerdem/playbook_user_management">GitHub - sezginerdem/playbook_user_management</a></li><li><a href="https://www.jenkins.io/">Jenkins</a></li></ul><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=317cb7f31fd7" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/user-management-in-ansible-playbook-via-jenkins-pipeline-2-317cb7f31fd7">User Management in Ansible-Playbook via Jenkins Pipeline-2</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[User Management in Ansible Playbook via Jenkins Pipeline-1]]></title>
            <link>https://faun.pub/user-management-6d7674508e2e?source=rss-a8430c79acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d7674508e2e</guid>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ansible]]></category>
            <dc:creator><![CDATA[Sezgin Erdem, Ph.D.]]></dc:creator>
            <pubDate>Wed, 22 Sep 2021 10:51:58 GMT</pubDate>
            <atom:updated>2021-09-23T10:13:44.492Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I explained how to automate the processes of creating users, add public keys to the servers, assign/remove users to/from groups and remove/add them on servers through Ansible in the Jenkins pipeline.</p><p>This scenario will be explained in 2 articles. This is the first one of this scenario.</p><p>I have described the first and second steps of this scenario in this article.</p><ul><li><strong>Step1:</strong> Create Ssh-keygen</li><li><strong>Step2: </strong>Ansible Configuration</li><li><strong>Step3: </strong>Create a Jenkins Pipeline</li></ul><p>Tools to be used in this scenario:</p><ul><li>Ubuntu 20.04</li><li>Git/Github</li><li>Ansible</li><li>Jenkins</li><li>YAML</li><li>Groovy.</li></ul><h4><strong>Step 1: Creating SSH-KEYGEN</strong></h4><p>Ssh-keygen is a tool for creating new authentication key pairs for SSH. Such key pairs are used for automating logins, single sign-on, and for authenticating hosts. The SSH protocol uses public-key cryptography for authenticating hosts and users. The authentication keys, called SSH keys, are created using the keygen program.</p><p>I will send the public key to the servers with ansible playbooks. Firstly I created ssh-keygen. If there is not, create a new .ssh folder under your home folder:</p><pre>$ mkdir ~/.ssh</pre><p>Go to .ssh folder:</p><pre>$ cd ~/.ssh</pre><p>Create a new ssh asymmetric key pair:</p><pre>$ ssh-keygen</pre><p>Now the inside the .sshfolder should be like this:</p><pre>$ ls</pre><pre>config id_rsa id_rsa.pub known_hosts</pre><p>Enter the following command to start the agent:</p><pre>$ eval `ssh-agent`</pre><p>Add the private SSH key:</p><pre>$ ssh-add ~/.ssh/id_rsa</pre><h4><strong>Step 2: Ansible Configuration</strong></h4><p>Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs.</p><p>Firstly update and upgrade OS:</p><pre>$ sudo apt update -y</pre><pre>$ sudo apt upgrade -y</pre><p>You can find different Ansible installation methods in the resources section at the bottom of the article in resources.</p><p>Secondly, I installed the Ansible tool on my Ubuntu server:</p><pre>$ sudo apt install ansible</pre><p>Check the installation:</p><pre>$ ansible --version</pre><p>Hostsfile is the default file that the Ansible control node needs to keep it’s information in order to connect to the managed nodes. The control node provides access to the managed nodes by accessing the information here.</p><p>Go to the hosts file:</p><pre>$ sudo vim /etc/ansible/hosts</pre><p>Configure Ansible hosts file like this:</p><pre>[server1]</pre><pre>server_name_1 ansible_host=&lt;IP_Address&gt; ansible_connection=ssh ansible_ssh_user=user_name ansible_ssh_pass=&lt;Password&gt;</pre><pre>[server2]</pre><pre>server_name_2 ansible_host=&lt;IP_Address&gt; ansile_connection=ssh ansible_ssh_user=user_name ansible_ssh_pass=&lt;Password&gt;</pre><p>Another way of connecting is the connection with ssh-keygen. If you have added the public key of your control node to a managed node, you no longer need to keep your password in your hostsfile. This is the best practice and preferred method in the production environment. The hosts file created in this way is as follows:</p><pre>[server1]</pre><pre>server_name_1 ansible_host=&lt;IP_Address&gt; ansible_connection=ssh ansible_ssh_user=user_name ansible_ssh_private_key_file=~/.ssh/id_rsa</pre><pre>[server2]</pre><pre>server_name_2 ansible_host=&lt;IP_Address&gt; ansible_connection=ssh ansible_ssh_user=user_name ansible_ssh_private_key_file=~/.ssh/id_rsa</pre><p>To confirm that all our hosts are located by Ansible, I run the command below.</p><pre>$ ansible all --list-hosts</pre><p>To make sure that all your hosts are reachable, we run various ad-hoc commands that use the ping module.</p><pre>$ ansible all -m ping</pre><p><strong><em>NOTE_1:</em></strong><em> If you get an error message like this:</em></p><pre>$ server_1 | FAILED! =&gt; {</pre><pre>“msg”: “to use the ‘ssh’ connection type with passwords, you must install the sshpass program”</pre><pre>}</pre><p>Install sshpass:</p><pre>$ apt-get install sshpass</pre><p><strong><em>NOTE_2:</em></strong><em> If you get an error message like this:</em></p><pre>$ server_1 | FAILED! =&gt; {</pre><pre>“msg”: “Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this. Please add this host’s fingerprint to your known_hosts file to manage this host.”</pre><pre>}</pre><p>Open ansible.cfg file and uncommenthost_key_checking = False line:</p><pre>$ sudo nano /etc/ansible/ansible.cfg<br>host_key_checking = False</pre><p>If your ping command is working after all these configurations, you should see the following output:</p><pre>$ server_1 | SUCCESS =&gt; {</pre><pre>“ansible_facts”: {</pre><pre>“discovered_interpreter_python”: “/usr/bin/python”</pre><pre>},</pre><pre>“changed”: false,</pre><pre>“ping”: “pong”</pre><pre>}</pre><pre>$ server_2 | SUCCESS =&gt; {</pre><pre>“ansible_facts”: {</pre><pre>“discovered_interpreter_python”: “/usr/bin/python”</pre><pre>},</pre><pre>“changed”: false,</pre><pre>“ping”: “pong”</pre><pre>}</pre><p>With this output, the connection between the control node and the managed node has been successfully established. Thus, I can configure my server_1 and server_2machines with the control node via ansible commands.</p><p>I created 2 playbooks named playbook_add_user.yml and playbook_remove_user.yml.</p><p>In playbook_add_user.yml I defined it’s name as Create Group User and Deploy the Public Key. I have assigned the variables var_server_name to hosts in Jenkins, which I will receive from the user I want the playbook to run from. I created the group names under vars. I used three modules in this playbook. The module named Create groups will create the group names that I have assigned as group_name variables. The module named Add User creates a user named var_add_user that I will assign as a variable in Jenkins and adds it to the group(s) named var_group_namethat I will assign as a variable in Jenkins. Set authorize kys were taken from file places the public key that I will take as the user_public_key.pub variable in the Jenkins of the module named ~.ssh of the user I created into the authorized_key file. If there is no such file, it creates it.</p><pre>$ vim playbook_add_user.yml</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c00f2f4e658eeefa0a72b19396344c1/href">https://medium.com/media/1c00f2f4e658eeefa0a72b19396344c1/href</a></iframe><p>The second playbook was created to remove users. It will be assigned to the var_server_name variable, which will be obtained from Jenkins in the hosts section. With the Remove User module, the user can be removed with the var_remove_user variable that will be taken from Jenkins. In addition, the user’s home folder and the files in this folder will be removed together with the user.</p><pre>$ vim playbook_add_user.yml</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/71c9cead5d13a0b0aff776790ec67578/href">https://medium.com/media/71c9cead5d13a0b0aff776790ec67578/href</a></iframe><p>After I made my Git/Github configurations, I pushed playbooks to my repository:</p><pre>$ git add .</pre><pre>$ git commit -m “added playbooks”</pre><pre>$ git push <a href="https://github.com/sezginerdem/playbook_user_management.git%60">https://github.com/sezginerdem/playbook_user_management.git</a></pre><p>In my second article, I will explain the Jenkins configuration and pipeline creation stages.</p><p>See you at my second article :)</p><h3><strong>Resources</strong></h3><ul><li><a href="https://www.ssh.com/academy/ssh/keygen">What is ssh-keygen &amp; How to Use It to Generate a New SSH Key?</a></li><li><a href="https://www.ansible.com/">Ansible Collaborative</a></li><li><a href="https://github.com/sezginerdem/playbook_user_management">GitHub - sezginerdem/playbook_user_management</a></li></ul><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d7674508e2e" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/user-management-6d7674508e2e">User Management in Ansible Playbook via Jenkins Pipeline-1</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reasons for Go’s Fast Forward in DevOps Projects]]></title>
            <link>https://faun.pub/reasons-for-gos-fast-forward-in-devops-projects-24de6908e6c6?source=rss-a8430c79acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/24de6908e6c6</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[go]]></category>
            <dc:creator><![CDATA[Sezgin Erdem, Ph.D.]]></dc:creator>
            <pubDate>Fri, 16 Jul 2021 07:43:29 GMT</pubDate>
            <atom:updated>2021-07-16T22:13:46.727Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*VP_euJY_iAd1m3KsxEOgNw.png" /><figcaption><strong>Go For DevOps</strong></figcaption></figure><h3><strong>What Makes Go so Good for DevOps?</strong></h3><p>According to Google, Go was designed with an eye on the felicity of programming, speed of compilation, orthogonality of concepts, and the need to support features such as concurrency and garbage collection. Don’t be shocked, even your favorite tools like Kubernetes, Docker, and many others are written in Go.</p><p>Go is excellent for working in environments where you can’t or don’t want to install dependencies since it compiles into a stand-alone binary. Without having to get the whole environment set up, you can get things done in a much faster way than other programming languages.</p><p>It is the language that is meant to be fast on the web. Google and many other companies back it, it is always improving, and it is here to stay. Sorry to repeat, Go is simple to understand, which makes it easier for testers and developers to read the code and collaborate better. Even if you get a new member in the team, he will quickly understand the code in a few days.</p><h3><strong>Features that Make DevOps People Like Go</strong></h3><ul><li>Simple, Reliable and Efficient</li><li>Open Source</li><li>Fast Compilation and Execution</li><li>Import-Defined Dependencies</li><li>stdlib — Wisely composed packages that are useful</li><li>Error Handling Capacity</li><li>One Binary to Rule them All</li><li>Cross-Compilation</li><li>Garbage Collection</li><li>Readability</li><li>Builtin Testing</li><li>Profiling</li><li><strong>Go Modules</strong></li></ul><p>Package management is one of the important things Go missed for a long time. One of the major drawbacks of Go’s ‘go get’ was the absence of support for handling dependency versions and facilitating reproducible builds.</p><p>Version 1.11 of the Go programming language introduced support for modules, a new dependency management system for Go. A Go Module is a way to group a set of packages and give it a version number to identify its existence (state) at a specific point in time.</p><p><em>Picking the right Go Module</em></p><p>It can be challenging to choose the right Go module for any new Go developer. There are plenty of great options open when deciding your Go Module, and this can be made simple by considering three fundamental parameters:</p><ol><li>Module Popularity — How widely used a module is</li><li>Module References — The attribution of the module</li><li>Module Compliance — The level of security within that module and its dependencies</li></ol><p>At <a href="https://pkg.go.dev/">pkg.go.dev</a>, there is a free repository of over 700,000 versioned Go Modules that can help you choose the right module for your project/use case.</p><ul><li><strong>Go PROXY</strong></li></ul><p>To improve the state of dependency management in Go, GOPROXY is enabled by default in Go v1.13. A GOPROXY controls the source of your Go module downloads and assures that builds are deterministic and secure.</p><p>A public GOPROXY is a centralized repository accessible and available free to Golang devs and enthusiasts worldwide. This hosts open-source Go modules that have been made public from third-party sources in publicly accessible VCS project repositories.</p><ul><li><strong>Go Center</strong></li></ul><p>GoCenter automatically processes and validates Go projects directly from source code repositories into immutable, versioned modules, making them freely available to the Go developer community.</p><p>In this blog, ‘<a href="https://jfrog.com/blog/oss-go-packages-in-gocenter/">Go at Full Speed with GoCenter</a>’ you will know more about how GoCenter empowers the Go community to reliably generate reproducible builds of their Go applications.</p><ul><li><strong>Security</strong></li></ul><p>The most frustrating thing for Go developers is Go Module vulnerabilities, with the approach of <a href="https://jfrog.com/devops-tools/what-is-devsecops/">DevSecOps best practices</a> and a shifting left strategy, it’s becoming even more relevant for developers to be able to track and report vulnerabilities as early as possible. JFrog GoCenter can help Go developers remove this frustration by tracking and mitigating vulnerabilities.</p><p>JFrog Xray’s security vulnerability scanning of Go modules has recently been added to GoCenter.io! GoCenter automatically scans for known vulnerabilities recognized in the public vulnerability database NVD. Those results are stored in GoCenter and exposed on the Security page of the UI, which will list all vulnerabilities that exist in the module version. Learn more about ‘GoCenter Reveals Go Module Vulnerabilities With Xray’.</p><p>To know more about Go Modules security, you can read this article ‘<a href="https://dzone.com/articles/go-modules-security">Go Modules Security</a>’</p><ul><li><strong>Go Registry</strong></li></ul><p>The Go ecosystem was missing standardization — there was an absence of a standard tool for dependency management, and hence, developers could not create reproducible builds with Go, which was a huge drawback working with Go projects and became quite an issue. After several years, Google eventually solved this issue by adding versioning support for Go.</p><p>Additionally, the release of Artifactory 5.11 added support for <a href="https://jfrog.com/integration/artifactory-go-registry/">Go registries</a> giving the community various capabilities when developing with Go.</p><ul><li><strong>Build promotion</strong></li></ul><p>Go applications are a single binary with dependencies included, lending themselves to build promotion for DevOps. Build once and promote throughout is one of the best practices when it comes to Go projects CI/CD best practices.</p><p>Building the Go-based microservices once, and promoting them to the next stages once promotion criteria such as tests and scans are met. When you intend to containerize your Go microservice, the same principle applies: ‘Build once and promote’ — That means building each Docker image once and promoting it through a series of staging repositories. Like this, you can ensure that what was tested is exactly what is being released to production.</p><h3><strong>Go helps make DevOps work</strong></h3><p>Go is a perfect choice for any firm that is starting out its DevOps journey. Go’s inherent features help enable the best practices for DevOps: immutable packages, testing, build promotion, security, etc. GoCenter is also a great resource for Go developers, providing always-available immutable access to dependencies with important metrics.</p><p>Explore GoCenter to see how it demonstrates these important DevOps principles.</p><p>Combined, a very powerful way to practice strong DevOps. Golang has become an ideal choice for developers working with open-source technology and DevOps projects; it has an excellent combination of concurrency, safety, and simplicity. It is undoubtedly an amazing programming language for writing web services and has the ability to integrate easily with other services. Top enterprise organizations are using Golang for their software development. Some worldwide popular companies that use Golang are Uber, YouTube, Google, BBC, Dailymotion, Adobe, etc. Since the market for Golang is still growing, it seems that the future continues to support this demand.</p><h3><strong>DevOps Tools Written in Go</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*xfdd6NEJZZ8pumfs-sFy9A.png" /></figure><ul><li><strong>Google</strong> itself is currently and heavily using Go to provide its cloud infrastructure.</li><li>Most of <strong>GitHub</strong>’s infrastructure is now written in Go.</li><li>To manage its 500 million users more efficiently, <strong>Dropbox</strong> uses Go<em>.</em></li><li><strong>Netflix</strong> and <strong>YouTube</strong> make use of Go programming language to manage the demanding load on their websites, and <strong>Soundcloud</strong> also uses Go to deploy its internal services.</li><li><strong>BBC</strong> has been using Golang for internal analytic services and backend development since 2012.</li><li><strong>Uber</strong> uses Go to improve its map processing speeds when users load geofence lookups.</li><li>Helm</li><li>Terraform</li><li>Prometheus</li><li>Etcd</li><li>Grafana</li><li>Jaeger</li><li>Honeycomb</li><li>Istio</li></ul><h3><strong>Let Us See Some Practical Cases on Who Else Is Using Go and Why</strong></h3><h4><strong><em>Kubernetes</em></strong></h4><p>The giant company Google considered writing Kubernetes in other languages, including but <a href="https://blog.gopheracademy.com/birthday-bash-2014/kubernetes-go-crazy-delicious/">according to Joe Beda</a>, co-founder of Kubernetes, none of these languages were as effective as Go. There were many reasons why Kubernetes is written in Go. Some of them include — great libraries, fast tools, built-in concurrency, garbage collection, type safety, etc. According to Joe, the patterns and tools in Go have encouraged the Kubernetes team to make well-factored and reusable code that will give them both a high degree of flexibility and velocity at the same time. Read the full story here, ‘<a href="https://medium.com/containerum/why-we-use-go-to-develop-containerum-platform-for-kubernetes-3a33d5bdc5ec">Why we use Go to develop Containerum platform for Kubernetes</a>.’</p><h4><strong><em>Docker</em></strong></h4><p>Docker has been the biggest user of Go. The team at <a href="http://www.slideshare.net/jpetazzo/docker-and-go-why-did-we-decide-to-write-docker-in-go">Docker liked Go</a> because it offered them many benefits: static compilation with no dependencies, neutral language, a full development environment, extensive strong standard library, and data types, strong duck typing, and the ability to build for multiple architectures with minimal nuisance.</p><h4><strong>Istio</strong></h4><p><a href="https://istio.io/">Istio</a>, part of the Kubernetes ecosystem, is also written in Go.</p><p>Since Kubernetes was also written in Go, it was a perfect approach for Istio to write in Go. That is not just one reason, among many, Go’s suitability for decentralized, distributed networking projects was one of the main reasons to choose Go at Istio.</p><h4><strong>SendGrid Moved to Go</strong></h4><p>SendGrid, a customer communication platform, decided to move to Go as its primary development language long back in 2014. The SendGrid team needed to make a fundamental shift in their development language, and it boiled down to a competition between Scala, Java, and Go.</p><p>The biggest challenge that SendGrid faced in development then was concurrent programming. Having the idea of concurrent asynchronous programming as part of the language was one of the most compelling reasons why Go was chosen at SendGrid.</p><p>Read the full story at their blog ‘<a href="https://sendgrid.com/blog/convince-company-go-golang/">How to convince your company to go with Golang</a>’</p><h4><strong>Hexac Switched From Python to Go</strong></h4><p>Tigran Bayburtsyan, the Co-Founder and CTO at Hexac, writes an exclusive article where he shares why his company <a href="https://hackernoon.com/5-reasons-why-we-switched-from-python-to-go-4414d5f42690">moved from Python to Go</a>. Based on their code base statistics, after rewriting all their projects in Go, they got 64% less code than they had earlier.</p><p>They saved a lot of resources (Memory, CPU) because of the built-in language features of Go.</p><p>Go gave their development team huge flexibility, single language for all use cases, and for all of them, it worked very well. At Hexact Inc, they got about 30% more performance on their backend and API services. Now they can handle logging real-time, transfer it to the database, and make streaming with Websocket from single or multiple services. This is an outstanding outcome of using Go language features.</p><h4><strong>Salesforce Ditched Python for Go</strong></h4><p>Before launching Einstein Analytics in 2017, Salesforce renewed the backend and entirely rebuilt it on Google’s popular Go language.</p><p>Salesforce principal architect Guillaume Le Stum stated that ‘Python fails to do multi-threading well, while Go, is built for heavy applications suitable for Google’s production systems, the language has been tested and approved by Google, so Salesforce chose to shift Einstein Analytics, the vital part of Salesforce, from a hybrid C-Python application to a completely Go application. Read the original article here, ‘<a href="https://www.zdnet.com/article/salesforce-why-we-ditched-python-for-googles-go-language-in-einstein-analytics/">Salesforce ditched Python for Google’s Go language in Einstein Analytics</a>’</p><h4><strong>Containerum Chose Go Over others</strong></h4><p>Containerum, a container management platform been using Go as their primary language for about four years now, and despite certain challenges, the engineering team thinks it is a good choice. The main reason to choose Go at Containerum Platform is that it consists of a group of smaller services that communicate with other components of the system. To ensure this, it is highly necessary to secure interface compatibility and write code that is too simple, easy to read and maintain.</p><p>Go enables adding patches and allows using ready components in the code base, e.g., image names parsing validation, key object models, etc. and this is one of the reasons Containerum chose Go.</p><p>Containerum considered Go over other languages because of its many Pro features/facts such as static typing, minimalism, standard library, fantastic performance, super-fast compilation, and much more.</p><p>Read the full story here, ‘<a href="https://medium.com/containerum/why-we-use-go-to-develop-containerum-platform-for-kubernetes-3a33d5bdc5ec">Why we use Go to develop Containerum platform for Kubernetes</a>.’</p><p>See more at ’10 <a href="https://www.infoworld.com/article/3442978/10-open-source-projects-proving-the-power-of-google-go.html">open-source projects proving the power of Google Go</a>’</p><p><em>If you’re programming your applications in GoLang, how hard is it to practice CI/CD? Pretty hard, isn’t it?</em></p><p>Well, not now. With the latest innovations in Go, like <strong>Go Center GOPROXY</strong>, the path to quality CI/CD is much clearer. GoCenter is a central public collection for immutable Go modules. It allows you to search for modules and versions, also you can easily add your modules to it to be shared publicly.</p><h3>References:</h3><p><a href="https://golang.org/">The Go Programming Language</a></p><figure><a href="https://faun.to/i9Pt9"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_MOgMTr_f1N4qHN_R7KVA.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24de6908e6c6" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/reasons-for-gos-fast-forward-in-devops-projects-24de6908e6c6">Reasons for Go’s Fast Forward in DevOps Projects</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Use the Go Language for Your Project?]]></title>
            <link>https://faun.pub/why-use-the-go-language-for-your-project-bee88a63b020?source=rss-a8430c79acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/bee88a63b020</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[cloud-com]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Sezgin Erdem, Ph.D.]]></dc:creator>
            <pubDate>Thu, 01 Jul 2021 09:32:54 GMT</pubDate>
            <atom:updated>2021-07-01T14:03:26.720Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*7iaXA1RWJFQ07BqwByYQEw.png" /></figure><p>If you’re planning to create or streamline an app for your business, start by choosing the proper technology. In a world of speedy changes, business owners often resort to Ruby as it allows them to create an app truly fast. But why use Golang?</p><h3>What is Go?</h3><p>Go is an open-source programming language that makes it easy to build simple, reliable, and efficient software. It’s statically typed and produces compiled machine code binaries. Developers say that Google&#39;s Go language is the C for the twenty-first century when it comes to syntax.</p><p>The world was first introduced to Go in 2009 thanks to Google’s Rob Pike, Robert Griesemer, and Ken Thompson. The main goal of creating Go was to combine the best features of other programming languages:</p><ul><li>Ease of use together with state-of-the-art productivity</li><li>High-level efficiency along with static typing</li><li>Advanced performance for networking and the full use of multi-core power</li></ul><h3>What are the Advantages of Using Go for Your Project?</h3><h4>Minimalist and easy to learn</h4><p>Golang’s specification is merely 50 pages long (Java’s, for example, is 750 pages long) and it’s full of examples. The language is quite easy to read and easy to learn from just this specification (and even more so if you are already well-versed in Java or C). Moreover, its clean syntax means the language is also easy to maintain. Some of the features that make Go so simple include a minimal interface, no implicit conversions, and packages with clear code separation.</p><pre>HELLO WORLD IN JAVA<br>class HelloWorldApp {<br>    public static void main(String[] args) {<br>        System.out.println(&quot;Hello World!&quot;); // Prints the string to the console.<br>    }<br>}</pre><pre>HELLO WORLD IN GO<br>package main</pre><pre>import &quot;fmt&quot;</pre><pre>func main() {<br>    fmt.Println(&quot;Hello, World&quot;)<br>}</pre><h4>Convenience</h4><p>Go has been compared to scripting languages like Python in its ability to satisfy many common programming needs. Some of this functionality is built into the language itself, such as “goroutines” for concurrency and threadlike behavior, while additional capabilities are available in Go standard library packages, like Go’s HTTP package. Like Python, Go provides automatic memory management capabilities including garbage collection. Unlike scripting languages such as Python, Go code compiles to a fast-running native binary. And unlike C or C++, Go compiles extremely fast—fast enough to make working with Go feel more like working with a scripting language than a compiled language. Further, the Go build system is less complex than those of other compiled languages. It takes few steps and little bookkeeping to build and run a Go project.</p><h4>Fast</h4><p>Go binaries run more slowly than their C counterparts, but the difference in speed is negligible for most applications. Go performance is as good as C for the vast majority of work, and generally much faster than other languages known for the speed of development (e.g., JavaScript, Python, and Ruby).</p><h4>Transparent</h4><p>Go’s syntax is meant to be transparent. It has only one standard code format created automatically by the fmt tool. The language makes it easy for you to always know what your code is doing and estimate resources. Languages like Python are as readable as Go, but not quite as transparent.</p><h4>Large community = Extensive tools</h4><p>As with most popular programming languages, Golang has a large and supportive community. The language has its own GitHub repository, which includes a number of editors and plugins, and there are also many other resources available, including a Slack channel, a blog, a sub-Reddit and a forum. And if that isn’t enough, there are countless Golang programmers out there open to sharing their knowledge.</p><h4>Large talent pool</h4><p>The fact Golang has such a large community also means there are countless developers offering Golang development services. As the most in-demand language in the world, you are sure to have your pick of developers if you’re looking to start a project using Go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*XN2vEchYpgKvU_7gjQ8X1w.png" /></figure><h4>Always compatible</h4><p>Golang offers excellent backward compatibility so, if you develop an app with its current version, you should not have problems with new versions in the future. Go’s compatibility means switching versions of the language at any time should be hassle-free.</p><h4>Scalable</h4><p>Golang’s advantages include Goroutines — functions that run simultaneously and independently — , which take little memory space and make it scalable when dealing with several concurrent processes. You can actually run millions of Goroutines without crashing your system, making for leaner software.</p><h4>Built-in testing</h4><p>Go includes a built-in testing tool, which, just like everything else regarding this language, was created with simplicity and efficiency in mind. It can be used for various types of testing and profiling, and you can even run tests in parallel, among many other features.</p><h3>What are the Disadvantages of Go?</h3><h4>A young language, so it is still developing</h4><p>Being a very young language, developers might find it difficult to make maximum use of the libraries. They might have to write the libraries themselves and there aren’t many books or online courses to help, while in doubt.</p><h4>The size of the generated binaries.</h4><p>Go binaries are statically compiled by default, meaning that everything needed at runtime is included in the binary image. This approach simplifies the build and deployment process but at the cost of a simple “Hello, world!” weighing in at around 1.5MB on 64-bit Windows. The Go team has been working to reduce the size of those binaries with each successive release. It is also possible to shrink Go binaries with compression or by removing Gos debug information. This last option may work better for stand-alone distributed apps than for cloud or network services, where having debug information is useful if a service fails in place.</p><h4>Error handling isn’t perfect</h4><p>Though error handling is not perfect in Go, the imperfectness of it could get you. Solutions are still being searched for, and proposals have come up for error handling.</p><h4>Runtime safety is not that good</h4><p>Go is safe, but it doesn’t deliver the level of the safety that Rust provides. The safety level is compile-time only and to a certain extent runtime. Go focuses on the speed of production, and Rust concentrates on the safety aspect.</p><p>Other cons include operator overloading, and problems in code duplication and metaprogramming because those cannot be statically checked.</p><h3>What projects should you use Go for?</h3><p>Go will definitely do the trick if you’re planning to develop the underlying services for your app. More than that, Go is good for scalable high-performance apps. Below, we list some apps and services that are enjoying the benefits of Go to the max.</p><h4>Cloud services</h4><p>As the creator of Go, Google is using this language to provide cloud infrastructure: it offers top performance and scalability to the Google Cloud Platform. But there are even more well-known cloud businesses out there using Go for the same reasons: Dropbox, Terraform, Kubernetes, and Docker.</p><h4>Media platforms</h4><p>YouTube, SoundCloud, and Netflix chose to Go to fight with high loads on their sites. SoundCloud uses this language for deploying some internal services within their complex projects.</p><h4>News outlets</h4><p>Back in 2012, the BBC (yep, it was a surprise to us too) started using Go for backend development and some of the elements of their internal analytics services.</p><h4>On-demand services</h4><p>The taxi giant Uber was looking to improve map processing speeds as people loaded geofence lookups, sending literally thousands of queries per second. Go helped Uber significantly reduce the timing of providing services to users, which was much appreciated by users.</p><p>Aside from the services and products, Go provides good tooling for mobile app development. This is why we’ll soon see even more examples of Go in mobile apps and probably in some other industries as well.</p><p>Although Go is still a relatively young programming language, it has gained popularity among real business monsters like Google, Netflix, Uber, and others who use Go to scale their products and achieve high performance. Go is quickly changing for the best, providing more and more tools for mobile and web development and remarkably decreasing the time and costs of app development and support.</p><h3>Go Language Futures</h3><p>The next phase in Go development may well be driven more by the wants and needs of its developer base, with Go’s minders changing the language to better accommodate this audience, rather than just leading by stubborn example. In other words, Go may gain the features that were originally not intended for it, like generics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*je6G9wmH43reYOQfqNKV6Q.png" /><figcaption>Google Trends July 2021</figcaption></figure><p>It’s clear Golang developers want these things. The 2018 Go user survey placed generics among the top three challenges in the way of broader Go adoption, along with better dependency and package management. And an existing proposal on GitHub for generics remains active as a proposal for Go 2.x. Changes like these may help Go take a more central place in enterprise development, where Java, JavaScript, and Python currently reign supreme.</p><p>Even without major changes, we can expect increased use of Go for infrastructure rebuilding projects, as per the replacements for SSH and NTP described above, and as part of multi-language projects.</p><p>Third-party implementations of the Go toolchain have also proliferated. ActiveState’s ActiveGo provides a commercially supported edition of the Go language, and both the LLVM and gccgo projects provide liberally licensed open source implementations of Go by way of alternative toolchains.</p><p>Finally, Go has also served as a base for developing entirely new languages, although two examples of this have ceased active development. One example was the Have language, which streamlined Go syntax, implemented some of the same concepts in its own way, and transpiled to Go for easy execution. Another defunct project, Oden, used Go’s assembler and toolchain to compile a newly designed language that took additional inspiration from languages like Lisp and Haskell.</p><p>This last set of projects illustrate one of the ways any IT innovation becomes truly revolutionary — when people take it apart and repurpose it, finding uses its designers never intended. The future of the Go language as a hackable project is just getting started. But its future as a major programming language is already assured, certainly in the cloud, where the speed and simplicity of Go ease the development of scalable infrastructure that can be maintained in the long run.</p><h3><strong>References</strong></h3><ul><li><a href="https://golang.org/doc/faq">Frequently Asked Questions (FAQ)</a></li><li><a href="https://github.com/sezginerdem/GoLang">sezginerdem/GoLang</a></li></ul><figure><a href="https://faun.to/i9Pt9"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_MOgMTr_f1N4qHN_R7KVA.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bee88a63b020" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/why-use-the-go-language-for-your-project-bee88a63b020">Why Use the Go Language for Your Project?</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Roman Numerals Converter Application (Python Flask) deployed on AWS EC2 with CloudFormation]]></title>
            <link>https://faun.pub/roman-numerals-converter-application-python-flask-deployed-on-aws-ec2-with-cloudformation-e473e5aeb054?source=rss-a8430c79acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/e473e5aeb054</guid>
            <category><![CDATA[cloud-services]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Sezgin Erdem, Ph.D.]]></dc:creator>
            <pubDate>Tue, 15 Jun 2021 09:57:57 GMT</pubDate>
            <atom:updated>2021-06-18T15:21:00.380Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p6zwYPwJemmRzJMDfEfvrg.png" /></figure><h3><strong>Description</strong></h3><p>The Roman Numerals Converter Application aims to convert the given number to Roman numerals. The application is to be coded in Python and deployed as a web application with Flask on AWS Elastic Compute Cloud (EC2) Instance using AWS CloudFormation Service.</p><h3>Problem Statement</h3><p>Your company has recently started on a project that aims to be one of the most used unit converters and formulas website. Roman Numerals Converter is part of the project. So you and your colleagues have started to work on the project.</p><p>As a first step of the project, you need to write a program that converts the given number (between 1 and 3999) to Roman numerals. The program should convert only from numbers to Roman numerals, not vice versa and during the conversion following notes should be taken into consideration.</p><p>You can look at the details of the program’s requirements in the <a href="https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn/blob/master/README.md">README</a> file.</p><p>As a second step, after you finish the coding, you are requested to deploy your web environment using Python’s Flask framework.</p><p>You need to transform your program into web application using the <a href="https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn/blob/master/templates/index.html">index.html</a> and <a href="https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn/blob/master/templates/result.html">result.html</a> within the <a href="https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn/tree/master/templates">templates</a> folder. Note the following for your web application.</p><ul><li>User should face first with <a href="https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn/blob/master/templates/index.html">index.html</a> when web app started.</li><li>User input should be taken via <a href="https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn/blob/master/templates/index.html">index.html</a> using http post method</li><li>If user input is not valid, user should be warned using the <a href="https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn/blob/master/templates/index.html">index.html</a> with template formatting.</li><li>Conversion result should be displayed using the <a href="https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn/blob/master/templates/result.html">result.html</a> with template formatting.</li></ul><p>Lastly, after transforming your code into web application, you are requested to push your program to the project repository on Github and deploy your solution in the development environment on AWS EC2 Instance using AWS Cloudformation Service to showcase your project. In the development environment, you can configure your CloudFormation template using the followings,</p><ul><li>The application stack should be created with new AWS resources.</li><li>The application stack should take the name of your Key Pair as a parameter from the user;</li><li>The application should run on Amazon Linux 2 EC2 Instance</li><li>EC2 Instance type can be configured as t2.micro.</li><li>Instance launched by Cloudformation should be tagged Web Server of StackName</li><li>The Web Application should be accessible via web browser and terminal from anywhere.</li><li>The Application files should be downloaded from the GitHub repo and deployed on EC2 Instance using user data script within CloudFormation template.</li><li>Roman Numerals Converter Application Website URL should be given as output by Cloudformation Service after the stack created.</li></ul><h3>Steps to Solution</h3><h4>Step 1: Create a project folder for local public repo on your pc</h4><p>I created a folder in my local for my project.</p><pre>$ mkdir p09-roman-num-converter-ec2-cfn<br>$ cd p09-roman-num-converter-ec2-cfn</pre><h4>Step 2: Download or clone project definition from my repo on GitHub</h4><p>I cloned the files in the GitHub repository to my locale. <a href="https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn/tree/master/templates">template</a> folder in my GitHub repository is the files given to me for this project.</p><pre>$ git clone <a href="https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn">https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*QceOv4QsxxV9wD8qjg-CPA.png" /></figure><h4>Step 3: Write the Roman Numerals Converter Application in Python</h4><p>I developed my Roman Numerals Converter Application with Python as per the requirements of the project.</p><h4>Step 4: Transform your application into web application using the Python Flask framework</h4><p>I added the Python Flask framework to the Python application that I developed. Here is the latest version of the application</p><pre><a href="https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn/blob/master/app.py">app.py</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*tdFbjYuntredmueUTFnnvg.png" /></figure><h4>Step 5: Prepare a CloudFormation template to deploy your app on EC2 Instance</h4><p>In the Description section, I wrote what this template is used for.</p><pre>AWSTemplateFormatVersion: 2010–09–09<br>Description: | <br>  CloudFormation Template for Roman Numerals Converter Application.<br>This template creates Python Flask Web Application on Amazon Linux 2 (ami-0947d2ba12ee1ff75) EC2 Instance with custom security group allowing http connections on port 80. Roman Numerals Converter Application is downloaded from Github repository, then installed on Flask.</pre><p>In the parameters section; I set the KeyName as the parameter. The description here is the text that the user will see during the keypair selection process. In this section, you should clearly write what you want the user to do.</p><pre>Parameters:  <br>  KeyPairName:    <br>    Description: Enter the name of your Key Pair for SSH connections<br>    Type: AWS::EC2::KeyPair::KeyName<br>    ConstraintDescription: Must one of the existing EC2 KeyPair</pre><p>I created my resources in the resource section. I created 2 resources in the project: WebServerSecurityGroup and WebServerHost.</p><p>I wrote a description of the purpose of the creation of this resource in the GroupDescriotion section. Security groups are stateful resources. That’s why I wrote only the ingress part. Under the SecurityGroupIngress section, I set the TCP protocol from port 80 to port 80 as IpProtocol. In the CidrIp blog, I determined which IP range would allow to enter this security group and defined it as accessible from anywhere. In the same way, I gave permissions for port 22 in the blocks under IpProtocol.</p><pre>Resources: <br>  WebServerSecurityGroup: <br>    Type: “AWS::EC2::SecurityGroup” <br>    Properties: <br>      GroupDescription: Enable HTTP for Flask Web Server #required<br>      SecurityGroupIngress: <br>        - IpProtocol: tcp <br>          FromPort: 80<br>          ToPort: 80<br>          CidrIp: 0.0.0.0/0 <br>        - IpProtocol: tcp #required <br>          FromPort: 22 <br>          ToPort: 22 <br>          CidrIp: 0.0.0.0/0</pre><p>ImageId</p><p>I assigned the amazon Linux 2 Ami number in the North Virginia region as the ImageId. I set t2.micro as the instance type. I got the KeyName by addressing the !Ref function with KeyPairName. I got the SecurityGroupId by addressing the WebServerSecurityGroup with !Ref function. I used Name as Tagsin Key and stack name to be determined by the user as Value. I set the ${AWS::StackName} attribute to pull this name. I used the !Sub function here to run this attribute.</p><pre>WebServerHost: <br>  Type: “AWS::EC2::Instance” <br>  Properties: <br>    ImageId: ami-0947d2ba12ee1ff75 <br>    InstanceType: t2.micro <br>    KeyName: !Ref KeyPairName <br>    SecurityGroupIds: <br>      -!Ref WebServerSecurityGroup <br>    Tags: <br>      - Key: Name <br>        Value: !Sub Web Server of ${AWS::StackName} Stack</pre><p>I used !Base64 |function to get !UserData.</p><pre>UserData: !Base64 | <br>        #! /bin/bash <br>        yum update -y #os updated for y/n question added -y<br>        yum install python3 -y #python3 installed for y/n question added -y<br>        pip3 install flask #flask installed<br>        cd /home/ec2-user #change directory<br>        wget https://raw.githubusercontent.com/sezginerdem/p09-roman-num-converter-ec2-cfn//master/app.py #download application<br>        mkdir templates #create directory<br>        cd templates #change directory<br>        wget https://raw.githubusercontent.com/sezginerdem/p09-roman-num-converter-ec2-cfn/master/templates/index.html #download index.hmtl<br>        wget https://raw.githubusercontent.com/sezginerdem/p09-roman-num-converter-ec2-cfn/master/templates/result.html #download result.html<br>        cd .. #change directory #change directory<br>        python3 app.py #execute python application</pre><p>I have defined the Outputs of CloudFormation. I’ve brought the URL here for easy access. I defined it in Outputs to get to the URL of my project as a shortcut. For the public address, I bring the PublicDNS of my WebServerHost machine with the !GetAtt method. I added an explanation about this output in the Description part.</p><pre>Outputs:<br>  WebsiteURL:<br>    Value: !Sub<br>      - http://${PublicAddress}<br>      - PublicAddress: !GetAtt WebServerHost.PublicDnsName<br>    Description: Roman Numerals Converter Application URL</pre><p>You can access the entire CloudFormation template from this link.</p><pre><a href="https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn/blob/master/cfn-template.yml">cfn-template.yml</a></pre><h4>Step 6: Push your application into your own public repo on GitHub</h4><p>I pushed the files I prepared to my GitHub repository.</p><pre>$ git add .<br>$ git commit -m “added app.py and cfn-template.yml”<br>$ git push</pre><h4>Step 7: Deploy your application on AWS Cloud using the CloudFormation template to showcase your app within your team.</h4><p>I opened the AWS console. First of all, I uploaded my CloudFormation template to CloudFormation/Designer. I checked if there is a problem. After seeing that there was no problem, I uploaded my CloudFormation. When I clicked on the URL in Outputs, I saw that my application was running successfully. Screenshots of index.html and result.html pages are as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*RNNk90Y3SR1zBYIOofWBcA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*n413h98Vu9biFMaHs2BWeg.png" /></figure><h3>References:</h3><ul><li><a href="https://github.com/sezginerdem/p09-roman-num-converter-ec2-cfn">sezginerdem/p09-roman-num-converter-ec2-cfn</a></li><li><a href="https://realpython.com/flask-by-example-part-1-project-setup/">Deploying a Python Flask Example Application Using Heroku - Real Python</a></li><li><a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html">What is AWS CloudFormation?</a></li></ul><figure><a href="https://faun.to/i9Pt9"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_MOgMTr_f1N4qHN_R7KVA.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e473e5aeb054" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/roman-numerals-converter-application-python-flask-deployed-on-aws-ec2-with-cloudformation-e473e5aeb054">Roman Numerals Converter Application (Python Flask) deployed on AWS EC2 with CloudFormation</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Fuchsia and Containerization]]></title>
            <link>https://faun.pub/google-fuchsia-and-containerization-a5801509db49?source=rss-a8430c79acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5801509db49</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Sezgin Erdem, Ph.D.]]></dc:creator>
            <pubDate>Tue, 01 Jun 2021 07:49:47 GMT</pubDate>
            <atom:updated>2021-06-01T13:18:21.745Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*czDernmey24d851jrvI_4g.png" /></figure><p>Google is working on a new operating system: With Fuchsia OS, the technology group turns its back on the Linux architecture and instead relies on the self-developed micro kernel Zircon. Fuchsia could not only replace the desktop operating system Chrome OS, but also Android, which is designed for mobile devices. And this despite the fact that Android is almost unrivaled on the market today.</p><p>The system is written in C, C++, Dart, Go, and Rust, and runs on modern 64-bit Intel ARM processors. Fuchsia relies on the Zircon microkernel on a capability-oriented distribution. The Zircon kernel is primarily designed to run on “<em>32-bit or 64-bit ARM cores to 64-bit X86 processors”</em>.</p><h3>​Modular system architecture</h3><p>The system architecture of Fuchsia OS is also based on a modular approach. The operating system comprises four more or less <strong>independent levels</strong>, each with its own tasks: Zircon, Garnet, Peridot, and Topaz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*eTdc8tylyCyjiGzNBFT-UA.png" /><figcaption>Fuchsia’s modular system architecture</figcaption></figure><h4>​Topaz</h4><p>Topaz is the system level of Fuchsia OS where users interact with the operating system. Here the user interfaces of the components defined on the levels are displayed: both the graphical user interface with home screen — depending on the device Armadillo or Capybara — and the visual front ends of the modules. Google’s cross-platform open source mobile app framework <a href="https://flutter.dev/"><strong>Flutter</strong></a> is also integrated at this system level. It can therefore be assumed that Fuchsia OS users will in the future also be able to run and use apps from other systems — such as Android or iOS apps.</p><h4>​Peridot</h4><p>Peridot is the operating system level of Fuchsia OS on which the modular applications are managed and compiled according to current user requirements. The core components of Peridot are Ledger and Maxwell.</p><ul><li><strong>Ledger</strong>: Ledger is a cloud-based storage system (Distributed Storage System) that provides a separate data store for each Fuchsia component (module or agent). This is synchronized across different devices. This allows a user to continue on a Fuchsia device exactly where they left off on another Fuchsia device. Ledger is secured to the user’s Google account.</li><li><strong>Maxwell</strong>: With Maxwell, Google has integrated a component in Fuchsia OS that supports users as artificial intelligence. Just like with Fuchsia, Maxwell has a modular design. The AI system consists of a series of agents that analyse the actions of the user and the content used by them, determine suitable information in the background, and forward suggestions to the operating system — for example, which modules or stories should be loaded to suit the user’s behaviour at a particular time. The Google Language Assistant is also part of the AI component, which is being further developed within the framework of the Fuchsia project under the code name <strong>Kronk</strong>.</li></ul><h4>Garnet</h4><p>Garnet is the first Fuchsia-specific system layer based on Zircon. Various system services at the device level as well as network, media, and graphics services are provided — for example for software installation, system administration, and communication with other systems. Garnet contains the graphic renderer Escher, the package management and update system <strong>Amber</strong>, as well as the text and code editor <a href="https://github.com/xi-editor/xi-editor">Xi</a>.</p><h4>Zircon</h4><p>The lowest layer starts with the <em>Zircon</em> kernel, which is the interface between hard- and software. Fundamentally, this is detached from the entire Fuchsia OS.</p><p>With the focus on security and isolation they note that on “<em>Fuchsia, a newly created process has nothing. A newly created process cannot access any kernel objects, cannot allocate memory, and cannot even execute code. Of course, such a process isn’t very useful, which is why we typically create processes with some initial resources and capabilities.” </em>The main capabilities components are:</p><ul><li>Event capabilities</li><li>Directory capabilities</li><li>Protocol capabilities</li><li>Service capabilities</li><li>Storage capabilities</li></ul><p>In addition, the modular system architecture meets the needs of Google’s sales partners, who want to adapt or extend Fuchsia OS according to their own ideas.</p><p>Hardware manufacturers have the possibility to exchange individual levels of the operating system with their own products without affecting the functionality of the other levels. Samsung, for example, could replace Topaz with a self-developed TouchWiz-style user interface. Amazon could forego Peridot and the Google Language Assistant and instead equip Fuchsia OS with an AWS-based app module including Alexa.</p><p>In both cases, device manufacturers could offer <strong>individualised versions of Fuchsia OS</strong> without affecting the Zircon and Garnet features or the official update cycles for these layers.</p><h3>​Fuschia and Containerization</h3><p>Through security vulnerabilities in hardware and software, malware can get onto the operating system. We have learned about various kernel features to make an operating system more secure. These include security mechanisms such as the isolation of software components for the secure execution of computer applications in an encapsulated system environment. This sandbox model is originally used to run untrusted code, unreliable software, or to open questionable documents. The basic idea is that no program (process) can access data outside its sandbox. One approach is to create an operating system based on security through isolation with virtual machines (which is far from lightweight). Another approach is a capability-based operating system using a microkernel called Zircon, which is still under heavy development. Beyond that, Theo de Raad states that “<em>You are absolutely deluded, if not stupid, if you think that a worldwide collection of software engineers who can’t write operating systems or applications without security holes, can then turn around and suddenly write virtualization layers without security holes.”</em> At least these techniques make us feel more secure.</p><p>Technology companies are adversely affected by delays caused by basic physics in data exchange speed (Latency). Millisecond delays experienced in lightning-fast data exchange can often become a major problem for running many applications.</p><p>Therefore, companies are in search of systems with completely different dynamics that can work in harmony with technologies such as 5G and produce Real-Time results. In my opinion, Fuchsia seems to be a project for Google to solve this problem.</p><p>As you know, it was DarwinOS and Cocoa Framework infrastructure that enabled Apple to develop its revolutionary products. Using this infrastructure, MacOS, IOS and TabletOS were developed. As far as I can see, Google has adopted a similar approach, but unlike Apple, Kubernetes / Microservice will also add the world to its project. Because Kubernetes is a very modular container management software. So you can put processes that will work in isolation instead of containers. While reviewing the documentation of the Fuchsia operating system, I saw that instead of today’s container, the processes in this operating system can easily pass.</p><h3>References:</h3><p><a href="https://fuchsia.dev/">Fuchsia</a></p><figure><a href="https://faun.to/i9Pt9"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_MOgMTr_f1N4qHN_R7KVA.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5801509db49" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/google-fuchsia-and-containerization-a5801509db49">Google Fuchsia and Containerization</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 K8s Distributions for Local Environments]]></title>
            <link>https://serdem.medium.com/5-k8s-distributions-for-local-environments-58578fb74bb2?source=rss-a8430c79acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/58578fb74bb2</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Sezgin Erdem, Ph.D.]]></dc:creator>
            <pubDate>Tue, 25 May 2021 06:22:05 GMT</pubDate>
            <atom:updated>2021-05-25T06:22:05.543Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*K9_25SQs8omv7FZEyqzJZQ.png" /></figure><p>This article contains benchmarks and reviews of the following Kubernetes distributions:</p><ul><li><a href="https://minikube.sigs.k8s.io/docs/">minikube</a></li><li><a href="https://microk8s.io/">microk8s</a></li><li><a href="https://k3s.io/">k3s</a></li><li><a href="https://k0sproject.io/">k0s</a></li><li><a href="https://kind.sigs.k8s.io/">kind</a></li></ul><h4><strong>Minikube:</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*m6PsKVpxCdC8DVWd.jpg" /><figcaption>minikube</figcaption></figure><p>Minikube is the oldest and most popular Kubernetes distribution for local environments. The project started in 2016. Its default configuration makes it very easy to get started. Most development tools support minikube out of the box. Minikube supports various “driver”s which allow you to run in different set-ups (virtualbox, docker, bare-metal, etc). For docker driver to work, docker has to be installed on the system and the current user has to have the right permissions.</p><p><a href="https://github.com/kubernetes/minikube">Minikube</a> has the primary goals of being the best tool for local Kubernetes application development, and to support all Kubernetes features that fit. No matter what operating system you use, <a href="https://minikube.sigs.k8s.io/docs">Minikube’s documentation</a> offers an easy <a href="https://minikube.sigs.k8s.io/docs/start/">installation</a>.</p><p>Minikube quickly sets up a local Kubernetes cluster on Linux, macOS, or Windows with the following features:</p><ul><li>Supports the latest Kubernetes release (+6 previous minor versions)</li><li>Cross-platform (Linux, macOS, Windows)</li><li>Deploys as a VM, a container, or on bare-metal</li><li>Multiple container runtimes (CRI-O, containerd, Docker)</li><li>Docker API endpoint for blazing-fast image pushes</li><li>LoadBalancer, filesystem mounts, FeatureGates, and other advanced features</li><li>Add-ons for easily installing Kubernetes applications</li></ul><p>Because Minikube is an open source project, you can contribute to its <a href="https://github.com/kubernetes/minikube">source code</a>.</p><h3>microk8s</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/0*6PXl1zU4E50RIK5w" /><figcaption>MicroK8s</figcaption></figure><p>MicroK8s is <a href="https://canonical.com/">Canonical</a>‘s way of getting into Kubernetes market. It’s a single “snap” command to install on Ubuntu systems. Internally MicroK8s uses containers as the container runtime which is bundled into the snap package.</p><p>Microk8s is a small, lightweight, and fully conformant Kubernetes distribution from Canonical. It’s a minimalistic distribution focused on simplicity and performance. Given its footprint, Microk8s can be easily deployed in IoT and edge devices.</p><p>Canonical has packaged <a href="https://microk8s.io/">Microk8s</a> as a snap, the company’s package manager for Linux. A snap is a bundle of an app and its dependencies that works without modification across many different Linux distributions. Snaps are independent, self-contained applications that run in a sandbox with mediated access to the host system. Snaps have emerged as an alternative to the standard .deb packages typically used in Debian-based distributions. Applications packaged as a snap can be easily installed and uninstalled.</p><p>Apart from the recent versions of Ubuntu, snaps can be deployed on a variety of platforms, including Linux Mint, Raspberry Pi OS, and Arch Linux.</p><p>During the benchmark microk8s did the worst. I am not sure what the slowness was caused by but my guess is its resource use.</p><p>Storage and DNS addons are disabled by default so they need to be enabled if persistence and DNS. Microk8s is the only distribution that disables DNS by default. During benchmarking I had issues with helm v3 packaged with microk8s because it was an early release which had a <a href="https://github.com/helm/helm/issues/7955">bug</a>.</p><h3>k3s</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*E89srdNhG2-KwZSpd_HmZw.png" /><figcaption>k3s</figcaption></figure><p>k3s is a highly available, certified Kubernetes distribution designed for production workloads in unattended, resource-constrained, remote locations or inside IoT appliances.</p><p>k3s is a distribution from <a href="https://rancher.com/">Rancher</a> and is a <a href="https://www.cncf.io/">CNCF</a> project. k3s binary contains all the necessary cluster components so the cluster setup is very quick (the quickest of the 5 distributions). Although it comes with both storage and DNS installed, it is also very light. k3s doesn’t have any dependencies.</p><p>k3s is very easy to use but as it’s not as widely used external tool support for it is not as good as minikube. It also lacks the shortcuts useful for beginners (e.g. helm works out of the box with minikube, but with k3s you have to extract kubeconfig from kubectl using “k3s kubectl config view –raw”).</p><p>k3s is packaged as a single &lt;40MB binary that reduces the dependencies and steps needed to install, run and auto-update a production Kubernetes cluster.</p><p>k3s is a fully compliant Kubernetes distribution with the following enhancements:</p><ul><li>Packaged as a single binary.</li><li>Lightweight storage backend based on sqlite3 as the default storage mechanism. etcd3, MySQL, Postgres also still available.</li><li>Wrapped in simple launcher that handles a lot of the complexity of TLS and options.</li><li>Secure by default with reasonable defaults for lightweight environments.</li><li>Simple but powerful “batteries-included” features have been added, such as: a local storage provider, a service load balancer, a Helm controller, and the Traefik ingress controller.</li><li>Operation of all Kubernetes control plane components is encapsulated in a single binary and process. This allows K3s to automate and manage complex cluster operations like distributing certificates.</li><li>External dependencies have been minimized (just a modern kernel and cgroup mounts needed). K3s packages required dependencies, including:</li><li>container</li><li>Flannel</li><li>CoreDNS</li><li>CNI</li><li>Host utilities (iptables, socat, etc)</li><li>Ingress controller (trafik)</li><li>Embedded service loadbalancer</li><li>Embedded network policy controller</li></ul><h3>k0s</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*AQHqbAaZ5f44OOGpzjHDPA.png" /><figcaption>k0s</figcaption></figure><p>k0s is similar to k3s in many ways. Like k3s, k0s also comes as a single binary which achieves a very quick setup times. k0s binary is massive (170MB) compared to k3s (50MB). You can add k0s to startup by using “k0s install controller” command or can run it quickly using “k0s controller” command. k0s, like k3s doesn’t have any dependencies.</p><p>Because of it’s low resource footprint I was surprised by the benchmark results. The average response time was similar to the response times achieved with microk8s.</p><p>k0s does not come with a storage handler. There isn’t even a command to install it. I had to set up helm and install <a href="https://rook.io/">rook</a>. For that reason it got the worst ease of use score.</p><p>k0s drastically reduces the complexity of installing and running a fully conformant Kubernetes distribution. New kube clusters can be bootstrapped in minutes. Developer friction is reduced to zero, allowing anyone, with no special skills or expertise in Kubernetes to easily get started.</p><p>k0s is distributed as a single binary with no host OS dependencies besides the host OS kernel. It works with any operating system without additional software packages or configuration. Any security vulnerabilities or perf issues can be fixed directly in the k0s distribution.</p><p>k0s is completely free for personal or commercial use, and it always will be. The source code is available on <a href="https://github.com/k0sproject/k0s">Github</a> under Apache 2 license. It’s a no brainer foundation for any Kubernetes projects and easy build upon.</p><h3>kind</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*iz74k4iNBn3gpDtgNb_j-g.png" /></figure><p><a href="https://kind.sigs.k8s.io/">kind</a>’s developers describe it as “a tool for running local Kubernetes clusters using Docker container ‘nodes.’” It was designed for testing Kubernetes but may also be used for local development or continuous integration.</p><p>Kind is another Kubernetes SIGs project but is quite different compared to minikube. As the name suggests it moves the cluster into Docker containers. This leads to a significantly faster startup speed compared to spawning VM.</p><p>Creating a cluster is very similar to minikube’s approach. Executing kind create cluster, playing the waiting game and afterwards you are good to go. By using different names ( — name) kind allows you to create multiple instances in parallel.</p><p>One feature that I personally enjoy is the ability to load my local images directly into the cluster. This saves me a few extra steps of setting up a registry and pushing my image each and every time I want to try out my changes. With a simple kind load docker-image my-app:latest the image is available for use in my cluster. Very nice!</p><p>If you are looking for a way to programmatically create a Kubernetes cluster, kind kindly (you have been for waiting for this, don’t you :P) publishes its Go packages that are used under the hood. If you want to get to know more have a look at the GoDocs and check out how KUDO uses kind for their integration tests.</p><p>kind supports:</p><ul><li>Multi-node (including high-availability) clusters</li><li>Building Kubernetes release builds from source</li><li>Make/Bash/Docker or Bazel, in addition to pre-published builds</li><li>Linux, macOS, and Windows</li></ul><p>In addition, kind is a Cloud Native Computing Foundation (CNCF)-certified conformant Kubernetes installer. Because it’s open source, you can find kind’s <a href="https://github.com/kubernetes-sigs/kind">source code</a> in its GitHub repository.</p><h3>Feature comparison</h3><p>When comparing distributions I made the following assumptions:</p><ul><li>minikube can actually run at but only if you define the service manually. k0s has a command to define the service. k3s will run at boot if installed by following the <a href="https://rancher.com/docs/k3s/latest/en/quick-start/">quick start guide</a></li><li>Subtracted ease of use points for each obstacle encountered during the installation of wordpress helm chart (missing addon, no default kubeconfig)</li><li>Considered k3s and k0s as single binary because they have no dependencies and do no downloads during the set up process.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MrWBQIAp0GggqQAZkUwf4Q.png" /></figure><h3>Verdict</h3><p>After spending hours testing and benchmarking these tools I’ll probably continue using minikube because it’s so easy to use. I will keep watching kind and k3s to see if they get better. Speed of k3s is its best advantage and I’m sure that alone will make lots of people use it.</p><h3>References:</h3><ul><li><a href="https://minikube.sigs.k8s.io/docs/start/">minikube start</a></li><li><a href="https://microk8s.io/docs">MicroK8s - MicroK8s documentation - home | MicroK8s</a></li><li><a href="https://rancher.com/docs/k3s/latest/en/">K3s - Lightweight Kubernetes</a></li><li><a href="https://k0sproject.io/">k0s | Kubernetes distribution for bare-metal, on-prem, edge, IoT</a></li><li><a href="https://kind.sigs.k8s.io/docs/user/quick-start/">Quick Start</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58578fb74bb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi-Region Jenkins CI/CD Deployment to AWS via Ansible and Terraform-Part 3]]></title>
            <link>https://serdem.medium.com/multi-region-jenkins-ci-cd-deployment-to-aws-via-ansible-and-terraform-part-3-bac114b56c9c?source=rss-a8430c79acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/bac114b56c9c</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ansible]]></category>
            <dc:creator><![CDATA[Sezgin Erdem, Ph.D.]]></dc:creator>
            <pubDate>Thu, 20 May 2021 11:43:44 GMT</pubDate>
            <atom:updated>2021-05-20T11:43:44.036Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ansible Configuration Management</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*19cVTcNEEFQliOHqvW2Kmw.png" /><figcaption>The Chronology of Ansible Playbook — Jenkins Master</figcaption></figure><p>I was exclusively working on the Ansible playbook for setting up myJenkins master/main node application. Afterwards I verified the syntax of the file using the syntax-check flag of ansible-playbook.</p><p>Note: For this project following along, please remember that this playbook expects that you have setup Ansible Dynamic inventory for EC2 (AWS) and the inventory configuration file from the following lesson:</p><h4>Configuring Terraform Provisioners for Config Management via Ansible</h4><p><em>Resources:</em> install_jenkins.yaml</p><p>I created the Ansible playbook for Jenkins worker to run inside the Terraform provisioner. I briefly went over the logic and modules used to setup the Jenkins worker and checked it’s syntax validity using the — syntax-check flag for the ansible-playbook command.</p><p><em>Resources:</em> install_worker.yaml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SgH4uqkGxtySFlOR5-ekOw.png" /><figcaption>The Chronology of Ansible Playbook — Jenkins Workers</figcaption></figure><p>I learned about Jinja templating in Ansible and creating Jinja templates. I referenced these templates earlier in the Ansible playbook for the Jenkins worker node.</p><p>Links to download the two Jinja templates created in this part can be found in the resources so.</p><p><em>Resources:</em><br>node.j2<br>cred-privkey.j2</p><h3>Bringing It All Together</h3><p>In this final, bring-it-all-together part, went through a checklist to make sure I did not missing any dependencies. I also modified the provisioners for the Jenkins master and worker nodes to plugged in the Ansible playbooks I wrote in previous part. In addition, we modify the ansible-playbook command in the Jenkins worker creation provisioner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KJYYPRIkvauvInBhppCETQ.png" /><figcaption>Deploying to AWS with Terraform and Ansible</figcaption></figure><p>I fetched a public DNS domain hosted on Route 53 and copy it into the default variable I had been created earlier in the variables.tf file: dns-name.</p><p>I also changed the default value of the variable webserver-port to 8080 as Jenkins expects traffic from ALB on 8080.</p><p>Finally, I run terraform apply and use the URL returned as output of terraform apply to verify if the deployment was successful.</p><p>I logged into the application using the following credentials:</p><p>username: admin password: password</p><p>With the Jenkins GUI, I could verify that the spun-up worker (in the variable.tf file by default) successfully integrated with the Jenkins master.</p><p>Note: For getting the DNS part to work, I need to provide a publicly routed domain.</p><p>I learned about the debugging environment variables available for both Ansible and Terraform, as well as the debugging flag available for Ansible. Later I went through guided demonstrations of how to invoke and use these debugging variables and what to expect in the output of verbose logs.</p><h3>References:</h3><ul><li><a href="https://github.com/sezginerdem/p11-MultiRegion_Jenkins_CI-CD_Dep_Ansible-Terraform">GitHub - sezginerdem/p11-MultiRegion_Jenkins_CI-CD_Dep_Ansible-Terraform</a></li><li><a href="https://docs.ansible.com/ansible/latest/index.html">Ansible Documentation - Ansible Documentation</a></li><li><a href="https://www.terraform.io/docs/index.html">Documentation | Terraform by HashiCorp</a></li></ul><p><a href="https://docs.aws.amazon.com/">https://docs.aws.amazon.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bac114b56c9c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi-Region Jenkins CI/CD Deployment to AWS via Ansible and Terraform-Part 2]]></title>
            <link>https://serdem.medium.com/multi-region-jenkins-ci-cd-deployment-to-aws-via-ansible-and-terraform-part-2-8413a19a5a78?source=rss-a8430c79acd------2</link>
            <guid isPermaLink="false">https://medium.com/p/8413a19a5a78</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Sezgin Erdem, Ph.D.]]></dc:creator>
            <pubDate>Tue, 11 May 2021 04:43:07 GMT</pubDate>
            <atom:updated>2021-05-11T04:43:07.555Z</atom:updated>
            <content:encoded><![CDATA[<h3>Terraform Infrastructure as Code (IaC)</h3><p>In the context of this project, I created multiple providers so that I can deploy resources in more than one AWS region.</p><p>I laid down the network foundation for our CI/CD project in this part. I deployed VPCs, subnets, and IGWs in two separate regions using the multiple providers I created earlier in the project. At the end, I had tested my Terraform code for consistency and syntax, then deployed it using terraform apply.</p><p><em>Resources: </em>network_setup_1.tf</p><p>I continued building on the network part of my deployment. I first built a VPC peering connection between the two VPCs in separate regions and then proceeded to manipulate VPC route tables so that both VPCs can communicate over the VPC peering connection.</p><p><em>Resources: </em>network_setup_2.tf</p><p>I went through the layout of security groups and also demonstrate them.</p><p><em>Resources: </em>network_setup_3.tf</p><p>I leveraged the power of Systems Manager (SSM) public parameter store to fetch AMI IDs in Terraform. I used these fetched AMI IDs later to spin up EC2 instances which would hosted our Jenkins application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*bTeglkxHQy6b2UsR.png" /><figcaption>Fetch AMI IDs Using SSM Parameter Store</figcaption></figure><p><em>Resources:</em><br><em> </em>instances.tf<br>ssm_resource_path_string.txt</p><p>I run through generating an SSH key pair and used it to create EC2 key pairs. I did this using Terraform, so that later I could attach those EC2 key pairs to our application nodes and connect to them using SSH.</p><p><em>Resources: </em>instances_2.tf</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*3c0eH5ZFSEnNWtJC.png" /><figcaption>Deploy EC2 Key Pairs for App Nodes</figcaption></figure><p>I defined the resources for creating the EC2 instances which hosted our Jenkins master and Jenkins worker nodes in separate regions. I also defined outputs in Terraform to show the public IPs of these instances once Terraform apply has run successfully. Finally I tested the EC2 keypairs that I had created in preceding part to SSH into our newly-created EC2 instances.</p><p><em>Resources: </em>instances_3.tf</p><p>In this part, I added Terraform provisioners to my EC2 instance resources and apply bootstrapping to the EC2 instances (for Jenkins Master and Worker nodes) via sample Ansible playbooks. I used Ansible dynamic inventory for AWS to keep track of instances as they were spun up and deleted. Later, I built customized Ansible playbooks for bootstrapping our Jenkins application installation and integration.</p><p><em>Resources:</em><br>tf_aws_ec2.yml<br>master_provisioner.tf<br>jenkins-master-sample.yml<br>jenkins-worker-sample.yml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*qSbo3PL7bXgvRs0t.png" /><figcaption>Deploy Jenkins Master and Worker EC2s</figcaption></figure><p>I went ahead with deploying an application load balancer which fronts an EC2 application node. In this lesson, I showed a sample Apache (HTTPD) webserver running on the EC2 instance in question.</p><p><em>Resources:</em><br>alb.tf<br>jenkins-master-sample_2.yml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*puGlQvQ7JQf0FbcV.png" /><figcaption>Creating an ALB and Routing Traffic to EC2 Node</figcaption></figure><p>I went about deploying the https endpoint for my application. I did this by adding an https listener to the ALB I created in the previous part. I generated an SSL certificate to attach to the ALB https listener so that https traffic can be terminated at the ALB. I put a DNS domain in front of our load balancer and also enabled http to https redirection.</p><pre>$ aws route53 list-hosted-zones</pre><p>Look for Name under the Hosted Zone field in the output of the above command.</p><p><em>Resources:</em><br>dns.tf<br>alb_2.tf<br>alb_acm.tf<br>outputs.tf</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*QeetAjePK4kS6H2f.png" /><figcaption>Deploy Route 53 Records (Public Hosted Zone) and HTTPS Endpoint</figcaption></figure><h3>References:</h3><ul><li><a href="https://github.com/sezginerdem/p11-MultiRegion_Jenkins_CI-CD_Dep_Ansible-Terraform">GitHub - sezginerdem/p11-MultiRegion_Jenkins_CI-CD_Dep_Ansible-Terraform</a></li><li><a href="https://www.terraform.io/docs/index.html">Documentation | Terraform by HashiCorp</a></li><li><a href="https://docs.ansible.com/ansible/latest/index.html">Ansible Documentation - Ansible Documentation</a></li></ul><p><a href="https://docs.aws.amazon.com/">https://docs.aws.amazon.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8413a19a5a78" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>