<?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[Webera - Medium]]></title>
        <description><![CDATA[We are a cloud consulting company with offices in the United States and Brazil - Medium]]></description>
        <link>https://medium.com/wearewebera?source=rss----b433a7f21c6d---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Webera - Medium</title>
            <link>https://medium.com/wearewebera?source=rss----b433a7f21c6d---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 10:48:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/wearewebera" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Workloads in Kubernetes]]></title>
            <link>https://medium.com/wearewebera/workloads-in-kubernetes-2627f8607ef7?source=rss----b433a7f21c6d---4</link>
            <guid isPermaLink="false">https://medium.com/p/2627f8607ef7</guid>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Lucas Lopes]]></dc:creator>
            <pubDate>Mon, 12 Dec 2022 12:52:11 GMT</pubDate>
            <atom:updated>2022-12-12T12:52:11.177Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*bLCBNVozYm5slgCUAC-ltw.jpeg" /></figure><h4>Managing Workloads with Deployments</h4><p>In advance, when we talk about <a href="https://kubernetes.io/docs/concepts/workloads/">workloads in Kubernetes</a>, we mean the API resource types that run an application. Those API resource types include a Deployment, ReplicaSet, StatefulSet, DaemonSet, Job, CronJob, and the Pod. In Kubernetes, a workload is executed in a Pod. There are various API resources that manage one or many Pods.</p><h4>Understanding Deployments</h4><p>The <strong>Pod</strong> is the central API resource for running an application in a container. Using a single instance of a Pod to operate an application has flaws. It represents a single point of failure as all traffic targeting the application is funneled to this Pod. This behavior is specifically problematic when the load increases due to higher demand. Another essential aspect of running an application in a Pod is failure tolerance. A Pod will not be rescheduled in the case of a node failure and, therefore, can lead to a system outage for end users.</p><blockquote>Briefly difference between ReplicaSet and Deployment</blockquote><p>A <em>ReplicaSet</em> is a Kubernetes API resource that controls multiple, identical instances of a Pod running the application, so-called replicas. It has the capability of scaling the number of replicas up or down on demand.</p><p>A <em>Deployment</em> abstracts the functionality of ReplicaSet and manages it internally. In practice, this means that you do not have to create, modify, or delete ReplicaSet objects yourself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7yWlAj8U3jtXGmLdHL1xLQ.png" /></figure><h4>Creating Deployments</h4><p>You can create a Deployment using the imperative command create deployment. At a minimum, you need to provide the name of the Deployment and the container image that should be used by the replicas.</p><p>The following command creates the Deployment named example-app-cache, which runs the object cache <a href="https://memcached.org/">Memcached</a> inside of the container on three replicas:</p><pre>kubectl create deployment example-app-cache --image=memcached:x.x.x --replicas=3</pre><p>Also, <strong>which is the best practice</strong>, create the deployment by a <em>manifest—declarative</em> method:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: example-app-cache<br>  labels:<br>    app: example-app-cache<br>spec:<br>  replicas: 3<br>  selector:<br>    matchLabels:<br>      app: example-app-cache<br>  template:<br>    metadata:<br>      labels:<br>        app: example-app-cache<br>    spec:<br>      containers:<br>      - name: memcached<br>        image: memcached:x.x.x</pre><h4>Listing Deployments and Pods</h4><p>We can inspect a Deployment after its creation by using the get deployments command.</p><pre>kubectl get deployments<br><br>NAME                READY   UP-TO-DATE   AVAILABLE   AGE<br>example-app-cache   3/3     3           3            30m</pre><p>That means:</p><p><em>Ready</em> — Lists the number of replicas available to end users in the format of &lt;ready&gt;/&lt;desired&gt;. The number of desired replicas corresponds to the value of spec.replicas.</p><p><em>Up-To-Date</em> — Lists the number of replicas that have been updated to achieve the desired state.</p><p><em>Available</em> — Lists the number of replicas available to end users.</p><p>The Pods controlled by the Deployment can be identified by the naming prefix in their names. For the previous Deployment, the Pod names start with example-app-cache-. The hash following the prefix is autogenerated and assigned to the name upon creation.</p><pre>kubectl get pods<br><br>NAME                        READY   STATUS    RESTARTS   AGE<br>example-app-cache-xxx-xyz   1/1     Running   0          3h<br>example-app-cache-xxx-xyz   1/1     Running   0          3h<br>example-app-cache-xxx-xyz   1/1     Running   0          3h</pre><h4>Rendering Deployment Details</h4><p>We can describe the details of a Deployment.</p><pre>kubectl describe deployment example-app-cache<br><br>Name:                   example-app-cache<br>Namespace:              default<br>CreationTimestamp:      Sun, 27 Nov 2022 09:44:18<br>Labels:                 app=example-app-cache<br>Annotations:            deployment.kubernetes.io/revision: 1<br>Selector:               app=example-app-cache<br>Replicas:               3 desired | 3 updated | 3 total | 3 available | \<br>                        0 unavailable<br>StrategyType:           RollingUpdate<br>MinReadySeconds:        0<br>RollingUpdateStrategy:  25% max unavailable, 25% max surge<br>Pod Template:<br>  Labels:  app=example-app-cache<br>  Containers:<br>   memcached:<br>    Image:        memcached:x.x.x<br>    Port:         &lt;none&gt;<br>    Host Port:    &lt;none&gt;<br>    Environment:  &lt;none&gt;<br>    Mounts:       &lt;none&gt;<br>  Volumes:        &lt;none&gt;<br>Conditions:<br>  Type           Status  Reason<br>  ----           ------  ------<br>  Progressing    True    NewReplicaSetAvailable<br>  Available      True    MinimumReplicasAvailable<br>OldReplicaSets:  &lt;none&gt;<br>NewReplicaSet:   example-app-cache-1x2y3z (3/3 replicas created)<br>Events:          &lt;none&gt;</pre><h4>Deleting a Deployment</h4><p>A Deployment takes full charge of the creation and deletion of the objects it controls, Pods and ReplicaSets. When you delete a Deployment, the corresponding objects are deleted as well.</p><pre>kubectl delete deployment example-app-cache<br><br>deployment.apps &quot;example-app-cache&quot; deleted</pre><p>For the next step, it is important to get an understanding of the &quot;Performing Rolling Updates and Rollbacks&quot;. It will be for the following step/article.</p><p>Thank you very much. And, if you have any questions, please hit me back.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2627f8607ef7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wearewebera/workloads-in-kubernetes-2627f8607ef7">Workloads in Kubernetes</a> was originally published in <a href="https://medium.com/wearewebera">Webera</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Docker container commands]]></title>
            <link>https://medium.com/wearewebera/a-docker-container-commands-3704567582cc?source=rss----b433a7f21c6d---4</link>
            <guid isPermaLink="false">https://medium.com/p/3704567582cc</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Lucas Lopes]]></dc:creator>
            <pubDate>Mon, 12 Dec 2022 12:51:43 GMT</pubDate>
            <atom:updated>2022-12-12T12:51:43.544Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*hHwZNtTjL7XRWt7iexUBPg.png" /></figure><h4>We&#39;ll be aware of the most common commands running in Docker container.</h4><p>In summary, Docker is designed to be a platform that creates, runs, manages, and can even orchestrate containers. It can be installed on a wide variety of operating systems, including Linux, Windows, and macOS. Docker, Inc. is the company that created the technology and continues to create technologies and solutions that make it easier to get the code on your laptop running in the cloud. Then, when we say <strong>&quot;Docker&quot;</strong>, we can be referring to either of the following:</p><ul><li>Docker, Inc., the company</li><li>Docker the technology</li></ul><p>Docker, Inc. is a San Francisco-based technology company founded by French-born American developer and entrepreneur Solomon Hykes. The company started as a platform as a service (PaaS) provider called <strong><em>dotCloud</em></strong>. Behind the scenes, the dotCloud platform was built on Linux containers. To help create and manage these containers, they built an in-house tool that they eventually nick-named &quot;Docker&quot;. And that&#39;s how the Docker technology was born.</p><p>It is also interesting to know that the word &quot;Docker&quot; comes from a British expression meaning <strong>dock</strong> worker — somebody who loads and unloads cargo from ships.</p><p>The Docker Technology is when most people talk about Docker, they&#39;re referring to the technology that runs containers. However, there are at least three things to be aware of when referring to Docker as a technology:</p><ul><li>The runtime</li><li>The daemon (engine)</li><li>The orchestrator</li></ul><p>The figure below shows a brief example of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*yVcqtLATC49Vbc_ekmIIhA.png" /></figure><p>With the started said, let&#39;s begin with our most common commands for Docker Container.</p><blockquote><strong>PS: before that, we might talk deeply about what the entries technology means as above. I’ll kindly ask you to keep me in the post.</strong></blockquote><h4>Image commands</h4><p>docker image pull</p><p>is the command to download images. We pull images from repositories inside of remote registries. By default, images will be pulled from repositories on Docker Hub.</p><p>docker image ls</p><p>lists all images stored in your Docker host&#39;s local image cache.</p><p>docker image inspect</p><p>it is a great thing. It gives you all the details of an image—layer data and metadata.</p><p>docker manifest inspect</p><p>allows you to inspect the manifest list of any image stored on Docker Hub.</p><p>docker buildx</p><p>is a Docker CLI plugin that extends the Docker CLI to support multi-arch builds.</p><p>docker image rm</p><p>is the command to delete images. Remember, you cannot delete an image associated with a container in the running or stopped states.</p><h4>Container commands</h4><p>docker container run</p><p>it is the command used to start a new container. An image is used to create the container, and the command is the application the container will run when it starts.</p><p>docker container ls</p><p>lists all containers in the running upstate. If you add the -a flag you will also see containers in the stopped state.</p><p>docker container exec</p><p>runs a new process inside of a running container. It&#39;s useful for attaching the shell of your Docker host to a terminal inside a running container.</p><p>docker container stop</p><p>will stop a running container and put it in the Exited (0) state. The command accepts container IDs and container names as arguments.</p><p>docker container start</p><p>will restart a stopped (Exited) container. You can give the name or ID of a container.</p><p>docker container rm</p><p>will delete a stopped container. You can specify containers by name or ID. It is recommended that you stop a container with the docker container stop command before deleting it.</p><p>docker container inspect</p><p>will show you detailed configuration and runtime information about a container.</p><h4>Containerizing commands</h4><p>docker image build</p><p>is the command that reads a Dockerfile and containerizes an application. The -t flag <strong>tags</strong> the image, and the -f flag lets you specify the name and location of the Dockerfile.</p><p>The FROM instruction in a Dockerfile specifies the base image for the new image you will build.</p><p>The RUN instruction in a Dockerfile allows you to <strong>run</strong> commands inside the image. <em>Each </em><em>RUN instruction creates a single new layer.</em></p><p>The COPY instruction in a Dockerfile adds files into the image as a new layer.</p><p>The EXPOSE instruction in Dockerfile documents the network port that the application uses.</p><p>The ENTRYPOINT instruction in a Dockerfile sets the default application to run when the image is started as a container.</p><h4>Docker Compose commands</h4><p>docker-compose up</p><p>it is the command to deploy a Compose application. It expects the Compose file to be called docker-compose.yaml.</p><p>docker-compose stop</p><p>will stop all containers in a Compose app without deleting them from the system.</p><p>docker-compose rm</p><p>will delete a stopped Compose app. It will delete containers and networks, but it will not delete volumes and images.</p><p>docker-compose restart</p><p>will restart a Compose app that has been stopped with docker-compose stop.</p><p>docker-compose ps</p><p>will list each container in the Compose app.</p><p>docker-compose down</p><p>will stop and delete a running Compose app. It deletes containers and networks but not volumes and images.</p><p>The commands above are one of the most common &quot;running&quot; when discussing Docker Container. However, we have much more there, such as <strong>&quot;Docker Swarm&quot;</strong>, <strong>&quot;Docker Networking&quot;</strong> etc., that we also can bring on. Let&#39;s keep in touch.</p><blockquote>The main content was obtained from the lovely and remarkable book &quot;Docker Deep Dive, by Nigel Poulton&quot;. My honest appreciation.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3704567582cc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wearewebera/a-docker-container-commands-3704567582cc">A Docker container commands</a> was originally published in <a href="https://medium.com/wearewebera">Webera</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stages in CI/CD Pipelines]]></title>
            <link>https://medium.com/wearewebera/stages-in-ci-cd-pipelines-6cb243b5c657?source=rss----b433a7f21c6d---4</link>
            <guid isPermaLink="false">https://medium.com/p/6cb243b5c657</guid>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cicd]]></category>
            <dc:creator><![CDATA[Lucas Lopes]]></dc:creator>
            <pubDate>Thu, 01 Dec 2022 13:54:44 GMT</pubDate>
            <atom:updated>2022-12-01T13:54:44.528Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXdLrEvBnFXOLYsw1vs7ZQ.jpeg" /></figure><h4>How pipelines are created to build and test application code and then deploy it to different environments.</h4><p><em>Continuous</em> <em>integration</em> (CI) is a software development practice in which all developers merge code changes in a central repository (Git). With CI, each code change (commit) triggers an automated build-and-test stage for the given repo and provides feedback to the developer(s) who made the change.</p><p><em>Continuous delivery</em> (CD) is the practice of automating the entire software release process. CD includes infrastructure provisioning in addition to deployment.</p><p>A CI/CD pipeline is a collection of stages, and each stage performs a specific task to achieve some objectives.</p><p><em>Productivity — </em>Code review, unit test, code coverage, code analysis, integration test, and run-time vulnerability are essential stages for design, quality, and security feedback to the developers.</p><p><em>Security</em> — Detect code and component vulnerabilities that are attack surfaces for potential exploitation.</p><p><em>Defect escape</em> — Reduce failure of customer interactions and costly rollback. A new release is typically providing new features or enhancing existing ones. If the features do not provide the correct functionality, the consequence will be customer dissatisfaction and potential revenue loss.</p><p><em>Scalability</em> — Discover scalability issues before the production release. A <strong>canary release is a way to deploy the new version to detect scalability issues using production traffic and dependencies.</strong></p><p><em>Time to market</em> — Deliver features to customers quicker.</p><p><em>Reporting</em> — Insight for continuous improvement and metrics for auditability.</p><h4>GitOps CI</h4><p>That illustrates a comprehensive CI pipeline building on the GitOps CI/CD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E1Fz6CNAjNtx5VkcBevGfA.png" /></figure><p><strong><em>PRE-BUILD STAGES</em></strong></p><ul><li>Pull Requests &amp; Code Review — all CI/CD pipelines should always start with a pull request, which allows code review to ensure consistency between design and implementation and catch other potential errors.</li><li>Vulnerability Scan — this might detect known vulnerabilities and licensing issues early in the development cycle.</li><li>Code Analysis</li></ul><p><strong><em>BUILD STAGES</em></strong></p><ul><li>Build — the build stage typically starts with downloading the dependency libraries before the project source code’s compilation.</li><li>Unit Test — a unit test is for verifying a small piece of code doing what it is supposed to do.</li><li>Code Coverage — code coverage measures the percentage of code that is covered by automated unit tests.</li><li>Docker Build — a Docker image is the deployable unit for Kubernetes.</li><li>Docker Push — the newly built Docker image needs to be published to a Docker registry for Kubernetes to orchestrate the eventual deployment. A Docker registry is a stateless, highly scalable server-side application that stores and lets you distribute Docker images.</li></ul><p><strong><em>CI STAGES</em></strong></p><ul><li>Git clone Config repository — this stage performs a Git clone to clone the Kubernetes config to the built environment for the subsequent stage to update your manifest.</li><li>Update manifests — once you have the manifests in your build environment, you can update the manifests with the newly created image id using a configuration management tool like `Kustomize`.</li><li>Git commits and push — once the manifests are updated with a new image id, the last step is to commit the manifests back to the Git repo.</li></ul><p><strong><em>POST-BUILD STAGES</em></strong></p><p><strong>CI Metrics</strong></p><ul><li>Build issues</li><li>CI</li><li>Compliance requirements — for SOC2 requirements, build information such as test results, who did the release, and what was released are required to be maintained anywhere from 14 months up to 7 years.</li><li>Build notification</li></ul><h4>GitOps CD</h4><p>That illustrates a comprehensive CD pipeline building on the GitOps CI/CD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QBi623HVvdi9WeuksR7ycA.png" /></figure><p><strong><em>CD STAGES</em></strong></p><ul><li>Git clone Config repository — the GitOps operator detects changes in your repo and performs a Git clone to get your Git repo’s latest manifests.</li><li>Discover manifests — the GitOps Operator also determines any delta between the manifests in Kubernetes versus the latest manifests from the Git repository.</li><li>K8S Apply — if the GitOps operator determines differences between Kubernetes manifests and Git repository manifests, the GitOps operator applies the new manifests to Kubernetes using the kubectl apply command.</li></ul><p><strong><em>POST-DEPLOYMENT STAGES</em></strong></p><ul><li>Integration tests — integration testing is a type of testing to check if different modules are working correctly together.</li><li>Run-time vulnerability — run-time vulnerabilities are traditionally detected by penetration testing. <strong>Penetration testing</strong>, or ethical hacking, is the practice of testing a computer system, network, or web application to find security vulnerabilities that an attacker could exploit.</li><li>CD Metrics — Compliance SOC2 requirements: build information such as test results, who did the release, and what was released are required to be maintained anywhere from 14 months up to 7 years.</li></ul><p>There we have covered some of the stages in the CI/CD pipeline. From now we can take a look at how the CI/CD pipeline can automate the promotion of code, image, and environment. But it will be for the following article.</p><p>Keep us in touch. If and, any questions, please hit me up. Thank you very much.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cb243b5c657" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wearewebera/stages-in-ci-cd-pipelines-6cb243b5c657">Stages in CI/CD Pipelines</a> was originally published in <a href="https://medium.com/wearewebera">Webera</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create your own custom action for using in GitHub Actions Workflows]]></title>
            <link>https://medium.com/wearewebera/how-to-create-your-own-custom-action-for-using-in-github-actions-workflows-41744264fc32?source=rss----b433a7f21c6d---4</link>
            <guid isPermaLink="false">https://medium.com/p/41744264fc32</guid>
            <dc:creator><![CDATA[Raphael Moraes]]></dc:creator>
            <pubDate>Fri, 19 Aug 2022 20:21:22 GMT</pubDate>
            <atom:updated>2022-08-19T20:43:36.080Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*YheSSavGXXmi-Md0.png" /></figure><p>Hey guys, good to have you back here reading one more article of mine! =)<br>Today I will talk shortly about an existing option working with GitHub Actions Workflow for creating your action from scratch. Yes, that is possible!</p><p>We know that sometimes we need to do some custom things, and in this case, we can encounter challenges that can frustrate us due to existing limitations. This article is precisely about this scenario, where I will use as an example a task that I worked on a long time ago to deploy new app releases on ECS clusters.</p><p>At that time, my first problem in that challenge was how to generate a custom task-definition.json file in a way that would be possible to reuse that same JSON file for multiple environments. My second problem was that I should avoid adding sensitive data hardcoded in the file besides needing to change the values used in that JSON specification file according to the environment I was going to deploy.</p><p>And before you ask yourself why don’t use the existing <a href="https://github.com/marketplace/actions/amazon-ecs-render-task-definition-action-for-github-actions">Amazon ECS “Render Task Definition” Action for GitHub Actions</a>, knows that even if that action is excellent, it would not fit all my needs. So, I decided to wrote my own action from scratch.</p><p>Before to start following the step-by-step, let me just introduce what are actions for those who are not familiar with GitHub Actions. Actions are individual tasks that you can combine to create jobs and customize your workflow. You can create your own actions, or use and customize actions shared by the GitHub community. You can write your own actions to use in your workflow or share the actions you build with the GitHub community. To share actions you’ve built with everyone, your repository must be public. I will not cover in this article about publishing an action, but you can read more about it <a href="https://docs.github.com/en/actions/creating-actions/publishing-actions-in-github-marketplace">here</a>. Actions can run directly on a machine or in a Docker container. You can define an action’s inputs, outputs, and environment variables. There are the following Types of Actions:</p><ul><li><a href="https://docs.github.com/en/actions/creating-actions/about-custom-actions#docker-container-actions">Docker container (OS: Linux)</a></li><li><a href="https://docs.github.com/en/actions/creating-actions/about-custom-actions#javascript-actions">JavaScript (OS: Linux, macOS, Windows)</a></li><li><a href="https://docs.github.com/en/actions/creating-actions/about-custom-actions#choosing-a-location-for-your-action">Composite Actions (OS: Linux, macOS, Windows)</a></li></ul><p>Now that you learned a little bit more about the actions and which types exist, knows that I’m going to use the Composite Action Type in this article. It allow us to combine multiple workflow steps within one action. For example, you can use this feature to bundle together multiple run commands into an action, and then have a workflow that executes the bundled commands as a single step using that action. Let’s jump now to the step-by-step.</p><h3>Step-by-Step</h3><p>Step 1. As recommended in the official documentation, we need to choose a location for the action. In my case, I created the following folder structure in the root directory of my project:</p><p>.github/<br>├── actions<br>│ └── generate-task-definition-json<br>│ └── action.yml<br>└── workflows<br> ├── ecs-workflow.yml<br> └── README.md</p><p>And inside the subfolder .github/actions/generate-task-definition-json I created the metadata file named action.yml (The metadata filename must be either action.yml or action.yaml) with the following content:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6be2fbf9a574ed073d65d246c63009bc/href">https://medium.com/media/6be2fbf9a574ed073d65d246c63009bc/href</a></iframe><p>NOTE: Action metadata files use YAML syntax. If you’re new to YAML, you can read “<a href="https://www.codeproject.com/Articles/1214409/Learn-YAML-in-five-minutes">Learn YAML in five minutes</a>.”</p><p>You can see above that we have some sections in the file action.yml:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*rX4R6Q5_CHIq49J8H2vuqA.png" /></figure><p>Step 2. Now, we can proceed to create the workflow, where we will call that action. I created a file named ecs-workflow.yml inside the subfolder .github/workflows/ with the following content:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cbaab67dbf2baff0fccd18834ecb3f56/href">https://medium.com/media/cbaab67dbf2baff0fccd18834ecb3f56/href</a></iframe><p>You can see that I used secret values for the fields app_datasource_password, app_datasource_url, and app_datasource_username. In this way, I don’t need anymore to hardcode sensitive data in the JSON file, because now it is being created dynamically and getting the sensitive data from GitHub Secrets (which keeps your environment variables encrypted in your Organization or repository)</p><p>Knows best practices and recommendations to ensure compatibility with GitHub Enterprise Server and release management is essential. So, if you are planning to start writing new actions for publishing to the GitHub MarketPlace, please, read the documentation shared in the references of this article.</p><p>That’s it. =)</p><p>Thank you for reading the article!</p><p>References:<br><a href="https://docs.github.com/en/actions/creating-actions">https://docs.github.com/en/actions/creating-actions</a><br><a href="https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions">https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions</a><br><a href="https://www.codeproject.com/Articles/1214409/Learn-YAML-in-five-minutes">https://www.codeproject.com/Articles/1214409/Learn-YAML-in-five-minutes</a><br><a href="https://docs.github.com/en/actions/creating-actions/creating-a-composite-action">https://docs.github.com/en/actions/creating-actions/creating-a-composite-action</a><br><a href="https://docs.github.com/en/actions/creating-actions/publishing-actions-in-github-marketplace">https://docs.github.com/en/actions/creating-actions/publishing-actions-in-github-marketplace</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41744264fc32" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wearewebera/how-to-create-your-own-custom-action-for-using-in-github-actions-workflows-41744264fc32">How to create your own custom action for using in GitHub Actions Workflows</a> was originally published in <a href="https://medium.com/wearewebera">Webera</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to check if your EKS cluster is deployed securely running the kube-bench OSS tool via Gitlab CI]]></title>
            <link>https://medium.com/wearewebera/how-to-check-if-your-eks-cluster-is-deployed-securely-running-the-kube-bench-oss-tool-via-gitlab-ci-21c62798d626?source=rss----b433a7f21c6d---4</link>
            <guid isPermaLink="false">https://medium.com/p/21c62798d626</guid>
            <dc:creator><![CDATA[Raphael Moraes]]></dc:creator>
            <pubDate>Thu, 18 Aug 2022 18:25:47 GMT</pubDate>
            <atom:updated>2022-08-18T19:01:17.163Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gO0SrzSvcPKAVgdm.png" /></figure><p>Hello guys, this is a short guide for explaining how to run the kube-bench tool against your EKS clusters via Gitlab CI Pipeline. For those who never had heard about the kube-bench, It’s an OSS tool created by <a href="https://www.aquasec.com/">AquaSecurity</a> that checks whether Kubernetes is deployed securely by running the checks documented in the <a href="https://www.cisecurity.org/benchmark/kubernetes/">CIS Kubernetes Benchmark</a>. If you also don’t know what is <a href="https://www.cisecurity.org/cis-benchmarks/">CIS Benchmarks</a>, know that are a set of globally recognized and consensus-driven best practices from the Center of Internet Security (CIS) to help security practitioners implement and manage their cyber security defenses. These best practices are a good starting point for creating a new product or service deployment plan or for verifying that existing deployments are secure. When you implement CIS Benchmarks, you can better secure your legacy systems against common and emerging risks by taking steps such as these:</p><ul><li>Disabling unused ports</li><li>Removing unnecessary app permissions</li><li>Limiting administrative privileges</li></ul><p>IT systems and applications also perform better when you disable unnecessary services.</p><p>Now that you know what are both the kube-bench tool and the <a href="https://www.cisecurity.org/cis-benchmarks/">CIS Benchmarks</a> security best practices, follow below how you can set a pipeline in Gitlab CI to run the kube-bench tool as a pod inside your clusters to generate a periodically report:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/512626a9e58c2eaac01fd6b8bf2717b7/href">https://medium.com/media/512626a9e58c2eaac01fd6b8bf2717b7/href</a></iframe><p>Considering that the Amazon EKS provides a managed control plane, you don’t need to run the checks in the control plane, just in your cluster nodes.</p><p>That’s it. =)</p><p>Thank you for reading the article!</p><p>References:<br><a href="https://www.eksworkshop.com/intermediate/300_cis_eks_benchmark/intro/">https://www.eksworkshop.com/intermediate/300_cis_eks_benchmark/intro/</a><br><a href="https://www.eksworkshop.com/intermediate/300_cis_eks_benchmark/run-as-job/">https://www.eksworkshop.com/intermediate/300_cis_eks_benchmark/run-as-job/</a><br><a href="https://www.eksworkshop.com/intermediate/300_cis_eks_benchmark/ssh-into-node/">https://www.eksworkshop.com/intermediate/300_cis_eks_benchmark/ssh-into-node/</a><br><a href="https://aws.amazon.com/blogs/containers/introducing-cis-amazon-eks-benchmark/">https://aws.amazon.com/blogs/containers/introducing-cis-amazon-eks-benchmark/</a><br><a href="https://www.cisecurity.org/benchmark/kubernetes">https://www.cisecurity.org/benchmark/kubernetes</a><br><a href="https://github.com/aquasecurity/kube-bench">https://github.com/aquasecurity/kube-bench</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21c62798d626" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wearewebera/how-to-check-if-your-eks-cluster-is-deployed-securely-running-the-kube-bench-oss-tool-via-gitlab-ci-21c62798d626">How to check if your EKS cluster is deployed securely running the kube-bench OSS tool via Gitlab CI</a> was originally published in <a href="https://medium.com/wearewebera">Webera</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to scale Gitlab Runners into Kubernetes using HPA based on external metrics throughout…]]></title>
            <link>https://medium.com/wearewebera/how-to-scale-gitlab-runners-into-kubernetes-using-hpa-based-on-external-metrics-throughout-16adfd996f08?source=rss----b433a7f21c6d---4</link>
            <guid isPermaLink="false">https://medium.com/p/16adfd996f08</guid>
            <dc:creator><![CDATA[Raphael Moraes]]></dc:creator>
            <pubDate>Tue, 15 Mar 2022 12:59:05 GMT</pubDate>
            <atom:updated>2022-03-15T12:57:20.442Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to scale Gitlab Runners into Kubernetes using HPA based on external metrics throughout Prometheus Adapter</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*fX23rO9axoc-UttqEhkMew.png" /></figure><p>Hey, I’m back here to share a much more efficient way to scale your Gitlab Runner using a custom metric about the number of jobs, instead of using the default metrics of resource usage. To do this, we need to export the metrics to the API <strong>“/apis/external.metrics.k8s.io/v1beta1” </strong>into<strong> </strong>Kubernetes. Before continuing, It’s important to understand that in this scenario I’m assuming that you are using the Gitlab Runner Instances into Kubernetes and that you have used the <a href="https://docs.gitlab.com/runner/install/kubernetes.html">official way of deploying using the <strong>“gitlab-runner”</strong> helm chart</a>.</p><p>By default, the HPA scales the PODs based on CPU or Mem usage (latest versions of Kubernetes), but this way may not be much efficient for some scenarios. The reason why I’m writing this article is a good example of a scenario in which the HPA needs to use custom metrics instead of using the default mechanism based on resource usage. But why? Because the pods of Gitlab Runners Instances need to be scaled based on the number of Jobs. To achieve this, we need firstly export the Gitlab Runner’s metrics, install the Prometheus Stack to get those metrics, and finally, install the Prometheus Adapter which will act as a Custom Metrics API Server for <strong>application-specific metrics </strong>(external.metrics.k8s.io or custom.metrics.k8s.io API) that are a not officially part of Kubernetes). In my case, I’m going to make the custom metric available throughout the API “<strong>external.metrics.k8s.io</strong>”.</p><p>Now that you understood the better and more efficient way for this scenario that I introduced to you, let’s walking through the configuration steps.</p><h4>Step1. Install the Kube Prometheus Stack and Prometheus Adapter</h4><p>Follow below the links providing the instructions for the installation:</p><p><strong>a. Installing Kube Prometheus Stack</strong></p><ul><li><a href="https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack">kube-prometheus-stack</a></li></ul><p>Below is the code snippet that you need to adjust in the “prometheus.prometheusSpec” section, to create a custom scrap to get the metrics of the Gitlab Runners using the <a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config">kubernetes_sd_configs</a> (kubernetes service discovery mechanism):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/00a704956034ffc73debe1cb597d7b5a/href">https://medium.com/media/00a704956034ffc73debe1cb597d7b5a/href</a></iframe><p><em>NOTE: In lines 21 to 23 is the part of the code that I did add an action to filter and keep the Gitlab Runner by the label “name”. This is helpful when you are using more than one Runner. In this way is possible to create a job_name for each one of the Runners that you have and filter by each specific name. It is extremely important to ensure that the HPA will work properly in the scenario where you have multiple Runners.</em></p><p><strong>b. Installing Prometheus Adapter (the API metrics server)</strong></p><ul><li><a href="https://artifacthub.io/packages/helm/prometheus-community/prometheus-adapter">prometheus-adapter</a></li></ul><p>Below is the code snippet that you need to add under the section “rule” in the values.yaml for the Prometheus Adapter:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/73e76dd41002643223ac804c62507d21/href">https://medium.com/media/73e76dd41002643223ac804c62507d21/href</a></iframe><p>Besides that code above, you need to adjust also this part of the values.yaml for setting properly the name of the Prometheus Server that you installed in the previous step (step a):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b688966164bd4fab686c6e6de9e58e61/href">https://medium.com/media/b688966164bd4fab686c6e6de9e58e61/href</a></iframe><p>Due to the reason why I used a specific namespace to install the Prometheus Adapater, was necessary to create a ClusterRole and ClusterRoleBindings, to grant permission to the default service account <strong>“horizontal-pod-autoscaler”</strong> (residing in kube-system) to access the API <strong>“external.metrics.k8s.io”</strong>.</p><p><strong>Cluster Role</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/094d68e9b24b87fbf4bb5e71d733a1db/href">https://medium.com/media/094d68e9b24b87fbf4bb5e71d733a1db/href</a></iframe><p><strong>Cluster Role Bindings</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c3417b161b2c025252babcb48f50d4a/href">https://medium.com/media/7c3417b161b2c025252babcb48f50d4a/href</a></iframe><h4>Step3. Adjust the HPA settings in the values.yaml for the Gitlab Runner Helm Chart</h4><p>Adjust the values.yaml file adding the HPA settings as you can see in the example below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1efd0fdf78877128827ac4a83ff901b6/href">https://medium.com/media/1efd0fdf78877128827ac4a83ff901b6/href</a></iframe><p>That’s it. =)</p><p>Now, your HPA will scale the Gitlab Runners Pods based on the custom metrics that were exported via API <strong>“external.metrics.k8s.io”</strong>.</p><p>Thank you for reading the article, and remember:</p><p>— “knowledge acquired but not shared is lost knowledge” —.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16adfd996f08" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wearewebera/how-to-scale-gitlab-runners-into-kubernetes-using-hpa-based-on-external-metrics-throughout-16adfd996f08">How to scale Gitlab Runners into Kubernetes using HPA based on external metrics throughout…</a> was originally published in <a href="https://medium.com/wearewebera">Webera</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Should DevOps be Rebranded as “Platform Engineering”?]]></title>
            <link>https://medium.com/wearewebera/should-devops-be-rebranded-as-platform-engineering-e19fff73adcb?source=rss----b433a7f21c6d---4</link>
            <guid isPermaLink="false">https://medium.com/p/e19fff73adcb</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[application]]></category>
            <category><![CDATA[platform]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[product-management]]></category>
            <dc:creator><![CDATA[Joel Zamboni]]></dc:creator>
            <pubDate>Tue, 15 Feb 2022 17:14:01 GMT</pubDate>
            <atom:updated>2022-02-15T17:14:01.803Z</atom:updated>
            <content:encoded><![CDATA[<p>DevOps is all about bringing applications and product development closer to operations to shorten the feedback loop and speed up its processes. But what if we rebranded DevOps as “platform engineering”? This rebranding would be a more accurate description of what DevOps practitioners do, and it would help clarify the role of DevOps engineers. This post will explore the benefits of rebranding DevOps as “platform engineering” and discuss some possible objections. Please, join in the comments section below. I would love to hear what you have to say about it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*--onnWXWGJKssSLq2wA4hg.png" /><figcaption>Keep CALMS</figcaption></figure><p>DevOps was defined more as a philosophy or framework than a simple job description. As the market saw its benefits and slowly tried to implement this philosophy, it became a descriptive list of what people should know and do instead of how teams should interact and improve their outcomes.</p><p>While you can clearly state the name of some other teams, like product and application teams, and have a good understanding of what they are doing, you can’t immediately capture the full assortment of responsibilities that the term DevOps encompasses.</p><figure><img alt="Platform Engineering" src="https://cdn-images-1.medium.com/max/605/1*l_LYw8BjSW11W2p1CTOfXA.png" /><figcaption>Platform Engineering</figcaption></figure><p>On the other hand, the team who consume the services provided by a “DevOps Team” don’t have an obligation to know what they do, as long as they keep CI/CD workflows and the production running. In summary, we are getting to the point where we will start to separate development and production again. Yes, can you believe it?</p><p>What if we connect the DevOps to the stack that delivers the final product, not as a separated part, but as an essential component. As the team that develops the platform on which the applications depend and are running on top? We might have a chance to keep the benefits of the DevOps philosophy and improve the entire product and applications view of what this critical team does.</p><p>What do you think? I would love to hear from you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e19fff73adcb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wearewebera/should-devops-be-rebranded-as-platform-engineering-e19fff73adcb">Should DevOps be Rebranded as “Platform Engineering”?</a> was originally published in <a href="https://medium.com/wearewebera">Webera</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nginx ingress controller reporting error “Failed to update lock”]]></title>
            <link>https://medium.com/wearewebera/nginx-ingress-controller-reporting-error-failed-to-update-lock-1fc493cbaae0?source=rss----b433a7f21c6d---4</link>
            <guid isPermaLink="false">https://medium.com/p/1fc493cbaae0</guid>
            <dc:creator><![CDATA[Raphael Moraes]]></dc:creator>
            <pubDate>Fri, 11 Feb 2022 21:54:30 GMT</pubDate>
            <atom:updated>2022-02-11T22:04:20.940Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BGtyJF_isWEYpX3y.png" /></figure><p>Hello folks, I’m back to share something interesting that happened recently with a colleague of mine during the deployment of a new version of an app in our EKS cluster. He asked me for help to figure out why the Kubernetes was not assigning an IP address to the Ingress object. The first thing that I asked for him was the output of kubectl get ingress -o yaml against the ingress name, and the output was the same as the example below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d988233d3365aca16bc3538c47dcf41/href">https://medium.com/media/6d988233d3365aca16bc3538c47dcf41/href</a></iframe><p>Please, pay attention to lines 11 and 12, where we can see that the “loadBalancer” section is empty, which means that there is no IP assigned to the ingress.</p><p>The second thing that we made was looking on Nginx Ingress Controller logs through the command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/33ae7360550afea0318fefbd91e88a8f/href">https://medium.com/media/33ae7360550afea0318fefbd91e88a8f/href</a></iframe><p>Where we got the following output:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f591bb131e2143b1bd148f1a69bf579a/href">https://medium.com/media/f591bb131e2143b1bd148f1a69bf579a/href</a></iframe><p>Through the logs, was possible to identify that something wrong was occurring with the Nginx Ingress Controller. That error is clearly saying that the service account “nginx-ingress-serviceaccount” that is used by Nginx Ingress Controller, wasn’t able to update the configmap for leader-election. It was interesting because it was working some days ago but seems that a recent change against the Nginx Ingress Controller, removing the argument “ — ingress-class=nginx” from the Deployment Object was made. Considering this information I identified that we have now two configMaps, as you can see below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c2d3a82e4ddc98511cc4efab32a32b0/href">https://medium.com/media/7c2d3a82e4ddc98511cc4efab32a32b0/href</a></iframe><p>So, after checking that information, I identified that there was no entry inside the Role Object within the namespace “ingress-nginx” for that new configMap name “ingress-controller-leader”, as you can see in line 21 in the section “resourceNames”:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46e280c8e736b3be6057d17f30a29ab1/href">https://medium.com/media/46e280c8e736b3be6057d17f30a29ab1/href</a></iframe><p>I just added that new configMap name to the Role, as you can see below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c2b7644a4b374a6748d0de0d3a82b923/href">https://medium.com/media/c2b7644a4b374a6748d0de0d3a82b923/href</a></iframe><p>And then, after that those errors that we were getting in the Nginx Ingress Controller were gone. That’s not all, for our joy, that problem that I mentioned at the beginning about the Kubernetes was not assigning an IP address to the Ingress Objects, it was finally solved also after fixing that issue about the <a href="https://kubernetes.github.io/ingress-nginx/deploy/rbac/">leader-election</a> process from the side of the Nginx Ingress Controller, as you can see below inside the section “loadBalancer”:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba635eb84c3694d80450ca317886ef56/href">https://medium.com/media/ba635eb84c3694d80450ca317886ef56/href</a></iframe><p>That’s all folks!! =)</p><p>Thank you for reading the article, and remember:</p><p>— “knowledge acquired but not shared is lost knowledge” — .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fc493cbaae0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wearewebera/nginx-ingress-controller-reporting-error-failed-to-update-lock-1fc493cbaae0">Nginx ingress controller reporting error “Failed to update lock”</a> was originally published in <a href="https://medium.com/wearewebera">Webera</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Terraform workflow with Gitlab CI using the feature Parent-child pipelines]]></title>
            <link>https://medium.com/wearewebera/gitlab-ci-and-terraform-workflow-using-the-feature-parent-child-pipelines-ab50cfe02c9e?source=rss----b433a7f21c6d---4</link>
            <guid isPermaLink="false">https://medium.com/p/ab50cfe02c9e</guid>
            <dc:creator><![CDATA[Raphael Moraes]]></dc:creator>
            <pubDate>Tue, 08 Feb 2022 12:32:43 GMT</pubDate>
            <atom:updated>2022-02-07T19:11:29.039Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*vhuXUKMcVaUha2Ye.png" /></figure><p>Hello, I’m back again, but now to share a super cool way to improve Gitlab CI pipelines. Sometimes it’s hard to visualize the workflow due to many jobs, mainly when you are using Gitlab to create a Terraform workflow to run against multiple environments. Even though that Gitlab has the <a href="https://docs.gitlab.com/ee/user/infrastructure/iac/">Terraform integration feature</a>, I adapted using some features, such as the <a href="https://docs.gitlab.com/ee/user/infrastructure/iac/mr_integration.html">terraform integration in the merge requests</a>. Still, some essential principles and best practices to work with Terraform are not covered in the Gitlab CI documentation, which I will cover in this article through the <a href="https://docs.gitlab.com/ee/ci/pipelines/parent_child_pipelines.html">Parent-child pipeline feature</a>.</p><p><em>NOTE: The feature Parent-child pipeline was </em><a href="https://gitlab.com/gitlab-org/gitlab/-/issues/16094"><em>introduced</em></a><em> in GitLab 12.7 and is available for All Tiers.</em></p><h3>Terraform Workflow configuration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*wQTAl2G2bkomLE-v3G_IHQ.png" /></figure><p>The first step is creating the repository where the templates will reside:</p><p><a href="https://mygitlab.example.com/infrastructure-as-code/templates/cicd">https://mygitlab.example.com/infrastructure-as-code/templates/cicd</a></p><p>The project will have the following folder structure:</p><p>├── CODEOWNERS<br>├── jobs<br>│ └── terraform-prepare.yml<br>├── README.md<br>└── workflows<br> ├── Terraform.gitlab-ci.yml</p><ul><li>The text file CODEOWNER is used to control who has permission to modify or delete anything in the project.</li><li>The text file README.md normally contains important instructions about the project and also for explaining how anything there will work.</li><li>Folder “jobs” is where the jobs/scripts reside.</li><li>Folder “workflows” is where the templates reside.</li></ul><p>Follow below the scripts (external YAML files to be included in the Parent CICD pipeline later) that will reside in the folder “jobs”:</p><p><strong>terraform-prepare.yml</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8178d7f1b2e7a12afe7647383a45cbda/href">https://medium.com/media/8178d7f1b2e7a12afe7647383a45cbda/href</a></iframe><p>And below, inside the folder “workflows”, is the template file that will be included in the Parent CICD pipeline:</p><p><strong>Terraform.gitlab-ci.yml</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f50f00b79af8992955110b624016892b/href">https://medium.com/media/f50f00b79af8992955110b624016892b/href</a></iframe><p><em>NOTE: That command at line 67 will be responsible to generate a report that will be attached during the merge request, where will be possible to see the following information about the changes:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7APbQEIVD-kLJfYHqOpmRA.png" /></figure><p><em>More details </em><a href="https://docs.gitlab.com/ee/user/infrastructure/iac/mr_integration.htm"><em>here</em></a><em>.</em></p><p>The second step is creating the repository where the Parent pipeline will reside:</p><p><a href="https://mygitlab.example.com/infrastructure-as-code/templates/cicd">https://mygitlab.example.com/infrastructure-as-code/</a>parent-pipeline</p><p>Which will have the following folder structure:</p><p>├── CODEOWNERS<br>├── dev<br>├── staging<br>├── production<br>├── .gitlab-ci.yml<br>└── README.md</p><ul><li>The text file CODEOWNER is used to control who has permission to modify or delete anything in the project.</li><li>The text file README.md normally contains important instructions about the project and also for explaining how anything there will work.</li><li>The YAML file .gitlab-ci.yml contains the CI/CD configuration.</li><li>Folder “dev”, “staging”, and “production” is where the main Terraform scripts reside.</li></ul><p>Follow below the content of the file “.gitlab-ci.yml”:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1bb10c76e2ca402c70b9402b69f978af/href">https://medium.com/media/1bb10c76e2ca402c70b9402b69f978af/href</a></iframe><p>Below what means those variables in each job:</p><ul><li>TF_ENV_PATH: Terraform environment folder where the terraform commands will be executed.</li><li>IMAGE_TAG: The docker image tag for the Terraform CLI version that will be used to execute the workflow. I extremely recommend locking the version of the client and the version of every Terraform resource that you are going to use. In this way, you will control the workflow, knowing what arrangement will work adequately and apply your code. If you decide to bump the version in this way, you can create a new TAG with a version most recently for testing, and if successful, you can then change the Terraform CLI version. But in case of a failure, you can roll back to the previous version fastly. Remember, you should prefer to use specific versions instead of the latest versions.</li><li>AWS_ACCOUNT_ID: Your AWS Account ID. It will be used in that script <strong>terraform-prepare.yml </strong>above, to assume a specific IAM role.</li><li>AWS_IAM_ROLE: The IAM role to programmatic access, in this case for Terraform. This role should have specific privileges for applying your code using Terraform CLI. I recommend following the standard security advice of <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege">granting the least privileges</a>.</li><li>AWS_REGION: The AWS region where you are going to apply your code for your infrastructure.</li></ul><p>Now I will finish this article explaining the code that we are using in the parent .gitlab-ci.yml file to trigger a child pipeline. This is where the magic happens:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*yeQrZDcN4_hGE450gAe5Hg.png" /></figure><p>Inside the “trigger:include” keyword, you will call an external pipeline, as you can see in the image above. Inside the include section, you will point to the project where the external pipeline, or in our case here, where the child pipeline resides, and specify the branch you want to use. Last but certainly not least, the keyword “strategy” will force the trigger job to wait for the downstream pipeline to complete before it is marked as <strong>success</strong>.</p><p>That’s all folks!! =)</p><p>For more details about the Parent-child pipeline feature, click <a href="https://docs.gitlab.com/ee/ci/pipelines/parent_child_pipelines.html">here</a>.</p><p><em>NOTE: I’m using DynamoDB as a </em><strong><em>locking mechanism to remote</em></strong><em> storage backend S3 to store my TF State files.</em></p><p>Thank you for reading the article, and remember:</p><p>— “knowledge acquired but not shared is lost knowledge” — .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab50cfe02c9e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wearewebera/gitlab-ci-and-terraform-workflow-using-the-feature-parent-child-pipelines-ab50cfe02c9e">Creating Terraform workflow with Gitlab CI using the feature Parent-child pipelines</a> was originally published in <a href="https://medium.com/wearewebera">Webera</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Helm diff upgrade returning the error unknown field “servicePort” and unknown field “serviceName”…]]></title>
            <link>https://medium.com/wearewebera/helm-diff-upgrade-returning-the-error-unknown-field-serviceport-and-unknown-field-servicename-da3f52506a18?source=rss----b433a7f21c6d---4</link>
            <guid isPermaLink="false">https://medium.com/p/da3f52506a18</guid>
            <dc:creator><![CDATA[Raphael Moraes]]></dc:creator>
            <pubDate>Thu, 27 Jan 2022 20:08:40 GMT</pubDate>
            <atom:updated>2022-01-27T20:17:07.132Z</atom:updated>
            <content:encoded><![CDATA[<h3>Helm diff upgrade returning the error unknown field “servicePort” and unknown field “serviceName” after upgrading EKS to v1.19</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xnbQlVFQTV4Nsu_L.jpg" /></figure><p>I am just sharing a wired behavior trying to run the Helm Diff Upgrade to check what Helm Upgrade would change to a chart of mine installed in the EKS cluster.</p><p>Follow below the error that I got running “helm diff upgrade”:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e52c00dd7b0b1b245b4a6255c992623/href">https://medium.com/media/2e52c00dd7b0b1b245b4a6255c992623/href</a></iframe><p>It’s interesting because I did remember that I did upgrade the cluster recently to v1.19, so my first guess was that something was probably changed from the side of the Kubernetes ingress network v1 API and introduced to this new version that I bumped. And googling about this error, I found this PR bellow that contains the change that caused that error that I got:</p><p><a href="https://github.com/kubernetes/kubernetes/pull/89778">https://github.com/kubernetes/kubernetes/pull/89778</a></p><ul><li>spec.backend -&gt; spec.defaultBackend</li><li>serviceName -&gt; service.name</li><li>servicePort -&gt; service.port.name (for string values)</li><li>servicePort -&gt; service.port.number (for numeric values)</li></ul><p>So, considering the information above, I just changed my Helm file (values.yaml) from:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bbafed7db58c919c4795e3d0d7188269/href">https://medium.com/media/bbafed7db58c919c4795e3d0d7188269/href</a></iframe><p>To:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/663118a137dd3d05df8867f2a83135f0/href">https://medium.com/media/663118a137dd3d05df8867f2a83135f0/href</a></iframe><p>After those changes, that error is gone, and the command succeeded.</p><p>Thank you for reading the article, and remember:</p><p>— “knowledge acquired but not shared is lost knowledge” —.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da3f52506a18" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wearewebera/helm-diff-upgrade-returning-the-error-unknown-field-serviceport-and-unknown-field-servicename-da3f52506a18">Helm diff upgrade returning the error unknown field “servicePort” and unknown field “serviceName”…</a> was originally published in <a href="https://medium.com/wearewebera">Webera</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>