<?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 Adegboro Gbenga on Medium]]></title>
        <description><![CDATA[Stories by Adegboro Gbenga on Medium]]></description>
        <link>https://medium.com/@adegborog?source=rss-947e7597af70------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1YeE2J1dqjUQzeQwcUGqsw@2x.jpeg</url>
            <title>Stories by Adegboro Gbenga on Medium</title>
            <link>https://medium.com/@adegborog?source=rss-947e7597af70------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 12:18:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adegborog/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[Monitoring Your Kubernetes Cluster With Prometheus — Part 2]]></title>
            <link>https://medium.com/@adegborog/monitoring-your-kubernetes-cluster-with-prometheus-part-2-4ebe9c08390a?source=rss-947e7597af70------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ebe9c08390a</guid>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[prometheus-training]]></category>
            <category><![CDATA[prometheus-operator]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[prometheus-school]]></category>
            <dc:creator><![CDATA[Adegboro Gbenga]]></dc:creator>
            <pubDate>Sun, 19 Dec 2021 17:15:20 GMT</pubDate>
            <atom:updated>2021-12-19T17:15:20.174Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HBDoCiTaRTgiTe6u" /><figcaption>Image by Behnam Norouzi from <a href="https://unsplash.com/photos/P4WNwqaen7o">Unsplash</a></figcaption></figure><p>In my <a href="https://link.medium.com/ooBivqZu7lb">previous article</a>, I explained in detail how to set up Prometheus, in this article I would be teaching you how to use it for real Kubernetes monitoring.</p><p>This tutorial focuses on monitoring the three signals that most easily serve as proxies for user happiness:</p><ul><li>Traffic: How many requests you’re receiving</li><li>Error rate: How many of those requests you can successfully serve</li><li>Latency: How quickly you can serve successful requests</li></ul><p>By default Prometheus does not measure any of these for you; you’ll have to instrument any application you deploy to emit them.</p><p>We would be using the simple application we cloned and exported in the previous tutorial, so if you didn’t go through my <a href="https://link.medium.com/ooBivqZu7lb">last article</a> I would advise you to do so before continuing with this.</p><p>To achieve this we would be:</p><ul><li>Building the application image</li><li>Deploying it to a cluster</li><li>Generating load against the app</li><li>Observing the metrics recorded</li></ul><p>Build the application image</p><p>The sample application provides a Dockerfile you’ll use to build the image. This section assumes that you have:</p><ul><li>Docker installed and configured locally</li><li>A Docker Hub account</li><li>Created a repository</li></ul><ol><li>Switch to the application directory:</li></ol><pre>$ cd $WORKDIR/node/golden_signals</pre><p>2. Login to Docker Hub:</p><pre>$ docker login</pre><p>3. Build the image:</p><pre>$ docker build . — tag=&lt;Docker username&gt;/prometheus-demo-node:latest</pre><p>4. Push the image to Docker Hub:</p><pre>$ docker push &lt;username&gt;/prometheus-demo-node:latest</pre><p>5. Verify that the image is available:</p><pre>$ docker images</pre><h4>Deploying the Application</h4><p>Now that the application image is in the Docker Hub, you can deploy it to your cluster and run the application.</p><ol><li>Modify the $WORKDIR/node/golden_signals/prometheus-demo-node.yaml file to pull the image from Docker Hub:</li></ol><pre>spec:</pre><pre>  containers:</pre><pre>    - image: docker.io/&lt;Docker username&gt;/prometheus-demo-node:latest</pre><p>2. Deploy the Image:</p><pre>$ kubectl apply -f $WORKDIR/node/golden_signals/prometheus-demo-node.yaml</pre><p>3. Verify that the application is running:</p><pre>$ kubectl get pods</pre><p>The pod containing the application would be listed with a “Running” status</p><p>4. Expose the application using a load balancer:</p><pre>$ kubectl expose deployment prometheus-node-demo — type=LoadBalancer — name=prometheus-node-demo — port=8080</pre><p>5. Confirm that your service has an external IP address:</p><pre>$ kubectl get services</pre><p>The running services would be listed with their external IP addresses.</p><h4>Generate Load to Test Monitoring</h4><p>Now that the service is up and running, we would generate some load against it using Apache Bench.</p><ol><li>Get the IP address of your service as a variable:</li></ol><pre>$ export SERVICE_IP=$(kubectl get svc prometheus-demo-node -json | jq -r ‘.status.loadBalancer.ingress[].ip’)</pre><p>2. Generate some load. Run this on a separate terminal window.</p><pre>$ ab -c 3 -n 1000 <a href="http://${service_ip}:8080/">http://${SERVICE_IP}:8080/</a></pre><h4>Review Metrics</h4><p>While the load is running, access the Prometheus UI in the cluster again and confirm that the “golden signal” metrics are being collected.</p><ol><li>Establish a connection to Prometheus:</li></ol><pre>$ kubectl get pods -n prometheus</pre><pre>$ kubectl port-forward &lt;pod Name&gt; 8080:9090 -n prometheus</pre><p>2. Open <a href="http://localhost:8080/"><strong>http://localhost:8080</strong></a> in a browser:</p><p>3. Use this expression to measure the request rate: rate(node_requests[1m])</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*XqwINjf7tdn8ibHC" /></figure><p>Other expressions:</p><ul><li><strong>rate(node_failed_requests[1m])</strong>: For measuring error rate</li><li><strong>sum(rate(node_request_latency_bucket{le=”100&quot;}[1h])) / sum(rate(node_request_latency_count[1h]))</strong>: For measuring Latency Note: you should set up two buckets, 100ms and 400ms. This expression returns the percentage of requests that meet the service level objective(SLO)</li></ul><h4>Summary</h4><p>Congratulations! You’ve completed the tutorial and hopefully have a much better understanding of how Prometheus works with Kubernetes</p><p>Thanks for reading 💜</p><h3>Please leave me a comment if you find any typos or technical glitches! if you also have any thoughts on the topic, leave a comment — I am open to learning and knowledge explorations.</h3><p>You can also reach out to me on <a href="http://twitter.com/adegboroolugbe1">Twitter</a>.</p><p>Remember to drop a 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ebe9c08390a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monitoring Your Kubernetes Cluster With Prometheus — Part 1]]></title>
            <link>https://medium.com/@adegborog/monitoring-your-kubernetes-cluster-with-prometheus-part-1-4f22296fdc60?source=rss-947e7597af70------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f22296fdc60</guid>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[prometheus-training]]></category>
            <category><![CDATA[prometheus-school]]></category>
            <category><![CDATA[prometheus-operator]]></category>
            <dc:creator><![CDATA[Adegboro Gbenga]]></dc:creator>
            <pubDate>Sun, 19 Dec 2021 17:13:09 GMT</pubDate>
            <atom:updated>2021-12-19T17:13:09.887Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Prometheus is a powerful toolkit for signal monitoring on Kubernetes. This is a tutorial on how to get started.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hKBkmzCMnuJ17Je4" /><figcaption>Image by Penghao Xiong from <a href="https://unsplash.com/photos/6a9THz_pt7k">Unsplash</a></figcaption></figure><p>Prometheus is a leading open-source metric instrumentation, collection, and storage toolkit built at SoundCloud. Since it was developed, Prometheus has graduated from the Cloud Native Computing Foundation to become the de facto standard for Kubernetes monitoring. There are many articles on Prometheus, however, a lot of them don’t focus on how to use Prometheus with Kubernetes. This article:</p><ul><li>Provides a tutorial on how to get started with Prometheus</li><li>Provides a tutorial on setting Prometheus up in a Kubernetes cluster for metrics monitoring</li></ul><p>This tutorial assumes:</p><ul><li>You have kubectl installed and properly configured for access</li><li>You have the cluster-admin role (or at least sufficient privileges to create namespaces and deploy applications).</li><li>You are running a Bash-based command-line interface.</li></ul><p>If you’re ready now, let’s go.</p><p>For this tutorial, I would be using the “prometheus-demo” repository which can be found on Yuri Grinshteyn GitHub. This repo contains all the necessary files for this tutorial.</p><h4>Install Prometheus</h4><p>In this section, we would be cloning the simple repository and using the Kubernetes’ configuration files to deploy Prometheus to a dedicated namespace.</p><ol><li>Clone the prometheus-demo repository locally and use it as the working directory:</li></ol><pre>$ git clone <a href="https://github.com/yuriatgoogle/prometheus-demo.git">https://github.com/yuriatgoogle/prometheus-demo.git</a></pre><pre>$ cd prometheus-demo</pre><pre>$ WORKDIR=$(pwd)</pre><p>2. Create a dedicated namespace for the deployment:</p><pre>$ kubectl create namespace prometheus</pre><p>3. Give the cluster lead role to the namespace:</p><pre>$ kubectl apply -f $WORKDIR/kubernetes/clusterRole.yaml</pre><p>4. Create a Kubernetes config map with scraping and alerting rules:</p><pre>$ kubectl apply -f $WORKDIR/kubernetes/configMap.yaml -n prometheus</pre><p>5. Deploy Prometheus:</p><pre>$ kubectl create -f prometheus-deployment.yaml -n prometheus</pre><p>6. Validate that Prometheus is running:</p><pre>$ kubectl get pods -n prometheus</pre><p>Now we have prometheus installed we have access to some basic metrics</p><h4>Review Basic Metrics</h4><p>In this section, we would access the Prometheus UI and review the basic metrics being collected.</p><ol><li>Use port forwarding to enable web access to the Prometheus UI locally:</li></ol><pre>$ kubectl port-forward &lt;pod Name&gt; 8080:9090 -n prometheus</pre><p>2. Go to <a href="http://localhost:8080/">http://localhost:8080</a> in a browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*ijNEtFqNviCQXn9X" /></figure><p>You are now ready to query Prometheus metrics!</p><p>3. The basic machine metrics are available right away (like the number of CPU cores and memory). For example, enter machine_memory_bytes in the expression field, switch to the Graph view, and click Execute to see the metric charted.</p><p>Now you know how to install Prometheus and use it to measure some out-of-the-box metrics.</p><p>Next is learning how to use it for real monitoring, check my next post for that.</p><p>Thanks for reading 💜</p><h3>Please leave me a comment if you find any typos or technical glitches! if you also have any thoughts on the topic, leave a comment — I am open to learning and knowledge explorations.</h3><p>You can also reach out to me on <a href="http://twitter.com/adegboroolugbe1">Twitter</a>.</p><p>Remember to drop a 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f22296fdc60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes for Beginners: Basics, Features, Architecture Part II]]></title>
            <link>https://medium.com/@adegborog/kubernetes-for-beginners-basics-features-architecture-part-ii-812ef17a9c9e?source=rss-947e7597af70------2</link>
            <guid isPermaLink="false">https://medium.com/p/812ef17a9c9e</guid>
            <category><![CDATA[configuration-management]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[minikube]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[devops-tool]]></category>
            <dc:creator><![CDATA[Adegboro Gbenga]]></dc:creator>
            <pubDate>Sat, 11 Dec 2021 13:44:39 GMT</pubDate>
            <atom:updated>2021-12-11T13:44:39.532Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*CA0geFp7LM49zVqy" /><figcaption>Image form <a href="https://www.appvia.io/blog/components-of-kubernetes-architecture">Appvia</a></figcaption></figure><p>I have spoken about the basics of Kubernetes a.k.a K8s in my previous post, if you are interested in that, click <a href="https://link.medium.com/67LfGwGYTlb">here</a>.</p><p>As more and more organizations are moving to microservice and cloud-native architectures, Kubernetes is quickly becoming the new standard for deploying and managing software in the cloud. With all the power Kubernetes provides, however, comes a steep learning curve. As a newbie, trying to parse the official documentation can be overwhelming. There are many different pieces that make up the system, and it can be hard to tell which ones are relevant for the use case. This blog post will provide a simplified and high-level overview of the most important components and how they fit together.</p><h4>Pods</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9lE5v639TxTK6uKa" /></figure><p>Unlike other containerized systems, <strong>Kubernetes doesn’t run containers directly</strong>; instead, it wraps one or more containers into a higher-level structure called a pod, and this is where the workload is run. All containers in the same pod share same resources and local network, hence making communication between them possible while still maintaining a degree of isolation.</p><p>Pods are used as the unit of replication in Kubernetes. If your application becomes too popular and a single pod instance can’t carry the load, Kubernetes can be configured to deploy new replicas of your pod to the cluster as necessary. Even when not under heavy load, it is standard to have multiple copies of a pod running at any time in a production system to allow load balancing and failure resistance.</p><h4>Node</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TNtVWI6QGw2oP6aF" /></figure><p>Kubernetes works by running Pods on something called the Node. It is a representation of a single machine. In most production systems, a node will likely be either a physical machine in a data center or a virtual machine hosted on a cloud provider like AWS. There are two distinct classifications of a node within Kubernetes: Master and Worker nodes.</p><h4>Cluster</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fW9foP-W8i8y3QpY" /></figure><p>Although working with individual nodes can be useful, it’s not the Kubernetes way. Rather, Kubernetes works with something called “a cluster” which is a collection of nodes. instead of worrying about the state of individual nodes, you should see the cluster as a whole.</p><p>In Kubernetes, nodes pool together their resources to form a more powerful machine. So when you deploy programs onto the cluster, it intelligently handles distributing work to the individual nodes for you. If any nodes are added or removed, the cluster will shift around work as necessary. It shouldn’t matter to the program, or the programmer, which individual machines are actually running the code.</p><h4>Deployment</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QvNaig01iWyiNHAp" /></figure><p>Although pods are the basic unit of computation in Kubernetes, they are not typically directly launched on a cluster. Instead, pods are usually managed by one more layer of abstraction: the deployment.</p><p>A deployment’s primary purpose is to declare how many replicas of a pod should be running at a time. When a deployment is added to the cluster, it will automatically spin up the requested number of pods, and then monitor them. If a pod dies, the deployment will automatically re-create it.</p><p>Using a deployment, you don’t have to deal with pods manually. You can just declare the desired state of the system, and it will be managed for you automatically.</p><h4>What’s Next</h4><p>What’s described above is an oversimplified version of Kubernetes, but it should give you a very basic understanding of its components and how it works. Next is to experiment with Kubernetes locally, I would be taking you through that in my next post. Watch out for it</p><p>Thanks for reading 💜</p><h3>Please leave me a comment if you find any typos or technical glitches! if you also have any thoughts on the topic, leave a comment — I am open to learning and knowledge explorations.</h3><p>You can also reach out to me on <a href="http://twitter.com/adegboroolugbe1">Twitter</a>.</p><p>Remember to drop a 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=812ef17a9c9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes for Beginners: Basics, Features, Architecture Part I]]></title>
            <link>https://medium.com/@adegborog/kubernetes-for-beginners-basics-features-architecture-part-i-9c6fee97a717?source=rss-947e7597af70------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c6fee97a717</guid>
            <category><![CDATA[configuration-management]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[minikube]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Adegboro Gbenga]]></dc:creator>
            <pubDate>Sat, 11 Dec 2021 13:42:25 GMT</pubDate>
            <atom:updated>2021-12-11T13:42:25.581Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>What is Kubernetes and why the buzz?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/0*0Z8QR3zPvAu4juzv" /><figcaption>Image from <a href="https://www.onixnet.com/insights/kubernetes-101-breaking-down-a-kubernetes-deployment">Onixnet</a></figcaption></figure><p>Container-based microservices architectures have immensely changed the way development and operations teams test and deploy modern software. Containers help companies modernize by making it easier to scale and deploy applications, but it also introduces new challenges and more complexity by creating an entirely new infrastructure ecosystem.</p><p>Large and small software companies alike are now deploying thousands of container instances daily, and that’s a complexity of scale they have to manage. So how do they do it?</p><p><strong>Enter the age of Kubernetes</strong>.</p><p>Kubernetes A.K.A K8s, is an open-source system of automating deployment, scaling, and managing containerized applications. Kubernetes makes it easy to deploy and operate applications in a microservice architecture; It does this by creating an abstraction layer on top of a group of hosts, so that development teams can deploy their applications and let Kubernetes manage the following activities:</p><ul><li>Controlling resource consumption by application</li><li>Evenly spreading application load across a host infrastructure</li><li>Automatically load balancing requests across the different instances of an application</li><li>Monitoring resource consumption and resource limits to automatically stop applications from consuming too many resources and restarting the applications again</li><li>Moving an application instance from one host to another if there is a shortage of resources in a host, or if the host dies</li><li>Automatically leveraging additional resources made available when a new host is added to the cluster</li><li>Easily performing seamless deployments and rollbacks</li></ul><h4>Pros of Kubernetes</h4><ol><li><strong>Using Kubernetes and its Huge Ecosystem Improves Productivity</strong></li></ol><p>If Kubernetes is properly implemented into a workflow. The abundance of tools available in the ecosystem shortens release cycles drastically, professionalizes workflows and eventually improves the software quality from development to production. Of course, this huge selection of technologies also helps for better customization. As an additional bonus, most of the tools in the k8s ecosystem are open-source and free to use.</p><p><strong>2. Kubernetes Improves Applications Stability</strong></p><p>Using Kubernetes improves application stability. For example, it allows for seamless change of software or update without downtime. It is further possible to set up Kubernetes in a way that it supports high availability applications and if you are using the public cloud services of major vendors, you can be pretty sure to reach a very high uptime.</p><p><strong>3. Kubernetes and a Cloud-native Tech Stack Attracts Talent</strong></p><p>Many software engineers want to work in companies that use modern and interesting technologies. Kubernetes is definitively one of them being ranked as the 3rd most wanted platforms in the Stack Overflow Developer Survey 2019. Combined with other cloud-native tools, technology stack and processes, it will be very attractive for potential applicants. This advantage of Kubernetes is often overlooked, but given the shortage of tech talent, it can be of great benefit to organizations.</p><p><strong>4. Kubernetes is a Future Proof Solution</strong></p><p>Kubernetes solution would be feasible for a very long time for several reasons:</p><ul><li>All major cloud vendors are supporting Kubernetes providing out-of-the-box solutions for it.</li><li>And of course: The Kubernetes ecosystem is growing incredibly fast and new products supporting different needs on top of the Kubernetes platform are being released every day.</li></ul><h4>Drawbacks of Kubernetes</h4><p>While all the above advantages sound pretty attractive, K8s still have some drawbacks. So let’s take a look at some of the main disadvantages of Kubernetes for businesses next.</p><ol><li><strong>Kubernetes Can be an Overkill for Simple Applications</strong></li></ol><p>Kubernetes is a complex but powerful technology that allows you to run software in a cloud environment at a massive scale pretty efficiently. However, if you do not intend to develop anything complex for a large or distributed audience (so, you are not building a worldwide online shop with thousands of customers for example) or with high computing resource needs (e.g. machine learning applications), there is not much benefit for you for the technical power of k8s. Let’s say you just want to develop a website showing the opening hours and location of a business. Then you should not use Kubernetes because this is not what it was made for. However, one cannot generally say that every machine learning software should run with Kubernetes and no simple website should. It is just way more likely that it will be beneficial in the first case than in the other one.</p><p><strong>2. Kubernetes is Very Complex and Can Reduce Productivity</strong></p><p>Kubernetes is infamously known for its complexity. Especially for developers not familiar with infrastructure technologies, it can be very hard to get used to the Kubernetes development workflow. However, if you want to practice the DevOps approach, developers need to get access to and deploy to Kubernetes as early as possible during the development lifecycle, so they can test their code quickly and early on to prevent costly mistakes later on in production.</p><p><strong>3. The Transition to Kubernetes Can be cumbersome</strong></p><p>The adoption of K8s by organizations with existing software that doesn’t use the containerization technology can be challenging at the same time overwhelming, as this would require a full change of the working system. Even with experienced engineers, several problems can still be encountered, making the whole process very complex.</p><p><strong>4. Security is Not Very Effective</strong></p><p>Kubernetes doesn’t offer the ability to protect applications from vulnerabilities. Hence, most organizations using K8s utilize third-party or additional tools to ensure their system is properly secured</p><p>In this article, I have explained Kubernetes, it’s advantages and disadvantages and in my next post I will take you through how it works. Check out my next post if you are interested in that.</p><p>Thanks for reading 💜</p><h3>Please leave me a comment if you find any typos or technical glitches! if you also have any thoughts on the topic, leave a comment — I am open to learning and knowledge explorations.</h3><p>You can also reach out to me on <a href="http://twitter.com/adegboroolugbe1">Twitter</a>.</p><p>Remember to drop a 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c6fee97a717" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Docker Compose]]></title>
            <link>https://medium.com/@adegborog/introduction-to-docker-compose-d1c597c9b27?source=rss-947e7597af70------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1c597c9b27</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[orchestration]]></category>
            <dc:creator><![CDATA[Adegboro Gbenga]]></dc:creator>
            <pubDate>Fri, 03 Dec 2021 18:21:52 GMT</pubDate>
            <atom:updated>2021-12-03T18:21:52.536Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*shlBXJW-jvcPdaWW" /><figcaption>Image by Kazuo Ota from <a href="https://unsplash.com/photos/ohXrVLI1MLw">Unsplash</a></figcaption></figure><p>Docker Compose is an advanced Docker tool used to define and run multi-container applications. With Compose, you use a YAML file to create and configure application’s services. Think of it as an automated multi-container workflow. Compose is an excellent tool for development, testing, CI workflows, and staging environments. If you are new to docker, I would advise you to read my other <a href="https://link.medium.com/Uvn8G0f1Glb">article</a> before coming over to this for better understanding.</p><h4>How to Install and Use Docker Compose</h4><p>Compose uses the Docker Engine, so you’ll not need to install anything extra if you have docker on your device.</p><p>Using Docker Compose is a three-step process:</p><ul><li>Build the component images using their Dockerfiles, or pull them from a registry.</li><li>Define all of the component services in a docker-compose.yml file.</li><li>Run them together using the docker-compose CLI.</li></ul><p>Docker Compose isn’t another kind of Dockerfile. You will still need to build and publish your Docker containers using a Dockerfile. But, instead of running them directly, you run them using docker-compose</p><h4>Docker Compose File Structure</h4><p>Now that you know how to use Docker Compose, you need to understand how the Compose file works. It’s actually simpler than it seems. In short, Docker Compose files work by applying multiple commands that are declared within a single docker-compose.yml configuration file. So if you are familiar with YAML this should be a work in the park, if not click here to check out my YAML tutorial</p><p>The basic structure of a Docker Compose YAML file looks like this:</p><pre>version: ‘X’</pre><pre>services:&#39;X&#39;</pre><pre>    service1:</pre><pre>        build: .</pre><pre>        ports:</pre><pre>            - “5000:5000”</pre><pre>        volumes:</pre><pre>            - . :/code</pre><pre>    sevice2:</pre><pre>        image: &lt;name of image&gt;</pre><ul><li><strong>version ‘X’:</strong> This denotes that you are using version X of Docker Compose, and Docker will provide the appropriate features for that version. At the time of writing this article, version 3.8 is the latest.</li><li><strong>services:</strong> This section defines all the different containers which would be created. In the example, I have two services, service1 and service2.</li><li><strong>service 1&amp;2:</strong> These are the names of each service. Docker Compose will create containers with the name provided.</li><li><strong>build:</strong> If the image for the service isn’t created yet the build command is used and the location of the dockerfile for the build is stated. As I said earlier, docker-compose isn’t a replacement for a dockerfile.</li><li><strong>ports:</strong> This is used for port mapping. It’s like the -p argument if you are familiar with Docker, the first represents the port for the host while the second represents the port for the Container.</li><li><strong>volumes:</strong> This is just like the -v option for mounting disks in Docker. In the example, I attach the code files directory to the containers’ ./code directory. By doing this, you won’t lose your volumes if the server goes down.</li><li><strong>links:</strong> This is used to link interdependent services so they would be able to communicate with each other. For the bridge network, you must specify which container should be accessible to which container using links.</li><li><strong>image:</strong> This is used instead of the build command stated above if the image you want to use is already built.</li><li><strong>environment:</strong> This clause allows you to set up an environment variable in the container. This is the same as the -e argument in Docker when running a container.</li></ul><h4>Docker Compose Commands</h4><p>Now that you know how to create a docker-compose file, I will take you over the most common Docker Compose commands that you can use. Keep in mind that I would only discuss the most frequently-used commands.</p><ul><li>Docker-compose: Every Compose command starts with this command. You can also use docker-compose &lt;command&gt; — help to provide additional information about arguments and implementation details.</li></ul><pre>$ docker-compose &lt;&gt;</pre><ul><li>Docker-compose Build: This command builds images from the docker-compose.yml file. The job of the build command is to get the images ready to create containers, so if a service is using the prebuilt image, it will skip this.</li></ul><pre>$ docker-compose build &lt;working directory path&gt;</pre><ul><li>Docker-compose Images: This command will list the images you’ve built using the current docker-compose file.</li></ul><pre>$ docker-compose images</pre><ul><li>Docker-compose Stop: This command stops the running containers of specified services.</li></ul><pre>$ docker-compose stop</pre><ul><li>Docker-compose Run: This is similar to the docker run command. It will create containers from images built for the services mentioned in the compose file.</li></ul><pre>$ docker-compose run</pre><ul><li>Docker-compose Up: This command does the work of the docker-compose build and docker-compose run commands. It builds the images if they are not located locally and starts the containers. If images are already built, it will fork the container directly.</li></ul><pre>$ docker-compose up</pre><ul><li>Docker-compose List: This command list all the containers in the current docker-compose file.</li></ul><pre>$ docker-compose ps</pre><ul><li>Docker-compose Down: This command is similar to the docker system prune command. However, in Compose, it stops all the services and cleans up the containers, networks, and images.</li></ul><pre>$ docker-compose down</pre><p>Congrats! Now you know how to write a Docker Compose file and some of its basic commands.</p><p>Go and familiarize yourself with compose and all it has to offer.</p><h4>What to learn next</h4><p>There’s still a lot to explore and learn to be a true Docker Compose master. Once you are comfortable making docker-compose files and working with those basic commands, you can move on to the following advancements:</p><ul><li>Working with multiple Dockerfiles in Compose (common for microservices)</li><li>Docker Compose environment variables (.env files)</li><li>Docker Swarm (for scaling and monitoring clusters)</li><li>Automated deployments with Docker Stack</li><li>and more</li></ul><p>Thanks for reading 💜</p><h3>Please leave me a comment if you find any typos or technical glitches! if you also have any thoughts on the topic, leave a comment — I am open to learning and knowledge explorations.</h3><p>You can also reach out to me on <a href="http://twitter.com/adegboroolugbe1">Twitter</a>.</p><p>Remember to drop a 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1c597c9b27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Docker in Application Development]]></title>
            <link>https://medium.com/@adegborog/using-docker-in-application-development-9f29a3be1d3?source=rss-947e7597af70------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f29a3be1d3</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker-compose]]></category>
            <dc:creator><![CDATA[Adegboro Gbenga]]></dc:creator>
            <pubDate>Fri, 03 Dec 2021 18:19:14 GMT</pubDate>
            <atom:updated>2021-12-03T18:19:14.591Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*zegt4kII_Aemxlc8" /><figcaption>Image by <a href="https://www.istockphoto.com/photo/forklift-driver-loading-goods-pallet-into-the-truck-container-freight-industry-gm1182359410-331977142">istockphoto</a></figcaption></figure><h4>What is Docker?</h4><p>Docker is simply an ecosystem that provides us with a set of services and tools to help in running and managing containers.</p><p>So, what are containers?</p><p>According to <strong>docker.com</strong>, “A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another”.</p><p>What this means is that a Docker container provides you with a package packed with your app, libraries, binaries, and settings so that it can independently run on any system isolated from the host OS. With the brief introduction understood, I would take you through a simple task</p><h4>Aim</h4><p>This task aims to make you better understand Docker and its role in app development and management.</p><h4>Task</h4><p>The task is to run a simple python app in a Docker container. This would be achieved through a series of steps which I will take you through. If you have Docker installed on your device, I would advise you to follow along.</p><p><strong>Step 1: Creating the Necessary Files and Folders</strong></p><p>Open your terminal and create a Folder named docker_tutorial, using the mkdir command. Inside the Folder, create another Folder called docker_webclock, this would be our working directory. Inside the working directory, create a file named dockerfile.</p><p><strong>Step 2: Creating a simple python script</strong></p><p>I already have a simple python app app.py, which displays the time on a web browser so I would not be creating one. Click <a href="https://github.com/Vanzz01/Web-Clock/blob/master/app.py">here</a> to download it from my online repository.</p><p>After doing that, copy it into the working directory.</p><p><strong>Step 3: Creating the Docker file</strong></p><pre>#Deriving a base image</pre><pre>FROM python: 3:6-alpine</pre><pre><br>#Installing the app requirements</pre><pre>RUN sudo yum update</pre><pre>RUN sudo install -y python python-pip</pre><pre>RUN pip install flask</pre><pre><br>#Any working directory can be chosen as per choice like ‘/’ or ‘/home’ etc, I chose /usr/app/src</pre><pre>WORKDIR /usr/app/src</pre><pre><br>#Coping the app from working directory to container</pre><pre>COPY app.py ./</pre><pre># Now the structure will look like this ‘/usr/app/src/app.py’</pre><pre><br>#For running the application within the container</pre><pre>CMD [“python”, “app.py”]</pre><p>Copy and paste the above code in the previously created dockerfile. The dockerfile is a file that contains all the instructions Docker would use to build up the image for the container. Instructions like the base image from which the new image would be contrived, the application requirements, port mapping, variables, and so on.</p><p><strong>Step 4: Building the Docker Container</strong></p><p>After you have created both the Python script and the Dockerfile, you will then use the Docker build command to build the Docker Image.</p><pre>$ docker build . -t python:0.0.1</pre><p>Here -t was used to add a tag so you can identify the image easily.</p><p><strong>Step 5: Verifying the Image Build</strong></p><p>After building the Docker Image, you can list all the Images to check if the build was successful.</p><pre>$ docker images</pre><p>If you find an image with the tag “python:0.01” that means the build was successful.</p><p><strong>Step 6: Running the Docker Container</strong></p><p>Now, you can use the Docker run command to run your Docker Container from the build image.</p><pre>docker run python:0.0.1</pre><p>After running it, go to your browser and enter localhost:80 and the time would be displayed</p><p>With this task completed, you should be able to run any simple app using docker. To learn more about docker check my next post.</p><p>Thanks for reading 💜</p><h3>Please leave me a comment if you find any typos or technical glitches! if you also have any thoughts on the topic, leave a comment — I am open to learning and knowledge explorations.</h3><p>You can also reach out to me on <a href="http://twitter.com/adegboroolugbe1">Twitter</a>.</p><p>Remember to drop a 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f29a3be1d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terraform: The Holy Grail of IaC]]></title>
            <link>https://medium.com/@adegborog/terraform-the-holy-grail-of-iac-228b608ce6?source=rss-947e7597af70------2</link>
            <guid isPermaLink="false">https://medium.com/p/228b608ce6</guid>
            <category><![CDATA[script]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[configuration-management]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Adegboro Gbenga]]></dc:creator>
            <pubDate>Tue, 30 Nov 2021 17:06:20 GMT</pubDate>
            <atom:updated>2021-11-30T17:06:20.766Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hD7vuuVeVx1fAG4oG_vrEw@2x.jpeg" /><figcaption>Image by Josh Applegate from <a href="https://unsplash.com/photos/AkKRBN1KHL4">Unsplash</a></figcaption></figure><p>I got into DevOps not too long ago and Terraform is an important tool I learned on my journey. So rather than do a write-up on what I think the best practice is or should be, I thought it would be better to share some of the lessons I learned along my journey and some of the things I wish I had known earlier on.</p><h4>Never Repeat Yourself</h4><p>There’s a principle in software development called DRY which stands for Don’t Repeat Yourself which holds up in Terraform too.</p><p>When you are just starting you might find yourself falling into the trap of copy and pasting code to create several resources. This is to be avoided as it makes maintenance of code difficult.</p><p>This might sound intimidating if you are just starting, but as you get more experience or realize that you have specific business requirements (for example, maybe you don’t want anyone to ever be able to create a public S3 Bucket by accident using a registry module) you would be compelled to write modules to control that.</p><h4>Understanding the State File and What is Stored in it.</h4><p>The state file is where the current state and configuration of all the resources managed by terraform is stored and it is one of the most important components of your terraform pipeline, treat it as such. There are so many explanations on how state works and its importance but I would not be focusing on that, anyway…</p><p>We mostly have heard stories of people commit secrets (usernames and passwords) into source code, right? You can make the same mistake with terraform state file if you don’t understand the state file well and how it works. To avoid this you should not store configuration secrets in your .tf files at all.</p><blockquote>Even though you are being smart and generating the key pair for your instance using a module and storing it in an AWS secrets manager resource, the secret value will still be stored in plain text in the state file.</blockquote><h4>Use Separate Files for Your Environmental Variables</h4><p>The tactical solution that becomes permanent for operators that don’t do this, that 3 am ClickOps fix to get the server back online after it ran out of disk space. And then you’ve got configuration drift- where your development environment isn’t the same as your production because you did it in a hurry and configured resources differently.</p><p>You can avoid this problem by providing different variable files for each environment (dev, test, and prod) while keeping the core code that delivers your infrastructure exactly the same. If need be, changes can be made to the environment level .tfvars file which can then be applied using the appropriate syntax.</p><h4>Split Everything</h4><p>Splitting the Terraform state by Components will help you build all the different components for your infrastructure in isolation from each other. Why should you do this?</p><p>It allows you to be more flexible in the definition of your Infrastructure as it increases in complexity. Depending on the size and complexity of the project, keep in mind that it’s easier to group components once they are defined, rather than splitting them after you have already deployed your Infrastructure.</p><h4>Familiarize Yourself With Functions and Meta-arguments</h4><p>While Terraform works with a wide collection of providers, resources, and variables, how you blend them all together requires a lot more finesse than is advertised on the box. This can be because of the way that the vendor API returns a value, the order in which resources get created, or maybe the Terraform provider is still being developed, but be sure before too long you’ll find yourself scratching your head wondering why something won’t work.</p><p>Terraform has a pretty standard set of tools for managing object types (strings, lists, and so on) that you can use to massage inputs to be what you want them to be. Some of the best examples of how to do this sort of thing can be found in the public Terraform Registry. Several conditionals can be defined during creation and this would ensure that the exact resource you want is created</p><h4>Terraform is Just Another Tool</h4><p>This might seem like an odd point to round off with but bear with me. When I started using terraform I was new to infrastructure as code(IaC) and I thought this was the holy grail of IaC, the only tool that I would ever need when it comes to infrastructure provisioning and deployment in general. With experience, I soon understood that though terraform is a great tool for infrastructure provisioning when it came to the configuration of those resources created, tools like <a href="https://www.ansible.com/">Ansible</a> were probably better suited.</p><p>As a newbie to IaC especially Terraform you would see many articles paint terraform in that light but don’t be caught in the high of thinking it’s the only tool you would need in infrastructure providing and configuration management, you would need a lot more tools to build an ideal infrastructure</p><p>Thanks for reading 💜</p><h4>Please leave me a comment if you find any typos or technical glitches! if you also have any thoughts on the topic, leave a comment — I am open to learning and knowledge explorations.</h4><p>You can also reach out to me on <a href="https://twitter.com/adegboroolugbe1">Twitter</a>.</p><p>Remember to drop a 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=228b608ce6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terraform Tutorial: Infrastructure Provisioning on AWS]]></title>
            <link>https://medium.com/@adegborog/terraform-tutorial-infrastructure-provisioning-on-aws-a82d4b8f64cf?source=rss-947e7597af70------2</link>
            <guid isPermaLink="false">https://medium.com/p/a82d4b8f64cf</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[configuration]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Adegboro Gbenga]]></dc:creator>
            <pubDate>Mon, 22 Nov 2021 13:13:28 GMT</pubDate>
            <atom:updated>2021-11-27T20:09:05.947Z</atom:updated>
            <content:encoded><![CDATA[<p>Being able to perform automatic provisioning of infrastructure is becoming a must-have feature for teams that want to be able to automate their entire provisioning and deployment process. Tools like HashiCorp’s <a href="https://www.hashicorp.com/products/terraform">Terraform</a> can help teams in reaching this goal by providing the capability of writing IaC (Infrastructure as Code) to define, provision, and manage infrastructure. This makes the process of provisioning automatic, repeatable, and more reliable as compared to performing all the operations manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/0*kL2Mlt6UHR5JR4ps" /></figure><p>I will teach you how to use Terraform to create infrastructure. I will provision an Amazon Machine Image (AMI) on Amazon Web Services (AWS) in this tutorial since AMIs are widely used.</p><h4><strong>Requirements To Follow This Tutorial:</strong></h4><ul><li>An AWS account</li><li>The AWS CLI installed</li><li>Terraform installed</li></ul><p>With your account created and the CLI installed, to configure the AWS CLI type in the command below:</p><pre>$ aws configure</pre><p>1. Follow the prompts to input your AWS Access Key ID and Secret Access Key.</p><p>2. The configuration process creates a file at ~/.aws/credentials on macOS and Linux or %UserProfile%\.aws\credentials on Windows, where your credentials are stored.</p><p>Note: This tutorial will provide resources that qualify under the AWS free tier. If your account doesn’t qualify under the AWS free tier, I am not responsible for any charges that may be incurred by you.</p><h4><strong>Write Configuration</strong></h4><p>The set of files used to describe infrastructure in Terraform is known as a Terraform configuration. I will be showing you how to write a simple configuration to launch a single AWS EC2 instance</p><p>Each configuration should be in its own directory. Create a directory for the new configuration.</p><pre>$ mkdir learning-terraform</pre><p>Change into the directory.</p><pre>$ cd learning-terraform</pre><p>Create a file for the configuration code.</p><pre>$ touch main.tf</pre><p>Paste the configuration below into main.tf and save it. Terraform loads all files in the working directory that end in .tf so you can name it anything you like.</p><pre>provider “aws” {</pre><pre>    profile = “default”</pre><pre>    region = “us-east-1”</pre><pre>}</pre><pre>resource “aws_instance” “example” {</pre><pre>    ami = “ami-04902260ca3d33422”</pre><pre>    instance_type = “t2.micro”</pre><pre>}</pre><p>This is a complete configuration that Terraform is ready to apply. In the following sections, we’ll review each block of the configuration in more detail.</p><h4><strong>Providers</strong></h4><p>The provider block configures the named provider, in our case aws, which is responsible for creating and managing resources. A provider is a plugin that Terraform uses to translate the API interactions with the service.</p><p>The profile attribute in the provider block refers Terraform to the AWS credentials stored in the AWS Config File, which was created when we configured the AWS CLI. HashiCorp recommends that you never hard-code credentials into *.tf configuration files. We are explicitly defining the default AWS config profile here to illustrate how Terraform should access sensitive credentials.</p><p>Note: If you leave out your AWS credentials, Terraform will automatically search for saved API credentials (for example, in ~/.aws/credentials) or IAM instance profile credentials. This is cleaner when files are checked into source control or if there is more than one admin user.</p><p>The last attribute is to choose the region you want the instant to be launched. In my case, I chose “us-east-1”</p><h4><strong>Resources</strong></h4><p>The resource block defines a piece of infrastructure. A resource might be a physical component such as an EC2 instance, or it can be a logical resource such as a Heroku application.</p><p>The resource block has two strings before the block: the resource type and the resource name. In the example, the resource type is aws_instance and the name is example. The prefix of the type maps to the provider. In our case, “aws_instance” automatically tells Terraform that it is managed by the “aws” provider.</p><p>The arguments for the resource are within the resource block. The arguments could be things like machine sizes, disk image names, or VPC IDs. Our <a href="https://www.terraform.io/docs/language/providers/index.html">provider reference</a> documents the required and optional arguments for each resource provider. For ours, I’m going to specify Amazon Linux 2 using its AMI ID (ami-04902260ca3d33422) and request a t2.micro instance so we can be under the free tier.</p><h4><strong>Initialize The Directory</strong></h4><p>When you create a new configuration, you need to initialize the directory using the init command. Make sure you are in the “learning-terraform” directory and type in the following command</p><pre>$ terraform init</pre><blockquote>Terraform uses a plugin-based architecture to support hundreds of infrastructure and service providers. Initializing a configuration directory downloads and installs providers used in the configuration.</blockquote><p>Terraform downloads the AWS provider and installs it in a hidden subdirectory within the current working directory.</p><h4><strong>Create Infrastructure</strong></h4><p>In the same directory as the main.tf the file you created, run terraform apply. You should see an output similar to the one shown below, though I have truncated some of the output to save space.</p><pre>$ terraform apply</pre><pre>## … Output truncated …</pre><pre>An execution plan has been generated and is shown below.</pre><pre>Resource actions are indicated with the following symbols:</pre><pre>+ create</pre><pre>Terraform will perform the following actions:</pre><pre># aws_instance.example will be created</pre><pre>  + resource “aws_instance” “example” {</pre><pre>  + ami                         = “ami-04902260ca3d33422”</pre><pre>  + arn                         = (known after apply)</pre><pre>  + associate_public_ip_address = (known after apply)</pre><pre>  + availability_zone           = (known after apply)</pre><pre>  + cpu_core_count              = (known after apply)</pre><pre>  + cpu_threads_per_core        = (known after apply)</pre><pre>  + get_password_data           = false</pre><pre>  + host_id                     = (known after apply)</pre><pre>  + id                          = (known after apply)</pre><pre>  + instance_state              = (known after apply)</pre><pre>  + instance_type               = “t2.micro”</pre><pre>  + ipv6_address_count          = (known after apply)</pre><pre>  + ipv6_addresses              = (known after apply)</pre><pre>## … Output truncated …</pre><pre>Plan: 1 to add, 0 to change, 0 to destroy.</pre><p>This output shows the execution plan, describing which actions Terraform will take to change real infrastructure to match the configuration.</p><p>The output format is similar to the diff format generated by tools such as Git. The output has a + next to aws_instance.example, meaning that Terraform will create this resource. Beneath that, it shows the attributes of the soon to be created instance.</p><p>Terraform will now pause and wait for your approval before proceeding. If anything in the plan seems incorrect or dangerous, it is safe to abort here with no changes made to your infrastructure.</p><p>In this case, the plan is acceptable, so I will type yes at the confirmation prompt to proceed. Executing the plan will take a few minutes since Terraform waits for the EC2 instance to become available.</p><p>When it shows apply complete, the infrastructure has been created using Terraform! Visit the <a href="https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:sort=instanceId">EC2 console</a> to see the created EC2 instance. Make sure you’re looking at the same region that was configured in the provider configuration!</p><blockquote>When Terraform creates resources, it gathers a lot of information about it and stores them in a file called terraform.tfstate. These values can be useful for inspection and configuring other resources if required.</blockquote><blockquote>Terraform generates an execution plan describing what it will do to reach the desired state, and then executes it to build the described infrastructure. As the configuration changes, Terraform can determine what changed and create incremental execution plans which can be applied.</blockquote><p>Thanks for reading 💜</p><p><strong>Hire Me</strong></p><p>Looking for an engineer to build and automate your application infrastructure/architecture to work remotely? Get in touch: <a href="/service/mailto:adegborog@gmail.com">adegborog@gmail.com</a></p><h4>You can also reach out to me on <a href="http://twitter.com/adegboroolugbe1">Twitter</a>.</h4><p>Remember to drop a 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a82d4b8f64cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[YAML Tutorial: A Guide For Configuration Writers]]></title>
            <link>https://medium.com/@adegborog/yaml-tutorial-a-guide-for-configuration-writers-51eab9fb88dd?source=rss-947e7597af70------2</link>
            <guid isPermaLink="false">https://medium.com/p/51eab9fb88dd</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[yaml]]></category>
            <category><![CDATA[configuration]]></category>
            <dc:creator><![CDATA[Adegboro Gbenga]]></dc:creator>
            <pubDate>Mon, 15 Nov 2021 15:22:53 GMT</pubDate>
            <atom:updated>2021-11-27T20:10:00.277Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zRG75No24dAeK8Rq" /><figcaption>Image by Ferenc from <a href="https://unsplash.com/photos/An6M5zgFPj4">unsplash</a></figcaption></figure><p>Depending on whom you ask, YAML stands for YAML Ain’t Markup Language or Yet Another Markup Language (a recursive acronym). It’s a data serialization language that allows you to store complex data in a compact and readable format. YAML is important for DevOps and virtualization as it’s essential in making efficient data management systems and automation.</p><p>While often overlooked by developers, it’s a powerful and simple tool that can greatly improve your job prospects with just a couple of hours of learning.</p><p>YAML is similar to XML and JSON files but uses a more minimalist syntax, even while maintaining similar capabilities. It is commonly used to create configuration files in infrastructure-as-code (IoC) programs or to manage containers in the DevOps development pipeline.</p><h4><strong>YAML vs. JSON vs. XML</strong></h4><p><strong>YAML(.yml)</strong></p><ul><li>Human-readable code</li><li>Minimalist syntax</li><li>Solely designed for data</li><li>Similar inline style to JSON (is a superset of JSON)</li><li>Allows comments</li><li>Strings without quotation marks</li><li>Considered the “cleaner” JSON</li></ul><p>Use Case: YAML is best for data-heavy apps that use DevOps pipelines or VMs. It’s also helpful when the data would be used often by others and needs to be very readable.</p><p><strong>JSON</strong></p><ul><li>Harder to read</li><li>Explicit, strict syntax requirements</li><li>Similar inline style to YAML (some YAML parsers can read JSON files)</li><li>No comments</li><li>Strings require double quotes</li></ul><p>Use Case: JSON is favoured in web development as it’s best for serialization formats and transmitting data over HTTP connections.</p><p><strong>XML</strong></p><ul><li>Harder to read</li><li>More verbose</li><li>Acts as a markup language, while YAML is for data formatting</li><li>Contains more features than YAML, like tag attributes</li><li>More rigidly defined document schema</li></ul><p>Use Case: XML is best for complex projects that require fine control over validation, schema, and namespace. XML is not human-readable and requires more bandwidth and storage capacity, but offers unparalleled control.</p><h4><strong>YAML STRUCTURE</strong></h4><p>YAML has a few basic concepts that make up the majority of data.</p><p><strong>Key-value pairs</strong></p><p>Most things in a YAML file are a form of key-value pair where the key represents the pair’s name and the value represents the data linked to that name. Key-value pairs are the basis for all other YAML constructions.</p><pre>&lt;key&gt;: &lt;value&gt;</pre><p><strong>Scalars and Mapping</strong></p><p>Scalars represent a single stored value. Scalars are assigned to key names using mapping. You define a mapping with a name, colon, and space, and then a value for it to hold.</p><p>YAML supports common types like integer and floating-point numeric values, as well as non-numeric types Boolean and String.</p><pre>integer: 24</pre><pre>float: 24.0</pre><pre>boolean: Yes</pre><pre>String: “24”</pre><p><strong>String</strong></p><p>Strings are a collection of characters that represent a sentence or phrase. You either use | to print each string as a new line or &gt; to print it as a paragraph.</p><pre>string: Hello World</pre><pre>dataone: | These lines</pre><pre>           would be</pre><pre>           broken up</pre><pre>datatwo: &gt; This text</pre><pre>           would be wrapped</pre><p><strong>Sequence</strong></p><p>Sequences are data structures similar to a list or array that hold multiple values under the same key. They’re defined using a block or inline flow style.</p><p>Block style uses spaces to structure the document. It’s easier to read but is less compact compared to flow style.</p><pre>_ _ _</pre><pre># Shopping List Sequence in Block Style</pre><pre>shopping:</pre><pre>  - coffee</pre><pre>  - cigarettes</pre><pre>  - water</pre><p>Flow style allows you to write sequences inline using square brackets, similar to an array declaration in a programming language like Python or JavaScript.</p><p>Flow style is more compact but harder to read at a glance.</p><pre>_ _ _</pre><pre># Shopping List Sequence in Flow Style</pre><pre>shopping: [coffee, cigarettes, water]</pre><p><strong>Dictionaries</strong></p><p>Dictionaries are collections of key-value pairs all nested under the same subgroup. They’re helpful to divide data into logical categories for later use.</p><p>Dictionaries are defined like mappings in that you enter the dictionary name, a colon, and a space followed by one or more indented key-value pairs.</p><pre># An employee record</pre><pre>Employees:</pre><pre>  - kelly:</pre><pre>      name: Kelly Joe</pre><pre>      job: Developer</pre><pre>      team: DevOps</pre><pre>  - James:</pre><pre>      name: James Headie</pre><pre>      job: Project Manager</pre><pre>      team: Web</pre><p>Dictionaries can contain more complex structures as well, such as sequences. Nesting sequences is a good trick to represent complex relational data.</p><h4><strong>Further Reading</strong></h4><p>The content in this guide should be all you need to comfortably write a config file. YAML does support additional features, which you can read about on the <a href="https://yaml.org/spec/1.2.2/">official site</a> or the less intimidating (but less exhaustive) <a href="https://learnxinyminutes.com/docs/yaml/">Learn X in Y minutes</a>.</p><p>Thanks for reading 💜</p><h4>You can also reach out to me on <a href="http://twitter.com/adegboroolugbe1">Twitter</a>.</h4><p>Remember to drop a 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51eab9fb88dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevOps Implementation: Where To Start]]></title>
            <link>https://medium.com/@adegborog/devops-implementation-where-to-start-4ea412278128?source=rss-947e7597af70------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ea412278128</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[devops-practice]]></category>
            <dc:creator><![CDATA[Adegboro Gbenga]]></dc:creator>
            <pubDate>Mon, 15 Nov 2021 15:21:43 GMT</pubDate>
            <atom:updated>2021-11-27T20:14:00.403Z</atom:updated>
            <content:encoded><![CDATA[<p>Despite a large amount of info on DevOps, there’s still a lack of details on its implementation. I have an article on DevOps basics so if you are new to DevOps I recommend you read that first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gmN966hNQP5sP2Uh" /><figcaption>Image by Jason from <a href="https://unsplash.com/photos/6awfTPLGaCE">unsplash</a></figcaption></figure><p>In this article, I will show you the difference between the traditional software development and DevOps, further explaining how It can be adopted in your operations.</p><h4><strong>Traditional Software Development vs. DevOps</strong></h4><h4><strong>The Traditional Software Development</strong></h4><p>In the pre-DevOps era, you basically had separate departments responsible for developing, testing, and delivery. As a result, successful project delivery relied heavily on effective interdepartmental collaboration. That could be particularly difficult to achieve if some of the operations are outsourced to third-party vendors.</p><p>You used to have a single staging environment where all pre-release preparations took place. After deployment to production, merge conflicts were far more likely to appear, resulting in irregular and long release cycles with a high probability of post-production defects.</p><h4><strong>DevOps</strong></h4><p>In DevOps, all departments are responsible for the release procedure. This leads to an open collaboration culture, close interdepartmental ties, and better team spirit instead of an individual mindset. Dealing with third-party vendors can still be quite challenging; however, a relaxed environment tends to work more effectively than strict release guidelines and rules.</p><p>DevOps practice adoption ensures that you have a ready-to-go deployment build. All software changes are automatically merged, tested, and deployed to a production environment with fewer efforts required to coordinate various departments.</p><p>The Agile mindset is the cornerstone of DevOps practitioners. Scrum methodology allows more frequent product releases, including unplanned ones. All changes are versioned and can be implemented as you go.</p><h4>DevOps Implementation Roadmap</h4><p>Below is a step-by-step plan to smoothly shift from traditional software development to the DevOps approach.</p><p><strong>1. Organizing a DevOps Initiative</strong></p><p>A company’s CIO should organize a DevOps initiative as a part of the IT department program. Thus, making the IT department get an opportunity to make changes in the development and operations for the entire company. A CIO, in his turn, can arrange financial investments, human resources in the most optimal way. The program manager becomes responsible for designing the DevOps strategy and monitoring its implementation.</p><p><strong>2. Building The DevOps Strategy</strong></p><p>To draw up an effective DevOps strategy, a program manager should utilize best practices that will improve interdepartmental collaboration and enable the new ways of infrastructure provisioning, software development and testing. Among the most important practices are the following:</p><ul><li>Put the company’s development, testing, design, operations and other teams in a shared working DevOps environment, making all the members focus on the outcomes of the software development cycle and understand each other’s motives and duties. Set the common goal — to accelerate a software development cycle and ensure high quality of the software — for everyone involved in software development and operations.</li><li>Implement IaC to ensure the prompt provision of the IT infrastructure upon developers’ or test engineers’ requests, whenever they need it for creating a new build or checking its quality. This will allow DevOps practitioners to get new infrastructure for development or testing in one click, as well as avoid human errors that often result from the manual configuration of IT infrastructures.</li><li>Automate software building, unit testing, application testing via UI, software integrating, deploying, and releasing processes to speed up the software development-testing-releasing cycle.</li></ul><p><strong>3. Containerizing</strong></p><p>Containerization implemented with tools like Docker solves the problem of reliability with software, for example, when it travels from the development to the testing environment and then to production. Containers include everything required to run the application, i.e. all the dependencies, libraries, configuration files. The isolation of the containerized parts of the software from the overall IT infrastructure allows for stable running regardless of the environment that it’s put in. Moreover, since the pieces of application (its database, front end, etc.) are put into several containers, it is easier for an operations team to manage the application since they do not need to rebuild the entire software when the changes are required in one of its microservices.</p><p><strong>4. Integrating Infrastructure Automation With CI/CD Tools</strong></p><p>When software is put into containers, the containerized application needs to be managed properly. Such infrastructure automation tools as Kubernetes, Ansible, or Chef are integrated with CI/CD tools like Jenkins or Bamboo for more efficient configuration management and software deployment.</p><p>For example, Kubernetes — for large infrastructures — or Ansible — for smaller ones — allows managing containers for fault tolerance, monitoring their health and rolling software updates, and Jenkins is used to create, test and deploy new builds into Kubernetes.</p><p><strong>5. Increasing The Amount Of Test Automation and Aligning QA With Development</strong></p><p>To achieve faster delivery with DevOps, sufficient automated testing must be ensured. However, not each testing type must be automated. For instance, exploratory, usability, and security testing should still be performed manually. Depending on the efforts needed to write automated tests, functional testing may partially remain manual.</p><p>The development and testing activities are carried out in tandem to avoid post-release bugs. While the application is still in development, the best practice is to conduct automated tests 1–2 times a day. In case defects are found, developers work on stabilizing software before releasing the next build.</p><p><strong>6. Ensuring Total Application Performance Monitoring</strong></p><p>Application performance monitoring provides the DevOps-related teams with transparency over all the performance issues, e.g., slow response, memory leaks, runtime errors. The issues may be revealed during application server monitoring, user experience monitoring, etc.</p><p>Application performance monitoring allows detecting, prioritizing and isolating application defects before end users find them, as well as finding the root causes of the errors quickly with the use of special application monitoring software, such as Zabbix, Nagios, or Prometheus customized for monitoring a particular application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NpvZZ1bBznn4kVH6" /></figure><h4><strong>What Is The Takeaway?</strong></h4><p>Firstly, DevOps allows you to develop a culture and environment where collaboration is key. Cross-functional collaboration is at the core of DevOps and teams benefit greatly from such a work environment.</p><p>It doesn’t matter how many tools you use to automate your business processes — if they aren’t used with DevOps, they will be virtually useless. The principles and practices of DevOps do not solve tooling problems but rather human problems.</p><p>Product- and project-oriented teams replace function-based teams in order to develop and grow over themselves. By having a plan to reach a single aim, IT and software development teams become way more efficient.</p><p>Secondly, DevOps works closely with automation meaning that all of the business processes will become much easier once you adopt the practices of DevOps. Repetitive manual work is eliminated while repeatable processes are perfected.</p><p>For the teams who don’t have automation in place already, test and deploy automation are a great starting point. Everyone benefits from automatized systems that take care of developing, testing, and operating work.</p><p>Teams that are only starting out with automation can benefit from the practice of continuous delivery where you have to run each code change through some automated tests facilitated by cloud-based infrastructures. After that, successful builds are packaged up and promoted towards production by using automated deploys. It’s not quick or easy, but the ROI is totally worth it.</p><p>Lastly, DevOps allows you to embrace failure and improve continuously. It’s about being agile and keeping up with the ever-changing world. Taking opportunities when you come across them has never been so important.</p><p>DevOps also ensures that you have the right data to assess your performance and see whether you are really improving.</p><h4><strong>Final Thoughts</strong></h4><p>DevOps is gaining momentum, and it’s not too late to jump on that train.</p><p>Embracing DevOps means so much more than just changing a particular delivery pipeline. It’s the mindset that matters most. So I suggest starting your journey with the DevOps implementation roadmap today.</p><p>All in all, that might be too much to process all at once. Get in touch with me if you need some help with getting your head around it. Together, we’ll design the DevOps implementation strategy that will meet your needs.</p><p>Thanks for reading 💜</p><h4>You can also reach out to me on <a href="http://twitter.com/adegboroolugbe1">Twitter</a>.</h4><p>Remember to drop a 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ea412278128" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>