<?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 Daniel Okoye on Medium]]></title>
        <description><![CDATA[Stories by Daniel Okoye on Medium]]></description>
        <link>https://medium.com/@iamdokoye?source=rss-2aa5b0d05794------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2T6gBSLcqnV_lA1jut5N0A.jpeg</url>
            <title>Stories by Daniel Okoye on Medium</title>
            <link>https://medium.com/@iamdokoye?source=rss-2aa5b0d05794------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 13:58:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iamdokoye/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Deploy a Docker Container on Kubernetes Using Helm]]></title>
            <link>https://medium.com/@iamdokoye/how-to-deploy-a-docker-container-on-kubernetes-using-helm-71875aebb019?source=rss-2aa5b0d05794------2</link>
            <guid isPermaLink="false">https://medium.com/p/71875aebb019</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Daniel Okoye]]></dc:creator>
            <pubDate>Fri, 30 May 2025 05:26:04 GMT</pubDate>
            <atom:updated>2025-05-30T08:51:14.537Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HHmjk7EvbEtqvuVHnFdzSg.png" /></figure><p>Deploying Docker containers on Kubernetes has become a standard DevOps task — but it’s often easier said than done. Kubernetes YAML files can be repetitive and hard to maintain. That’s where <strong>Helm</strong>, the package manager for Kubernetes, comes in. Helm allows you to deploy applications using pre-configured templates called <strong>charts</strong>, which simplify complex deployments.</p><p>In this article, we’ll walk through deploying a Docker container to a Kubernetes cluster using Helm. We’ll cover setup and execution for <strong>Windows</strong>, <strong>macOS</strong>, and <strong>Linux</strong>, using the <strong>command line interface (CLI).</strong></p><h3>Prerequisites</h3><p>Regardless of your operating system, you’ll need:</p><ul><li>Docker installed and running</li><li>Kubernetes cluster (local or cloud)</li><li>Helm installed (v3+ recommended)</li><li>A basic understanding of YAML and Kubernetes concepts (pods, services, deployments)</li></ul><h3>Step 1: Setting Up the Environment</h3><h4>A. On macOS</h4><ul><li>Install Docker Desktop for Mac and enable Kubernetes via Docker Desktop</li><li>Install Helm with Homebrew</li></ul><pre>brew install helm</pre><ul><li>Verify Setup</li></ul><pre>kubectl version --client <br>helm version<br>docker version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KlqbXFHJTuB8HWocQktHiA.png" /><figcaption>My Laptop (Setup verification)</figcaption></figure><h4>B. On Windows</h4><ul><li><strong>Install Docker Desktop and e</strong>nable Kubernetes in Docker Desktop settings.</li><li>Install Helm</li></ul><pre># Using powershell or cmd<br><br>choco install kubernetes-helm</pre><ul><li>Verify Installation</li></ul><pre>kubectl version --client <br>helm version <br>docker version</pre><h4>C. On Linux</h4><ul><li>Install Docker</li></ul><pre>sudo apt update <br>sudo apt install docker.io <br>sudo systemctl start docker<br>sudo systemctl enable docker</pre><ul><li><strong>Install Minikube (for local Kubernetes)</strong></li></ul><pre>curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube <br>minikube start</pre><ul><li>Install Helm</li></ul><pre>curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash</pre><ul><li>Verify Everything</li></ul><pre>kubectl version --client <br>helm version<br>docker version</pre><h4>Step 2: Create a Docker Container</h4><p>Let’s use a simple <strong>Node.js app</strong> as an example.</p><p><strong>A. Dockerfile Example</strong></p><p>Create a folder myapp/ and add these files:</p><pre>#Dockerfile<br><br>FROM node:24.1.0-alpine<br>WORKDIR /app<br>COPY . .<br>RUN npm install<br>EXPOSE 3000<br>CMD [&quot;node&quot;, &quot;index.js&quot;]</pre><pre>#index.js<br><br>const express = require(&#39;express&#39;);<br>const app = express();<br>app.get(&#39;/&#39;, (req, res) =&gt; res.send(&#39;Hello from Docker + Helm!&#39;));<br>app.listen(3000, () =&gt; console.log(&#39;App running on port 3000&#39;));</pre><pre>#package.json<br><br>{<br>  &quot;name&quot;: &quot;docker-helm-app&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;main&quot;: &quot;index.js&quot;,<br>  &quot;dependencies&quot;: {<br>    &quot;express&quot;: &quot;^4.17.1&quot;<br>  }<br>}</pre><p><strong>B. Build the Docker Image in the Root Folder</strong></p><pre>docker build -t myapp:v1 .</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fSwOYkqvoAr-rba8S573RA.png" /><figcaption>Building the Image</figcaption></figure><p>If using Docker Desktop, use its GUI to <strong>Build Image</strong> and tag it myapp:v1.</p><p><strong>C. Push to a Registry(Optional for Minikube)</strong></p><p>You can use DockerHub or any other container registry.</p><pre>docker tag myapp:v1 yourdockerhub/myapp:v1<br>docker push yourdockerhub/myapp:v1</pre><p>If you haven’t logged in to dockerhub on your system, use the code below, then input your password:</p><pre>docker login -u &lt;username&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qUCCw7oJmh0Zbf2J50Zpkg.png" /><figcaption>Pushing to Registry</figcaption></figure><h4>Step 3: Create a Helm Chart</h4><p>Generate a new Helm chart:</p><pre>helm create myapp-chart</pre><p>This creates a folder structure:</p><pre>myapp-chart/<br>  charts/<br>  templates/<br>  values.yaml<br>  Chart.yaml</pre><h4>Step 4: Customize Helm Values</h4><p>Edit myapp-chart/values.yaml:</p><pre>image: #line 9<br>  repository: yourdockerhub/myapp <br>  tag: v1 <br>  pullPolicy: IfNotPresent<br><br>service: #line 53<br>  type: LoadBalancer<br>  port: 80</pre><p>Edit myapp-chart/templates/deployment.yaml if necessary to expose port 3000 internally:</p><pre>ports:<br>- containerPort: 3000 #line 45</pre><p>Edit service.yaml to forward port 80 to containerPort 3000:</p><pre>ports: #line 9<br>- port: 80<br>  targetPort: 3000<br>  protocol: TCP</pre><h4>Step 5: Deploy to Kubernetes with Helm</h4><p>Make sure Minkube is running(if using minikube). Then, from the chart directory:</p><pre>helm install myapp ./myapp-chart</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DKy_KSVaKFqZFXj4REMcTA.png" /><figcaption>Deploying to Kubernetes</figcaption></figure><p>To upgrade later:</p><pre>helm upgrade myapp ./myapp-chart</pre><p>To uninstall:</p><pre>helm uninstall myapp</pre><h4>Step 6: Verify Deployment</h4><p>Check pods and services</p><pre>kubectl get pods<br>kubectl get svc</pre><p>If using <strong>Minikube</strong>, get the service URL:</p><pre>minikube service myapp-myapp-chart</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iJ1uX795TkDV59sbWE8lvw.png" /><figcaption>Verifying Deployment</figcaption></figure><p>If using <strong>Docker Desktop</strong>, access via localhost:&lt;NodePort&gt; or check LoadBalancer IP under kubectl get svc.</p><h4>Troubleshooting Tips</h4><p>Here are some likely errors you may encounter and some tips on how to solve them.</p><ul><li>Image pull errors: Make sure the image is pushed to a reigstry accessible to your cluster.</li><li>Service not accessible: Use kubectl port-forward or ensure the type: LoadBalancer is working<a href="https://medium.com/social-science-weekly/the-1-minute-introduction-that-makes-people-remember-you-forever-497cefcfdccc?source=home_for_you---------1-98--------------------32fa0205_db24_4c34_8ae3_c70061c997ed-------15-------">(this may not work on Minikube)</a></li><li>Helm Installation fails: Use --debug --dry-run to simulate</li><li>Changes not reflected: Run helm upgrade instead of install again</li></ul><h3>Summary</h3><p>Using Helm to deploy Docker containers on Kubernetes drastically reduces the complexity of managing microservices. Helm gives you a reusable, configurable structure to scale your deployments regardless of which system or OS is being used.</p><p>With Helm, you no longer need to manually write repetitive YAML files. Instead, you focus on building your app , and Helm takes care of deploying, templating, upgrading, and rolling back.</p><p>If you’re new to Kubernetes, using Docker Desktop is a great way to get started with a graphical interface. For more advanced users, the CLI gives full control and scriptability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71875aebb019" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Secure AWS VPC Using Terraform Modules: A Simple Hands-On Guide]]></title>
            <link>https://medium.com/@iamdokoye/building-a-secure-aws-vpc-using-terraform-modules-a-simple-hands-on-guide-e6e0009776ba?source=rss-2aa5b0d05794------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6e0009776ba</guid>
            <category><![CDATA[vpc]]></category>
            <category><![CDATA[iac]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <dc:creator><![CDATA[Daniel Okoye]]></dc:creator>
            <pubDate>Wed, 21 May 2025 11:30:04 GMT</pubDate>
            <atom:updated>2025-05-21T11:30:04.312Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IV1R-QyidI61uMg8.png" /><figcaption>Photo from Wallpaper Safari</figcaption></figure><p>Today, businesses are using cloud computing more and more. This is because it helps them grow easily, offers flexibility, and saves money. Amazon Web Services (AWS) is a top cloud provider that offers many services for different needs.</p><p>A key part of AWS’s network is the Virtual Private Cloud (VPC). A VPC is a private section of the AWS cloud where you can set up your own virtual network and launch AWS services.</p><p>However, setting up a VPC by hand can take a lot of time and lead to mistakes, especially when you have many different setups (like for development, testing, and live systems). This is where Infrastructure as Code (IaC) helps. IaC lets you build and manage your computer systems using code. This makes the process faster, more consistent, and less likely to have errors.</p><p>Terraform, a free IaC tool, lets you set up both cloud and local systems using simple code. One of Terraform’s best features is its support for modules. Modules are like ready-made packages of Terraform code that you can use again and again for different projects. By using these reusable Terraform modules, you can make your VPC setups standard, follow best practices, and set things up much faster.</p><p>If you’re looking to set up a secure and reusable Virtual Private Cloud (VPC) on AWS using Terraform, this guide is for you. This will walk you through the steps to create a VPC with public and private subnets, using Terraform modules to keep things organized and reusable.</p><h4>Prerequisites</h4><p>Before we begin, ensure you have the following:</p><ul><li><strong>AWS Account</strong>: An active AWS account.</li><li><strong>AWS CLI</strong>: Installed and configured with your credentials.</li><li><strong>Terraform</strong>: Installed on your machine.</li></ul><p><em>This article assumes you’ve already set up your AWS CLI. If you haven’t, let me know in the comments and I’ll drop a guide on how to do that.</em></p><h4>Step 1: Set Up Your Project Directory</h4><p>Create a new directory for your Terraform project and navigate into it:</p><pre>mkdir my-aws-vpc<br>cd my-aws-vpc</pre><h4>Step 2: Define the AWS Provider</h4><p>Create a file named provider.tf to specify the AWS provider and region:</p><pre>provider &quot;aws&quot; {<br>  region = &quot;us-east-1&quot;  # Change to your desired region<br>}</pre><h4>Step 3: Use the Terraform AWS VPC Module</h4><p>We’ll use the official Terraform AWS VPC module to create our VPC. Create a file named main.tf:</p><pre>module &quot;vpc&quot; {<br>  source  = &quot;terraform-aws-modules/vpc/aws&quot;<br>  version = &quot;3.18.0&quot;<br><br>  name = &quot;my-vpc&quot;<br>  cidr = &quot;10.0.0.0/16&quot;<br><br>  azs             = [&quot;us-east-1a&quot;, &quot;us-east-1b&quot;]<br>  public_subnets  = [&quot;10.0.1.0/24&quot;, &quot;10.0.2.0/24&quot;]<br>  private_subnets = [&quot;10.0.101.0/24&quot;, &quot;10.0.102.0/24&quot;]<br><br>  enable_nat_gateway = true<br>  single_nat_gateway = true<br><br>  tags = {<br>    Terraform   = &quot;true&quot;<br>    Environment = &quot;dev&quot;<br>  }<br>}</pre><p>This configuration sets up:</p><ul><li>A VPC with CIDR block 10.0.0.0/16.</li><li>Two public subnets and two private subnets across two availability zones.</li><li>A NAT gateway to allow instances in private subnets to access the internet.</li></ul><h4>Step 4: Output VPC Information</h4><p>Create a file named outputs.tf to output useful information:</p><pre>output &quot;vpc_id&quot; {<br>  description = &quot;The ID of the VPC&quot;<br>  value       = module.vpc.vpc_id<br>}<br><br>output &quot;public_subnets&quot; {<br>  description = &quot;List of public subnet IDs&quot;<br>  value       = module.vpc.public_subnets<br>}<br><br>output &quot;private_subnets&quot; {<br>  description = &quot;List of private subnet IDs&quot;<br>  value       = module.vpc.private_subnets<br>}</pre><h4>Step 5: Initialize and Apply Terraform Configuration</h4><p>Run the following commands to initialize Terraform and apply the configuration:</p><pre>terraform init<br>terraform apply</pre><p>Terraform will prompt you to confirm the action. Type yes to proceed.</p><h4>Step 6: Verify the Resources</h4><p>After the apply completes, Terraform will output the VPC ID and subnet IDs. You can also log in to the AWS Management Console to verify that the VPC and subnets have been created as expected.</p><h4>Step 7: Clean Up Resources</h4><p>If you want to remove the resources you’ve created, run:</p><pre>terraform destroy</pre><p>Again, Terraform will prompt you to confirm. Type yes to proceed.</p><h4>Reusing the Module</h4><p>One of the advantages of using modules is reusability. You can use the same module to create different VPCs by changing the variable values. For example, to create a production VPC, you might have:</p><pre>module &quot;prod_vpc&quot; {<br>  source  = &quot;terraform-aws-modules/vpc/aws&quot;<br>  version = &quot;3.18.0&quot;<br><br>  name = &quot;prod-vpc&quot;<br>  cidr = &quot;10.1.0.0/16&quot;<br><br>  azs             = [&quot;us-east-1a&quot;, &quot;us-east-1b&quot;]<br>  public_subnets  = [&quot;10.1.1.0/24&quot;, &quot;10.1.2.0/24&quot;]<br>  private_subnets = [&quot;10.1.101.0/24&quot;, &quot;10.1.102.0/24&quot;]<br><br>  enable_nat_gateway = true<br>  single_nat_gateway = true<br><br>  tags = {<br>    Terraform   = &quot;true&quot;<br>    Environment = &quot;prod&quot;<br>  }<br>}</pre><p>This approach allows you to maintain consistency across environments and simplifies management.</p><h4>Security Considerations</h4><p>When building a secure VPC, remember to keep the following in mind:</p><ul><li><strong>Least Privilege</strong>: Assign the minimum necessary permissions to users and services.</li><li><strong>Secure State Files</strong>: Terraform state files can contain sensitive information. Store them securely, preferably in an encrypted S3 bucket with state locking via DynamoDB.</li><li><strong>Use VPC Endpoints</strong>: For services like S3 and DynamoDB, consider using VPC endpoints to keep traffic within the AWS network.</li><li><strong>Regular Auditing</strong>: Use AWS CloudTrail and Config to monitor changes and ensure compliance.</li></ul><p>By following this guide, you’ve set up a secure and reusable VPC on AWS using Terraform modules. This modular approach not only simplifies your infrastructure management but also promotes best practices in cloud architecture.</p><h4>So that’s that. Thanks for reading!❤️ Please leave a clap👏 and/or a comment if you have any thoughts about this topic. It will be very much appreciated. Catch you later.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6e0009776ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ansible]]></title>
            <link>https://medium.com/@iamdokoye/ansible-2f0842e3f057?source=rss-2aa5b0d05794------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f0842e3f057</guid>
            <dc:creator><![CDATA[Daniel Okoye]]></dc:creator>
            <pubDate>Thu, 13 Oct 2022 13:28:08 GMT</pubDate>
            <atom:updated>2022-10-13T14:08:20.051Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this article, we will discuss what Ansible is, different use cases of Ansible to make processes efficient and different components of Ansible like Ansible Playbook &amp; Modules.</h4><h4>Ansible</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*59w7QN_v30--uddjB6m2Wg.png" /><figcaption>Fig. 1: Image by Author</figcaption></figure><p>Ansible is a tool used for automating various IT tasks. Ansible is a suite of software tools that enables infrastructure as code. It is open-source and the suite includes software provisioning, configuration management, and application deployment functionality.</p><blockquote>Ansible is an open-source IT automation tool that automates provisioning, configuration management, application deployment, orchestration, and many other manual IT processes. It is a software tool that provides simple but powerful automation for cross-platform computer support.</blockquote><p>Now, what are examples of these manual tasks and why is it a good practice to automate them? When dealing with a complex IT infrastructure with lots of servers, some IT tasks become time-consuming and strenuous to perform manually. With a complex IT infrastructure, there will be lots of servers running the distributed application. <br>In such a scenario where a new application version is released, a user will need to deploy the new application on all the servers, or when the docker version on the server needs to be updated, a user will need to do it manually for all the servers when there are steps and processes to update it on just one server whereas there are lots of servers to update. Repetitive tasks are done by system administrators that often take hours to achieve and complete like backups, updates, system reboots, etc.</p><p>The manual approach to handling these tasks would be to SSH into the first server, handle the configuration in that server, then SSH into the next server and repeat until all the servers have been configured. Every time there is an upgrade, the process will repeat itself. If there are multiple steps involved in the configuration, it becomes very hard to remember the steps taken when configuring the server. Developers sometimes document all the things they configured or changed on the servers to deploy an application or the steps on how they installed a certain software so they can remember it when they need to configure it again on the server for another environment, but that is still stressful. How would we be able to automate these processes and save ourselves extra time and energy? We use Ansible.</p><p>Ansible makes all these scenarios more efficient and less time-consuming in four different ways:</p><ul><li><strong>Execute tasks from your local machine</strong>: Ansible makes it possible for you to execute tasks from your local machine without going to SSH remotely into the servers one by one.</li><li><strong>Steps can be written in a single YAML file</strong>: All the configuration, installation and deployment steps can be written in a single YAML file instead of using manual steps and shell scripts.</li><li><strong>Re-use the same file for different environments</strong>: Instead of doing everything from scratch again, a file can be used multiple times for the same task sequence if needed. You can use it on the same server when doing an upgrade for example, or on a different environment when you’re trying to create an identical environment for dev. staging and prod. environments.</li><li><strong>More reliable</strong>: Using Ansible to automate processes makes it more reliable and less likely to contain errors as humans make mistakes sometimes and are likely to forget certain things, it makes it less likely that errors will occur when configuring servers and deploying applications.</li></ul><p>As Ansible is now, whatever IT or system administration task you can imagine, from Operating System updates to Cloud provisioning, you can automate all of them with Ansible because it supports all Operating Systems and a lot of cloud providers and virtual cloud servers. The only thing you need to do to execute Ansible on the remote target server from your local machine is SSH access to each of the servers. This brings us to the next section of this article.</p><h4>Advantages of Ansible</h4><ul><li><strong>Ansible is agentless</strong>: One of the unique features of Ansible, when compared to its alternatives, is the fact that it is agentless. Normally, when you want to use a tool on a machine, you’d need to install an agent on the machine for that tool. However, there is no need to install any agent on the servers/machines when using Ansible, the only required place to install Ansible is your local machine. The machine would be able to manage a large number of target servers remotely(once SSH access has been granted).</li><li>There is no deployment effort: There is no deployment</li><li>No upgrade effort</li><li><strong>Ansible uses YAML</strong>: Ansible uses YAML which means it doesn’t require learning any specific language to use it. The <strong>modules</strong> are written in YAML.</li></ul><h4>Ansible Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*7IVnnjSg1OvHRW_bPgeWpg.jpeg" /><figcaption>Fig. 2: Image from — educba.com</figcaption></figure><p>Ansible works with modules, which are small programs that actually do the work. They get sent to the target server from the local machine, do their work and are removed after completion. A module does a small specific task like creating a file, installing NGINX server, starting NGINX server, etc.<br>Ansible has hundreds of modules that each execute a specific task which makes it possible to execute any IT task, (you can check the <a href="https://docs.ansible.com/ansible/2.9/modules/modules_by_category.html">Module Index</a> to see all the modules available on Ansible.) Modules are granular and specific so when handling complex applications and configurations, multiple modules are used and executed. These modules need to be arranged in a certain sequence and grouped together to represent the configuration or the steps to deploy an application. That’s where Ansible Playbook comes in.</p><h4>Ansible Playbook</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*7oD_SAA4YO74yYqO8TGacg.png" /><figcaption>Fig. 3</figcaption></figure><p>Modules arranged sequentially are grouped into tasks. Each task makes sure the module(PostgreSQL_table, in this instance) gets executed with certain arguments (table, rename, owner, truncate) and describes the task using the <em>name</em>. Fig. 3 shows different tasks using the PostgreSQL module, let’s look at Fig.4, running multiple modules in a sequence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*BjxewlS5k1UdOX6kIcZLhg.png" /><figcaption>Fig. 4</figcaption></figure><p>Fig.4 shows different modules executed in a sequence. The first module is a file module that creates a directory for NGINX, the second module is a yum module that installs NGINX, then a service module that starts NGINX once it has been installed, and this will get executed in this sequence. Now, all these tasks can be one configuration. When defining tasks, you also need to define where these tasks should be executed or on which target machines the tasks should be executed. This is done using the attribute called <em>hosts</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*BKx357k__8x7rHZa-ckiqw.png" /><figcaption>Fig. 5</figcaption></figure><p>The <em>hosts</em> attribute basically defines where the tasks should be executed and the <em>remote_user</em> defines and specifies the user that will execute those tasks. In fig. 5, the tasks will be executed in the databases host by the user <strong>root</strong>. YAML is a very simple language but it has very strict indentation as the indents in which each attritube is in is very important. A block like fig. 5 which contains a host, tasks, user is called a <strong>play</strong>. <br>In a single file, you can have multiple plays (for different purposes like database or webserver. Fig. 5 is a play for databases and fig. 4 with the <em>hosts</em> as webservers and a<em> remote_user</em> is a play for webservers.) which may depend on each other or which may need to be executed in a sequence. A file that contains one or multiple plays is known as a <strong>playbook</strong>. A playbook defines the sequence, the time, the target area and the modules to be executed for a particular function. A good practice when using playbooks would be to name your plays because it summarizes what the play is about and what it does. A question you might come across or ask yourself is; where does the value of the host come from? It comes from the Ansible Inventory.</p><h4>Ansible Inventory</h4><p>An inventory in Ansible is a file that contains all the machines involved in task executions. Running a playbook without an inventory requires several command-line flags. An inventory file helps to organize your managed nodes into groups with information like the SSH user. Using an inventory file, a single playbook can maintain hundreds of network devices with a single command. You can define the entries in a <em>hosts</em> file as IP adresses or hostnames.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*PrrlpIl5bOXfmH3NIFnGjQ.png" /><figcaption>Fig. 6</figcaption></figure><p>Buttressing on the point stated earlier, using this syntax( <strong>‘[]’</strong> ), as shown in Fig. 6. helps you to select multiple Ip addresses or hostnames as reference them as a group. So instead of writing each individual IP address when you need it, you can simply group them in the hosts&#39; file and reference it using the group name. The hosts&#39; names of the IP addresses could be of cloud, virtual or bare metal servers.</p><blockquote><em>If you have any contributions or questions about this topic, you can reach out to me on f you have any contributions or questions about this topic, you can reach out to me on </em><a href="http://twitter.com/CDOkoyee"><em>Twitter</em></a><em>.</em></blockquote><h3>So that’s that. Thanks for reading!❤️ Please leave a clap👏 and/or a comment if you have any thoughts about this topic. It will be very much appreciated. Catch you later.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f0842e3f057" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GitHub Actions Demo]]></title>
            <link>https://medium.com/@iamdokoye/github-actions-demo-3e73d4fa6582?source=rss-2aa5b0d05794------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e73d4fa6582</guid>
            <category><![CDATA[demo]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Daniel Okoye]]></dc:creator>
            <pubDate>Sat, 08 Oct 2022 12:04:34 GMT</pubDate>
            <atom:updated>2022-10-13T13:43:37.016Z</atom:updated>
            <content:encoded><![CDATA[<h4>In our last article, we looked at CI/CD with GitHub Actions, you can read the article <a href="https://medium.com/@CD_Okoye/ci-cd-github-actions-2e13db011932">here</a>. In this article, we will be looking at a demo of how to configure CI/CD using GitHub Actions.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*0-n7f0gjrvryJ4Y9qObuxQ.png" /><figcaption>Image by Author</figcaption></figure><h4>Creating a Repo</h4><ul><li>Let’s create a repo on GitHub and name it, <strong>my-project</strong>. I’m going to make this repo public.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*81aig7gcgVgM0O8-e63qUA.png" /><figcaption>Fig. 1 create a repo</figcaption></figure><ul><li>After creating the repo, there’s an <em>actions</em> tab at the top of the repo. Click the tab to integrate Actions with your repo.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-oawcc2fp-Z8hQjY4YlzHA.png" /><figcaption>Fig.2 Repo</figcaption></figure><p>On the Actions tab, there are a lot of templates already created and available by some developers which you will only need to implement in your code to be able to use them. Before we go into automation, we will pull code from this <a href="https://github.com/nanuchi/my-project">link</a> and push it to the new repo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9a97V_cPw4RawbEPxSnGSg.png" /><figcaption>Fig. 3</figcaption></figure><p>This is how the repo looks after pushing the code into it. Now, the next step is to click on the actions tab again so we can start automating processes. This is a Java app that uses Gradle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KKnP3-ExGyUC4gZJt-_k3w.png" /><figcaption>Fig. 4 Actions</figcaption></figure><p>These are various workflow templates for different use cases depending on the developer&#39;s intent. You don’t need to start writing your own workflow code from scratch as you can easily find a template that matches your need and use it instead. On the Actions page, there are four different main categories; deployment, continuous integration, automation and security.</p><ul><li>The next step is to select a <em>java with Gradle </em>template and click on configure.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zpZEL3I2n9Hs279N2QnTlw.png" /><figcaption>Fig. 5</figcaption></figure><p>This is what the file looks like, the configuration is created automatically in <strong>my-project</strong> in the repo and creates the path <em>“.github/workflows/gradle.yml”</em>. The file is written in YAML. When using a template, you might need to adjust a few things depending on your project but the major part of the template is already pre-configured and doesn’t need to be changed.</p><h4>Syntax of Workflow File</h4><p>Let’s look at the syntax of the workflow file in detail so we can understand how to write our own workflows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKoR7b48DdmTv-5MDwnGcA.png" /><figcaption>Fig. 6</figcaption></figure><p>The first section, <strong>name</strong>, is basically used to describe what the workflow is meant to do or what it is doing. The next section, <strong>on</strong>, is where events are defined to trigger a workflow whenever they are done. Anytime an event happens, a workflow will be triggered in response to that event. For instance, every time a push is sent to the master branch, the workflow below it will get triggered in response to that event. In this <a href="https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows">link</a>, you can see a detailed explanation and usage of all the events that trigger workflows.<br>The <strong>job(s)</strong> is the part that gets executed in response to an event or events. <em>“build”</em> is a name of a job that will be executed in response to an event. A job groups a set of actions that will be executed, which are defined in the <strong>steps</strong>. The <strong>uses</strong> define a particular action and select it. Let’s look at the first action.</p><p>Whenever an application is built or a test is run, we need to checkout the repo or code first. So how does it work? in the <em>actions</em> path, a pre-defined action code is stored. Basically, everybody that uses a CI/CD pipeline in GitHub Actions will need to use a checkout command. Instead of letting everybody write the code on their own, an action called <em>checkout</em> was created for everybody to use. If you go to the <a href="https://github.com/actions">Actions page</a>, you will see a list of repositories containing all the actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rIYWkQaZc1O0qQxljg1irQ.png" /><figcaption>Fig. 7 Repos containing actions</figcaption></figure><p>In this list of repos, there is a <strong><em>checkout</em></strong> repo. In that repo, there is an action.yml file that describes what <em>checkout</em> action does in the background as you can see below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*noE_eOLvw7mMpjZfOVQvhQ.png" /><figcaption>Fig. 8 Checkout repo</figcaption></figure><p>This is a logic already written by people so you don’t need to write it again as it is reusable and readily available. Each action will have documentation explaining the additional parameters you will need to configure. Using the <strong>uses</strong> attribute allows you to use any action that is made available by any community or team.<br>The next section in <strong>steps</strong> is <em>set-up java</em> action. This action prepares your environment with Java with the version defined below. Using GitHub Actions allows you to use this action without actually installing and configuring Java like you would have to do on Jenkins. <br>The next section talks about the <strong>run</strong> attribute. The difference between <strong>uses </strong>and <strong>run</strong> attributes is the former is used when referring to an action in a repo while to latter is used to run a command-line command. The first <strong>run</strong> attribute changes the Gradle file permissions, and the next attribute calls the Gradle build.</p><p>The actions execute in the same environment in the order in which they are written. Let’s execute the workflow in the project.</p><ul><li>Commit the YAML file in Fig. 5 and put it in a new branch.</li><li>Create a pull request to merge the branch to the main branch.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a5ljIw3IK_4Z3dgEgF_oaw.png" /><figcaption>Fig. 9</figcaption></figure><p>As you can see in Fig. 9, the workflow in our code got triggered because the event done now matched one of the events written in our code. To see the actual work happening in the background, click on details. In detail, you will see all the steps being executed in the background.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jDz9iVWXVwT5hgIQrPXAsA.png" /><figcaption>Fig. 10</figcaption></figure><p>Fig. 10 shows all the steps defined in Fig. 6. Setting up JDK, Building Gradle, etc. All these tasks were automated using GitHub Actions.</p><blockquote><em>If you have any contributions or questions about this topic, you can reach out to me on </em><a href="https://twitter.com/CDOkoyee"><em>Twitter</em></a><em>.</em></blockquote><h3>So that’s that. Thanks for reading!❤️ Please leave a clap👏 and/or a comment if you have any thoughts about this topic. It will be very much appreciated. Catch you later.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e73d4fa6582" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD: GitHub Actions]]></title>
            <link>https://medium.com/@iamdokoye/ci-cd-github-actions-2e13db011932?source=rss-2aa5b0d05794------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e13db011932</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Daniel Okoye]]></dc:creator>
            <pubDate>Fri, 30 Sep 2022 09:14:22 GMT</pubDate>
            <atom:updated>2022-10-13T13:44:14.941Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this article, we will discuss GitHub Actions, a CI/CD platform used for automation, testing, building and deploying.</h4><p>Before we discuss GitHub Actions, let’s briefly explain what CI/CD is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*RI_C1YFr2KDhKXkahCkzwA.png" /><figcaption>Image by — flagship.io</figcaption></figure><p>CI/CD refers to a set of development practices that enable the rapid and reliable delivery of code changes. It is a method to frequently deliver apps to customers by introducing automation into the stages of app development. The main concepts attributed to CI/CD are continuous integration, continuous delivery, and continuous deployment. For more explanation on this, you can refer to my article <a href="https://medium.com/@CD_Okoye/the-devops-series-2-becoming-a-successful-devops-practitioner-81d41ec610d0">here</a>. CI/CD is a method and a process, and this method needs a platform to run, GitHub Actions is one of such platforms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WL8RHta1Hs4xCOfdkKC9TA.png" /><figcaption>Image by Author</figcaption></figure><blockquote>GitHub Actions is <strong>a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline</strong>.</blockquote><p>GitHub Actions is a platform for automating development workflows like CI/CD pipelines. Let us see an illustration of how GitHub Actions can be used.</p><p>GitHub is an open-source platform for hosting code for versioning and collaboration. Developers who have developed their own libraries in some programming language, can host their projects on GitHub and make them publicly available so that the community can use and contribute to the libraries.<br>When the team managing the libraries gets new contributors or users create pull requests, they have a lot of organization tasks to manage in order to keep the library working or running. Let’s look at an example.</p><p><em>A developer named </em><strong><em>Alex </em></strong><em>creates a Web Scraper to extract content and data from a lot of websites in Python. It’s a Python library and Alex gets a few contributors to his library and some users. Naturally, whenever a user sees an update or a new release of that library has a bug or an error, they can create an issue that something is not working in the library. <br>Alex or one of the contributors has to check and sort out the issue. When the issue is resolved and a pull request is created to merge the fix into the next release of the library, Alex reviews the code to make sure the issue is not reproducible(it will not generate anymore), and he merges it to the master so users can upgrade the version where the issue is resolved. <br>After merging the pull request to the master branch, Alex will start a pipeline that will test the code and build an artefact, etc. and document a note that states what got added in the new version and so on and so forth.</em></p><p>These are all examples of workflows that Alex needs to do as a maintainer of such a library or repository. As this library gets bigger and bigger, with more contributors and users, the organization tasks will also get bigger with more issues and more pull requests which will be very time-consuming and stressful to handle and resolve. Alex as a developer needs to automate as much as possible so he can focus on programming and developing new features in the library. That’s where GitHub comes in.</p><p>If Alex is using GitHub Actions, every time an <strong>event</strong>(a pull request, an issue, a contributor joining the project etc.) happens in his repository, he can configure automatic actions that will be executed in response to those events. GitHub Apps, OAuth Apps, or anything that utilizes GitHub APIs or webhooks that have been integrated into GitHub can also produce such events that can be automatically responded to.<br>Now, Alex wants to automate a workflow. To do this, he listens to an event and depending on the event, a workflow should execute automatically. So, if a user creates an issue as an event, Alex may want to automatically sort, categorize or label that issue, or assign it to a respective contributor or to himself by default. <br>Each small task that is triggered on an event is a separate action, and the combination of different actions makes up a workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hRCleWQfrSys76KDHcJ0UA.png" /><figcaption>Image by — aws.amazon.com</figcaption></figure><h4>Advantages of Using CI/CD with GitHub Actions</h4><p>The most common workflow a developer will think of when building an application in a repo is a CI/CD pipeline. The process is quite simple; a developer commits code, the build starts, it tests the code and builds it into an artefact and pushes it into a storage, and then it deploys the application on a deployment server. That is; commit code, test, build, push, deploy.</p><ul><li><strong>Using the Same Platform:</strong> An advantage of using GitHub Actions is, a user does not need to set up another CI/CD tool if he uses GitHub to host his code. The same tool is used for hosting and creating a pipeline, there will be no need to manage each tool separately as it is integrated into the code repository.</li><li><strong>Ease of Use:</strong> Another advantage of using GitHub Actions is the ease of building a pipeline. GitHub Actions makes it easy to build a CI/CD pipeline which in turn makes the process of testing, building and deploying easy. Also, there is no need to have a separate developer that will be dedicated to setting up and managing the CI/CD pipeline in the project.</li><li><strong>Integration with different tools:</strong> In CI/CD pipelines, one of the most important things is integration with different tools when setting up a pipeline. There are many combinations of different that are used in the development process. For instance, A developer is developing a NodeJS app, which will be built into a Docker image, then pushed into a nexus repo and deployed on a DigitalOcean server, or a Java app with Maven, which will be built into a Docker image, then pushed to an AWS registry and deployed on AWS EKS. Normally, the tools would have to be installed with some plugins and configured to make the CI/CD pipeline work. GitHub Actions helps you bypass this process by letting you specify the environment you want to build your app in and the testing and deployment process.</li></ul><p>In our next article, we will be working on a demo of using GitHub Actions to set up a CI/CD Pipeline.</p><blockquote>If you have any contributions or questions about this topic, you can reach out to me on <a href="https://twitter.com/CDOkoyee">Twitter</a>.</blockquote><h3>So that’s that. Thanks for reading!❤️ Please leave a clap👏 and/or a comment if you have any thoughts about this topic. It will be very much appreciated. Catch you later.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e13db011932" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Service Mesh]]></title>
            <link>https://medium.com/@iamdokoye/service-mesh-f0a82afbcfb6?source=rss-2aa5b0d05794------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0a82afbcfb6</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[service-mesh]]></category>
            <dc:creator><![CDATA[Daniel Okoye]]></dc:creator>
            <pubDate>Thu, 22 Sep 2022 12:08:34 GMT</pubDate>
            <atom:updated>2022-10-13T13:44:40.700Z</atom:updated>
            <content:encoded><![CDATA[<h4>In this article, we will discuss what Service Mesh is. We will discuss the challenges of Microservice Architecture and how the features of Service Mesh solve those challenges.</h4><p>Before we discuss what Istio is, we need to understand what Service Mesh is.</p><h4>Service Mesh</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JtVHKCfEwNPw2ugx" /><figcaption>Photo by <a href="https://unsplash.com/@jjying?utm_source=medium&amp;utm_medium=referral">JJ Ying</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>A service mesh is a platform layer on top of the infrastructure layer that enables managed, observable, and secure communication between individual services</blockquote><p>It is a solution for managing communication between individual microservices in a microservice application. It is a way to control how different parts of an application share data with one another. Unlike other systems for managing this communication, a service mesh is a dedicated infrastructure layer built right into an app.<br>This begets the question: why do we need a dedicated tool to manage communication between microservices and what are the challenges that this tool will solve?</p><h4>Challenges of a Microservice Architecture</h4><p>Moving from monolith applications to microservice applications brought about a few challenges that were not present with monolith applications. In an online e-commerce application that is made up of several microservices, there is the web server that gets the UI request, the shopping cart, the product inventory, the Database, etc. and the microservice application is being deployed in a Kubernetes cluster. There are some configurations that are required to run the application successfully.</p><ul><li><strong>Communication</strong>: First, each microservice has its particular logic like the web server handling UI requests, the database handles data, etc. Services need to talk to each other. For instance, when a user puts a product in the shopping cart, a request is received by the web server, which hands it over to the shopping cart microservice, which will talk to the database to persist the data. Now, how do services know how to communicate with each other, and what is the endpoint of each service?<br>All the service endpoints that the web server interacts with must be configured for the web server microservice. This means that whenever a new microservice is added, the endpoint for that microservice must also be added and configured to all the microservices that need to interact with it. This information is added as part of the deployment code</li><li><strong>Security</strong>: Usually, a common environment will have firewall rules set up for the Kubernetes cluster and a proxy as an entrypoint that gets the request first so that the cluster can’t be accessed directly, this sets up security around the cluster. However, once a request gets inside the cluster, the communication is insecure. Microservices communicate with each other over an insecure protocol like HTTP, and there are no restrictions on the way services interact with each other.<br>Security-wise, if an attacker somehow gets inside the cluster, it can do anything because there’s no additional security measure inside.<br>An additional configuration must be added inside each application to secure communication between services inside the cluster. Using <strong>retry logic</strong> inside each microservice is also a good choice to make the whole application more robust. If the connection from a microservice is lost, a user will want to retry the connection again.</li><li><strong>Data</strong>: A developer may add <strong>metrics logic</strong> that monitors how the services are performing, what HTTP errors are in the system, the number of requests the microservices are receiving or sending and so on. Monitoring logic may be added also for Prometheus using a Prometheus client library and collecting tracing data using a tracing library.</li></ul><p>Teams of developers of each microservice need to add all the logic to each service and configure additional setup in the cluster to handle all these challenges in the application. This makes the developers work on the network logic for security and communication instead of working on the actual service logic thus adding complexity to the services instead of keeping them as simple and lightweight as possible.</p><h4>Features of a Service Mesh</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*9bfwziH6En4azfSs_jlhow.png" /><figcaption>Image by — weave.works</figcaption></figure><p>A Service Mesh extracts all the non-business logic out of the microservice and puts them into a small sidecar application that handles all the logic and acts as a proxy. This small application is a third-party application that the cluster can configure and operate easily through an API without figuring out how the logic is implemented. Using this, developers can focus on working on the actual business logic. <br>It is not necessary to add the sidecar application to your deployment YAML file because a service mesh has a control plane that automatically injects the proxy into every microservice pod. Now, the microservices interact with each other through the proxies.<br>Basically, a service mesh is the network layer for service-to-service communication consisting of the control plane and the proxies.</p><p>Another major feature of a service mesh is <strong>traffic split configuration</strong>. This is a configuration used to specify a percentage distribution of traffic across two or more of the versions within a service. For example, when changes are made to a particular microservice(for example, the payment service in our e-commerce app above)and a new version is built, tested and deployed to a production environment, there is still a possibility of a bug being present in the code that a user could not find during testing. If the microservice is not working, it may cost a lot of revenue to the company. A service mesh can be used to easily configure a webserver microservice that will direct a certain percentage of traffic to the new version of the payment service. This method is also known as <strong>Canary deployment</strong>.</p><p>Other features include;</p><ul><li>High availability and fault tolerance</li><li>High visibility</li><li>Secure communication</li></ul><blockquote>If you have any contributions or questions about this topic, you can reach out to me on <a href="https://twitter.com/CDOkoyee">Twitter</a>.</blockquote><h3>So that’s that. Thanks for reading!❤️ Please leave a clap👏 and/or a comment if you have any thoughts about this topic. It will be very much appreciated. Catch you later.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0a82afbcfb6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Kubernetes?]]></title>
            <link>https://medium.com/@iamdokoye/what-is-kubernetes-c9ce9cea156?source=rss-2aa5b0d05794------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9ce9cea156</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Daniel Okoye]]></dc:creator>
            <pubDate>Mon, 19 Sep 2022 16:28:58 GMT</pubDate>
            <atom:updated>2022-10-13T13:45:03.518Z</atom:updated>
            <content:encoded><![CDATA[<h4>Last week, we discussed Docker, Containers and Images. In this article, we will discuss Kubernetes, its basic architecture, the problem it is used to solve and the basic concept, amongst others.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xtLb4z3ntZfp1WNJUyvY8Q.png" /><figcaption>Image by Author</figcaption></figure><blockquote>Kubernetes (also known as k8s or “kube”) is <strong>an open source container orchestration framework that automates the manual processes involved in deploying, managing, and scaling containerized applications</strong>.</blockquote><p>Google initially developed Kubernetes. So, on the foundation, it manages containers be it Docker containers or some other technology like Podman or ZeroVM. Kubernetes helps users manage applications that are made up of a lot of containers(hundreds of containers) in different environments like physical machines, virtual machines, cloud environments or hybrid deployment environments.</p><h4>What is Kubernetes Used for?</h4><p>In recent years, microservices are used a lot in the delivery of large, complex applications. This caused an increased usage of containers as they are the perfect host for small independent applications. The rise of microservices and the use of containers resulted in applications that contain hundreds, if not thousands, of containers. Managing the containers across multiple environments using manual means like scripts and other self-made tools can be really complex and tasking, sometimes even becoming impossible due to the sheer amount of workload involved. This problem bought about a need to have a proper way to manage the containers, bringing about container orchestration technologies of which Kubernetes is one such.</p><p>What do container orchestration tools like Kubernetes offer?</p><ul><li><strong>High availability or no downtime</strong>: This simply means that the application can always be accessed by the users because it is always available. High availability requires that the application ensures an agreed level of uptime for a higher than normal period.</li><li><strong>Scalability or High performance</strong>: Users have a very high response rate when using the application because it has high performance.</li><li><strong>Disaster recovery</strong>: This basically refers to the ability to back up data and restore it to the latest state if the server explodes or the server centre experiences some issue to prevent the application from losing any data, and the application can run from the latest state after recovery.</li><li>Continuous Integration/Continuous Delivery</li></ul><h4>Kubernetes Basic Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*QS7tiMsQuO6nI9eH11q3Wg.png" /><figcaption>Image by — platform9.com</figcaption></figure><p>The Kubernetes cluster is made up of at least one master node and a few worker nodes, with each worker node having a <strong>Kubelet</strong> process running on it. A Kubelet is a process that allows the cluster to communicate with each other. The Kubelet doesn’t do any work on its own, but it is responsible for making sure the work and tasks assigned to each node get done like running application processes. Each worker node has containers of different applications deployed on it and a different number of containers running on a node depending on how the workload is distributed. While the applications are running on the worker nodes, Kubernetes’ processes which are necessary to run and manage the cluster properly are run on the master node. Such processes include:</p><ul><li><strong>API Server</strong>: This process is the entrypoint to the Kubernetes cluster, which different clients will interact with, like UI(Kubernetes Dashboard), an API(Scripts and automation technologies) or a Command-Line Tool(Cube CTL)</li><li><strong>Controller Manager</strong>: This process is used to keep a general overview of the cluster and manage containers.</li><li><strong>Scheduler</strong>: This process is responsible for scheduling containers on different nodes based on the workload and the available server resources on each node. It decides which worker node the next container should be scheduled on based on the resources on the nodes and the load that the container meets.</li><li><strong>ETCD Storage</strong>: This holds the current state of the Kubernetes cluster at any point in time. It holds all the configuration data and the status data of each node and each container inside of the node. Backups and restoration of the Kubernetes cluster are made from etcd snapshots.</li><li><strong>Virtual Network</strong>: This is the process that enables the communication between worker nodes and master nodes. The virtual network turns all the nodes in a cluster into a machine that has the sum of all the resources of the individual nodes.</li></ul><p>Worker nodes are much bigger and have more resources than master nodes because they run all the containers and applications inside whereas the master node runs a couple of processes that don’t need a lot of resources. However, master nodes are much more important than worker nodes because the cluster can only be accessed if a user has access to the master node. Therefore, a user must have a backup of the master node at all times. In a situation where there are multiple master nodes, the cluster would continue to function even if a master node is lost because of the other master nodes present in the cluster.</p><h4>Kubernetes Components</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*0Aiim3t736tHHuxRoanblA.png" /><figcaption>Image by — kubernetes.io</figcaption></figure><ul><li><strong>Pod</strong>: This is the smallest unit a Kubernetes user can configure and interact with. It is basically a wrapper of a container. In a worker node, there are multiple pods, and inside a pod, there are multiple containers. Usually, a user would have a pod per application, with one container in it unless the main application(database, Java app, NodeJS server, etc.) requires helper containers. The virtual network assigns each pod its own IP address making each pod a self-contained server, using the IP addresses as a means of communication from one pod to another. Containers are not configured in the Kubernetes cluster, they are configured in the pods. <br>The pod is a component of Kubernetes that manages the containers running in itself without the intervention of the user. For instance, if a container dies, the pod restarts the container. However, pods die frequently too and are restarted also. Upon creation, pods are assigned new IP addresses which are quite inconvenient to adjust all the time. Another component of Kubernetes solves this issue.</li><li><strong>Service</strong>: This is a component of Kubernetes that is used as an alternative to the IP addresses assigned to each pod. Instead of using the IP addresses to communicate, the services sit in front of a pod and communicate with other pods. If a pod behind a service dies and gets recreated, the service stays in place because it has a stable IP address. Service has two main characteristics”<br> — A Permanent IP address<br> — Load balancing</li></ul><blockquote>If you have any contributions or questions about this topic, you can reach out to me on <a href="https://twitter.com/CDOkoyee">Twitter</a>.</blockquote><h3>So that’s that. Thanks for reading!❤️ Please leave a clap👏 and/or a comment if you have any thoughts about this topic. It will be very much appreciated. Catch you later.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9ce9cea156" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Git Study I: Version Control and Version Control Systems]]></title>
            <link>https://medium.com/@iamdokoye/the-git-study-i-version-control-and-version-control-systems-dba4b983e057?source=rss-2aa5b0d05794------2</link>
            <guid isPermaLink="false">https://medium.com/p/dba4b983e057</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Daniel Okoye]]></dc:creator>
            <pubDate>Sat, 17 Sep 2022 09:16:45 GMT</pubDate>
            <atom:updated>2022-10-13T14:07:15.065Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QwXMFGPFqWOvIVDg.png" /><figcaption>Image from — towardsdatascience.com</figcaption></figure><p>More often than not, we’ve come across <strong>GitHub</strong> in our experience and study or during our learning phase. <strong>Git</strong> is a version control system that developers use all over the world. It helps you track different versions of your code and collaborate with other developers. Git is different from GitHub in some ways. While Git is a version control system that lets you keep your source code history while tracking your files, GitHub is a cloud-based hosting service that helps in managing Git repositories — Repos. While you can use Git without GitHub, you can’t use GitHub without using Git. There are many alternatives to GitHub such as GitLab, BitBucket, TaraVault, SourceForge, Gogs, Bitbucket, AWS CodeCommit, etc.</p><blockquote><strong>Git</strong> is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. It is a software used for tracking changes in any set of files, usually used for developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows (thousands of parallel branches running on different systems).</blockquote><p>If you are working on a project over time, you may want to keep track of which changes were made, by whom, and when those changes were made, especially if this project is a big one requiring collaboration from a lot of programmers. This becomes increasingly important if you end up having a bug in your code! Git can help you with this. But Git can also be a bit confusing when you first start learning it, so in this article we will discuss all you need to know about Git, covering topics such as repositories, commits, branches and much more!</p><p><strong>GitHub</strong> is a product that allows you to host your Git projects on a remote server somewhere, in the cloud. It’s important to remember that <strong>GitHub is not Git</strong>. GitHub is just a hosting service. Other companies offer hosting services like GitHub, such as Bitbucket and GitLab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*yS1xD3LLJc7qjJ-g.jpg" /><figcaption>Image from — Devmountain.com</figcaption></figure><p>As earlier stated, Git is a <strong>version control system</strong> used for tracking code and files. Therefore, to understand Git and how to use it, we need to understand what version control is, how it is used and what it is used for.</p><blockquote>According to Wikipedia, <strong>Version control</strong> (also known as <strong>revision control</strong>, <strong>source control</strong>, or <strong>source code management</strong>) is a class of systems responsible for managing changes to computer programs, documents, large web sites, or other collections of information. Version control is a component of software configuration management.</blockquote><p>From this definition, it can be said that version control, also known as source control, is the practice of tracking and managing changes to software code. Version control systems are software tools that help software teams work on changes to source code over time. With this practice, a programmer could revert to or recover an original version of a file or code that has been versioned. For instance, one could make use of a version control system to create different versions which could include updates or new features in the different versions of a particular file. Software code is mostly version controlled with a VCS — a Version Control System. Using a VCS comes with a lot of advantages and helps a programmer to be more efficient when writing code. Some advantages are stated below.</p><ul><li>When writing code, a lot of complexities are involved including debugging for errors and the like. Using a VCS reduces the workload for programmers and developers, software code can be modified continuously from time to time and stored in bits in a repo where developers can have access to it at any point in time.</li><li>VCS can aid immensely in collaboration, where programmers and developers can work hand in hand on projects where both parties gain access to the software code via the VCS database and make changes to the software code according to their area of work on the software code.</li><li>With VCS, troubleshooting can be done with relative ease, as current versions of software code can be compared to previous versions of code to help identify where the problem emanates from.</li></ul><blockquote><em>If you have any contributions or questions about this topic, you can reach out to me on </em><a href="http://twitter.com/CDOkoyee"><em>Twitter</em></a><em>.</em></blockquote><h3>So that’s that. Thanks for reading!❤️ Please leave a clap👏 and/or a comment if you have any thoughts about this topic. It will be very much appreciated. Catch you later.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dba4b983e057" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing and Setting up Docker on your Local Machine]]></title>
            <link>https://medium.com/@iamdokoye/installing-and-setting-up-docker-on-your-local-machine-234c972f7ac?source=rss-2aa5b0d05794------2</link>
            <guid isPermaLink="false">https://medium.com/p/234c972f7ac</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Daniel Okoye]]></dc:creator>
            <pubDate>Wed, 14 Sep 2022 20:43:27 GMT</pubDate>
            <atom:updated>2022-09-14T20:43:27.136Z</atom:updated>
            <content:encoded><![CDATA[<h4>This article will look at installing Docker on your local machine, setting up and creating a container, and deploying your dockerized app. If you haven’t read my previous article on Docker, you can read it <a href="https://medium.com/@oneMrDaniel/a-brief-introduction-to-docker-9d1528f99913">here</a>.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T_e4zsdjeeJJbYzXnTk9nQ.png" /><figcaption>Image from — dev.to</figcaption></figure><h4><strong>Installing Docker</strong></h4><p>To install Docker, go to the <a href="https://docs.docker.com/desktop">official documentation</a> and follow the guide for Mac, Windows or Linux. After installation, the next thing to do is to confirm is it has been installed successfully on your machine. This is done by using this code.</p><pre>docker --version</pre><p>You would see something like this(for Linux users).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*litvotXnG0qS1s6ucZbdpA.png" /><figcaption>docker version</figcaption></figure><p>The next process is to run and create our container. We will do this using two different methods: the app and the terminal. To create our container, we will need a Docker Image.</p><blockquote>A Docker Image is a template that the contains application code, libraries, tools, dependencies and other files needed to make an application run.</blockquote><p>When a user runs an image, it can become one or many instances of a container. Docker images have multiple layers, each one originates from the previous layer but is different from it. Images and Containers are used similarly, but the major difference between the two is that an image can exist without a container, but a container needs an image to run. Containers are existent on images and use them to create an environment for an application to run. Images are created <strong>Interactively </strong>or using a <strong>Dockerfile</strong>.</p><p>Creating an image interactively involves downloading an existing image from the Docker registry, making manual changes and edits to create a new image locally and then saving it. A Dockerfile is basically a file containing all the commands a user can access to create and assemble an image.</p><p>Now we have cleared the air on that, let’s continue with creating our container.</p><h4>Creating a Container using the Interactive Method</h4><ul><li>First, create an account on the registry, then look for a suitable image to pull to your local machine. (we will be using NGINX in this article.)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JBAST9Fz2HZwYTZZbYra4w.png" /><figcaption>Image from — hub.docker.com</figcaption></figure><ul><li>To pull the image, input this command in your terminal.</li></ul><pre>sudo docker pull nginx</pre><p>The above command downloads the NGINX image unto our local machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*dGBCmGCsqnFqfC-4qf1USQ.png" /><figcaption>NGINX image</figcaption></figure><ul><li>To view the image, input this command in your terminal.</li></ul><pre>sudo docker images</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*n8FQSlHIE9_pWckxDtKo6w.png" /><figcaption>docker images</figcaption></figure><p>As you can see, the NGINX image is on my local machine.</p><ul><li>Now, let’s create a container from the image. We would do this by mapping a port on our local machine to the port of the container so we can access the container locally on our browser. To do this, we will map port 8080(from our machine) to port 80(the container) by inputting this code into our terminal.</li></ul><pre>sudo docker run -d -p 8080:80 nginx:latest</pre><p>docker run starts the container, -d runs the container in detached mode meaning the container is running in the background, -p binds the ports 8080 and 80 together, making us able to have access to the container using our browsers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gc0ThnStrybAoeeOQnr5DA.png" /><figcaption>NGINX</figcaption></figure><p>And there you have it! This is the end product of creating and running our container using the Nginx image.</p><h4>Creating a Container using a Dockerfile</h4><p>For this method, you will need to clone a git repository. You can use <a href="https://github.com/oneMrDaniel/nginx-website-docker">this one</a> or anyone of your choice. This cloned repository contains a Dockerfile that instructs you on how the docker image would be built. The Dockerfile looks like this</p><pre>FROM nginx:alpine</pre><pre>COPY website/ /usr/share/nginx/html</pre><p>To create the container, we need to build the image from the Dockerfile first. To do that, input this code into the terminal.</p><pre>cd nginx-website-docker</pre><pre>docker build -t &lt;your_dockerhub_username&gt;/nginx-website-docker:latest .</pre><p>The -t command tags your username to the docker image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YIJedXjuQSzmvuZoW636JA.png" /><figcaption>Docker Image</figcaption></figure><p>Great! Our Image is ready, now let’s proceed to run our container from the image we just created. Input this code to do so.</p><pre>docker run -d -p 8080:80 &lt;your_docker_username&gt;/&lt;docker_image&gt;</pre><pre>docker run -d -p 8080:80 danielokoye/nginx-website-docker</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TfaRXWsyoCl2V-tSF6iE3A.png" /><figcaption>Docker run</figcaption></figure><p>Now that our container is set, let’s access the port from our browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*diKdcoynNLGjEd4morBeng.png" /><figcaption>Localhost</figcaption></figure><p>There you have it! Our container is working with a website running inside it locally.</p><h3>So that’s that. Thanks for reading!❤️ Please leave a clap👏 and/or a comment if you have any thoughts about this topic. It will be very much appreciated. Catch you later.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=234c972f7ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Brief Introduction to Docker]]></title>
            <link>https://medium.com/@iamdokoye/a-brief-introduction-to-docker-9d1528f99913?source=rss-2aa5b0d05794------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d1528f99913</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Daniel Okoye]]></dc:creator>
            <pubDate>Tue, 13 Sep 2022 09:41:55 GMT</pubDate>
            <atom:updated>2022-09-13T09:41:55.451Z</atom:updated>
            <content:encoded><![CDATA[<h4>As a DevOps engineer, Docker is one of the tools that would be frequently used in infrastructure management and isolation. In this article, we will discuss what Docker is, what it is used for, the benefits of using Docker, and the difference between a Docker container and a Virtual Machine in no specific order.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8edQ5HGw0kY9u1vcx-EdlQ.png" /><figcaption>Image by — Author</figcaption></figure><blockquote>Docker is an open platform for building, deploying, developing, shipping and running applications.</blockquote><p>Docker is a tool for running applications in an isolated standardized, executable component that combines an application source code with the operating system libraries and dependencies required to run that code in any environment. These isolated components are called containers. Docker is a platform as a service(PaaS) product that uses OS-virtualization to deliver software in containers. Docker packages an application and all its dependencies in a virtual container that can run on any Linux server. This is why they are called Containers because they have all the necessary dependencies contained in a single piece of software.</p><p>Docker is composed of the following elements:</p><ul><li>a Daemon, which is used to build, run, and manage the containers</li><li>a high-level API which allows the user to communicate with the Daemon,</li><li>and a CLI, the interface we use to make this all available.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*GOXBfyaStcyqKaf7F2vvLg.png" /><figcaption>Image by — docker.com</figcaption></figure><p>Containers are lightweight virtualized runtime environments for running applications. Each container represents a package of software that contains source code, system tools, libraries, dependencies, and configuration files required for running a specific application. They are independent and isolated from the host and other instances running on the host. Containers are pretty similar to virtual machines but they are actually different in terms of… Let’s briefly differentiate between the two terms.</p><p><strong>Containers</strong> are an abstraction at the app layer that packages code and dependencies together. Multiple containers can run on the same machine and share the same OS kernel with other containers, with each container running as an isolated process in the infrastructure. Containers are very quick to boot and startup when compared to VMs.</p><p><strong>Virtual Machines</strong> are an abstraction of physical hardware turning a particular server into many servers. The hypervisor allows multiple VMs to run on a single machine. Each VM includes a full copy of an OS, the application and its dependencies, which consume lots of storage space. VMs are also slow to boot when compared to containers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*TI2ngqhvJeB8FOZLGORjEg.png" /><figcaption>Image by — docs.docker.com</figcaption></figure><p><strong>Benefits of Using Docker</strong></p><ul><li>It is easy to set up and start running applications in the container using Docker tools instead of VMs,</li><li>Using Docker results in low disk usage, it does not operate as many resources as VMs.</li><li>Docker uses less memory thereby making operations fast and smooth.</li><li>Docker does not need a full Operating System to run.</li><li>With Docker comes ease of deployment, the containers can be deployed in any environment.</li><li>With Docker, things can be tested locally and in isolation before being deployed in the desired environment.</li><li>With Docker scalability comes with ease as you can quickly create new containers if demand for your applications requires them.</li><li>It is easy to use and maintain while being cheaper than the average VM.</li></ul><p>Does this mean that we don’t need Virtual Machines anymore? No, on the contrary, VMs are still very much needed if a user wants to have a full operating system for each customer or just needs the whole environment as a sandbox. VMs are usually used as middle layers when you have a big server rack and several customers using it. A medium-sized VM can host 3–8 containers. It depends on how many resources your containers use and how much of the underlying OS it needs to boot before running the whole application.</p><p>In our next article, we’d look at how to install docker and create our own docker container and how to deploy your dockerized application.</p><h3>So that’s that. Thanks for reading!❤️ Please leave a clap👏 and/or a comment if you have any thoughts about this topic. It will be very much appreciated. Catch you later.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d1528f99913" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>