<?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 SQANA on Medium]]></title>
        <description><![CDATA[Stories by SQANA on Medium]]></description>
        <link>https://medium.com/@sqanafrica?source=rss-b6c972eaf6c5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YwZsAQT6SLI9jXG6jDXi0w.png</url>
            <title>Stories by SQANA on Medium</title>
            <link>https://medium.com/@sqanafrica?source=rss-b6c972eaf6c5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 14:28:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sqanafrica/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[Stop Copying Terraform Code: Why Every Growing Infrastructure Needs Terragrunt]]></title>
            <link>https://medium.com/@sqanafrica/stop-copying-terraform-code-why-every-growing-infrastructure-needs-terragrunt-59ad9bdb2f9e?source=rss-b6c972eaf6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/59ad9bdb2f9e</guid>
            <category><![CDATA[cloud-engineering]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[terragrunt]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[SQANA]]></dc:creator>
            <pubDate>Wed, 26 Aug 2026 14:42:14 GMT</pubDate>
            <atom:updated>2026-08-26T14:42:14.743Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mjxyfJQh9pfFML1U2EKBHg.png" /></figure><p>There comes a point in almost every Terraform engineer’s journey where the excitement of Infrastructure as Code slowly begins to give way to frustration.</p><p>It often starts innocently enough. You build your first environment, everything works beautifully, and then someone asks for a staging environment. Shortly after that comes production. Before long, you find yourself copying the same provider configuration, the same backend configuration, and the same module definitions from one folder to another, changing only a few values along the way.</p><p>At first, it feels harmless.</p><p>Months later, you discover that fixing one small configuration means hunting through dozens of nearly identical files, hoping you don’t miss one. What once looked organized has quietly become difficult to maintain.</p><p>This is exactly the problem <strong>Terragrunt</strong> was created to solve.</p><p>Rather than replacing Terraform, Terragrunt wraps around it, helping teams eliminate repetitive configuration while making infrastructure easier to organize, scale, and maintain. It embraces one of the oldest and most valuable principles in software engineering: DRY, <strong>Don’t Repeat Yourself</strong>.</p><h3>The Problem with Raw Terraform at Scale</h3><p>Terraform is an outstanding Infrastructure as Code tool, but once your infrastructure begins to grow, the scaffolding around your actual resources can become surprisingly repetitive.</p><p>Every environment typically needs the same provider configuration. Every environment usually points to the same backend type. Every module requires similar setup.</p><p>Here’s what that repetition actually looks like once you have three environments running side by side:</p><pre>infrastructure/<br>├── dev/<br>│   ├── main.tf<br>│   ├── variables.tf<br>│   ├── outputs.tf<br>│   ├── providers.tf        # nearly identical to staging and production<br>│   └── backend.tf          # nearly identical to staging and production<br>├── staging/<br>│   ├── main.tf<br>│   ├── variables.tf<br>│   ├── outputs.tf<br>│   ├── providers.tf        # copy-pasted from dev<br>│   └── backend.tf          # copy-pasted from dev<br>└── production/<br>    ├── main.tf<br>    ├── variables.tf<br>    ├── outputs.tf<br>    ├── providers.tf        # copy-pasted from dev, hopefully kept in sync<br>    └── backend.tf          # copy-pasted from dev, hopefully kept in sync</pre><p>Notice anything?</p><p>The provider is duplicated.</p><p>The backend is duplicated.</p><p>Most of the configuration is duplicated.</p><p>The more environments you introduce, the more this duplication accumulates. Every future change becomes another opportunity for inconsistency. One forgotten update in production, one backend configured differently from staging, or one provider version left behind can quickly become an expensive mistake.</p><p>Terragrunt approaches this differently. Instead of defining identical configurations repeatedly, you define them once in a shared configuration file, and every environment inherits those settings automatically. Suddenly, your infrastructure becomes smaller, cleaner, and significantly easier to reason about.</p><h3>A Cleaner Terragrunt Folder Structure</h3><p>One of the most practical improvements Terragrunt brings is a clear separation between reusable infrastructure modules and the environments that consume them.</p><p>A common Terragrunt project structure looks something like this:</p><ul><li><strong>infrastructure-modules</strong> — reusable Terraform modules such as VPCs, EC2 instances, databases, or Kubernetes clusters.</li><li><strong>infrastructure-live</strong> — the actual environments, like Development, Staging, and Production, each referencing those modules.</li></ul><pre>infrastructure-modules/<br>├── vpc/<br>│   ├── main.tf<br>│   ├── variables.tf<br>│   └── outputs.tf<br>├── ec2/<br>│   ├── main.tf<br>│   ├── variables.tf<br>│   └── outputs.tf<br>└── rds/<br>    ├── main.tf<br>    ├── variables.tf<br>    └── outputs.tf</pre><pre>infrastructure-live/<br>├── root.hcl                  # shared provider + backend config, inherited by everything below<br>├── dev/<br>│   ├── vpc/terragrunt.hcl<br>│   ├── ec2/terragrunt.hcl<br>│   └── rds/terragrunt.hcl<br>├── staging/<br>│   ├── vpc/terragrunt.hcl<br>│   ├── ec2/terragrunt.hcl<br>│   └── rds/terragrunt.hcl<br>└── production/<br>    ├── vpc/terragrunt.hcl<br>    ├── ec2/terragrunt.hcl<br>    └── rds/terragrunt.hcl</pre><p>Notice what disappeared: there’s no providers.tf or backend.tf duplicated in every environment folder anymore. Each terragrunt.hcl file is a few lines pointing at a module and supplying environment-specific inputs, not a full copy of your infrastructure code.</p><p>This separation makes it much easier to understand what your infrastructure does versus where it is deployed. Instead of duplicating Terraform code across environments, each environment simply references the reusable module while supplying its own inputs. The result is infrastructure that is far easier to maintain as your organization grows.</p><h3>Write Once, Reuse Everywhere: The root.hcl File</h3><p>One of Terragrunt’s biggest strengths is its ability to centralize configuration.</p><p>Rather than defining your AWS provider configuration and remote state backend inside every module, you place them in a root configuration file, commonly named root.hcl:</p><pre># infrastructure-live/root.hcl</pre><pre>remote_state {<br>  backend = &quot;s3&quot;<br>  generate = {<br>    path      = &quot;backend.tf&quot;<br>    if_exists = &quot;overwrite&quot;<br>  }<br>  config = {<br>    bucket         = &quot;my-company-terraform-state&quot;<br>    key            = &quot;${path_relative_to_include()}/terraform.tfstate&quot;<br>    region         = &quot;us-east-1&quot;<br>    encrypt        = true<br>    dynamodb_table = &quot;terraform-locks&quot;<br>  }<br>}</pre><pre>generate &quot;provider&quot; {<br>  path      = &quot;provider.tf&quot;<br>  if_exists = &quot;overwrite&quot;<br>  contents  = &lt;&lt;EOF<br>provider &quot;aws&quot; {<br>  region = &quot;us-east-1&quot;<br>}<br>EOF<br>}</pre><p>Every child configuration then inherits those settings automatically, using an include block:</p><pre># infrastructure-live/dev/vpc/terragrunt.hcl</pre><pre>include &quot;root&quot; {<br>  path = find_in_parent_folders()<br>}</pre><pre>terraform {<br>  source = &quot;../../../infrastructure-modules/vpc&quot;<br>}</pre><pre>inputs = {<br>  cidr_block  = &quot;10.0.0.0/16&quot;<br>  environment = &quot;dev&quot;<br>}</pre><p>The benefit becomes obvious the first time you need to make a global change. Need to upgrade your provider version? Need to modify your backend configuration? Need to change tagging standards across your entire infrastructure? Instead of updating dozens of Terraform files individually, you make the change once in root.hcl. The rest of your environments simply inherit it.</p><h3>Better State Management with Isolated State Files</h3><p>Terraform state files are incredibly valuable, but they can also become one of the biggest operational headaches in large projects.</p><p>A single monolithic state file eventually becomes slower to refresh, slower to plan against, and riskier to modify. One mistake has the potential to affect resources that were never intended to be touched.</p><p>Terragrunt encourages breaking infrastructure into smaller, isolated states, one per module per environment. Given the key pattern in the root.hcl example above, your S3 backend ends up organized like this:</p><pre>s3://my-company-terraform-state/<br>├── dev/vpc/terraform.tfstate<br>├── dev/ec2/terraform.tfstate<br>├── dev/rds/terraform.tfstate<br>├── staging/vpc/terraform.tfstate<br>├── staging/ec2/terraform.tfstate<br>├── staging/rds/terraform.tfstate<br>├── production/vpc/terraform.tfstate<br>├── production/ec2/terraform.tfstate<br>└── production/rds/terraform.tfstate</pre><p>Each module maintains its own state independently. This brings several practical advantages. Deployments become faster because Terraform works against smaller state files. Failures become easier to isolate. Changes to one resource are far less likely to interfere with completely unrelated infrastructure. As your infrastructure expands, this isolation becomes increasingly valuable.</p><h3>Managing Dependencies Without the Guesswork</h3><p>Infrastructure rarely exists in isolation. An EC2 instance usually depends on a VPC. An application often depends on a database. A Kubernetes cluster may rely on networking resources that must already exist.</p><p>Without careful orchestration, deployment quickly becomes a sequence of manual steps that engineers must remember every time.</p><p>Terragrunt simplifies this through dependency blocks. Instead of relying on documentation or tribal knowledge, dependencies become part of your infrastructure configuration itself:</p><pre># infrastructure-live/dev/ec2/terragrunt.hcl</pre><pre>include &quot;root&quot; {<br>  path = find_in_parent_folders()<br>}</pre><pre>terraform {<br>  source = &quot;../../../infrastructure-modules//ec2&quot;<br>}</pre><pre>dependency &quot;vpc&quot; {<br>  config_path = &quot;../vpc&quot;<br>}</pre><pre>inputs = {<br>  vpc_id    = dependency.vpc.outputs.vpc_id<br>  subnet_id = dependency.vpc.outputs.subnet_id<br>}</pre><p>Here, the ec2 module doesn&#39;t need you to manually copy the VPC ID from one apply into another module&#39;s variables. Terragrunt reads it directly from the VPC module&#39;s outputs, and it knows to run the VPC deployment first. Deployments occur in the correct order, making the entire process far more predictable.</p><h3>Is Terragrunt Still Worth Using in 2026?</h3><p>This question comes up frequently because Terraform itself has evolved significantly over the years.</p><p>The short answer is yes.</p><p>Terraform has become more capable, but it still leaves much of the multi-environment organization and orchestration to the engineer. Terragrunt continues to fill that gap remarkably well.</p><p>If you’re currently learning Terraform, or if you’re just a single developer and your company and your infrastructure consists of a single environment with only a handful of modules, Terraform by itself is usually more than sufficient. Adding another abstraction may simply introduce unnecessary complexity.</p><p>However, the story changes as your infrastructure grows. If you’re managing multiple environments, maintaining numerous modules with shared configuration, or coordinating complex deployment dependencies, Terragrunt removes a tremendous amount of repetitive work.</p><p>It becomes especially valuable when:</p><ul><li>You manage several environments and want them to remain consistently configured.</li><li>Your infrastructure contains many modules with interdependent resources.</li><li>Your Terraform state has grown large enough to become difficult or risky to manage.</li><li>Your team has grown from one to multiple engineers managing/using the same infrastructure</li><li>You want cleaner project organization and significantly less duplicated configuration.</li></ul><h3>Final Thoughts</h3><p>Every engineering team eventually reaches a point where maintaining infrastructure becomes more challenging than creating it.</p><p>That transition rarely happens because Terraform stops working. It happens because duplicated configuration quietly accumulates until every change feels larger than it should.</p><p>Terragrunt addresses that problem without asking you to abandon Terraform. Instead, it complements Terraform by removing repetition, improving project organization, simplifying dependency management, and making infrastructure easier to scale over time.</p><p>If your Terraform repository still feels small, Terraform alone will likely serve you well.</p><p>But if you’ve reached the point where you’re copying configuration files from one environment to another, or dreading the thought of making the same change in ten different places, Terragrunt is no longer just a convenience.</p><p>It becomes one of the simplest ways to bring structure, consistency, and long-term maintainability back to your infrastructure.</p><p>I came across this beginner-friendly terragrunt tutorial on YouTube; feel free to check it out: <a href="https://www.youtube.com/watch?v=chMAwiNaAak">https://www.youtube.com/watch?v=chMAwiNaAak</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59ad9bdb2f9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Built a K3s Kubernetes Homelab With GitOps And Argo CD]]></title>
            <link>https://medium.com/@sqanafrica/how-i-built-a-k3s-kubernetes-homelab-with-gitops-and-argo-cd-0472a9361d08?source=rss-b6c972eaf6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/0472a9361d08</guid>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[devops-practice]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[SQANA]]></dc:creator>
            <pubDate>Thu, 12 Feb 2026 20:11:05 GMT</pubDate>
            <atom:updated>2026-02-13T22:02:02.920Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OfGIzxx9YbvXexlDfAWO9w.png" /></figure><p>For the past few months, I’ve been on a mission to turn my homelab into a “real” platform: version‑controlled infrastructure, repeatable deployments, and a place to run all the small apps I’ve been hacking on.</p><p>I didn’t want a pile of kubectl apply commands and half‑forgotten YAML files. I wanted something closer to how things run in production: a real Kubernetes cluster, infrastructure defined in Git, and a deployment story that did not rely on me remembering which kubectl apply command I had run last week.</p><p>This is the story of how I put that together: a K3s-based homelab cluster wired to a GitOps repository, with Argo CD keeping everything in sync and a small scaffolding tool that generates all the boilerplate manifests for every new app I intend to deploy.</p><p>It really is a lived setup. I broke things, hit limitations, changed course, and learned a lot in the process.</p><p>In this article, I’ll walk through:</p><ul><li><strong>Why </strong>I went with GitOps for my homelab.</li><li><strong>Why </strong>I chose to use K3s for cluster setup</li><li><strong>How </strong>I built the cluster itself on a Windows machine using WSL and Ubuntu-24.04</li><li><strong>How </strong>my GitOps repository is structured (bases, overlays, Argo CD apps).</li><li>The <strong>scaffolding tool </strong>that generates new app manifests and Argo applications.</li><li>My <strong>deployment workflow</strong> from code to running pods.</li><li>A few <strong>lessons learned</strong>, including handling secrets safely.</li></ul><h3>High‑level architecture</h3><p>At a high level, my setup looks like this:</p><ul><li><strong>GitHub repo: </strong>homelab-gitops<br>The declarative configuration for all applications and related infrastructure pieces.</li><li><strong>Kubernetes cluster:</strong> my homelab cluster running:<br>- Argo CD in its own namespace (argocd)<br>- Namespaces like homelab-dev where my applications live.</li><li><strong>Argo CD:</strong><br>- One root application that points to argocd/apps.<br>- Multiple child applications, one per app (e.g. dockerfile-generator-frontend, taskflow-backend, sukuulu, etc.).</li><li><strong>App manifests:<br>- </strong>Bases: shared configuration (Deployment, Service, etc.).<br>- Overlays: environment‑specific customization (e.g. homelab-dev), plus an optional version.yaml for image tags.</li><li><strong>Scaffolding tool:</strong> a PowerShell script (with a simple GUI) that generates:<br>- Base manifests under apps/bases/&lt;app-name&gt;/<br>- Overlays under apps/overlays/&lt;env&gt;/&lt;app-name&gt;/<br>- Argo CD application manifests under argocd/apps/&lt;app-name&gt;.yaml</li></ul><p>Everything runs through a Git→Argo CD→Kubernetes loop. I commit changes, Argo CD reads them, and the cluster converges.</p><h3>Why GitOps for a homelab?</h3><p>At first glance, GitOps can feel like overkill for a home cluster. But once you start running multiple apps, it becomes very easy to lose track of what’s deployed where and why.</p><p>I wanted:</p><ul><li><strong>Single source of truth:</strong> The cluster state should reflect what’s in Git, not a series of manual applies.</li><li><strong>Auditability:</strong> Every change to the cluster goes through a Git commit.</li><li><strong>Easy rollbacks: </strong>Revert a commit, and the cluster self‑heals back to the previous state.</li><li><strong>Consistency across apps:</strong> All of my <em>vibe‑coded</em> apps should follow the same deployment pattern.</li></ul><p>Argo CD gives me a control plane that watches my homelab-gitops repository and continuously reconciles my Kubernetes cluster to match it. If something drifts (a manual change, a broken deployment), Argo CD flags it and, in many cases, fixes it automatically.</p><h3>Why K3s?</h3><p>My first instinct was to use Kind. It is simple to install, perfect for CI, and great for quick experiments. But after a bit of use, I ran into its limits for a homelab.</p><p>Kind runs Kubernetes itself inside Docker containers. That is fine conceptually, but I started to feel the layers:</p><ul><li>HostPath mounts were slightly awkward.</li><li>Buit for disposable clusters, best for short-lived testing</li><li>It did not feel like a “real” node with a systemd-managed kubelet.</li></ul><p>What I wanted was:</p><ul><li>A real Linux node with Kubernetes running as a service.</li><li>A container runtime that felt closer to a normal cluster.</li><li>Something lightweight enough for a single machine, but still realistic.</li></ul><p>That is what pushed me toward <a href="https://k3s.io/">K3s</a>. It is a CNCF-certified Kubernetes distribution that is stripped down and tuned for edge and small environments. It installs as a systemd service, uses containerd by default, ships with Traefik as an ingress controller, and still behaves like the Kubernetes I would expect to see in production.</p><p>Once I made that switch, the whole homelab felt less like a demo and more like an actual small cluster.</p><h3>How I Set up The K3s Cluster</h3><h4>Step 1: Setting Up Ubuntu On WSL</h4><p>I run Windows, but I wanted a Linux environment that felt native. WSL was the obvious choice.</p><p>The high-level steps were:</p><ul><li>Enable WSL and install Ubuntu from the Microsoft Store.</li><li>Open an Ubuntu terminal and treat it like my “control plane” for everything Kubernetes related.</li></ul><p>Inside Ubuntu I updated the system and installed a few basics:</p><pre>sudo apt update &amp;&amp; sudo apt upgrade -y<br>sudo apt install -y curl</pre><p>From this point on, all the cluster work happened inside that Ubuntu shell.</p><h4>Step 2: Installing K3s</h4><p>Once Ubuntu was ready, installing K3s was surprisingly painless. Rancher provides a simple install script that pulls down and configures everything.</p><pre>curl -sfL https://get.k3s.io | sh -</pre><p>That one line set up:</p><ul><li>kubelet and control plane components</li><li>containerd</li><li>kubectl (via the K3s distribution)</li><li>CoreDNS</li><li>Traefik ingress</li><li>A local storage provisioner</li></ul><p>K3s runs as a systemd service. I could check its status with:</p><pre>sudo systemctl status k3s</pre><p>To confirm that the cluster was up, I used:</p><pre>kubectl get nodes</pre><p>At this stage I had a single-node cluster acting as both control plane and worker. It already felt closer to a real environment than Kubernetes in Docker.</p><h4>Step 3: Making kubeconfig Comfortable To Use</h4><p>By default, K3s stores its kubeconfig at:</p><pre>/etc/rancher/k3s/k3s.yaml</pre><p>To use kubectl without sudo and without constantly pointing at that path, I copied it into my home directory:</p><pre>mkdir -p $HOME/.kube<br>sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config<br>sudo chown &quot;$USER:$USER&quot; $HOME/.kube/config</pre><p>Now I could run:</p><pre>kubectl get pods -A</pre><p>with normal user permissions.</p><p>Because I was running inside WSL, I also adjusted the server field in that kubeconfig when I wanted to reach the cluster from Windows tools (PowerShell, CMD, Lens). The kubeconfig generated by K3s points to https://127.0.0.1:6443 , which works inside WSL but not from Windows.</p><p>To solve this, I first retrieved the WSL IP address:</p><pre>ip addr show eth0</pre><p>Then I updated the server field in the kubeconfig file from:</p><pre>server: https://127.0.0.1:6443</pre><p>to:</p><pre>server: https://&lt;WSL-IP&gt;:6443</pre><p>After that, I copied the modified kubeconfig to:</p><pre>C:\Users\&lt;MyUser&gt;\.kube\config</pre><p>on Windows.</p><p>Once configured, I could now run kubectl commands both inside Ubuntu and directly from Windows, giving me a consistent and practical development workflow.</p><h4>Step 4: Adding Argo CD For GitOps</h4><p>A running cluster is nice, but my real goal was GitOps. That meant installing Argo CD and letting it drive all changes based on what is in Git.</p><p>First, I created an argocd namespace:</p><pre>kubectl create namespace argocd</pre><p>Then I installed Argo CD using the official manifests:</p><pre>kubectl apply -n argocd \<br>  -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml</pre><p>After a short wait I checked its pods:</p><pre>kubectl get pods -n argocd</pre><p>Once they were all running, I port-forwarded the server to access the UI from my browser:</p><pre>kubectl -n argocd port-forward svc/argocd-server 8080:443</pre><p>Opening https://localhost:8080 showed the Argo CD login screen.</p><p>The initial admin password lives in a Kubernetes Secret. I grabbed it with:</p><pre>kubectl get secret argocd-initial-admin-secret \<br>  -n argocd \<br>  -o jsonpath=&quot;{.data.password}&quot; | base64 --decode</pre><p>I logged in as admin, changed the password immediately in the UI, and from that point on I had a proper GitOps dashboard for the cluster.</p><h4>Step 5: Creating The homelab GitOps Repository</h4><p>With K3s and Argo CD running, I needed a place to define the desired state. That became a GitHub repository called homelab-gitops.</p><p>I created a matching directory structure locally and a corresponding repo on GitHub. Initially, I made it public to simplify bootstrapping. Later, I added proper SSH access and tightened things up.</p><p>The repository is laid out roughly like this:</p><ul><li>argocd/ - Argo CD Application manifests.</li><li>apps/bases/ - base Kustomize packages for each application.</li><li>apps/overlays/&lt;environment&gt;/ - environment-specific overlays, for example homelab-dev.</li></ul><p>This layout gives me a single place to describe every application in the cluster and how it is deployed.</p><h4>Step 6: Wiring Argo CD To GitHub With SSH</h4><p>Pointing Argo CD at the repository is straightforward when the repo is public and uses HTTPS, but my eventual goal was a private repo with SSH-based access. Along the way, I also had to deal with an accidentally committed personal access token, so I was motivated to do this correctly.</p><p>The first time I tried to sync against a private repo, Argo CD responded with a familiar message:</p><blockquote><em>ComparisonError: failed to list refs: authentication required: Repository not found</em></blockquote><p>That was its way of saying, <em>“I cannot reach this repository with the credentials you have given me.”</em></p><p>To fix this cleanly, I created an SSH keypair specifically for Argo CD and stored it in a Kubernetes Secret.</p><h4><strong>a) Creating The Argo CD SSH Key</strong></h4><p>Inside my GitOps environment I ran:</p><pre>ssh-keygen -t rsa -b 4096 -C &quot;argocd-homelab&quot; -f ./argocd-homelab -N &quot;&quot;</pre><p>That gave me:</p><ul><li>argocd-homelab (private key)</li><li>argocd-homelab.pub (public key)</li></ul><h4>b) Creating The Kubernetes Secret</h4><p>Then I created a Secret in the argocd namespace that contains this key and the repo URL:</p><pre>kubectl create secret generic repo-homelab-gitops \<br>  -n argocd \<br>  --from-literal=url=git@github.com:MarkBenjaminKatamba/homelab-gitops.git \<br>  --from-file=sshPrivateKey=./argocd-homelab \<br>  -o yaml | kubectl apply -f -</pre><p>By itself, Argo CD doesn’t yet know that this Secret is meant to be a repository credential.</p><h4>c) Labeling the Secret so Argo recognizes it</h4><p>Argo CD uses a label to know which Secrets are repository credentials, so I added that too:</p><pre>kubectl label secret repo-homelab-gitops \<br>  -n argocd \<br>  argocd.argoproj.io/secret-type=repository --overwrite</pre><p>Now Argo CD sees this as a repository connection secret with:</p><ul><li>SSH private key: sshPrivateKey</li><li>Repo URL: git@github.com:MarkBenjaminKatamba/homelab-gitops.git</li></ul><h4>d) Updating the Argo CD Applications to use SSH</h4><p>In my Argo CD Application manifests, I changed repoURL to the SSH form:</p><pre>repoURL: git@github.com:MarkBenjaminKatamba/homelab-gitops.git<br># instead of https://github.com/MarkBenjaminKatamba/homelab-gitops.git</pre><p>This ensures that all Argo CD traffic to GitHub uses SSH + the secret instead of HTTPS + tokens.</p><h4>e) Adding The Deploy Key On GitHub</h4><p>Finally, I added the public key from argocd-homelab.pub as a Deploy Key in the homelab-gitops repository settings on GitHub (<em>Go to GitHub → </em><em>homelab-gitops → Settings → Deploy Keys</em>). With that in place, Argo CD had read access through SSH, and the GitOps loop was complete.</p><h4>Step 7: Designing The GitOps Structure</h4><p>Once the basic plumbing worked, I needed a systematic way to describe applications.</p><p>I ended up with three main layers.</p><h4>Argo CD root and child applications</h4><p>Inside argocd/ I keep:</p><ul><li>apps-root.yaml - a &quot;root&quot; Argo CD Application that points to argocd/apps.</li><li>apps/*.yaml - a child Application for each app in the cluster.</li></ul><p>apps-root.yaml tells Argo CD:</p><ul><li>Watch the homelab-gitops repo at the argocd/apps path.</li><li>Automatically create and manage any Application manifests found there.</li><li>Sync them automatically, prune old resources, and self-heal when drift is detected.</li></ul><p>Each child Application then points to an overlay directory under apps/overlays, which is where the actual Kubernetes manifests live.</p><h4>Base manifests</h4><p>Every app has a base at apps/bases/&lt;app-name&gt;/ with:</p><ul><li>deployment.yaml</li><li>service.yaml</li><li>kustomization.yaml</li></ul><p>The base defines the core Deployment and Service. It is not environment-specific. It just says <em>“this is how this application runs in Kubernetes in general.”</em></p><h4>Overlays per environment</h4><p>Then for each environment I have overlays at apps/overlays/&lt;environment&gt;/&lt;app-name&gt;/. For example:</p><pre>apps/overlays/homelab-dev/dockerfile-generator-frontend/</pre><p>An overlay typically contains:</p><ul><li>A kustomization.yaml that references the base.</li><li>A version.yaml patch for overriding the container image tag and sometimes other fields like labels or replicas.</li></ul><p>This pattern lets me describe one app that can run in multiple environments with small deltas, instead of copying entire deployment files.</p><h4>Step 8: The Scaffolding Tool That Glues It Together</h4><p>By the time I had several apps, I realized that creating bases, overlays, and Argo CD Application manifests by hand was boring and easy to get wrong.</p><p>So I wrote a small scaffolding tool in tools/scaffold-app:</p><ul><li>New-App.ps1 - a PowerShell script that generates:<br>- apps/bases/&lt;AppName&gt;/{deployment.yaml,service.yaml,kustomization.yaml} <br>- apps/overlays/&lt;Env&gt;/&lt;AppName&gt;/{kustomization.yaml,version.yaml} <br>-argocd/apps/&lt;AppName&gt;.yaml</li><li>New-App.GUI.ps1 - a simple GUI wrapper that calls the same script.</li><li>templates/ - template YAML files with placeholders for things like app name, container image, port, and repo URL.</li></ul><p>From the repo root, creating a new app looks like this:</p><pre>pwsh ./tools/scaffold-app/New-App.ps1 `<br>  -AppName my-service `<br>  -ContainerName api `<br>  -ContainerPort 8080 `<br>  -Image ghcr.io/you/my-service:latest `<br>  -Env homelab-dev `<br>  -Namespace homelab-dev `<br>  -RepoURL git@github.com:MarkBenjaminKatamba/homelab-gitops.git `<br>  -TargetRevision HEAD</pre><p>The script fills in template variables, writes out all the YAML in the right places, and leaves me with a ready-to-sync app.</p><p>If I do not want to remember all those parameters, I can use the GUI script:</p><pre>pwsh ./tools/scaffold-app/New-App.GUI.ps1</pre><p>The GUI lets me type values into fields and then generates everything in the same way.</p><p>I might tweak a couple of details, such as resource limits, environment variables, or a more specific image tag in version.yaml, but 90% of the plumbing is handled.</p><p>This tool is not large, but it changed the feel of the whole setup. Adding a new app went from <em>“sigh, time to copy and edit another set of manifests”</em> to <em>“fill out a short form and commit the result.”</em></p><p>I wrote a more detailed article about how I created this scaffold app tool; feel free to check it out <a href="https://medium.com/@sqanafrica/stop-copy-pasting-manifests-how-i-automated-kubernetes-argo-cd-app-scaffolding-windows-friendly-eb2c1ddf247f">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*lXLUhRIb-Nt5kjCF" /></figure><h3>A day in the life: deploying a new app</h3><p>Once everything was wired up, my day‑to‑day loop for new and existing “vibe‑coded” apps became very straightforward:</p><ol><li>Develop app code in its own repo and build a Docker image (often tagged with a commit SHA).</li><li>A GitHub Actions workflow in that app repository kicks in automatically. It:</li></ol><ul><li>Builds a Docker image for the app, usually tagged with the commit SHA.</li><li>Pushes the image to GitHub Container Registry (GHCR).</li><li>Updates the corresponding apps/overlays/&lt;environment&gt;/&lt;app-name&gt;/version.yaml file in the homelab-gitops repository with the new image tag and commits that change. I do not touch the image tag manually in version.yaml – the workflow owns that.</li></ul><p>3. Argo CD notices the new commit in homelab-gitops, pulls the repository via SSH, renders the updated Kustomize overlay, and applies the changes to the cluster.</p><p>4. If a deployment causes issues, I do not change anything directly in the GitOps repository. Instead, I revert the problematic commit in the app repository. That revert triggers the GitHub Actions workflow again, which builds and pushes the image for the reverted state and updates the <em>version.yaml</em> back to the previous image tag in homelab-gitops. Argo CD then sees the desired state change and rolls the cluster back to the earlier version.</p><p>There is no manual kubectl apply in this flow. The applications move from source code to running pods through a chain of Git pushes, GitHub Actions automation, and Argo CD reconciliation, with homelab-gitops acting as the single source of truth in the middle.</p><h3>Lessons learned (especially about secrets)</h3><p>One of the more educational moments in this project was around secrets and Git history.</p><p>At one point I accidentally committed a GitHub personal access token into the repository. Tools like GitGuardian and GitHub’s own secret scanning caught it and notified me:</p><ul><li>Even though I later deleted the file and added it to .gitignore, the token was still present in older commits.</li><li>GitHub automatically revoked the PAT to protect my account.</li><li>I had to rotate credentials and ensure Argo CD wasn’t relying on that token.</li></ul><p>In the end, the long‑term solution was:</p><ul><li>Use SSH deploy keys for Argo CD’s access to homelab-gitops instead of PATs.</li><li>Store credentials in Kubernetes Secrets (created with kubectl), not in plain YAML in the repo.</li><li>Use path‑based history rewriting (e.g. git filter-repo) to remove the offending files from history.</li><li>Put <em>all</em> secret‑like paths in .gitignore so they never get committed again.</li></ul><p>The takeaway: in a GitOps world, Git is the source of truth — not only for your cluster, but also for your mistakes. Once a secret is committed, you must assume it’s compromised, rotate it, and then clean up history.</p><h3>Why this setup works well for a homelab</h3><p>Even though this is “just” a homelab, the GitOps approach gives me a ton of benefits:</p><ul><li><strong>Production‑like practices at home</strong><br>I get to practice the same workflows I’d expect in a professional environment: PRs, reviews, rollbacks, and declarative infra.</li><li>F<strong>ast onboarding for new apps</strong><br>With the scaffolding tool, spinning up a new service is mostly about choosing an image and port, not drowning in repetitive YAML.</li><li><strong>Self‑documenting cluster state</strong><br>Anyone (including future me) can clone homelab-gitops and understand what’s running in the cluster just by reading the repo.</li><li><strong>Easy experiments</strong><br>I can experiment with new apps or configurations with confidence. If it doesn’t work out, I revert the commit and let Argo CD heal the cluster.</li></ul><p>Most importantly, this setup behaves a lot like the environments I want to work with professionally. I get to practice real workflows at homelab scale: pull requests, reviews, rollouts, rollbacks, and a cluster that always tries to match what Git says the world should look like.</p><p>If you’re running your own homelab and want something more structured than a pile of ad‑hoc YAML files, this kind of GitOps‑driven approach is absolutely worth the effort.</p><p>Remember to leave clap if you loved what you just read, and feel free to share your thoughts as well. Cheers!<br><em>- </em><a href="https://www.linkedin.com/in/mark-benjamin-katamba-76055092/"><em>Mark Benjamin Katamba</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0472a9361d08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Copy-Pasting Manifests: How I Automated Kubernetes + Argo CD App Scaffolding (Windows-friendly…]]></title>
            <link>https://medium.com/@sqanafrica/stop-copy-pasting-manifests-how-i-automated-kubernetes-argo-cd-app-scaffolding-windows-friendly-eb2c1ddf247f?source=rss-b6c972eaf6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb2c1ddf247f</guid>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[devops-practice]]></category>
            <dc:creator><![CDATA[SQANA]]></dc:creator>
            <pubDate>Thu, 02 Oct 2025 11:36:42 GMT</pubDate>
            <atom:updated>2025-10-02T12:23:10.143Z</atom:updated>
            <content:encoded><![CDATA[<h3>Stop Copy-Pasting Manifests: How I Automated Kubernetes + Argo CD App Scaffolding (Windows-friendly CLI + GUI)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MBbOrzZ6CXUF2CeNZiuQCQ.png" /></figure><p><strong>The problem</strong><br>If you’ve ever added a new app/service to a GitOps repo, you know the grind:<br>- Copy a base Deployment and Service<br>- Wire up an environment overlay with Kustomize<br>- Author an Argo CD Applicationpointing to the overlay<br>- Fix names, labels, selectors, images, ports, paths… everywhere</p><p>It’s repetitive, error-prone, and frankly, not the best use of your time.</p><h4>The idea</h4><p>I wanted a one-liner (and/or a simple UI) that asks for a few inputs — app name, image, port, environment — and generates everything in the right folders with the right content. And after that, Argo CD does the rest.</p><p>So I built a tiny scaffolding system inside my GitOps repo that contains:<br>- Reusable YAML templates for base, overlay, and Argo CD resources<br>- A PowerShell script to render templates and place files correctly<br>- A simple Windows GUI to do the same without the terminal</p><p>When run, the system:<br>- Prompts for a few fields (app name, container name, image, port, env)<br>- Generates base manifests, an environment overlay, and an Argo CD Application</p><p>It works two ways:<br>- CLI one‑liner (PowerShell 7)<br>- Simple Windows GUI to fill fields and click Generate</p><p>I implemented this on Windows 11. Linux/macOS users can run the same script with PowerShell 7 (pwsh) or a small bash wrapper.</p><p><em>Note: the scaffolding code lives inside your GitOps repo under </em><em>tools/scaffold-app. That’s intentional—your generator evolves alongside your manifests and conventions.</em></p><p>— -</p><h4>Folder structure (tree view)</h4><p>Make sure your repo follows a consistent layout (the script assumes this). Here’s the structure I use:</p><pre>homelab-gitops/<br>  apps/<br>    bases/<br>      &lt;app-name&gt;/<br>        deployment.yaml<br>        service.yaml<br>        kustomization.yaml<br>    overlays/<br>      &lt;env-name&gt;/<br>        &lt;app-name&gt;/<br>          kustomization.yaml<br>          version.yaml<br>  argocd/<br>    apps/<br>      &lt;app-name&gt;.yaml<br>    apps-root.yaml          # App-of-Apps root (see below)<br>  tools/<br>    scaffold-app/<br>      New-App.ps1<br>      New-App.GUI.ps1<br>      README.md<br>      templates/<br>        base/<br>          deployment.yaml.tmpl<br>          service.yaml.tmpl<br>          kustomization.yaml.tmpl<br>        overlay/<br>          kustomization.yaml.tmpl<br>          version.yaml.tmpl<br>        argo/<br>          application.yaml.tmpl</pre><ul><li>apps/bases: environment‑agnostic manifests</li><li>apps/overlays/&lt;env&gt;/&lt;app&gt;: Kustomize overlays per environment</li><li>argocd/apps: one Argo CD Application per app (per env if you prefer)</li><li>argocd/apps-root.yaml: the “App‑of‑Apps” root Application so Argo CD discovers child apps automatically</li><li>tools/scaffold-app: your scaffolder and templates</li></ul><p>— -</p><h4>What the scaffolder generates</h4><p>Given a few inputs, it creates:<br><strong>Base:<br>- </strong>apps/bases/&lt;AppName&gt;/deployment.yaml <br>- apps/bases/&lt;AppName&gt;/service.yaml <br>- apps/bases/&lt;AppName&gt;/kustomization.yaml</p><p><strong>Overlay:<br>- </strong>apps/overlays/&lt;Env&gt;/&lt;AppName&gt;/kustomization.yaml <br>- apps/overlays/&lt;Env&gt;/&lt;AppName&gt;/version.yaml (image override hook)</p><p><strong>Argo CD:<br>- </strong>argocd/apps/&lt;AppName&gt;.yaml</p><p>Commit and push; with App‑of‑Apps, Argo CD will auto‑create and sync the new app.</p><h4>Windows GUI and CLI (and a fix you’ll care about)</h4><ul><li>GUI: tools/scaffold-app/New-App.GUI.ps1 <br>- Fill in fields and click Generate<br>- Argument quoting is handled so paths with spaces (like E:\\\\My Documents\\\\...) work correctly</li><li>CLI: tools/scaffold-app/New-App.ps1 <br>- Fast one‑liner for terminals and CI</li></ul><p>Both paths create identical outputs.</p><h4>Step‑by‑step: set up the scaffolder from scratch</h4><p>1. <strong>Create the scaffolder folders:</strong></p><pre>mkdir -p tools/scaffold-app/templates/base<br>mkdir -p tools/scaffold-app/templates/overlay<br>mkdir -p tools/scaffold-app/templates/argo</pre><p>2. <strong>Add the templates (placeholders like </strong><strong>{{APP_NAME}} are replaced by the script)</strong></p><p>Base deployment.yaml.tmpl:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: {{APP_NAME}}<br>  labels:<br>    app.kubernetes.io/name: {{APP_NAME}}<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app.kubernetes.io/name: {{APP_NAME}}<br>  template:<br>    metadata:<br>      labels:<br>        app.kubernetes.io/name: {{APP_NAME}}<br>    spec:<br>      containers:<br>        - name: {{CONTAINER_NAME}}<br>          image: {{IMAGE}}<br>          ports:<br>            - containerPort: {{CONTAINER_PORT}}</pre><p>Base service.yaml.tmpl :</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: {{APP_NAME}}<br>spec:<br>  selector:<br>    app.kubernetes.io/name: {{APP_NAME}}<br>  ports:<br>    - port: 80<br>      targetPort: {{CONTAINER_PORT}}</pre><p>Overlay kustomization.yaml.tmpl :</p><pre>apiVersion: kustomize.config.k8s.io/v1beta1<br>kind: Kustomization<br>nameSuffix: -{{ENV}}<br>resources:<br>- ../../../bases/{{APP_NAME}}<br>replicas:<br>- count: 1<br>  name: {{APP_NAME}}-{{ENV}}<br>patches:<br>- patch: |-<br>    - op: replace<br>      path: /spec/template/metadata/labels/app.kubernetes.io~1name<br>      value: {{APP_NAME}}-{{ENV}}<br>    - op: replace<br>      path: /spec/selector/matchLabels/app.kubernetes.io~1name<br>      value: {{APP_NAME}}-{{ENV}}<br>  target:<br>    group: apps<br>    kind: Deployment<br>    name: {{APP_NAME}}<br>    version: v1<br>- patch: |-<br>    - op: replace<br>      path: /spec/selector/app.kubernetes.io~1name<br>      value: {{APP_NAME}}-{{ENV}}<br>  target:<br>    kind: Service<br>    name: {{APP_NAME}}<br>    version: v1<br>- path: version.yaml</pre><p>Overlay version.yaml.tmpl :</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: {{APP_NAME}}<br>spec:<br>  template:<br>    spec:<br>      containers:<br>        - name: {{CONTAINER_NAME}}<br>          image: {{IMAGE}}</pre><p>Argo application.yaml.tmpl :</p><pre>apiVersion: argoproj.io/v1alpha1<br>kind: Application<br>metadata:<br>  name: {{APP_NAME}}<br>  namespace: argocd<br>spec:<br>  destination:<br>    server: &lt;https://kubernetes.default.svc&gt;<br>    namespace: {{NAMESPACE}}<br>  project: default<br>  source:<br>    path: apps/overlays/{{ENV}}/{{APP_NAME}}<br>    repoURL: {{REPO_URL}}<br>    targetRevision: {{TARGET_REVISION}}<br>  syncPolicy:<br>    automated:<br>      prune: true<br>      selfHeal: true<br>    syncOptions:<br>    - CreateNamespace=true</pre><p><strong>3. Add </strong><strong>tools/scaffold-app/New-App.ps1 (the generator):</strong></p><pre>param(<br>    [Parameter(Mandatory=$true)]<br>    [string]$AppName,<br><br>    [Parameter(Mandatory=$true)]<br>    [string]$ContainerName,<br><br>    [Parameter(Mandatory=$true)]<br>    [int]$ContainerPort,<br><br>    [Parameter(Mandatory=$true)]<br>    [string]$Image,<br><br>    [string]$Env = &quot;homelab-dev&quot;,<br>    [string]$Namespace = &quot;homelab-dev&quot;,<br>    [string]$RepoURL = &quot;git@github.com:MarkBenjaminKatamba/homelab-gitops.git&quot;,<br>    [string]$TargetRevision = &quot;HEAD&quot;<br>)<br><br>$ErrorActionPreference = &quot;Stop&quot;<br><br>function Replace-TemplateVars {<br>    param(<br>        [string]$Content<br>    )<br>    $Content = $Content.Replace(&quot;{{APP_NAME}}&quot;, $AppName)<br>    $Content = $Content.Replace(&quot;{{CONTAINER_NAME}}&quot;, $ContainerName)<br>    $Content = $Content.Replace(&quot;{{CONTAINER_PORT}}&quot;, $ContainerPort)<br>    $Content = $Content.Replace(&quot;{{IMAGE}}&quot;, $Image)<br>    $Content = $Content.Replace(&quot;{{ENV}}&quot;, $Env)<br>    $Content = $Content.Replace(&quot;{{NAMESPACE}}&quot;, $Namespace)<br>    $Content = $Content.Replace(&quot;{{REPO_URL}}&quot;, $RepoURL)<br>    $Content = $Content.Replace(&quot;{{TARGET_REVISION}}&quot;, $TargetRevision)<br>    return $Content<br>}<br><br>function New-FromTemplate {<br>    param(<br>        [string]$TemplatePath,<br>        [string]$DestinationPath<br>    )<br>    $template = Get-Content -Raw -Path $TemplatePath<br>    $rendered = Replace-TemplateVars -Content $template<br>    $destDir = Split-Path -Parent $DestinationPath<br>    if (-not (Test-Path $destDir)) { New-Item -ItemType Directory -Path $destDir -Force | Out-Null }<br>    Set-Content -Path $DestinationPath -Value $rendered -NoNewline<br>}<br><br>$root = Resolve-Path (Join-Path $PSScriptRoot &quot;..\..&quot;)<br><br># Bases<br>$baseDir = Join-Path $root &quot;apps\bases\$AppName&quot;<br>New-Item -ItemType Directory -Path $baseDir -Force | Out-Null<br>New-FromTemplate -TemplatePath (Join-Path $PSScriptRoot &quot;templates\base\deployment.yaml.tmpl&quot;) -DestinationPath (Join-Path $baseDir &quot;deployment.yaml&quot;)<br>New-FromTemplate -TemplatePath (Join-Path $PSScriptRoot &quot;templates\base\service.yaml.tmpl&quot;) -DestinationPath (Join-Path $baseDir &quot;service.yaml&quot;)<br>New-FromTemplate -TemplatePath (Join-Path $PSScriptRoot &quot;templates\base\kustomization.yaml.tmpl&quot;) -DestinationPath (Join-Path $baseDir &quot;kustomization.yaml&quot;)<br><br># Overlays<br>$overlayDir = Join-Path $root &quot;apps\overlays\$Env\$AppName&quot;<br>New-Item -ItemType Directory -Path $overlayDir -Force | Out-Null<br>New-FromTemplate -TemplatePath (Join-Path $PSScriptRoot &quot;templates\overlay\kustomization.yaml.tmpl&quot;) -DestinationPath (Join-Path $overlayDir &quot;kustomization.yaml&quot;)<br>New-FromTemplate -TemplatePath (Join-Path $PSScriptRoot &quot;templates\overlay\version.yaml.tmpl&quot;) -DestinationPath (Join-Path $overlayDir &quot;version.yaml&quot;)<br><br># ArgoCD app<br>$argoDir = Join-Path $root &quot;argocd\apps&quot;<br>New-Item -ItemType Directory -Path $argoDir -Force | Out-Null<br>New-FromTemplate -TemplatePath (Join-Path $PSScriptRoot &quot;templates\argo\application.yaml.tmpl&quot;) -DestinationPath (Join-Path $argoDir &quot;$AppName.yaml&quot;)<br><br>Write-Host &quot;Scaffolded app &#39;$AppName&#39; for env &#39;$Env&#39;.&quot;</pre><ul><li>Renders templates, creates folders, writes files</li><li>Lives in your repo to stay versioned with your conventions</li></ul><p><strong>4. Add </strong><strong>tools/scaffold-app/New-App.GUI.ps1 (the Windows GUI):</strong></p><pre>Add-Type -AssemblyName System.Windows.Forms<br>Add-Type -AssemblyName System.Drawing<br><br>$scriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path<br>$scaffoldScript = Join-Path $scriptRoot &#39;New-App.ps1&#39;<br><br>$form = New-Object System.Windows.Forms.Form<br>$form.Text = &#39;Scaffold New App&#39;<br>$form.Size = New-Object System.Drawing.Size(560, 520)<br>$form.StartPosition = &#39;CenterScreen&#39;<br><br>function New-Label {<br>    param([string]$Text, [int]$X, [int]$Y)<br>    $l = New-Object System.Windows.Forms.Label<br>    $l.Text = $Text<br>    $l.Location = New-Object System.Drawing.Point($X,$Y)<br>    $l.AutoSize = $true<br>    return $l<br>}<br><br>function New-Textbox {<br>    param([string]$Text, [int]$X, [int]$Y, [int]$W=360)<br>    $t = New-Object System.Windows.Forms.TextBox<br>    $t.Text = $Text<br>    $t.Location = New-Object System.Drawing.Point($X,$Y)<br>    $t.Size = New-Object System.Drawing.Size($W, 23)<br>    return $t<br>}<br><br>$xL = 20<br>$xT = 170<br>$y = 20<br>$dy = 34<br><br>$lblApp = New-Label &#39;AppName&#39; $xL $y; $txtApp = New-Textbox &#39;&#39; $xT $y; $y += $dy<br>$lblContainer = New-Label &#39;ContainerName&#39; $xL $y; $txtContainer = New-Textbox &#39;api&#39; $xT $y; $y += $dy<br>$lblPort = New-Label &#39;ContainerPort&#39; $xL $y; $txtPort = New-Textbox &#39;8080&#39; $xT $y; $y += $dy<br>$lblImage = New-Label &#39;Image&#39; $xL $y; $txtImage = New-Textbox &#39;ghcr.io/you/app:latest&#39; $xT $y; $y += $dy<br>$lblEnv = New-Label &#39;Env&#39; $xL $y; $txtEnv = New-Textbox &#39;homelab-dev&#39; $xT $y; $y += $dy<br>$lblNs = New-Label &#39;Namespace&#39; $xL $y; $txtNs = New-Textbox &#39;homelab-dev&#39; $xT $y; $y += $dy<br>$lblRepo = New-Label &#39;RepoURL&#39; $xL $y; $txtRepo = New-Textbox &#39;git@github.com:MarkBenjaminKatamba/homelab-gitops.git&#39; $xT $y; $y += $dy<br>$lblRev = New-Label &#39;TargetRevision&#39; $xL $y; $txtRev = New-Textbox &#39;HEAD&#39; $xT $y; $y += $dy<br><br>$btnRun = New-Object System.Windows.Forms.Button<br>$btnRun.Text = &#39;Generate&#39;<br>$btnRun.Location = New-Object System.Drawing.Point(170, $y)<br>$btnRun.Size = New-Object System.Drawing.Size(120, 30)<br><br>$btnClose = New-Object System.Windows.Forms.Button<br>$btnClose.Text = &#39;Close&#39;<br>$btnClose.Location = New-Object System.Drawing.Point(310, $y)<br>$btnClose.Size = New-Object System.Drawing.Size(120, 30)<br>$y += 40<br><br>$output = New-Object System.Windows.Forms.TextBox<br>$output.Multiline = $true<br>$output.ScrollBars = &#39;Vertical&#39;<br>$output.ReadOnly = $true<br>$output.Location = New-Object System.Drawing.Point(20, $y)<br>$output.Size = New-Object System.Drawing.Size(500, 200)<br><br>function Append-Out([string]$text) { $output.AppendText($text + [Environment]::NewLine) }<br><br>$btnRun.Add_Click({<br>    $output.Clear()<br>    if ([string]::IsNullOrWhiteSpace($txtApp.Text)) { Append-Out &#39;AppName is required.&#39;; return }<br>    if (-not [int]::TryParse($txtPort.Text, [ref]([int]0))) { Append-Out &#39;ContainerPort must be an integer.&#39;; return }<br>    if (-not (Test-Path $scaffoldScript)) { Append-Out &quot;Scaffold script not found: $scaffoldScript&quot;; return }<br><br>    function Quote-Arg([string]$s) {<br>        if ($null -eq $s) { return &#39;&quot;&quot;&#39; }<br>        if ($s -match &#39;[\s\&quot;`]&#39;) {<br>            return &#39;&quot;&#39; + ($s -replace &#39;&quot;&#39;, &#39;\&quot;&#39;) + &#39;&quot;&#39;<br>        }<br>        return $s<br>    }<br><br>    $rawArgs = @(<br>        &#39;-File&#39;, $scaffoldScript,<br>        &#39;-AppName&#39;, $txtApp.Text,<br>        &#39;-ContainerName&#39;, $txtContainer.Text,<br>        &#39;-ContainerPort&#39;, $txtPort.Text,<br>        &#39;-Image&#39;, $txtImage.Text,<br>        &#39;-Env&#39;, $txtEnv.Text,<br>        &#39;-Namespace&#39;, $txtNs.Text,<br>        &#39;-RepoURL&#39;, $txtRepo.Text,<br>        &#39;-TargetRevision&#39;, $txtRev.Text<br>    )<br>    $quotedArgs = $rawArgs | ForEach-Object { Quote-Arg $_ }<br>    $argString = ($quotedArgs -join &#39; &#39;)<br><br>    Append-Out (&#39;Running: pwsh &#39; + $argString)<br><br>    try {<br>        $psi = New-Object System.Diagnostics.ProcessStartInfo<br>        $psi.FileName = &#39;pwsh&#39;<br>        $psi.Arguments = $argString<br>        $psi.RedirectStandardOutput = $true<br>        $psi.RedirectStandardError = $true<br>        $psi.UseShellExecute = $false<br>        $psi.CreateNoWindow = $true<br>        $p = [System.Diagnostics.Process]::Start($psi)<br>        $stdOut = $p.StandardOutput.ReadToEnd()<br>        $stdErr = $p.StandardError.ReadToEnd()<br>        $p.WaitForExit()<br>        if ($stdOut) { Append-Out $stdOut }<br>        if ($stdErr) { Append-Out $stdErr }<br>        Append-Out (&quot;Exited with code &quot; + $p.ExitCode)<br>    }<br>    catch {<br>        Append-Out (&quot;Error: &quot; + $_.Exception.Message)<br>    }<br>})<br><br>$btnClose.Add_Click({ $form.Close() })<br><br>$form.Controls.AddRange(@(<br>    $lblApp,$txtApp,<br>    $lblContainer,$txtContainer,<br>    $lblPort,$txtPort,<br>    $lblImage,$txtImage,<br>    $lblEnv,$txtEnv,<br>    $lblNs,$txtNs,<br>    $lblRepo,$txtRepo,<br>    $lblRev,$txtRev,<br>    $btnRun,$btnClose,<br>    $output<br>))<br><br>[void]$form.ShowDialog()<br><br></pre><ul><li>Basic WinForms UI that calls New-App.ps1</li><li>Properly quotes arguments and script path</li></ul><p><strong>5. Commit it:</strong></p><pre>git add tools/scaffold-app<br>git commit -m &quot;Add K8s + Argo CD scaffolder (CLI + GUI)&quot;<br>git push</pre><h4>App‑of‑Apps: zero kubectl after bootstrap</h4><p>One-time, create a “root” Application that points Argo CD to argocd/apps/. After that, any new Application you commit under argocd/apps/ is auto‑created and synced, and its overlay is applied—no per‑app kubectl apply needed.</p><p>Root Application (save as argocd/apps-root.yaml):</p><pre>apiVersion: argoproj.io/v1alpha1<br>kind: Application<br>metadata:<br>  name: apps-root<br>  namespace: argocd<br>spec:<br>  project: default<br>  destination:<br>    server: &lt;https://kubernetes.default.svc&gt;<br>    namespace: argocd<br>  source:<br>    repoURL: git@github.com:you/your-gitops-repo.git # Remember to change &quot;you&quot; and &quot;your-gitops-repo&quot; to your correct values<br>    targetRevision: HEAD<br>    path: argocd/apps<br>  syncPolicy:<br>    automated:<br>      prune: true<br>      selfHeal: true<br>    syncOptions:<br>    - CreateNamespace=true</pre><p>Bootstrap once:</p><pre>kubectl apply -f argocd/apps-root.yaml -n argocd</pre><p>Then in Argo CD, sync apps-root if it doesn’t auto‑sync. From now on, your workflow is:<br>- Run scaffolder → review changes → commit + push<br>- Argo CD (via apps-root) auto‑creates each child Application and syncs the overlay</p><p>Fallback (if you don’t use App‑of‑Apps):<br>- After scaffolding, you must manually apply: <br>— kubectl apply -f argocd/apps/&lt;app&gt;.yaml -n argocd <br>— kubectl apply -k apps/overlays/&lt;env&gt;/&lt;app&gt; -n &lt;namespace&gt;</p><p>- Then push to git <br>- But App‑of‑Apps removes these manual steps after the one‑time bootstrap</p><h4>Using it (examples)</h4><p><strong>1. Windows 11 CLI (PowerShell 7)<br></strong>Use app‑matching container name (recommended for clarity). My app/service in this case is called “taskflow”. This is what you run in your terminal:</p><pre>pwsh ./tools/scaffold-app/New-App.ps1 `<br>  -AppName taskflow-frontend `<br>  -ContainerName taskflow-frontend `<br>  -ContainerPort 3000 `<br>  -Image ghcr.io/you/taskflow-frontend:latest `<br>  -Env homelab-dev `<br>  -Namespace homelab-dev `<br>  -RepoURL git@github.com:you/your-gitops-repo.git `<br>  -TargetRevision HEAD</pre><p>Outputs:</p><ul><li>apps/bases/taskflow-frontend/...</li><li>apps/overlays/homelab-dev/taskflow-frontend/...</li><li>argocd/apps/taskflow-frontend.yaml</li></ul><p>With App‑of‑Apps, just push — Argo CD takes it from there.</p><p><strong>2. Windows GUI<br></strong>Here you’ll simly run pwsh./tools/scaffold-app/New-App.GUI.ps1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*2Rs6S3M89txPZioa4SDa8Q.png" /></figure><p>Fill in the fields, click Generate. Spaces in paths are handled.</p><p><strong>Linux/macOS (pwsh)</strong></p><pre>pwsh -File ./tools/scaffold-app/New-App.ps1 \\<br>  -AppName taskflow-frontend \\<br>  -ContainerName taskflow-frontend \\<br>  -ContainerPort 3000 \\<br>  -Image ghcr.io/you/taskflow-frontend:latest \\<br>  -Env homelab-dev \\<br>  -Namespace homelab-dev \\<br>  -RepoURL git@github.com:you/your-gitops-repo.git \\<br>  -TargetRevision HEAD</pre><h4>Tips: Ports and private images</h4><ul><li>Ports <br>- containerPort: the port your app actually listens on inside the container (e.g., 80 for nginx) <br>- Service port: how clients inside the cluster reach your app <br>- targetPort: the destination port on the pod that the Service forwards to—must match your container’s listening port</li><li>Private images on GHCR<br>- If images are private, configure an imagePullSecret (or make images public) <br>- Best-practice for homelab: create secret manually in the cluster; for production, use Sealed Secrets or External Secrets</li></ul><h4>Why this helps (now and later)</h4><ul><li>Consistent manifests for every new service</li><li>Minutes instead of hours of tedious setup</li><li>Fewer copy‑paste mistakes in labels/selectors/paths</li><li>Easy to onboard teammates: “Use the wizard or run the command”</li><li>Evolves with your repo: update templates once, reap benefits forever</li><li>With App‑of‑Apps: zero kubectl per app after bootstrap — just scaffold, commit, push</li></ul><p>Bonus: You can extend the templates with probes, resources, env vars, default annotations, multi‑env generation, or switch to Helm‑based scaffolding later.</p><h4>Credits and a note</h4><p>I built and refined this on Windows 11. You can do the same on Linux/macOS with pwsh. This solution was rapidly iterated using Vibe Coding in Cursor AI—use any tool that boosts your speed.</p><p>To use this approach, place the scaffolding at tools/scaffold-app inside your GitOps repository.</p><h4>Your turn</h4><p>Know another clean way to achieve the same result (custom CLI, Helm plugin, codegen, GitHub Actions that PR new apps)? I’d love to hear it — drop your approach in the comments!</p><p><em>Written by </em><a href="https://www.linkedin.com/in/mark-benjamin-katamba-76055092/"><em>Mark Benjamin Katamba</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb2c1ddf247f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Headaches: Unsticking StatefulSets from EBS ReadWriteMany Drama]]></title>
            <link>https://medium.com/@sqanafrica/kubernetes-headaches-unsticking-statefulsets-from-ebs-readwritemany-drama-e603facba912?source=rss-b6c972eaf6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e603facba912</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws-eks]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <dc:creator><![CDATA[SQANA]]></dc:creator>
            <pubDate>Wed, 23 Jul 2025 22:32:07 GMT</pubDate>
            <atom:updated>2025-07-23T22:32:07.152Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tqDOwhuMABc7mBucbiGlTA.png" /></figure><blockquote><strong>Note:</strong> This post assumes some familiarity with AWS EKS, Kubernetes StatefulSets, and EBS volumes.</blockquote><h3>The Situation: One Pod, One PVC, and One Very Stubborn Problem</h3><p>This happened to me a while back in my previous role, where I was managing Kubernetes workloads on AWS EKS as a QA engineer transitioning into DevOps. I was deploying a seemingly straightforward single-pod StatefulSet, eager to see my application spring to life. I hit kubectl apply, sat back, and waited for the magic to happen. Instead, my pod decided to play the longest game of “I’m not moving” I’ve ever witnessed, stubbornly sticking in a Pending state for what felt like an eternity – seriously, over 2 hours! My frustration mounted with each passing minute, and I knew I had a genuine Kubernetes head-scratcher on my hands.</p><h4>The Stubborn Symptom: Pod Stuck in Pending Limbo</h4><p>When a pod just sits there, Pending, it&#39;s like a warning siren blaring in the Kubernetes world. My first instinct, as always, was to consult the pod events. And there it was, plain as day:</p><pre>FailedScheduling: running PreBind plugin &quot;VolumeBinding&quot;: binding volumes: timed out waiting for the condition</pre><p>“Timed out waiting for the condition.” Classic. This usually points to a volume issue, so I immediately shifted my gaze to the PersistentVolumeClaim (PVC). Lo and behold, the PVC was also in a Pending state, with a rather telling message when I described it with kubectl describe pvc data-myapp-0 -n prod :</p><pre>waiting for a volume to be created, either by external provisioner &quot;ebs.csi.aws.com&quot; or manually created by system administrator</pre><p>Now, this was Kubernetes itself throwing its hands up, waiting for a volume that simply wasn’t appearing. It felt like an endless loop of “<em>provisioning… provisioning… nope!</em>”</p><p>At first, I couldn’t decipher much beyond the cryptic FailedScheduling message and the stubbornly unbinding PVC. I assumed it might be a fluke, perhaps a bad storage class or something trivial. But after combing through logs, documents, and some suspiciously helpful Reddit threads, the real problem emerged. I learned that the error message thrown by the PVC often boils down to a mismatch between your requested storage configuration and the volume provisioner’s capabilities, especially concerning access modes. So, on examining my statefulset.yml file, I realized that I had unknowingly set the access mode to ReadWriteMany, which AWS EBS does not support:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k6jIOeviLq-wOu6DI6Wtmw.png" /></figure><h4>Understanding the Root Cause</h4><ul><li><strong>My StatefulSet was configured with </strong><strong>ReadWriteMany as the access mode.</strong> This means multiple pods could potentially write to the same volume simultaneously.</li><li><strong>However, the AWS EBS storage provisioner (</strong><strong>ebs.csi.aws.com) does not support </strong><strong>ReadWriteMany.</strong> It&#39;s designed for ReadWriteOnce, meaning only a single EC2 instance (and by extension, a single pod in most Kubernetes setups) can attach to and write to an EBS volume at any given time.</li></ul><blockquote><strong>By the way, why doesn&#39;t AWS EBS support ReadWriteMany?<br></strong>This is a fundamental design choice by AWS for EBS. EBS volumes are block-level storage, designed to be attached to a <em>single</em> EC2 instance. Imagine multiple computers trying to write to the same physical hard drive simultaneously without any coordinated locking mechanism — it would lead to data corruption and inconsistencies very quickly! While there are AWS services like Amazon EFS (Elastic File System) that provide shared file system access (and thus support ReadWriteMany), EBS prioritizes performance and reliability for single-instance attachments. For shared access, you’d typically use EFS or a similar network file system.</blockquote><p>To make matters worse, even after I realized my mistake and deleted the StatefulSet to recreate it, the PVC stubbornly persisted! This is Kubernetes’ default behavior: PVCs are often retained even after their associated StatefulSets or Deployments are gone. This retention mechanism is great for data persistence, but in this scenario, it meant the old, incompatible ReadWriteMany configuration was still blocking any new volume provisioning. Modifying the existing PVC to ReadWriteOnce and reapplying the statefulset was a no-go, creating a frustrating chicken-and-egg problem where the old PVC blocked the new one from binding, and the pod stayed Pending.</p><blockquote><strong>Wait, why is it that modifying the existing PVC was a no-go?<br></strong>Well, you cannot directly modify the access modes of a StatefulSet’s PersistentVolumeClaims (PVCs) after the StatefulSet has been created, other than through the limited options of replicas, update strategy, and the object template. Attempting to do so will result in a Forbidden error.</blockquote><blockquote><strong>Explanation:<br></strong>StatefulSets are designed to manage stateful applications with persistent storage requirements. They rely on PVCs to claim persistent volumes (PVs) for their pods. Kubernetes enforces restrictions on modifying the core specifications of a StatefulSet, including the access modes of its PVCs, to maintain the stability and predictability of the managed application.</blockquote><h4>The Fix? A Clean Slate</h4><p>The solution, once I pieced it together, was relatively straightforward: achieve a clean slate. This meant manually deleting the stubborn PVC along with the other StatefulSet resources to allow a fresh start with the correct configuration. It felt like performing a surgical strike to remove the problematic old data.</p><p><strong>Step-by-Step Solution:<br></strong>If you find yourself in a similar pickle, here’s the playbook that got me out of trouble:</p><ol><li><strong>Delete the Existing StatefulSet, Service, and Ingress Resources<br></strong>First things first, let’s clear out all the old, potentially misconfigured resources related to your StatefulSet. Think of it as tidying up before you start fresh.</li></ol><pre>kubectl delete sts &lt;statefulset-name&gt; -n &lt;namespace&gt;<br>kubectl delete svc &lt;service-name&gt; -n &lt;namespace&gt;<br>kubectl delete ingress &lt;ingress-name&gt; -n &lt;namespace&gt;</pre><p><strong>2. Manually Delete the PersistentVolumeClaim (PVC)<br></strong>This is the crucial step! Because PVCs have a life of their own, you need to explicitly delete it. <strong>A big, bold warning here:</strong> Deleting the PVC <em>will</em> remove any data stored within it. If that data is precious, make sure you’ve backed it up before proceeding!</p><pre>kubectl delete pvc &lt;pvc-name&gt; -n &lt;namespace&gt;</pre><h4>3. Update the StatefulSet to Use ReadWriteOnce Access Mode</h4><p>Now for the correction! Go into your StatefulSet configuration (your YAML file) and make sure the accessModes for your volumeClaimTemplates is set to ReadWriteOnce. Double-check your storageClassName (e.g., gp2 or gp3 for AWS EBS) and resources.requests.storage as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j3FeMjdDDhkaauD1Spa9jQ.png" /></figure><h4>4. Reapply the Corrected Configurations (StatefulSet, Service, Ingress)</h4><p>Once you’re absolutely sure the old PVC is gone and your StatefulSet YAML is updated with ReadWriteOnce, it&#39;s time to bring your StatefulSet back to life. Remember to reapply all your application’s resources — the StatefulSet, Service, Ingress, and any other associated manifests that were deleted — to ensure everything comes up correctly with the new, desired configuration. If you’re using Kustomize: kubectl apply -k &lt;kustomize-overlay-directory&gt; , or simply: kubectl apply -f your-statefulset-and-other-manifests.yaml .</p><h4>5. Sync the Application in ArgoCD (If You’re Using It)</h4><p>If you’re managing your deployments with ArgoCD, give it a nudge to pick up the new changes. In ArgoCD, select the application and initiate a sync to apply the changes.</p><h4>6. Verify Pod and Volume Status</h4><p>The moment of truth! Check your pods to see if they’re finally leaving their <em>pending</em> slumber: <br>kubectl get pods -n &lt;namespace&gt; <br>And confirm that your PVC is now happily <em>Bound</em>: <br>kubectl get pvc -n &lt;namespace&gt;</p><p>If all goes well, you should see your pods transitioning to a Running state and your PVC showing as Bound to a newly provisioned EBS volume!</p><h3>Summary: The Takeaways from My Kubernetes Conundrum</h3><p>This whole ordeal boiled down to a retained PVC with an unsupported access mode. Here’s the TL;DR for future reference:</p><ul><li><strong>The Problem:</strong> Your StatefulSet pod is stuck in Pending because the PVC is also Pending, waiting for a volume that can&#39;t be provisioned due to an incompatible access mode (like ReadWriteMany with AWS EBS).</li><li><strong>The Culprit:</strong> AWS EBS volumes are block storage and primarily support ReadWriteOnce. If you try to use ReadWriteMany, you&#39;ll hit a wall. Plus, Kubernetes keeps old PVCs around, even after StatefulSet deletion.</li><li><strong>The Fix:</strong></li></ul><ol><li>Delete the StatefulSet, its associated resources (Service, Ingress, etc.), and the problematic PVC.</li><li><strong>Crucially, manually delete the PersistentVolumeClaim (PVC).</strong> Remember to back up data if needed!</li><li>Update your StatefulSet with the correct ReadWriteOnce access mode.</li><li><strong>Reapply the StatefulSet and all its associated resources (Service, Ingress, etc.).</strong></li><li>Sync in ArgoCD (if applicable).</li><li>Verify that your pods are Running and your PVC is Bound.</li></ol><p>This process allowed Kubernetes to bind the new volume with the correct access mode and resolved the pod scheduling issue, allowing the StatefulSet to enter the Running state. It was a valuable lesson in the nuances of Kubernetes storage and a good reminder that sometimes, the simplest solutions are found by understanding the underlying infrastructure limitations. Happy Kuberneting!</p><p><strong>What about you?</strong> Have you ever faced a similar head-scratching Kubernetes issue, perhaps with a stubborn StatefulSet or a mysterious PVC? Share your war stories, debugging tips, or any questions you have in the comments below! I’d love to hear your experiences and learn from them.</p><p><em>Written by </em><a href="https://www.linkedin.com/in/mark-benjamin-katamba-76055092"><em>Mark Benjamin Katamba</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e603facba912" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Automated Dockerfile Creation with AI — Here’s How]]></title>
            <link>https://medium.com/@sqanafrica/i-automated-dockerfile-creation-with-ai-heres-how-5c4284e2c38f?source=rss-b6c972eaf6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c4284e2c38f</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[llama-3]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[SQANA]]></dc:creator>
            <pubDate>Wed, 11 Jun 2025 18:49:40 GMT</pubDate>
            <atom:updated>2025-06-12T09:38:59.383Z</atom:updated>
            <content:encoded><![CDATA[<h3>I Automated Dockerfile Creation with AI — Here’s How</h3><h3>Introduction</h3><p>Have you ever wished you could generate a perfect Dockerfile for any programming language — complete with best practices and custom tweaks — just by clicking a button? That’s exactly what I set out to build after being inspired by the <a href="https://www.youtube.com/watch?v=Yr8si-1sTKw&amp;list=PLdpzxOOAlwvJ_qWyuqhbHteY84O1qr72a&amp;index=6">AI-Assisted DevOps</a> course on YouTube by Abhishek Veeramalla.</p><p>In this article, I’ll walk you through how I created a full-stack, AI-powered Dockerfile Generator using <strong>FastAPI</strong>, <strong>Ollama</strong>, <strong>Llama 3</strong>, <strong>React</strong>, and <strong>GitHub Actions</strong>. I’ll share the technical details, the lessons I learned about prompt engineering, and how you can run this project on your own laptop!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lTZFw_oMAKxPR07VI3enXA.gif" /><figcaption>Dockerfile Generator UI/UX</figcaption></figure><h4>Table of Contents</h4><p>1. The Inspiration: AI-Assisted DevOps<br>2. Project Overview<br>3. How It Works: Architecture<br>4. Prompt Engineering: Making AI Work for DevOps<br>5. Step-by-Step: Running the Project Locally<br>6. CI/CD and Docker: Shipping Like a Pro<br>7. What I Learned &amp; What’s Next<br>8. Try It Yourself!<br>9. Credits &amp; Attribution</p><h4>1. The Inspiration: AI-Assisted DevOps</h4><p>I’ve always been fascinated by the intersection of AI and DevOps. When I discovered Abhishek Veeramalla’s <a href="https://www.youtube.com/watch?v=Yr8si-1sTKw&amp;list=PLdpzxOOAlwvJ_qWyuqhbHteY84O1qr72a&amp;index=6">AI-Assisted DevOps YouTube course</a>, I was hooked! The course dives deep into using AI for DevOps tasks, including prompt engineering and automating infrastructure.</p><p>One concept that stood out was using AI to generate Dockerfiles. I thought: “What if I could build a web app that lets anyone generate and explain Dockerfiles for any language, with or without custom requirements?” That’s how this project was born!</p><h4>2. Project Overview</h4><p><strong>Dockerfile Generator</strong> is a web application that lets you:<br>- Select a programming language (Python, Node.js, Java, etc.)<br>- Optionally add custom specifications (e.g., “multi-stage build”, “use Python 3.11”)<br>- Instantly generate a best-practice Dockerfile, tailored to your needs<br>- Get a detailed, AI-generated explanation of every line in the Dockerfile</p><p><strong>Tech stack:</strong><br><strong>- Frontend:</strong> React (TypeScript), Vite, Material-UI<br>- <strong>Backend:</strong> FastAPI (Python), Ollama (LLM runner), Llama 3 (llama3.2:3b)<br>- <strong>CI/CD:</strong> GitHub Actions, GitHub Container Registry (GHCR)<br>- <strong>Prompt Engineering:</strong> Dynamic prompts for accurate, context-aware Dockerfile generation</p><h4>3. How It Works: Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*U1MK5eg_qu9LTRpBNnuePA.png" /></figure><p>- <strong>Frontend:</strong> A modern React app with Material-UI, providing a beautiful and responsive user experience.<br>- <strong>Backend:</strong> FastAPI server that talks to Ollama, which runs the Llama 3 model locally.<br>- <strong>Ollama:</strong> Think of it as your “LLM DockerHub” — it manages and serves LLMs like llama3.2:3b on your machine.<br>- <strong>LLM (Llama 3):</strong> The brains behind the operation, generating Dockerfiles and explanations based on your input.<br>- <strong>CI/CD:</strong> Automated Docker builds and pushes to GHCR on every push to main.</p><h4>4. Prompt Engineering: Making AI Work for DevOps</h4><p>One of the coolest things I learned from Abhishek’s course was <strong>prompt engineering</strong> — the art of crafting prompts that get the best results from an LLM.</p><p>In this project, the backend dynamically builds prompts like:</p><blockquote>“ONLY Generate an ideal Dockerfile for Python with best practices. Do not provide any descriptions.</blockquote><blockquote>In addition, the Dockerfile should satisfy these user specifications: multi-stage build”</blockquote><p>This ensures the LLM always considers your custom requirements, but also works perfectly if you leave the field blank (for a generic Dockerfile).</p><p><strong>Result: </strong><br>- If you want a standard Dockerfile, just select a language and go!<br>- If you want something special (e.g., a specific base image, multi-stage build), just type it in.</p><h4>5. Step-by-Step: Running the Project Locally</h4><p><strong>a) Install Ollama and Pull the LLM</strong></p><p>- Download Ollama: <a href="https://ollama.com/download](https://ollama.com/download)">https://ollama.com/download</a><br>- Pull the LLM (llama3.2:3b):<br><em> ```<br> ollama pull llama3.2:3b<br> ```</em><br>- Start Ollama (it runs as a local service):<br><em>```<br>ollama serve<br>```</em></p><p><strong>b) Set Up the Backend<br></strong>- Here, you need to set up the Python environment to allow for logical separation of packages, and then activate the virtual environment:</p><p><em>```<br>cd local-llms-ollama<br>python -m venv myenv<br># On Windows:<br>myenv\Scripts\activate<br># On Mac/Linux:<br>source myenv/bin/activate<br>pip install -r requirements.txt<br>```</em></p><p>- Then start the backend by running: <em>python generate_dockerfile.py</em></p><ul><li>The backend runs at `<a href="http://localhost:8000`">http://localhost:8000`</a></li></ul><p><strong>c) Set Up the Frontend</strong></p><p>```bash<br>cd frontend<br>npm install<br>npm run dev<br>```<br>- The frontend runs at `<a href="http://localhost:3000`">http://localhost:3000`</a></p><p><strong>d) Use the App!</strong></p><p>- Open your browser to `<a href="http://localhost:3000`">http://localhost:3000`</a><br>- Select a language, add specs if you want, and generate your Dockerfile!</p><h4>6. CI/CD and Docker: Shipping Like a Pro</h4><p>- <strong>GitHub Actions</strong> automatically builds and pushes Docker images for both frontend and backend to GHCR on every push to main.<br>- <strong>Docker Compose</strong> or Kubernetes can be used for deployment (future work!).</p><h4><strong>7. What I Learned &amp; What’s Next</strong></h4><ul><li><strong>Prompt engineering</strong> is a superpower for DevOps automation.<br>- Running LLMs locally (with Ollama) is fast, private, and flexible.<br>- Full-stack development is even more fun when you can “vibe code” and iterate quickly!<br>- There’s huge potential for AI in developer tooling — this is just the beginning.</li><li><strong>Understanding LLMs: Local vs. Hosted<br></strong>One of the most valuable lessons I learned from Abhishek Veeramalla’s course is that there are <strong>two main ways to use Large Language Models (LLMs)</strong> in your projects:</li><li><strong>a) Local LLMs: </strong>Companies like Meta and Deepseek release their own LLMs (like Llama) that you can download and run directly on your own machine. These are called Local Large Language Models.<br>- <strong>Biggest advantage:</strong> Security and privacy. Your data and conversations stay on your machine — Meta (or any other provider) never sees them.<br>- <strong>Downside:</strong> You’re responsible for the infrastructure. Running an LLM on your laptop is great for personal use, but scaling it for a whole team or company means you’ll need serious hardware (maybe even your own data center!). So don’t be surprised if your app is taking long to respond, local LLMS are quite resource-intensive.</li><li><strong>b) Hosted LLMs: </strong>Companies like OpenAI host their LLMs in massive data centers and let you access them via API keys.<br>- <strong>Advantage:</strong> No infrastructure headaches. You just use the API and let OpenAI handle the heavy lifting.<br>- <strong>Downsides: </strong><br> — Privacy: Your data is sent to their servers, and you have no control over how it’s used or stored. The LLM may even use your prompts for further training.<br> — Cost: You are charged for each API call. Keep in mind that when you make API calls to a language model (LLM), the calls you make to the LLM generate tokens. A well-crafted prompt usually results in less text generated, which means fewer tokens are used. In contrast, a poorly written prompt may produce more text and, consequently, a higher token count. This difference can lead to increased costs, depending on the LLM you are using.</li><li>In this project, I chose the local LLM route for maximum privacy and control, using Ollama to run Llama 3 right on my laptop.</li></ul><h4><strong>8. Try It Yourself!</strong></h4><p>Check out the <a href="https://github.com/MarkBenjaminKatamba/dockerfile-generator">GitHub repo</a> for full instructions and code.</p><h4><strong>9. Credits &amp; Attribution</strong></h4><p>This project was inspired by the Dockerfile generator concept in the AI-Assisted DevOps course by <a href="https://www.youtube.com/@AbhishekVeeramalla">Abhishek Veeramalla</a>.</p><p>The frontend design, user experience, and all enhancements, including the full-stack integration, additional features, and improvements, were conceived, implemented, and refined by me through <a href="https://en.wikipedia.org/wiki/Vibe_coding">vibe coding</a> with the <a href="https://www.cursor.com/">Cursor AI</a> code editor.</p><h4>Final Thoughts</h4><p>If you’re passionate about DevOps, AI, or just love building cool tools, give this project a try! <br>Feel free to fork, star, or contribute on GitHub — and don’t forget to check out Abhishek’s course for more inspiration.</p><p>Happy coding! 🚀</p><p><strong><em>Disclaimer:</em></strong><em><br>This project is an independent implementation and extension of the ideas demonstrated in the referenced course. It is not affiliated with or endorsed by Abhishek Veeramalla. All frontend design, UX, and additional backend logic are original work.</em></p><p><em>By </em><a href="https://www.linkedin.com/in/mark-benjamin-katamba-76055092/"><em>Mark Benjamin Katamba</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c4284e2c38f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kenya’s Cashless Revolution: Lessons for Uganda and Beyond]]></title>
            <link>https://medium.com/@sqanafrica/kenyas-cashless-revolution-lessons-for-uganda-and-beyond-e35f43067553?source=rss-b6c972eaf6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e35f43067553</guid>
            <category><![CDATA[kenya]]></category>
            <category><![CDATA[cashless-economy]]></category>
            <category><![CDATA[digital-payment]]></category>
            <category><![CDATA[digital-transformation]]></category>
            <category><![CDATA[uganda]]></category>
            <dc:creator><![CDATA[SQANA]]></dc:creator>
            <pubDate>Wed, 23 Apr 2025 14:02:27 GMT</pubDate>
            <atom:updated>2025-05-07T08:19:05.685Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-FkFSgJxdR8FxUaM" /><figcaption>Image by Ken Mwaura on Pexels</figcaption></figure><p>I’ve been to Nairobi a couple of times, and on most occasions, it’s been because of work. As a Ugandan, I’ve always been fascinated by Kenya’s vibrant capital, but my visits were typically a whirlwind of meetings, deadlines, and hotel stays. I had never really taken the time to observe the way some things — like technology — seamlessly weave into everyday life here. That all changed during my most recent work trip three weeks ago, when a simple stop at a roadside sugarcane vendor’s stall opened my eyes to something extraordinary.</p><p>On one chilly evening, as we were heading back from work with two of my colleagues after a long day, we stopped by a sugarcane vendor. One of my workmates, who hails from Zimbabwe but has lived and worked in Nairobi for the past five years, decided to treat us to some fresh sugarcane. As he negotiated the price — 140 Kenyan shillings (KES) — I watched in amazement as he pulled out his phone and effortlessly “wired” 140 KES plus a 10 KES tip to the vendor’s M-Pesa account. The vendor, who barely spoke English and relied mostly on Swahili to chat with my friend, didn’t even check his phone to confirm the payment. He simply nodded, smilingly, and handed over the sweet chops. For him, cashless transactions were as routine as slicing sugarcane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*qitffOUysugG1XtEI73Few.png" /><figcaption>Source: Wikimedia Commons</figcaption></figure><p>This seemingly mundane interaction represents something revolutionary happening in Kenya — a digital payment ecosystem so deeply integrated into daily life that even street vendors operate cashlessly without a second thought.</p><p>In Uganda, a similar scenario would likely involve a fumbling for change, perhaps even a negotiation if smaller denominations weren’t available. The idea of a roadside vendor seamlessly accepting mobile money payments is still a relatively novel concept back home. Out of ten sugarcane vendors, perhaps only three or four would have a phone and/or mobile money account, and even fewer, if any, would prefer digital payments over cash. This stark difference got me thinking: why is Kenya racing ahead in adopting innovations like mobile money and cashless payments, while countries like Uganda seem to be lagging behind?</p><h4>M-Pesa: The Catalyst of Kenya’s Mobile Banking Revolution</h4><p>The answer lies in Kenya’s embrace of M-Pesa, a mobile money service launched in 2007 by Vodafone and Safaricom, Kenya’s leading mobile operator. What began as a tool for microloan repayments has transformed into an economic powerhouse. By the financial year ending 31 March 2024, <a href="https://www.statista.com/statistics/1139190/m-pesa-customer-numbers/">M-Pesa had grown to over 66.2 million</a> customers across Africa, with a significant portion in Kenya, where 77 million registered mobile money accounts were reported in 2023 — reflecting a penetration rate of 150% (registered accounts to population ratio), up from 60% in 2013. The number of active M-Pesa agents in Kenya reached 320,000 in 2023, up from 110,000 in 2013, facilitating cash-in and cash-out transactions worth nearly $1 billion that year.</p><p>M-Pesa’s impact on Kenya’s economy is profound. <a href="https://www.gsma.com/solutions-and-impact/connectivity-for-good/mobile-for-development/wp-content/uploads/2025/03/Kenya.pdf">In 2023, mobile money contributed an additional $24 billion to Kenya’s GDP</a>, equivalent to an 8.6% increase, comparable to the contributions of the manufacturing and real estate sectors. This was more than double its economic impact in 2013 (3.9%) and significantly higher than the average mobile money impact across Sub-Saharan Africa (4.5%). At the individual level, mobile money boosted GDP per capita by $460 (2017 PPP) in 2023, nearly three times its contribution a decade earlier. A 2021 survey showed that 69% of Kenyan adults had a mobile money account, underscoring its role in financial inclusion. For many, M-Pesa is their first entry into financial services, bypassing traditional banks altogether.</p><p>This widespread adoption was evident in my encounter with the sugarcane vendor. His comfort with cashless payments, without even verifying the transaction, reflects a cultural shift that has made digital transactions the norm in Kenya. And it’s not limited to urban centers; rural communities, small-scale farmers, and street vendors alike have embraced this shift as an integral part of their daily operations.</p><h4>Uganda’s Mobile Money Scene: A Slower Climb</h4><p>In Uganda, mobile money is growing, but the pace is slower. According to the <a href="https://www.imarcgroup.com/uganda-mobile-money-market">IMARC Group</a>, the Uganda mobile money market size reached USD 133.0 Billion in 2024 and is expected to hit USD 1,150.1 Billion by 2033 at a CAGR of 25.73% (2025–2033). This growth is driven by factors such as underdeveloped financial infrastructure, increasing internet penetration, and government initiatives pushing for digital financial inclusion. However, despite this promising trajectory, challenges persist. As of September 2024, only 30.4 million mobile money SIM cards were active out of the registered 45.6 million subscribers, according to data from the Uganda Communications Commission (UCC). This indicates that roughly <a href="https://www.monitor.co.ug/uganda/business/markets/15m-mobile-money-simcards-are-inactive-ucc-data-shows-4830862">15 million accounts remain inactive</a>, suggesting that while many Ugandans have signed up for mobile money services, a significant portion are not regularly using them.</p><p>The scale of mobile money usage is evident in transaction volumes, which grew to Shs191 trillion (approximately USD 51 billion) in the financial year 2022–2023, as <a href="https://businessfocus.co.ug/mobile-money-transactions-grew-to-shs191-trillion-in-2022-2023-bou-report/">reported by the Bank of Uganda</a>. This figure reflects robust activity among active users, though it still lags behind Kenya’s more mature mobile money ecosystem. Supporting this growth is the expansion of telecom infrastructure, with European investment driving the construction of new telecom towers across Uganda. This improved network coverage is vital for extending mobile money services to rural areas, where traditional banking remains scarce.</p><p>Yet, Uganda’s journey mirrors some of the early hurdles Kenya faced. <a href="https://www.findevgateway.org/sites/default/files/publications/files/mfg-en-paper-mobile-money-in-uganda-use-barriers-and-opportunities-oct-2012.pdf">A 2012 FinDev Gateway study</a> on mobile money in Uganda identified barriers such as limited awareness, lack of trust in digital platforms, and inadequate infrastructure — issues that persist to some extent today. While internet penetration is rising, the digital divide remains a hurdle, particularly in rural regions where network reliability and literacy levels can limit adoption.</p><p>This gap became even more apparent during another experience on my trip. While visiting a friend at his office in Nairobi’s iconic GTC building, he mentioned that he hadn’t held cash in over a month. This would be almost unimaginable in Kampala, where I typically make multiple cash transactions daily.</p><h4>Why Kenya’s Ahead: The Key Drivers</h4><p>Several factors explain Kenya’s tech lead over Uganda:</p><p><strong>1. Progressive Regulatory Framework</strong><br>Kenya’s Central Bank has adopted a progressive “test and learn” approach to mobile money regulation, fostering innovation and allowing services like M-Pesa to flourish. <a href="https://www.weforum.org/stories/2022/03/mobile-payments-africa-covid-pandemic/?utm_source=perplexity">During the COVID-19 pandemic</a>, the government and Safaricom waived fees and raised transaction limits, further accelerating digital adoption. In contrast, Uganda has historically maintained a more cautious regulatory stance, which, while evolving to close the gap, still enforces stricter regulations that may stifle growth in mobile financial services.</p><p><strong>2. Better Infrastructure</strong><br>Kenya’s robust telecommunications network, with high mobile penetration and reliable rural coverage, supports widespread M-Pesa use. Uganda’s mobile penetration is decent, but patchy network coverage in rural areas limits access to mobile money.</p><p><strong>3. Early Market Dominance<br></strong>M-Pesa’s early market dominance created network effects that accelerated adoption. Safaricom’s market position allowed it to invest heavily in agent networks and marketing, while Uganda’s market has been more fragmented across multiple providers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*toVVz7kdvU_scBzmrLq2tA.jpeg" /></figure><p><strong>4. Cultural Openness to Innovation<br></strong>Kenya has cultivated a culture that embraces technological innovation, earning Nairobi the title of “Silicon Savannah.” <a href="https://www.findevgateway.org/sites/default/files/publications/files/mfg-en-paper-mobile-money-in-uganda-use-barriers-and-opportunities-oct-2012.pdf">The 2012 FinDev Gateway</a> study highlighted that cultural barriers to mobile money adoption in Uganda were more challenging to overcome than in Kenya. Kenyans have enthusiastically embraced technology trends, as demonstrated by the success of M-Pesa, which creates a network effect — everyone uses it because everyone else does. In contrast, Uganda’s transition from cash has been slower, likely due to entrenched cultural habits and some mistrust.</p><p>Furthermore, Nairobi’s status as a major regional hub, coupled with a higher rate of urbanization compared to Kampala, positions it for quicker adoption of digital solutions. The city’s fast-paced, interconnected lifestyle, along with a concentration of businesses and tech-savvy individuals, fosters an environment where new technologies can thrive.</p><h4>What Can Uganda Learn?</h4><p>Uganda is making strides in its digital transformation journey, but there’s an opportunity to accelerate the adoption of technologies that enhance convenience, efficiency, and financial inclusion. This could involve:</p><p><strong>1. Address Inactive Accounts<br></strong>With 15 million inactive mobile money SIM cards reported in Uganda, there’s a clear need to understand and address the barriers preventing active usage. Kenya’s success has been built not just on registration but on creating an ecosystem that encourages regular usage.</p><p><strong>2. Infrastructure Investment<br></strong>Although European investments are driving telecom tower expansion in Uganda, more targeted infrastructure development in underserved areas could help close the digital divide with Kenya. The UGX 191 trillion in mobile money transactions shows there’s already significant activity to build upon.</p><p><strong>3. Digital Literacy Programs<br></strong>Expanding digital literacy initiatives would help address knowledge gaps, especially among older generations and rural populations. The 2012 FinDev Gateway study highlighted education as a key barrier to adoption in Uganda, an issue that remains relevant today.</p><p><strong>4. Regulatory Harmonization<br></strong>Uganda could benefit from studying Kenya’s “test and learn” regulatory approach that allowed M-Pesa to flourish. Creating a regulatory environment that encourages innovation while protecting consumers could accelerate adoption.</p><p><strong>5. Promoting Interoperability<br></strong>Encouraging seamless transactions across different mobile money platforms and facilitating smooth interactions with traditional financial institutions. This would help to bridge the gap between digital and conventional banking systems, ensuring that users can easily transfer funds, access services, and conduct business without unnecessary barriers. By enhancing interoperability, individuals and businesses would be empowered to engage in financial activities with greater freedom and efficiency, ultimately promoting financial inclusion and expanding economic opportunities for all.</p><p><strong>6. Fostering Public-Private Partnerships<br></strong> Encouraging collaboration between government, mobile network operators, banks, and fintech startups to drive adoption.</p><h4>The Way Forward</h4><p>My encounter with the sugarcane vendor who accepted digital payment without hesitation signifies more than a simple transaction — it illustrates a fundamental shift in how an economy functions. Kenya’s digital payment revolution demonstrates how technology can democratize financial services and create opportunities for economic inclusion.</p><p>For Uganda to bridge this digital divide, we need concerted efforts from government, private sector, and civil society. The benefits — reduced corruption, increased tax compliance, greater financial inclusion, and economic efficiency — are well worth the investment.</p><p>As I returned to Kampala, I couldn’t help but wonder: how might Uganda’s vibrant markets transform if our boda boda drivers, taxi conductors, market women, and street vendors embraced digital payments with the same confidence as that Nairobi sugarcane seller?</p><h4>Over to You</h4><p>Have you noticed differences in technology adoption between African countries? What factors do you think accelerate or hinder digital transformation in your community? Or what innovative tech trends do you see taking off in your country, and what steps do you think are crucial for bridging the digital adoption gap between nations in Africa? Share your thoughts and experiences in the comments below!</p><p><em>About the Author: </em><a href="https://www.linkedin.com/in/mark-benjamin-katamba-76055092/"><em>Mark Benjamin Katamba</em></a><em> is a QA-turned-DevOps engineer and writer.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e35f43067553" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Troubleshooting Common 503 Errors in Kubernetes Applications]]></title>
            <link>https://medium.com/@sqanafrica/troubleshooting-common-503-errors-in-kubernetes-applications-1db3998e4071?source=rss-b6c972eaf6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/1db3998e4071</guid>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[503-service-unavailable]]></category>
            <dc:creator><![CDATA[SQANA]]></dc:creator>
            <pubDate>Mon, 17 Mar 2025 09:32:31 GMT</pubDate>
            <atom:updated>2025-03-17T09:32:31.222Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/626/0*sTjJ6tZaUNoc5fWl.jpg" /></figure><p>Encountering a “503 Service Unavailable” error on an application that has been running smoothly can be puzzling, especially when the application logs show no issues, the pods appear healthy, and Argo CD indicates that all resources are functioning properly without degradation. This article assumes that the reader uses/has an understanding of the following tools: Kubernetes and Kustomize, Kubectl, ArgoCD, Istio VirtualServices, and AWS Route53. To effectively troubleshoot this scenario, consider some of the following steps:</p><h4><strong>A) Verify Load Balancer Consistency</strong>:</h4><ul><li>Ensure the load balancer specified in the application’s <em>ingress.yml</em> file matches the one displayed in ArgoCD.</li><li>Confirm that the same load balancer is associated with the application’s URL in Route 53.</li><li>If the load balancer specified in the <em>ingress.yml</em> file and Argo CD matches but differs from the one in Route 53, there might be a “hidden” ingress defined previously. This could cause Route 53 to associate with the incorrect load balancer. To verify, delete the Route 53 record with the differing load balancer and refresh the page to see if it is recreated with the same incorrect load balancer. If the record is automatically recreated, you’ll need to first identify the ingress associated with that load balancer address using <em>kubectl get ingress -A | grep [the_address_url_for_the_loadbalancer_in_question]</em>, and then run <em>kubectl delete ingress [the_ingress_you’ve_identified_from_above_command] -n namespace </em>to delete that ingress before re-applying your intended configuration.</li></ul><h4><strong>B) Identify Conflicting Ingresses</strong>:</h4><ul><li>List all ingresses across the known namespaces (qa, dev, prod, uat) to ensure there isn’t another ingress using the same URL but pointing to a different load balancer. (use this command: <em>kubectl get ingress -A | grep [the_url_for_the_ingress_in_question] </em>to easily identify the conflicting ingress)</li><li>If such an ingress is found, it is likely the “hidden” ingress causing the conflict. Remove this ingress (using <em>kubectl delete ingress [the_ingress_you’ve_identified_from_above_command] -n namespace)</em> and refresh the application to check if the issue is resolved.</li></ul><h4><strong>C) Check the Default Namespace</strong>:</h4><ul><li>Sometimes, ingresses might be inadvertently applied to the default namespace instead of the intended one. This could lead to conflicts if the ingress in the default namespace points to a different load balancer.</li><li>Review the default namespace for any such ingresses. If found, delete the conflicting ingress and refresh the application URL to verify if the issue is resolved.</li></ul><h4><strong>D) Investigate Virtual Services</strong>:</h4><ul><li>If the problem persists, list all the virtual services present in all namespaces to determine if the application is deployed via Istio Virtual Services (<em>kubectl get virtualservice — —all-namespaces)</em></li><li>In such cases, deleting the Route 53 record alone might not resolve the issue. You need to first delete the conflicting virtual service, then remove the Route 53 record (if it doesn’t disappear automatically, or if it keeps recreating itself whenever you delete it), and finally re-apply your ingress or virtual service configuration.</li></ul><h4><strong>E) Check Application Listening Port</strong>:</h4><ul><li>Confirm with the developer that they have not updated or changed the application’s listening port in the <em>application.properties</em> file. If the port is changed from the one configured in the deployment manifests (for example, from 8080 to 8082), each time the developer makes a push, the application may fall back to a 503 error due to the port number mismatch.</li><li>The solution would be for the developer to revert the port number to match the deployment configurations, or you can update the port number in the deployment configurations to align with the one specified in the <em>application.properties</em> file.</li></ul><h4><strong>F) Restart the Deployment</strong>:</h4><ul><li>Sometimes after troubleshooting and making/pushing your changes, it might require you to restart your application deployment for it to create new pods. For example, if you have applications deployed as Istio Virtual Services and you make some updates to your Istio or virtual service configs (say you update the <em>external-dns.alpha.kubernetes.io/target:</em> value to a newly-created Istio ALB DNS name and apply the virtual service), the already-existing application pod(s) may not pick up your changes right away. Therefore, you might want to consider restarting the deployment entirely to allow it to recreate the pods.</li></ul><p>That’s a wrap. If you have encountered a 503 error and resolved it using a method different from the ones mentioned above, please share in the comments!</p><p><em>By </em><a href="https://www.linkedin.com/in/mark-benjamin-katamba-76055092/"><em>Mark Benjamin Katamba</em></a><em>, SQANA</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1db3998e4071" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Exciting Career Paths for QA Professionals Beyond Traditional Testing Roles]]></title>
            <link>https://medium.com/@sqanafrica/7-exciting-career-paths-for-qa-professionals-beyond-traditional-testing-roles-c8918d33c47a?source=rss-b6c972eaf6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8918d33c47a</guid>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[tech-career-change]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[tech-career]]></category>
            <dc:creator><![CDATA[SQANA]]></dc:creator>
            <pubDate>Mon, 03 Mar 2025 13:32:39 GMT</pubDate>
            <atom:updated>2025-03-07T06:04:52.408Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/626/0*shJhrIeDFiUJaQ4U.jpg" /></figure><p><a href="https://medium.com/@sqanafrica/unveiling-the-testers-mindset-secrets-developers-don-t-fully-grasp-5dd45514a8ed">Quality Assurance (QA) professionals</a> play a critical role in the tech world by implementing rigorous testing methodologies to ensure that products not only align with user requirements but also perform optimally under various conditions. However, the skills acquired in QA — attention to detail, analytical thinking, process optimization, and user advocacy — can open doors to diverse career paths in tech. If you’re a QA engineer looking to explore new horizons, here are <strong>7</strong> <strong>non-traditional career paths</strong> to consider:</p><h4>1. Product Management</h4><p>Product Managers (PMs) bridge the gap between business goals, user needs, and technical execution. They define product roadmaps, prioritize features, and collaborate with cross-functional teams to deliver value. QA professionals excel here due to their deep understanding of user pain points and product quality.</p><p><strong>Learning Curve: </strong>Transitioning to PM requires shifting from defect-focused thinking to strategic vision. QA professionals transitioning into Product Management may need to acquire skills in market research, stakeholder management, product strategy, project management, and agile prioritization frameworks like RICE or MoSCoW. They’ll also need to deeply understand customer needs and business objectives.</p><p><strong>Essential Tools:</strong></p><ul><li><strong>Market Research Tools:</strong> Tools like Google Analytics, SurveyMonkey, and user feedback platforms help gather insights into customer preferences and market trends.</li><li><strong>Project Management Software:</strong> Platforms such as Jira, Trello, or Asana facilitate task tracking, team collaboration, and project planning.</li><li><strong>Product Analytics Tools: </strong>Tools like Mixpanel or Amplitude provide data-driven insights into user behavior and product performance.</li></ul><h4>2. DevOps Engineering</h4><p>DevOps Engineers streamline software delivery by automating CI/CD pipelines, managing infrastructure, and fostering collaboration between development and operations teams. While DevOps isn’t traditionally considered a career path for QA professionals, their expertise in testing and quality assurance can be invaluable in bridging the gap between development and operations.</p><p><strong>Learning Curve</strong>: Transitioning into DevOps requires an understanding of infrastructure as code, cloud platforms, continuous integration/continuous deployment (CI/CD) pipelines, and configuration management tools like Chef, Puppet, or Ansible. You can start with foundational tools like Docker, Git, and Jenkins before diving into Kubernetes and/or Terraform.</p><p><strong>Essential Tools:</strong></p><ul><li><strong>Infrastructure as Code (IaC) Tools</strong>: Platforms like Terraform or AWS CloudFormation allow infrastructure provisioning and configuration through code, enabling automated deployment and scaling.</li><li><strong>Containerization Tools:</strong> Technologies such as Docker or Kubernetes facilitate packaging, deploying, and managing applications in isolated environments, enhancing consistency and portability.</li><li><strong>Monitoring and Logging Tools:</strong> Tools like Prometheus, Grafana, or ELK Stack (Elasticsearch, Logstash, Kibana) provide insights into application performance, infrastructure health, and system logs.</li><li><strong>Scripting Tools</strong>: Tools like Python or Bash can be used to automate repetitive tasks.</li></ul><h4>3. Technical Writing</h4><p>Technical Writing involves creating documentation, tutorials, release notes, and user guides for software products and systems. QA professionals with strong communication skills and a knack for explaining complex technical concepts can excel in this role, especially since QA professionals understand software intricacies and user pain points.</p><p><strong>Learning Curve:</strong> Transitioning into Technical Writing requires proficiency in writing clear and concise content, as well as familiarity with documentation tools and style guides.</p><p><strong>Essential Tools:</strong></p><ul><li><strong>Documentation Tools:</strong> Platforms like Confluence, Microsoft Word, or Markdown editors facilitate the creation and management of technical documentation.</li><li><strong>Diagram Tools:</strong> Tools like Lucidchart help with visualizing workflows.</li><li><strong>Version Control Systems:</strong> Using Git or other version control systems helps track changes and collaborate on documentation projects effectively.</li><li><strong>Style Guides:</strong> Adherence to style guides such as the Microsoft Manual of Style or the Chicago Manual of Style ensures consistency and readability in technical documentation.</li><li><strong>Generative AI Tools:</strong> Tools like Grammarly, Quillbot, and other AI-powered writing assistants can enhance grammar, style, and clarity in technical writing. These tools can help catch errors and improve overall readability, making it easier to produce high-quality documentation</li></ul><h4><strong>4. User Experience Design</strong></h4><p>UX Design focuses on enhancing the usability and accessibility of digital products by understanding user needs and behaviors. QA professionals with a keen eye for detail and empathy for end-users can transition into UX Design roles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/0*Jn7Itr27OsV1kTD2" /></figure><p><strong>Learning Curve:</strong> Transitioning into UX Design requires learning principles of user-centered design, conducting user research, and proficiency in prototyping and wireframing tools.</p><p><strong>Essential Tools:</strong></p><ul><li><strong>Design and Prototyping Tools:</strong> Platforms like Adobe XD, Sketch, or Figma enable UX designers to create prototypes and wireframes for testing and iteration.</li><li><strong>User Research Tools:</strong> Tools like UsabilityHub or Optimal Workshop facilitate user testing, surveys, and feedback collection to inform design decisions.</li><li><strong>Accessibility Evaluation Tools:</strong> Platforms such as Axe or WAVE help identify and address accessibility issues in digital products, ensuring inclusivity for all users.</li></ul><h4>5. Business Analyst</h4><p>A <strong>Business Analyst (BA)</strong> acts as a bridge between business needs and technical teams, ensuring that software solutions align with business objectives. Simply put, BAs translate stakeholder needs into technical requirements by analyzing processes, identifying inefficiencies, and proposing data-driven solutions.</p><p>QA professionals are well-suited for this role because they already analyze requirements, identify gaps, and ensure quality — skills that directly apply to business analysis.</p><p><strong>Learning Curve: </strong>Becoming a BA requires understanding business processes, stakeholder management, and documentation techniques. QA professionals may need to improve their analytical thinking, communication, and problem-solving skills.</p><h4>Essential Tools:</h4><ul><li><strong>Requirement Management Tools:</strong> Jira, Confluence, and Azure DevOps help track business requirements and ensure alignment with development teams.</li><li><strong>Process Modeling Tools:</strong> Lucidchart and Microsoft Visio assist in visualizing workflows, use cases, and business processes.</li><li><strong>Data Analysis Tools:</strong> SQL, Excel, and Tableau allow BAs to analyze business data and make data-driven decisions.</li><li><strong>Documentation &amp; Collaboration Tools:</strong> Google Docs, Notion, and SharePoint help create detailed business requirement documents (BRDs) and collaborate with teams.</li></ul><h4>6. Data Analyst</h4><p>A <strong>Data Analyst</strong> collects, processes, and interprets data to help businesses make informed decisions. Since QA professionals are already skilled at identifying patterns, anomalies, and inconsistencies in software, transitioning into data analysis can be a great fit.</p><p><strong>Learning Curve: </strong>QA professionals moving into Data Analytics need to develop strong statistical analysis, data visualization, and database management skills. Understanding business intelligence and how data-driven decisions impact organizations is also crucial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/0*-2RaZ16JuQvvEqHd.jpg" /></figure><h4>Essential Tools:</h4><p><strong>Data Analysis &amp; Visualization:</strong></p><ul><li><strong>Excel &amp; Google Sheets</strong> — Fundamental tools for organizing and analyzing structured data.</li><li><strong>Tableau &amp; Power BI</strong> — Used for creating interactive data visualizations and dashboards.</li><li><strong>Python (Pandas, NumPy) &amp; R</strong> — Programming languages for statistical computing and data manipulation.</li></ul><p><strong>Database Management &amp; Querying:</strong></p><ul><li><strong>SQL (MySQL, PostgreSQL, Microsoft SQL Server)</strong> — Essential for extracting and managing structured data.</li><li><strong>NoSQL (MongoDB, Firebase)</strong> — Useful for handling unstructured and semi-structured data.</li></ul><p><strong>Big Data &amp; Cloud Technologies:</strong></p><ul><li><strong>Apache Spark &amp; Hadoop</strong> — Useful for processing large datasets.</li><li><strong>Google BigQuery &amp; AWS Redshift</strong> — Cloud-based tools for scalable data analysis.</li></ul><p><strong>Reporting &amp; Business Intelligence (BI):</strong></p><ul><li><strong>Looker, Metabase, or Mode Analytics</strong> — Tools for sharing insights with stakeholders.</li></ul><p>QA professionals with strong analytical skills and attention to detail can easily transition into a <strong>Data Analyst</strong> role, opening up opportunities in industries like finance, healthcare, and e-commerce!</p><h4>7. Agile Coaching and Scrum Master</h4><p>Agile Coaching and Scrum Master roles involve guiding teams in adopting Agile methodologies and facilitating the Scrum framework to enhance collaboration, productivity, and delivery outcomes. QA professionals with experience in Agile practices and a passion for continuous improvement can transition into coaching or Scrum Master roles.</p><p><strong>Learning Curve:</strong> Transitioning into Agile Coaching and Scrum Master roles requires a deep understanding of Agile principles, facilitation skills, and proficiency in Agile project management tools.</p><p><strong>Essential Tools:</strong></p><ul><li><strong>Agile Project Management Tools: </strong>Platforms like Jira, Rally, or Trello facilitate sprint planning, backlog management, and progress tracking in Agile environments.</li><li><strong>Facilitation Techniques:</strong> Mastery of facilitation techniques such as retrospectives, stand-ups, and sprint planning meetings is essential for fostering team collaboration and communication.</li><li><strong>Agile Certifications:</strong> Obtaining certifications like Certified Scrum Master (CSM) or Professional Scrum Master (PSM) can enhance credibility and competence in Agile coaching and Scrum Master roles.</li></ul><h4>Conclusion</h4><p>The tech industry presents numerous career opportunities for QA professionals beyond traditional QA engineering and <a href="https://medium.com/@sqanafrica/software-quality-assurance-testing-enhancing-africas-digital-economy-in-the-face-of-emerging-3506f2e920d1">software testing</a> roles. By leveraging their skills and adaptability, they can explore paths in any of the above-mentioned roles. With a focus on continuous learning and strategic planning, the possibilities are vast.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8918d33c47a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Validation and Verification in Software Testing: What’s the Difference?]]></title>
            <link>https://medium.com/@sqanafrica/validation-and-verification-in-software-testing-whats-the-difference-30aa655bacc0?source=rss-b6c972eaf6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/30aa655bacc0</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[quality-control]]></category>
            <category><![CDATA[software-verification]]></category>
            <category><![CDATA[software-validation]]></category>
            <category><![CDATA[qa]]></category>
            <dc:creator><![CDATA[SQANA]]></dc:creator>
            <pubDate>Mon, 24 Feb 2025 13:31:52 GMT</pubDate>
            <atom:updated>2025-02-25T09:25:06.488Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B53F8f4WE2T8Z0p5.png" /><figcaption>Image Source: Geekflare</figcaption></figure><p>In software testing, <strong>validation</strong> and <strong>verification</strong> are two distinct activities that ensure the software meets both user needs and specified requirements.</p><h4>Validation: Building the Right Product</h4><p><strong>Validation</strong> ensures that the software meets the user’s needs and requirements, answering the question, “Are we building the right product?” It involves evaluating the final product to confirm that it fulfills its intended purpose and is suitable for its intended users.</p><h4>Example of Validation</h4><p>In a banking application, validation involves ensuring that the application correctly calculates interest rates and processes transactions as specified in the business requirements. This could involve:<br>- Performing user acceptance testing (UAT) with actual users to ensure the application is user-friendly and meets their needs.<br>- Conducting <a href="https://medium.com/@sqanafrica/software-quality-assurance-testing-enhancing-africas-digital-economy-in-the-face-of-emerging-3506f2e920d1">end-to-end testing</a> to verify that business processes such as account creation, transactions, and interest calculation are working as intended.</p><h4>Verification: Building the Product Right</h4><p><strong>Verification</strong>, on the other hand, focuses on whether the software has been built correctly and is error-free, answering the question, “Are we building the product right?” Verification activities involve checking that the software adheres to its design specifications and requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*UZE2Ei_l-90DQaY1fMkKZQ.png" /></figure><h4>Example of Verification</h4><p>During verification, testers review the software’s code to ensure that it follows coding standards and conduct tests to confirm that each feature functions as expected based on its design specifications. This could involve:<br>- Conducting code reviews to ensure coding standards are met and the code is free from defects.<br>- Performing unit testing to verify that individual components or modules work correctly.<br>- Conducting integration testing to ensure that different modules or services interact as expected.</p><h4>Summarized Comparison</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*efhD0o2yd7L-uhIFgPJMfQ.png" /></figure><h4>Bonus: Quality Assurance vs. Quality Control in Software Development</h4><p><strong>Quality Assurance (QA)</strong> and <strong>Quality Control (QC)</strong> are two distinct processes that contribute to ensuring the quality of software products. While they are often used interchangeably, they serve different purposes in the software development lifecycle.</p><h4><strong>Quality Assurance (QA): Process-Oriented</strong></h4><p>QA is a process-oriented activity that focuses on preventing defects and ensuring that the development process is efficient and effective. It involves defining and implementing standards, processes, and procedures to maintain a consistent and high level of quality throughout the software development lifecycle.</p><h4>Example of Quality Assurance</h4><p>In QA, a company may establish a set of testing best practices and guidelines that all testers should follow. QA aims to identify potential issues early and implement measures to mitigate risks. For instance:<br>- Developing a test plan that outlines the testing strategy, resources, schedule, and scope.<br>- Implementing automated testing frameworks to ensure consistent and repeatable test execution.<br>- Conducting regular process audits and reviews to ensure adherence to established procedures.</p><h4>Quality Control (QC): Product-Oriented</h4><p>QC is a product-oriented activity that involves evaluating the actual product to identify defects and ensure that it meets the specified requirements and standards. It is a reactive process that focuses on finding and fixing defects before the software is released to the end-users.</p><h4>Example of Quality Control</h4><p>In QC, testers execute test cases and conduct various testing activities, such as functional testing, regression testing, and performance testing, to uncover defects and verify that the software functions correctly. For example:<br>- Performing functional testing to ensure that all features work as intended.<br>- Conducting regression testing to verify that new changes have not introduced new defects.<br>- Executing performance testing to ensure that the application performs well under expected load conditions.</p><h4>Summarized Comparison</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*cW-1RlV8XfGTf8Eijf-f6Q.png" /></figure><h4>Conclusion</h4><p>Understanding the differences between validation, verification, quality assurance (QA), and quality control (QC) is crucial for any software development and testing process. Effectively applying these concepts can result in higher quality software, reduced maintenance efforts, and an improved overall user experience. By clearly distinguishing between these terms and following best practices, teams can enhance both the development process and the final product, ensuring that it meets the intended requirements and satisfies user needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30aa655bacc0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Page Object Model (POM) in Test Automation]]></title>
            <link>https://medium.com/@sqanafrica/understanding-the-page-object-model-pom-in-test-automation-29441b128840?source=rss-b6c972eaf6c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/29441b128840</guid>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[page-object-model]]></category>
            <category><![CDATA[quality-assurance-testing]]></category>
            <dc:creator><![CDATA[SQANA]]></dc:creator>
            <pubDate>Thu, 08 Aug 2024 07:05:03 GMT</pubDate>
            <atom:updated>2024-08-08T07:05:03.315Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/503/0*7pLluqcOUxvLOY1K.png" /><figcaption>Source: e-zest</figcaption></figure><p>The <strong>Page Object Model (POM)</strong> is a design pattern in test automation that plays a crucial role in enhancing the maintainability and reusability of test scripts. By creating a separate class for each web page or UI component of the application under test, POM encapsulates the elements and actions associated with specific pages or components. This abstraction allows changes in the application’s UI to be easily managed by updating the corresponding Page Object class without affecting the test scripts.</p><h4><strong>How POM Works: An Example</strong></h4><p>Imagine you have a login page on your website. Using the POM approach, you would create a `LoginPage` class that includes methods for entering the username, password, and clicking the login button. The test scripts interact with the `LoginPage` class to perform login actions, which makes the tests more maintainable and readable:</p><pre>public class LoginPage {<br>    private WebDriver driver;<br>    <br>    // Constructor<br>    public LoginPage(WebDriver driver) {<br>        this.driver = driver;<br>    }<br>    <br>    // Locators<br>    private By usernameField = By.id(&quot;username&quot;);<br>    private By passwordField = By.id(&quot;password&quot;);<br>    private By loginButton = By.id(&quot;loginButton&quot;);<br>    <br>    // Methods<br>    public void enterUsername(String username) {<br>        driver.findElement(usernameField).sendKeys(username);<br>    }<br>    <br>    public void enterPassword(String password) {<br>        driver.findElement(passwordField).sendKeys(password);<br>    }<br>    <br>    public void clickLoginButton() {<br>        driver.findElement(loginButton).click();<br>    }<br>}</pre><p>In this example, the LoginPage class encapsulates all interactions with the login page. The test script would then use this class as follows:</p><pre>LoginPage loginPage = new LoginPage(driver);<br>loginPage.enterUsername(&quot;testuser&quot;);<br>loginPage.enterPassword(&quot;password&quot;);<br>loginPage.clickLoginButton();</pre><h4><strong>Implementing POM in Manual Test Cases</strong></h4><p>POM should be considered right from the point of writing manual test cases, not just when test automation scripts are being written. Manual test cases should be organized in such a way that they follow the POM structure. For instance, when documenting test cases for the login functionality:</p><p>- <strong>Step 1:</strong> Navigate to the login page.<br>- <strong>Step 2:</strong> Enter username in the username field.<br>- <strong>Step 3:</strong> Enter password in the password field.<br>- <strong>Step 4:</strong> Click the login button.<br>- <strong>Expected Result:</strong> User should be logged in successfully.</p><p>By adhering to this structure, manual test cases can be directly translated into automated test scripts without much rework.</p><h4>Benefits of POM</h4><p><strong>- Enhanced Readability:</strong> Test scripts become more readable by using methods that represent user actions.<br><strong>- Ease of Maintenance:</strong> Any changes in the UI only require updates in the corresponding Page Object class.<br><strong>- Reusability:</strong> Common actions can be reused across multiple test scripts, reducing code duplication.</p><h4>Additional Examples</h4><p><strong>a) </strong>Consider an e-commerce application with a product page and a shopping cart page. Using POM, you would create ProductPage and ShoppingCartPage classes:</p><p>- ProductPage class would include methods like selectProduct, addToCart, and viewProductDetails.<br>- ShoppingCartPage class would include methods like verifyProductInCart, removeProduct, and proceedToCheckout.</p><p>Test scripts for various scenarios, such as adding a product to the cart and verifying its presence, would interact with these classes, making the tests modular and easier to manage.</p><p><strong>b) Registration Page:</strong> For a registration page, you might have a RegistrationPage class:</p><pre>public class RegistrationPage {<br>    private WebDriver driver;<br>    <br>    // Constructor<br>    public RegistrationPage(WebDriver driver) {<br>        this.driver = driver;<br>    }<br>    <br>    // Locators<br>    private By firstNameField = By.id(&quot;firstName&quot;);<br>    private By lastNameField = By.id(&quot;lastName&quot;);<br>    private By emailField = By.id(&quot;email&quot;);<br>    private By submitButton = By.id(&quot;submitButton&quot;);<br>    <br>    // Methods<br>    public void enterFirstName(String firstName) {<br>        driver.findElement(firstNameField).sendKeys(firstName);<br>    }<br>    <br>    public void enterLastName(String lastName) {<br>        driver.findElement(lastNameField).sendKeys(lastName);<br>    }<br>    <br>    public void enterEmail(String email) {<br>        driver.findElement(emailField).sendKeys(email);<br>    }<br>    <br>    public void clickSubmitButton() {<br>        driver.findElement(submitButton).click();<br>    }<br>}<br></pre><p><strong>c) Dashboard page:</strong> For a dashboard page, you might have a DashboardPage class:</p><pre>public class DashboardPage {<br>    private WebDriver driver;<br>    <br>    // Constructor<br>    public DashboardPage(WebDriver driver) {<br>        this.driver = driver;<br>    }<br>    <br>    // Locators<br>    private By welcomeMessage = By.id(&quot;welcomeMessage&quot;);<br>    private By logoutButton = By.id(&quot;logoutButton&quot;);<br>    <br>    // Methods<br>    public String getWelcomeMessage() {<br>        return driver.findElement(welcomeMessage).getText();<br>    }<br>    <br>    public void clickLogoutButton() {<br>        driver.findElement(logoutButton).click();<br>    }<br>}</pre><p>These examples show how the POM approach can be applied to different pages, promoting clean and maintainable test scripts.</p><p><em>Happy testing</em>😎<em>!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29441b128840" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>