<?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 Shegezzy on Medium]]></title>
        <description><![CDATA[Stories by Shegezzy on Medium]]></description>
        <link>https://medium.com/@shegezzy?source=rss-e3fc5a9da2ef------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*sWkdsoZ1rjlPgtNG</url>
            <title>Stories by Shegezzy on Medium</title>
            <link>https://medium.com/@shegezzy?source=rss-e3fc5a9da2ef------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 17:21:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shegezzy/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[Cloudflare 18 November 2025 Outage: Full Breakdown, Root Cause, and Impact: A DevOps Perspective]]></title>
            <link>https://medium.com/@shegezzy/cloudflare-18-november-2025-outage-full-breakdown-root-cause-and-impact-a-devops-perspective-c73d0e9b4af2?source=rss-e3fc5a9da2ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/c73d0e9b4af2</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[internet]]></category>
            <dc:creator><![CDATA[Shegezzy]]></dc:creator>
            <pubDate>Thu, 20 Nov 2025 19:23:04 GMT</pubDate>
            <atom:updated>2025-11-20T19:23:04.865Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*cbNzJuelG1EQNYoX.jpeg" /></figure><p>On 18 November 2025, users across the globe experienced widespread outages on applications like X and ChatGPT. As a DevOps engineer based in Lagos, Nigeria, observing this incident offers a valuable opportunity to understand how a small misconfiguration can ripple into a global disruption.</p><p><strong>What Happened</strong></p><p>For context, Cloudflare acts as a reverse proxy between users and the applications they want to access. In simple terms:</p><p><strong>User → Cloudflare (Edge) → Application</strong></p><p>Cloudflare provides a combination of CDN, DNS, web application firewall (WAF), DDoS protection, and edge computing services. Its primary role is to deliver content with low latency, secure traffic, and optimize routing.</p><p>On the morning of 18 November, users trying to access services like ChatGPT encountered 5xx errors. Many assumed it was a cyber attack, but the cause was rooted in Cloudflare’s internal systems.</p><p><strong>Root Cause</strong></p><p>Cloudflare uses a <strong>Bot Management System</strong>, which assigns scores to requests to differentiate between legitimate users and bots. This system relies on a <strong>feature configuration file</strong>, which is updated frequently — every five minutes.</p><p><strong>Here’s how things went wrong:</strong></p><ol><li><strong>Duplicate entries</strong> were introduced into the feature configuration file due to a database permission issue.</li><li>Cloudflare uses <strong>memory preallocation</strong> for this file to optimize performance. If the file exceeds a certain limit (200 features in this case), it can cause the Rust process powering the system to crash.</li><li>As updates continued, the oversized feature file breached the memory limit, causing the request-processing pipeline to fail and resulting in a global outage.</li></ol><p><strong>How Cloudflare Fixed It</strong></p><ul><li>The team stopped distributing the corrupted file.</li><li>A previously known-good feature file replaced the faulty one.</li><li>Services gradually returned to normal.</li></ul><p>There were no DDoS attacks or cyber intrusions involved, although traffic spikes may have contributed.</p><p><strong>Other Observed Impacts</strong></p><ul><li><strong>Turnstile</strong> (Cloudflare’s bot-checking script) partially failed.</li><li>The Cloudflare dashboard was inaccessible for new logins during the outage.</li><li>Email security services continued working but experienced temporary drops in spam detection accuracy.</li><li>High latency occurred due to CPU load from debugging and observability systems.</li></ul><p><strong>Lessons for DevOps Engineers</strong></p><ol><li><strong>Even large infra providers fail</strong>: AWS, Azure, and Cloudflare have all experienced outages. Resilience and reliability must always be top priorities.</li><li><strong>Tiny misconfigurations can have massive effects</strong>: A single misconfigured file brought down a global system.</li><li><strong>Preventative measures matter</strong>: Rigorous testing, monitoring, and fail-safes for critical configuration files can mitigate risks.</li><li><strong>Scale brings complexity</strong>: With AI adoption increasing globally — particularly in regions like India — the pressure on infrastructure will continue to grow.</li></ol><p>As a DevOps engineer, these incidents are both a warning and a learning opportunity. Outages will happen, but understanding the root causes and applying lessons ensures we don’t repeat the same mistakes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c73d0e9b4af2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Production Level Blue-Green Deployment CI/CD Pipeline]]></title>
            <link>https://medium.com/@shegezzy/production-level-blue-green-deployment-ci-cd-pipeline-c5882515ff62?source=rss-e3fc5a9da2ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5882515ff62</guid>
            <dc:creator><![CDATA[Shegezzy]]></dc:creator>
            <pubDate>Fri, 28 Feb 2025 00:18:58 GMT</pubDate>
            <atom:updated>2025-02-28T00:18:58.959Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Basic understanding of Project Blue-Green Deployment</strong></h4><p>We will deploy an application using blue-green deployment strategy. That means there will be two environment, blue environment and green environment.</p><p>Scenario where our application is currently deployed to blue environment and we want to upgrade our application with some features.</p><p>Written the source code for the new features and for the application, we can deploy it to next environment which is green and switch the traffic from blue environment to green environment.</p><p><strong>Main Benefit: </strong>blue-green deployment strategy is that there is zero downtime.</p><p>We will up the EKS cluster where we are going to deploy the application, how we are going to set up all the tools required and all the different servers needed like Sonar, Kip server, Nexus server and more.</p><p><strong>We will built with parameter option</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*iJHv5sWdL_FIPnjo" /></figure><p>Parameter section where we can decide where we want to deploy. We want to deploy to blue environment or green. If you select green then don’t forget to check Switch traffic option.</p><h4>Best part about using blue green deployment strategy</h4><p>It supports zero downtime. That means if we upgrade our application from version one to version two, there won’t be any downtime for the application upgrade.</p><h4>Taking simple example to understand our Project flow</h4><p>Understanding blue green deployment, simple example of an application. So we are taking an example where we are having an application with this having database of mysql and the application source code → frontend &amp; backend is written in written using Java, and HTML.</p><p><strong>When we deploy the application inside Kubernetes- Pods Creation with Services in Kubernetes see simple example below</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/0*S4lI5pfU2MvFFgbE" /></figure><ol><li><strong>MySQL Pod (Database)</strong></li></ol><ul><li>The <strong>MySQL Pod</strong> is deployed inside the Kubernetes cluster.</li><li>It is exposed using a <strong>ClusterIP Service</strong> (default service type in Kubernetes).</li></ul><p><strong>Purpose</strong>:</p><ul><li><strong>ClusterIP Service</strong> allows internal communication between different pods inside the Kubernetes cluster.</li><li>The database is not exposed to the external world, ensuring security.</li></ul><p>2.<strong> Main Application Pod (Frontend + Backend)</strong></p><ul><li>The <strong>Main Application Pod</strong> contains Java code for both frontend and backend.</li><li>It is exposed using a <strong>LoadBalancer Service.</strong></li></ul><p><strong>Purpose</strong>:</p><ul><li><strong>LoadBalancer Service</strong> allows external access.</li><li>Users can send requests to the LoadBalancer URL to access the application.</li></ul><p>3. <strong>Communication Between Pods</strong></p><ul><li>If the <strong>Main Application Pod</strong> needs to communicate with the <strong>MySQL Pod</strong>, it cannot directly access it.</li><li>Instead, it sends requests to the <strong>ClusterIP Service</strong> of the database.</li><li>The <strong>ClusterIP Service</strong> then routes the request to the <strong>MySQL Pod</strong>.</li></ul><p>4. <strong>Summary of Setup</strong></p><ul><li><strong>MySQL Pod</strong> → Exposed via <strong>ClusterIP Service</strong> (Internal Communication)</li><li><strong>Main App Pod</strong> → Exposed via <strong>LoadBalancer Service</strong> (External Access)</li><li><strong>App ↔ Database Communication</strong> → Done via <strong>ClusterIP Service</strong> between pods.</li></ul><p><strong>What is Blue-Green Deployment with our simple example below?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Sh68Pw6vxQAeJU6d" /></figure><p>It’s a deployment strategy that helps in upgrading applications <strong>without downtime</strong> by having two identical environments:</p><ul><li><strong>Blue Environment (Current Version — v1)</strong></li><li><strong>Green Environment (New Version — v2)</strong></li></ul><p><strong>How It Works?</strong></p><ol><li><strong>Deploy the Current Version (Blue)</strong></li></ol><ul><li>Deploy <strong>MySQL Pod</strong> and expose it using a <strong>ClusterIP Service.</strong></li><li>Deploy <strong>App Pod (v1)</strong> and expose it using a <strong>LoadBalancer Service.</strong></li><li>The <strong>LoadBalancer</strong> routes traffic to <strong>Blue (v1).</strong></li></ul><p>2. <strong>Deploy the New Version (Green):</strong> Developers create a <strong>new version (v2)</strong> of the app with updated features. A new <strong>App Pod (v2)</strong> is deployed separately. The <strong>Green (v2)</strong> Pod is ready but <strong>not</strong> <strong>receiving traffic yet.</strong></p><p>3. <strong>Switch Traffic Without Downtime:</strong> Update the <strong>LoadBalancer Service</strong> to point to the <strong>Green (v2)</strong> environment instead of Blue. Now, users are accessing <strong>v2</strong> without downtime.</p><p>4. <strong>Remove the Old Version (Optional):</strong> Once <strong>v2</strong> is stable, the <strong>Blue (v1) Pod</strong> can be deleted.</p><p><strong>Key Benefits of Blue-Green Deployment</strong></p><p><strong>Zero Downtime</strong> — Users don’t experience disruptions.<br><strong>Instant Rollback</strong> — If v2 has issues, switch back to v1.<br><strong>Safe Testing</strong> — <strong>Green (v2)</strong> can be tested before going live.</p><h3>Practical Setting up EKS Cluster</h3><ul><li><strong>Infrastructure Setup:</strong> Determine the infrastructure where you will deploy the application.</li><li><strong>Virtual Machine (EC2) Creation:</strong> Set up a virtual machine to run the Terraform commands for creating the (EKs) cluster. Will install terraform and create EKS cluster with help of terraform commands</li><li><strong>Create Virtual Machine “server”:</strong> (will use this machine to create EKS Cluster)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zg5PBJkuj9sLnYej" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YJKzeiQQmTKYFgsO" /></figure><ul><li><strong>Name the VM: “</strong>server<strong>”.</strong></li><li><strong>Select Ubuntu version: </strong>24.04.</li><li><strong>Choose instance size: </strong>T2 Medium.</li><li><strong>Configuration Storage: </strong>20gb</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nkJYOoFjVKEjr0fi" /></figure><ul><li>You can open these ports in security group, of course not recommended for production environment.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IgXgMpFjEjdV3a7K" /></figure><ul><li>Launch Instance</li><li><strong>Setting up Terraform inside this VM</strong> — “Server”</li><li>Connect to this VM</li></ul><pre>          sudo apt-get update</pre><ul><li>We are going to use <strong>AWS CLI</strong> to connect to our AWS account with this VM</li></ul><pre>sudo apt update <br>sudo apt install unzip curl -y             <br>curl &quot;https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip&quot; -o &quot;awscliv2.zip&quot;             <br>unzip awscliv2.zip             <br>sudo ./aws/install             <br>aws --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W19ZKxV-y7MJ15de" /></figure><pre>aws configure   <br>aws s3 ls # To check</pre><p>We are going to install <strong>Terraform</strong> in VM “<strong>Server</strong>”</p><pre>sudo snap install terraform --classic</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Cc-e6B7b4eBBVKUN" /></figure><p><em>Successfully installed the terraform.</em></p><p><strong>Clone the repo to our “Server” EC2 now</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*93JxuaqIBsJ3V6qI" /></figure><pre>$git clone https://github.com/shegezzy/Blue-Green-Deployment.git </pre><pre>cd Blue-Green-Deployment/Cluster   <br>terraform init    <br>#Inside cluster directory our all the terraform files are p</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WZc36NCZycUnAa_E" /></figure><p>$terraform plan : to see what are resources we will be creating on our AWS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Cx2ANQVbzbyN9V7W" /></figure><p>$terraform apply : this command will apply the changes and will create the mentioned infrastructure to our AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hGNQsXYoYff5-HiT" /></figure><p>Before implementing apply make sure you have changed your <a href="http://variables.tf/"><strong>variables.tf</strong></a><strong> </strong>file in <strong>Cluster directory</strong>. Change the default value to your key-value pair of current ec2 instance which we have named “Server”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eXVln8eCC5XGCyic" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BAaxvTs-DWdCAboD" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GpNdUKYgTavVSKc5" /></figure><p><strong><em>We have successfully setup the EKS Cluster with help of terraform file.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*adZz-v3jpJaaKZpB" /></figure><h3>Install Kubectl</h3><p>Before connecting to the EKS cluster, you need to install kubectl.<br>Run the following command:</p><pre>sudo snap install kubectl --classic</pre><h3>Connect to the EKS Cluster</h3><p>After creating an EKS cluster, you need to configure kubectl to connect to it.<br><strong><em>Run the following command</em></strong></p><pre>#aws eks --region &lt;your-region&gt; update-kubeconfig --name &lt;your-cluster-name&gt;<br>aws eks --region ap-south-1 update-kubeconfig --name amit-cluster</pre><ul><li>This command creates a <strong>kubeconfig file</strong> and allows you to authenticate to the <strong>cluster</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sBEEoAPPqkN-l_Sz" /></figure><ul><li>To verify connectivity, run:</li></ul><pre>kubectl get nodes</pre><ul><li>If the command fails, it means you do not have permissions to connect to the cluster. But <strong>since you have update kubeconfig file, you will be authenticated and ready to manipulate the EKS Cluster using your Server instance</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M4NQcfMts6NL1irJ" /></figure><h3>Create 3 EC2 instance with t2.medium and setup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/0*3KccXfYBoQif7jUl" /></figure><ol><li>NEXUS — <strong>run with docker container</strong></li><li>SonarQube — <strong>run with docker container</strong></li><li>Jenkins — <strong>install in machine directly.</strong></li></ol><ul><li>Install Jenkins on EC2 Machine “Jenkins”</li><li>Setup SonarQube and NEXUS with help of Docker container on both EC2 instances- Install docker container in rest of the ec2 machine</li></ul><p><strong><em>Hopefully you would have setup all the configurations.</em></strong></p><h3><strong>1. Installing Nexus with docker on our Nexus Instance</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lDFP2zLX73H5mYTg" /></figure><ul><li>$docker run -itd -p 8081:8081 sonatype/nexus3</li><li><strong>Access Nexus:</strong> http:&lt;ip-address&gt;:8081</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*acziVr9wdOcUEfz-" /></figure><p><strong>Go inside container and fetch the password for nexus</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yLvZGpkAjzGpbYMr" /></figure><ul><li>docker exec -it &lt;cont id&gt; sh</li><li>cd sonatype-work/nexus3</li><li>cat admin.password</li></ul><p><em>To login to Nexus we need to get the password by logging in the docker container directly from terminal, like we did above.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KgTwMqFED2ZAQ0Lo" /></figure><h3><strong>2. Installing SonarQube with docker on our SonarQube instance</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oNj_0FK18-GwYYNw" /></figure><ul><li>$docker run -d -p 9000:9000 sonarqube:lts-community</li><li><strong>Access SonarQube</strong> : http:&lt;ip-address&gt;:9000</li></ul><p><strong><em>Note</em></strong><em>: By default id and password of SonarQube is “admin”</em></p><h3><strong>3. Installing</strong> Jenkins on our “Jenkins instance” directly + Configurations with Jenkins</h3><ul><li>Make sure you have installed java and Jenkins. Java is a pre-requisite for Jenkins to run.<br><strong>Note: You can also install java headless**</strong> Java headless is a pkg which don’t provide UI to operate. Hence works for the Jenkins.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jzYiKNvodhHQPMHk" /></figure><ul><li><strong>Install trivy on jenkins instance</strong></li></ul><pre>sudo apt-get install wget apt-transport-https gnupg lsb-release           <br>wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -           <br>echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list <br>sudo apt-get update           <br>sudo apt-get install trivy</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/0*peD47yJf0YcavnPH" /></figure><ul><li><strong>Because by default Trivy is not available in Jenkins plugins. So we have installed trivy externally to our Jenkins Master node.</strong> We will operate Jenkins with single node only currently for building.</li><li><strong>Install Kubectl on Jenkins instance,</strong> because we will have commands to operate for Kubernetes through Jenkins.</li></ul><p>$sudo snap install kubectl —classic</p><p><strong><em>Getting back to our “Server Instance” through which we are operating our EKS Cluster</em></strong></p><h3>Login to “Server” EC2 instance and Create a Service Account and Assign RBAC Permissions</h3><p><strong>Create a Namespace</strong></p><pre>kubectl create ns webapps</pre><ul><li>This creates a namespace called web-apps where the service account will be deployed.</li></ul><p>Creating Service Account</p><p>vim sa.yml</p><pre>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: jenkins<br>  namespace: webapps</pre><pre>kubectl apply -f sa.yml</pre><p><strong>Create Role</strong></p><p>vim role.yml</p><pre>apiVersion: rbac.authorization.k8s.io/v1<br>kind: Role<br>metadata:<br>  name: app-role<br>  namespace: webapps<br>rules:<br>  - apiGroups:<br>        - &quot;&quot;<br>        - apps<br>        - autoscaling<br>        - batch<br>        - extensions<br>        - policy<br>        - rbac.authorization.k8s.io<br>    resources:<br>      - pods<br>      - componentstatuses<br>      - configmaps<br>      - daemonsets<br>      - deployments<br>      - events<br>      - endpoints<br>      - horizontalpodautoscalers<br>      - ingress<br>      - jobs<br>      - limitranges<br>      - namespaces<br>      - nodes<br>      - secrets<br>      - pods<br>      - persistentvolumes<br>      - persistentvolumeclaims<br>      - resourcequotas<br>      - replicasets<br>      - replicationcontrollers<br>      - serviceaccounts<br>      - services<br>    verbs: [&quot;get&quot;, &quot;list&quot;, &quot;watch&quot;, &quot;create&quot;, &quot;update&quot;, &quot;patch&quot;, &quot;delete&quot;]</pre><pre>kubectl apply -f role.yml</pre><p><strong>Bind the role to service account</strong></p><p>vim rolebind.yml</p><pre>apiVersion: rbac.authorization.k8s.io/v1<br>kind: RoleBinding<br>metadata:<br>  name: app-rolebinding<br>  namespace: webapps <br>roleRef:<br>  apiGroup: rbac.authorization.k8s.io<br>  kind: Role<br>  name: app-role <br>subjects:<br>- namespace: webapps <br>  kind: ServiceAccount<br>  name: jenkins</pre><pre>kubectl apply -f rolebind.yml</pre><p><strong>Create a Token for Authentication | Creating for Service Account</strong></p><p>vi sec.yml</p><pre>apiVersion: v1<br>kind: Secret<br>type: kubernetes.io/service-account-token<br>metadata:<br>  name: mysecretname<br>  namespace: webapps<br>  annotations:<br>    kubernetes.io/service-account.name: jenkins # our service account name</pre><p><strong>To </strong><a href="https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#:~:text=To%20create%20a%20non%2Dexpiring,with%20that%20generated%20token%20data."><strong>generate token</strong></a><strong> you can also check.</strong></p><pre>kubectl apply -f sec.yml</pre><p><strong>Extract token now</strong></p><pre>kubectl describe secret mysecretname -n webapps</pre><p><strong>You will see token, save that to a file. To use for authentication in Jenkins.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*czG-DKXHRqExIqQK" /></figure><h3>Login to Jenkins Instance and Configure Jenkins</h3><h4>Store the Kubernetes Token in Jenkins</h4><ol><li>Go to <strong>Jenkins Dashboard → Manage Jenkins → Manage Credentials</strong></li><li>Select <strong>Global Credentials → Add Credentials</strong></li><li>Choose <strong>Secret Text</strong></li><li>Paste the copied Kubernetes token</li><li>Set ID as k8-token</li><li>Save the credentials.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0wEey0pUStQ0ZZ53" /></figure><h4>Install Required Plugins</h4><p>Go to Manage <strong>Jenkins → Manage Plugins → Available Plugins, search for and install:</strong></p><ul><li>SonarQube Scanner</li><li>Config File Provider</li><li>Maven Integration</li><li>Pipeline Maven Integration</li><li>Pipeline Stage View</li><li>Docker Pipeline</li><li>Kubernetes</li><li>Kubernetes Credentials</li><li>Kubernetes Client API</li><li>Kubernetes CLI</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D1mvowqOI81iCQ6z" /></figure><p><strong><em>Restart Jenkins after installation.</em></strong></p><h3>Doing some Configurations in tools before continuing Pipeline</h3><p><strong>Define Maven</strong></p><p>So, for defining the maven plugin: Go to &gt; <strong>Manage Jenkins &gt; Tools &gt; Maven Installations &gt; Add Maven &gt; Name: maven3</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9UyihEY1OhjK7o3Z" /></figure><p><strong>Defining Sonar-scanner</strong></p><p>So, for defining the sonar-scanner plugin: <strong>Go to &gt; Manage Jenkins &gt; Tools &gt; SonarQube Scanner &gt; Name: sonar-scanner</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Du-b-Y_lFW42wmhj" /></figure><p><strong><em>Note We can skip jdk17 installation, and docker. Just like Trivy we have installed jdk17 on Jenkins machine directly. As JDK is the pre-requisite for installing Jenkins.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cowJpX7DJD9oxEN3" /></figure><h3>Integrate SonarQube and Jenkins</h3><p><strong>Go to</strong> Sonarqube &gt; Administration</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iXEFkqOrzdqUycCO" /></figure><p><strong>First create user in Sonarqube</strong></p><p><strong>Go to</strong> Sonarqube &gt; Security &gt; user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CJh8yapzHYRN9rSB" /></figure><p>Create a <strong>token in Administrator to authenticate jenkins</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6FywA_iDenSmOUI7" /></figure><p><strong>Login to Jenkins: to add SonarQube token in Jenkins</strong></p><p><strong>Go to</strong> manage Jenkins &gt; Credentials</p><p><strong>Go to</strong> global &gt; Add credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CacBugiEPsiNSjyG" /></figure><p><strong>Click on</strong> “add credentials”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GpnuBUudp9CYhsKP" /></figure><p><strong>Add credentials:</strong> The one we copied the token from sonarqube</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qvMO5Ybm7q8JeWxs" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gmK66NaU0Lwl--pY" /></figure><p><strong>Now adding SonarQube Server inside Jenkins</strong></p><p><strong>Go to</strong> Jenkins &gt; Manage Jenkins &gt; System &gt; SonarQube Installation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*n7uCen_srJmdXCQP" /></figure><p><strong><em>Congrats! You have successfully integrated Sonar and Jenkins</em></strong></p><h3>Integrate Nexus and Jenkins</h3><h4>Configure Managed Files in Jenkins for Nexus</h4><ol><li>Go to <strong>Jenkins Dashboard → Click on Manage Jenkins.</strong></li><li>Click on <strong>“Managed files”.</strong></li><li>Click on <strong>“Admin Config” → Select “Global Maven Settings”.</strong></li><li>Rename it to <strong>“Maven-settings”.</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IE80uDZMU5BctBef" /></figure><p>5. Click on <strong>Next</strong>.</p><p>6. <strong>Scroll down </strong>to the <strong>Credentials section</strong> for Nexus.</p><p>7. <strong>Remove any existing comments</strong> in the configuration. Remove comment from server and shift comment to above &lt;server&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cMLmXnz9_P_2BMrZ" /></figure><p>8. <strong>Add credentials</strong> for the specific Nexus repository.</p><p>To fetch the nexus credentials, let’s login to nexus and refer below steps:</p><h4>Configure Nexus Repository Credentials for Managed Files in Jenkins</h4><ol><li>Nexus uses two repositories in case of java based application:</li></ol><ul><li><strong>Maven Releases</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YRH4LuXXfnTqMppj" /></figure><ul><li><strong>Maven Snapshots</strong></li></ul><p>2. Copy the repository names and paste them into Jenkins:</p><ul><li><strong>ID</strong> → Repository Name.</li><li><strong>Username</strong> → Admin.</li><li><strong>Password</strong> → Your Nexus password.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eVJS_j1KQqfB196t" /></figure><ul><li><strong>Do the process for both the repositories.</strong></li><li>Click <strong>Save</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Uwb-Gq629_Ye0Hwm" /></figure><h4>Configure Maven Settings in pom.xml</h4><ul><li>Go to the <strong>Nexus repository → Copy the URL.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MN5RbeWtTur0V-KT" /></figure><p>Copy for both: <strong>Maven-releases and Maven-snapshots</strong></p><ul><li><strong>Navigate to the pom.xml file</strong> in your project inside Github repo</li><li><strong>Enter edit mode.</strong></li><li><strong>At the end of the file, </strong>check for the &lt;repositories&gt; section:</li><li>If it’s not present, <strong>add it manually.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rKG-CAatSCgEi3xB" /></figure><ul><li><strong>Update the repository URLs for:</strong></li><li><strong>Maven Releases.</strong></li><li><strong>Maven Snapshots.</strong></li><li><strong>Verify the artifact type </strong>(release or snapshot).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ff44QvaLgl3cCBjS" /></figure><h3>Create a Jenkins Pipeline</h3><ol><li>Go to <strong>Jenkins Dashboard</strong></li><li>Click <strong>New Item → Pipeline</strong></li><li>Name it <strong>blue-green-deployment</strong></li><li>Check <strong>“Discard Old Builds” &gt; “Max Builds to keep: 2”</strong></li><li>Under <strong>Build Triggers</strong>, enable <strong>Poll SCM </strong>if needed</li><li>Scroll to <strong>Pipeline</strong> and select <strong>Pipeline Script</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mI6ezNMHrSTmLdMg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3KW-shPyZ9lk-GVC" /></figure><h4>1st stage: Git Checkout</h4><p><strong>“Git Checkout” &gt; Generate script &gt; Pipeline Syntax</strong></p><p>Add GitHub Personal Access Token as Secret Text in Global Credential to authenticate Jenkins with Github.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GQOoSttk3qSBu1L_" /></figure><p><strong>Generate syntax</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dVTZ-WfqGN0Fx_HG" /></figure><pre>stage(&#39;Git Checkout&#39;) {<br>            steps {<br>              git branch: &#39;main&#39;, credentialsId: &#39;git-cred&#39;, url: &#39;https://github.com/shegezzy/blue-green-deployment-v1.git&#39;<br>            }<br>        }</pre><h3>2nd stage: Compile</h3><p>We will run compile early because to find out issues at the early stage itself. Compile will able to help what kind of syntax error our source code has.</p><pre>stage(&#39;Compile&#39;) {<br>            steps {<br>                sh &#39;mvn compile&#39;<br>            }<br>        }</pre><p><strong>Note</strong>: third party plugin which we install in Jenkins, we need to define in our pipeline script. Example: we have installed Trivy in Jenkins machine directly, so we don’t need to define Trivy here.</p><h3>3rd stage: Tests</h3><p><strong>Define the Maven tool inside the pipeline using the “tools” block.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X8Ihb6bXxYp33pCR" /></figure><pre>tools {<br>    maven &#39;maven3&#39;<br>}</pre><p><strong>tool type:</strong> maven, <strong>tool name: </strong>maven3, “maven3” is the tool name configured in Jenkins.</p><p><strong>To skip test cases</strong> (if they are failing), modify it. Third stage adding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5rrqZtbH8oSo5qJA" /></figure><pre>stage(&#39;Test&#39;) {  <br>            steps {  <br>                sh &#39;mvn test -DskipTests=true&#39;<br>            }  <br>        }</pre><h3>4th stage: Perform File System Scan with Trivy</h3><pre>curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh<br>   58  sudo mv /root/bin/trivy /usr/local/bin/trivy<br>   59  sudo chmod +x /usr/local/bin/trivy<br>   60  echo $PATH<br>   61  trivy -v</pre><pre>stage(&#39;Trivy FS Scan&#39;) {  <br>            steps {  <br>                sh &#39;trivy fs --format table -o fs.html .&#39;<br>            }  <br>        }</pre><h3>5th stage: Configure SonarQube for Code Analysis</h3><p><strong>SonarQube consists of two parts:</strong></p><ul><li>SonarQube Server (where reports are stored).</li><li>SonarQube Scanner (which performs the analysis).</li></ul><p><strong>Define SonarQube Scanner in the pipeline first:</strong></p><pre>environment {<br>    SCANNER_HOME = tool &#39;sonar-scanner&#39;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4UvUisuNYkKSxh40" /></figure><p>This is our home directory of the tool sonar-scanner</p><p><strong>Execute SonarQube analysis:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/0*dF3VZ7pmQuQK_Whz" /></figure><p>Just name of server will come here ‘sonar’ &gt; as we have mentioned in system config</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7wM2WCGkQp61Z8aP" /></figure><p>Since, this is a java project. So, we have targeted “target” file. Target file includes java binaries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EcbQH5cEXWD8tDb_" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sirV-n2d66LL9b5h" /></figure><h3>6th Stage: Configure Quality Gate Check</h3><ol><li>Go to <strong>SonarQube Administration → Configuration → Webhooks.</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GW1mHsVTZjYFKGM1" /></figure><p><strong>Go to</strong> Configuration &gt; Webhooks</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ioDe7Q3cYghLSfNw" /></figure><p><strong>Create a new webhook:</strong></p><ul><li><strong>Name</strong>: Jenkins.</li><li><strong>URL</strong>: http://&lt;JENKINS_URL&gt;/sonarqube-webhook</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KuFnv-kuEi3N9GjZ" /></figure><p>We are all set: as you can see, we successfully created webhook on SonarQube</p><p>Now we can configure Quality Gate Check in pipeline</p><pre>stage(&#39;Quality Gate Check&#39;) {  <br>            steps {  <br>               timeout(time: 1, unit: &#39;HOURS&#39;) {<br>                     waitForQualityGate abortPipeline: true<br>                }<br>            }  <br>        }</pre><p>We have utilized pipeline syntax for writing code. Two times we have used, for first we have generated timeout and second quality gate.</p><h3>7th stage: Build Artifacts</h3><pre>stage(&#39;Build Artifacts&#39;) {  <br>            steps {  <br>                  sh &#39;mvn package -DskipTests=true&#39;<br>            }  <br>        }</pre><p>We have built artifacts first for publishing to nexus</p><h3>8th Stage: Publish artifacts to Nexus</h3><p>We will use pipeline syntax</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qpAKbxFbd0xxyCPu" /></figure><pre>stage(&#39;Publish Artifacts to Nexus&#39;) {  <br>            steps {  <br>               withMaven(globalMavenSettingsConfig: &#39;maven-settings&#39;, jdk: &#39;&#39;, maven: &#39;maven3&#39;, mavenSettingsConfig: &#39;&#39;, traceability: true) {<br>                    sh &#39;mvn deploy -DskipsTests=true&#39;<br>                    }<br>            }  <br>        }  <br>    }  <br>}</pre><h3>Docker Integration for Blue-Green Deployment</h3><p><strong>The goal is to:</strong></p><ol><li>Build Docker images.</li><li>Tag them as blue or green. We will have two docker images one for blue env and second for green env.</li><li>Switch traffic to the latest version.</li></ol><p><em>So before building images -</em></p><h4>Define Deployment Parameters: Before starting pipeline we can define if this is for blue or green env</h4><p>Before building images, define parameters to manage the Blue-Green strategy. We will also setup parameters for same.</p><pre>parameters {<br>        choice(name: &#39;DEPLOY_ENV&#39;, choices: [&#39;blue&#39;, &#39;green&#39;], description: &#39;Choose which environment to deploy: Blue or Green&#39;)<br>        choice(name: &#39;DOCKER_TAG&#39;, choices: [&#39;blue&#39;, &#39;green&#39;], description: &#39;Choose the Docker image tag for the deployment&#39;)<br>        booleanParam(name: &#39;SWITCH_TRAFFIC&#39;, defaultValue: false, description: &#39;Switch traffic between Blue and Green&#39;)<br>    }</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qBmz2fZPEaEhZ6i_" /></figure><ul><li>DEPLOYMENT_ENV: Defines if the deployment is for blue or green.</li><li>DOCKER_TAG: Defines the image tag.</li><li>SWITCH_TRAFFIC: Controls whether to switch traffic. We can decide at runtime whether you want to switch traffic or not. Helps in zero downtime.</li></ul><h3>Set Up Docker Variables</h3><pre>environment {<br>    IMAGE_NAME = &quot;shegezzy/bankapp&quot;<br>    TAG = &quot;${params.DOCKER_TAG}&quot;  // The image tag now comes from the parameter<br>}</pre><p>We have defined the env variables inside the pipeline only below the agent section, so that we can use these parameters value inside our 9th stage which is build and tag docker image.</p><h3>9th Stage: Build and Tag Docker Image:</h3><p>We will take use of pipeline syntax and make syntax. Authenticate with Docker Hub</p><pre>stage(&#39;Docker Build and Tag Image&#39;) {  <br>            steps {  <br>                 withDockerRegistry(credentialsId: &#39;docker-cred&#39;) {<br>                        sh &#39;docker build -t ${IMAGE_NAME}:${TAG} .&#39;<br>                    }<br>                }  <br>            }</pre><p>Ensure <strong>Docker credentials</strong> are configured in Jenkins under <strong>Manage Jenkins → Credentials.</strong></p><h3>10th stage: Docker Image Scan using Trivy</h3><pre>stage(&#39;Trivy Image Scan&#39;) {<br>            steps {<br>                sh &quot;trivy image --format table -o image.html ${IMAGE_NAME}:${TAG}&quot;<br>            }<br>        }</pre><h3>11th Stage: Push Docker Image to Docker Hub</h3><pre>stage(&#39;Docker Push Image&#39;) {<br>            steps {<br>                script {<br>                    withDockerRegistry(credentialsId: &#39;docker-cred&#39;) {<br>                        sh &quot;docker push ${IMAGE_NAME}:${TAG}&quot;<br>                    }<br>                }<br>            }<br>        }</pre><h3>Understanding the Architecture before moving to next stage</h3><p>We have an application with multiple components:</p><ul><li><strong>MySQL Database</strong></li><li><strong>Application (Blue and Green versions)</strong></li><li><strong>Service for the Application</strong></li></ul><h3>Key Points:</h3><ul><li><strong>Database and Service remain unchanged</strong> because data is not modified, and access URLs remain constant.</li><li>Only the <strong>application pod changes during deployment.</strong></li><li><strong>We will deploy MySQL first, followed by the application components </strong>in a structured manner.</li></ul><h3>12th Stage: Deploy MySQL Deployment with it’s Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*07jBd-NmqrskkMM8" /></figure><p>Change this <strong>serverURL → to our EKS API Server Endpoint </strong>and <strong>cluster name to your EKS cluster</strong></p><pre>stage(&#39;Deploy MySQL Deployment and Service&#39;) {<br>            steps {<br>                script {<br>                    withKubeConfig(caCertificate: &#39;&#39;, clusterName: &#39;amit-cluster&#39;, contextName: &#39;&#39;, credentialsId: &#39;k8-token&#39;, namespace: &#39;webapps&#39;, restrictKubeConfigAccess: false, serverUrl: &#39;https://6577D435A2B49DDF4EF2774516148399.gr7.ap-south-1.eks.amazonaws.com&#39;) {<br>                        sh &quot;kubectl apply -f mysql-ds.yml -n ${KUBE_NAMESPACE}&quot;  // Ensure you have the MySQL deployment YAML ready<br>                    }<br>                }<br>            }<br>        }</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IoUQdpAM005FWo0C" /></figure><h3>13th Stage: Deploy Application Load Balancer Service</h3><pre>stage(&#39;Deploy SVC-APP&#39;) {<br>            steps {<br>                script {<br>                    withKubeConfig(caCertificate: &#39;&#39;, clusterName: &#39;amit-cluster&#39;, contextName: &#39;&#39;, credentialsId: &#39;k8-token&#39;, namespace: &#39;webapps&#39;, restrictKubeConfigAccess: false, serverUrl: &#39;https://46743932FDE6B34C74566F392E30CABA.gr7.ap-south-1.eks.amazonaws.com&#39;) {<br>                        sh &quot;&quot;&quot; if ! kubectl get svc bankapp-service -n ${KUBE_NAMESPACE}; then<br>                                kubectl apply -f bankapp-service.yml -n ${KUBE_NAMESPACE}<br>                              fi<br>                        &quot;&quot;&quot;<br>                   }<br>                }<br>            }<br>        }</pre><ul><li>This will expose the application to the outside world.</li><li>The <strong>LoadBalancer will route traffic</strong> to the correct pod (Blue or Green).</li><li>With this LB we can get URL to access the application</li></ul><p>We have a condition if service is not present then only we will deploy the service initially we will setup version → Blue</p><h3>Blue-Green Deployment Strategy</h3><h4>14 Stage: Blue green deployment trigger according to the parameters we choose at runtime</h4><pre>stage(&#39;Deploy to Kubernetes&#39;) {<br>            steps {<br>                script {<br>                    def deploymentFile = &quot;&quot;<br>                    if (params.DEPLOY_ENV == &#39;blue&#39;) {<br>                        deploymentFile = &#39;app-deployment-blue.yml&#39;<br>                    } else {<br>                        deploymentFile = &#39;app-deployment-green.yml&#39;<br>                    }<br>                    <br>                    withKubeConfig(caCertificate: &#39;&#39;, clusterName: &#39;amit-cluster&#39;, contextName: &#39;&#39;, credentialsId: &#39;k8-token&#39;, namespace: &#39;webapps&#39;, restrictKubeConfigAccess: false, serverUrl: &#39;https://6577D435A2B49DDF4EF2774516148399.gr7.ap-south-1.eks.amazonaws.com&#39;) {<br>                        sh &quot;kubectl apply -f ${deploymentFile} -n ${KUBE_NAMESPACE}&quot;<br>                    }<br>                }<br>            }<br>        }</pre><h3>MOST IMPORTANT SWITCHING Traffic from blue / green deployment</h3><h4>15th Stage: Switching Traffic</h4><p>Here we will decide on which deployment our Load Balancer URL will point towards</p><pre>stage(&#39;Switch Traffic Between Blue &amp; Green Environment&#39;) {<br>            when {<br>                expression { return params.SWITCH_TRAFFIC }<br>            }<br>            steps {<br>                script {<br>                    def newEnv = params.DEPLOY_ENV<br>                    // Always switch traffic based on DEPLOY_ENV<br>                    withKubeConfig(caCertificate: &#39;&#39;, clusterName: &#39;amit-cluster&#39;, contextName: &#39;&#39;, credentialsId: &#39;k8-token&#39;, namespace: &#39;webapps&#39;, restrictKubeConfigAccess: false, serverUrl: &#39;https://6577D435A2B49DDF4EF2774516148399.gr7.ap-south-1.eks.amazonaws.com&#39;) {<br>                        sh &#39;&#39;&#39;<br>                            kubectl patch service bankapp-service -p &quot;{\\&quot;spec\\&quot;: {\\&quot;selector\\&quot;: {\\&quot;app\\&quot;: \\&quot;bankapp\\&quot;, \\&quot;version\\&quot;: \\&quot;&#39;&#39;&#39; + newEnv + &#39;&#39;&#39;\\&quot;}}}&quot; -n ${KUBE_NAMESPACE}<br>                        &#39;&#39;&#39;<br>                    }<br>                    echo &quot;Traffic has been switched to the ${newEnv} environment.&quot;<br>                }<br>            }<br>        }</pre><pre>kubectl patch service bankapp-service -p &quot;{\\&quot;spec\\&quot;: {\\&quot;selector\\&quot;: {\\&quot;app\\&quot;: \\&quot;bankapp\\&quot;, \\&quot;version\\&quot;: \\&quot;&#39;&#39;&#39; + newEnv + &#39;&#39;&#39;\\&quot;}}}&quot; -n ${KUBE_NAMESPACE}</pre><p>This command will help to switch the traffic</p><p>We have used a When condition: this stage will only run if the switch traffic is enabled</p><h3>Last Stage: To Verify the deployment</h3><h4>15th Stage: Verify Deployment</h4><pre>stage(&#39;Verify Deployment&#39;) {<br>            steps {<br>                script {<br>                    def verifyEnv = params.DEPLOY_ENV<br>                    withKubeConfig(caCertificate: &#39;&#39;, clusterName: &#39;amit-cluster&#39;, contextName: &#39;&#39;, credentialsId: &#39;k8-token&#39;, namespace: &#39;webapps&#39;, restrictKubeConfigAccess: false, serverUrl: &#39;https://46743932FDE6B34C74566F392E30CABA.gr7.ap-south-1.eks.amazonaws.com&#39;) {<br>                        sh &quot;&quot;&quot;<br>                        kubectl get pods -l version=${verifyEnv} -n ${KUBE_NAMESPACE}<br>                        kubectl get svc bankapp-service -n ${KUBE_NAMESPACE}<br>                        &quot;&quot;&quot;<br>                    }<br>                }<br>            }<br>        }</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gTTS5uIJgceRr4gi" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e4yJYwVvfqNEuoCJ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UvHnK09mKF-db6FO" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BhihQk2DE6rklvhF" /></figure><h3>Jenkins Pipeline Steps</h3><ol><li><strong>Fetch the EKS Cluster Endpoint</strong></li><li><strong>Deploy MySQL</strong></li><li><strong>Deploy Application Service</strong></li><li><strong>Deploy Application Pod (Blue or Green)</strong></li><li><strong>Switch Traffic Based on Parameters</strong></li><li><strong>Verify Deployment</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HzdYFgo-m03xoQKL" /></figure><h3>Now we are moving ahead with green environment and switch traffic from blue to green</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Vv82Kw27SfxPUrw3" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zjfNE404dd7Afrk7" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QQ5BoJoEkIudAYU2" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zr9xnJPrmViyMfPK" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*svBCgmcPjfOkw4He" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z2VN4wkZqNCK9Bsq" /></figure><h3>Final Thoughts</h3><ul><li><strong>First, deploy Blue and verify it works.</strong></li><li><strong>For upgrades, deploy Green and switch traffic.</strong></li><li><strong>Use Jenkins to automate the entire process.</strong></li><li><strong>Keep both versions running for rollback. 🚀</strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5882515ff62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up NGINX on Ubuntu: My DevOps Stage 0 Experience]]></title>
            <link>https://medium.com/@shegezzy/setting-up-nginx-on-ubuntu-my-devops-stage-0-experience-f46495a7bd26?source=rss-e3fc5a9da2ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/f46495a7bd26</guid>
            <category><![CDATA[devops-practice]]></category>
            <category><![CDATA[devops-training]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Shegezzy]]></dc:creator>
            <pubDate>Fri, 31 Jan 2025 01:31:17 GMT</pubDate>
            <atom:updated>2025-01-31T01:31:17.901Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Embarking on the DevOps Stage 0 task at HNG was an exciting opportunity to work hands-on with NGINX, a widely used web server. This task involved installing and configuring NGINX on a fresh Ubuntu server and serving a custom HTML page. In this blog, I will walk through my approach, the challenges I faced, and my key takeaways from this experience.</p><h3>Step-by-Step Approach</h3><h3>1. Provisioning the Ubuntu Server</h3><p>To get started, I set up an Ubuntu server using a Amazon Web Service as my cloud provider. After connecting to the instance via SSH, I updated the package list to ensure all dependencies were up to date:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lmCodKkEyE1fO58qIx7faw.png" /></figure><pre>sudo apt update &amp;&amp; sudo apt upgrade -y</pre><h3>2. Installing NGINX</h3><p>Next, I installed the NGINX web server using the following command:</p><pre>sudo apt install nginx -y</pre><p>Once the installation was complete, I started and enabled the service to ensure it runs on boot:</p><pre>sudo systemctl start nginx<br>sudo systemctl enable nginx</pre><p>To confirm that NGINX was running successfully, I used:</p><pre>systemctl status nginx</pre><h3>3. Creating a Custom HTML Page</h3><p>I then modified the default NGINX page to display my personalized message:</p><pre>sudo tee /var/www/html/index.html &lt;&lt;EOF<br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;DevOps Stage 0&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;h1&gt;Welcome to DevOps Stage 0 - Olusegun Akinnola&lt;/h1&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br>EOF</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zFttwk8rsZsUTnf3xHIldQ.png" /></figure><p>After making these changes, I restarted NGINX:</p><pre>sudo systemctl restart nginx</pre><h3>4. Testing the Web Page</h3><p>To verify that my custom page was accessible, I retrieved my server’s public IP address:</p><pre>curl ifconfig.me</pre><p>I then entered <a href="http://35.173.133.50/">http://35.173.133.50</a> in a browser and confirmed that my custom message is displaying.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ml7GyPbK6-f6Jd9E7F4wSA.png" /></figure><h3>Challenges and How I Overcame Them</h3><ol><li><strong>Firewall Blocking Access</strong><br>Initially, I couldn’t access the web page from my browser. I realized that the firewall was blocking traffic, so I enabled access for NGINX:</li></ol><pre>sudo ufw allow &#39;Nginx HTTP&#39;<br>sudo ufw enable</pre><p><strong>2. Permission Issues with index.html</strong><br>I encountered permission issues while modifying the default HTML file. Using sudo allowed me to successfully write to the file.</p><p><strong>3. NGINX Not Restarting Properly</strong><br>After making changes, NGINX failed to restart. Checking the logs with sudo journalctl -xe helped me identify a syntax error in my configuration.</p><h3>Key Takeaways</h3><ul><li>This task reinforced my understanding of web server configurations and file permissions.</li><li>Debugging issues helped me develop troubleshooting skills, a crucial aspect of DevOps.</li><li>Proper firewall rules are essential for making services accessible on the internet.</li></ul><h3>How This Contributes to My Professional Growth</h3><p>Mastering NGINX is fundamental for anyone in DevOps, Site Reliability Engineering, or Cloud Engineering. This hands-on experience strengthened my ability to deploy and configure web servers, which is crucial for managing scalable and reliable infrastructure.</p><p>Additionally, I referenced <a href="https://hng.tech/hire/devops-engineers"><strong>DevOps Engineers</strong></a>, <a href="https://hng.tech/hire/cloud-engineers"><strong>Cloud Engineers</strong></a>, and <a href="https://hng.tech/hire/site-reliability-engineers"><strong>Site Reliability Engineers</strong></a> to align my learning with industry needs.</p><h3>Conclusion</h3><p>Completing this task gave me practical insights into server management and web hosting. It was a rewarding experience that highlighted the importance of troubleshooting, automation, and efficient configurations. I look forward to tackling more DevOps challenges and refining my skills further!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f46495a7bd26" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>