<?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 Henryeknyarko on Medium]]></title>
        <description><![CDATA[Stories by Henryeknyarko on Medium]]></description>
        <link>https://medium.com/@henryeknyarko?source=rss-2cfc5c8aa7a5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*m2eI36H17tdoCt2USZIqIg.jpeg</url>
            <title>Stories by Henryeknyarko on Medium</title>
            <link>https://medium.com/@henryeknyarko?source=rss-2cfc5c8aa7a5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:40:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@henryeknyarko/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[A Practical DevSecOps + GitOps Playbook: From Code to Production with Jenkins, Security Scans, and…]]></title>
            <link>https://medium.com/@henryeknyarko/a-practical-devsecops-gitops-playbook-from-code-to-production-with-jenkins-security-scans-and-28600631a47d?source=rss-2cfc5c8aa7a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/28600631a47d</guid>
            <dc:creator><![CDATA[Henryeknyarko]]></dc:creator>
            <pubDate>Mon, 29 Dec 2025 11:33:09 GMT</pubDate>
            <atom:updated>2025-12-29T11:33:09.992Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pcx_q9V9kFPclnMNaZYIqA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-3dZa1e-7VOC7qe7DTie-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t6ted99zpOGDQMJA91ki2A.png" /></figure><p>A Practical DevSecOps + GitOps Playbook: From Code to Production with Jenkins, Security Scans, and Argo CD</p><p><strong>Author:</strong> Ernest Kwasi Henry Nyarko | Senior DevOps / Platform Engineer<br><strong>GitHub:</strong> <a href="https://github.com/Henrynyarko">https://github.com/Henrynyarko</a></p><p><strong>Audience:</strong> DevOps engineers, SREs, Platform Engineers<br><strong>Goal:</strong> Build a secure, automated CI/CD pipeline with GitOps-based deployment using Argo CD<br><strong>Outcome:</strong> Fully deployed, security-validated Kubernetes applications in a <strong>Healthy &amp; Synced</strong> state</p><h3>1. Architecture Overview</h3><p>This implementation combines <strong>DevSecOps</strong> and <strong>GitOps</strong> best practices:</p><p><strong>Core Tools</strong></p><ul><li>Jenkins — CI orchestration</li><li>Docker — Containerization</li><li>Kubernetes (EKS / any K8s) — Runtime platform</li><li>Argo CD — GitOps continuous delivery</li></ul><p><strong>Security Tooling</strong></p><ul><li>Secrets scanning</li><li>SAST (SpotBugs)</li><li>SCA (Dependency &amp; OSS license checks)</li><li>Container image scanning</li><li>DAST</li></ul><p><strong>Source of Truth</strong></p><ul><li>GitHub — application code + Kubernetes manifests</li></ul><p><strong>High-Level Flow:</strong></p><pre>Developer → Git Push<br>   ↓<br>Jenkins CI Pipeline<br>   ↓<br>Security &amp; Quality Gates<br>   ↓<br>Container Build &amp; Scan<br>   ↓<br>GitOps Repo Update<br>   ↓<br>Argo CD Sync<br>   ↓<br>Kubernetes Deployment</pre><h3>2. Repository Structure</h3><p><strong>Application Repository (dso-demo)</strong></p><pre>dso-demo/<br>├── Jenkinsfile<br>├── Dockerfile<br>├── src/<br>├── pom.xml<br>└── tests/</pre><p><strong>GitOps / Kubernetes Manifests Repository (k8s-manifests)</strong></p><pre>k8s-manifests/<br>├── apps/<br>│   └── dso-demo/<br>│       ├── deployment.yaml<br>│       ├── service.yaml<br>│       └── namespace.yaml<br>└── argocd/<br>    └── application.yaml</pre><blockquote><strong><em>Best practice:</em></strong><em> Jenkins builds images; Argo CD deploys manifests. Keep CI/CD and GitOps separate.</em></blockquote><h3>3. CI Pipeline Stages (Jenkins)</h3><p>Each stage acts as a <strong>quality gate</strong>.</p><h3>3.1 Setup Stage</h3><p><strong>Purpose:</strong> Prepare the build environment</p><p><strong>Steps:</strong></p><ul><li>Checkout source code</li><li>Install dependencies</li><li>Run secrets scanning</li></ul><p><strong>Snippet:</strong></p><pre>stage(&#39;Setup&#39;) {<br>  steps {<br>    checkout scm<br>    sh &#39;npm install&#39;<br>    sh &#39;trufflehog --json .&#39;<br>  }<br>}</pre><blockquote><em>Prevents credential leaks early.</em></blockquote><h3>3.2 Build Stage</h3><p><strong>Purpose:</strong> Compile and package the application</p><p><strong>Snippet:</strong></p><pre>stage(&#39;Build&#39;) {<br>  steps {<br>    sh &#39;mvn clean package&#39;<br>  }<br>}</pre><blockquote><em>Fails fast if compilation errors occur.</em></blockquote><h3>4. Static Analysis (Shift Left Security)</h3><p><strong>Stages:</strong></p><ul><li>Dependency Checker — scan for CVEs</li><li>OSS License Checker — ensure license compliance</li><li>SCA — inspect third-party dependencies</li><li>SpotBugs — detect insecure coding patterns</li><li>Unit Tests — validate logic</li></ul><p><strong>Snippet:</strong></p><pre>stage(&#39;Static Analysis&#39;) {<br>  steps {<br>    sh &#39;mvn spotbugs:check&#39;<br>    sh &#39;mvn dependency-check:check&#39;<br>  }<br>}</pre><blockquote><em>Only clean, compliant code proceeds.</em></blockquote><h3>5. Packaging Stage</h3><p><strong>5.1 Docker Build:</strong></p><pre>stage(&#39;Docker Build&#39;) {<br>  steps {<br>    sh &#39;docker build -t dso-demo:${GIT_COMMIT} .&#39;<br>  }<br>}</pre><p><strong>5.2 Image Hardening:</strong></p><ul><li>Non-root user</li><li>Minimal base image</li><li>Remove unused packages</li></ul><h3>6. Artifact Analysis</h3><p><strong>6.1 Container Scan:</strong></p><pre>stage(&#39;Scan&#39;) {<br>  steps {<br>    sh &#39;trivy image dso-demo:${GIT_COMMIT}&#39;<br>  }<br>}</pre><p><strong>6.2 Kubernetes Hardening:</strong></p><ul><li>Resource limits</li><li>Security contexts</li><li>No privileged containers</li><li>7. Deployment via GitOps (Argo CD)</li></ul><p><strong>7.1 Jenkins → GitOps Handoff:</strong></p><ul><li>Update GitOps repo with new image tag</li><li>Push commit → triggers Argo CD sync</li></ul><pre>sh &quot;&quot;&quot;<br>sed -i &quot;s|image: dso-demo:.*|image: dso-demo:${GIT_COMMIT}|g&quot; k8s-manifests/apps/dso-demo/deployment.yaml<br>git add .<br>git commit -m &quot;Deploy ${GIT_COMMIT}&quot;<br>git push origin main<br>&quot;&quot;&quot;</pre><p><strong>7.2 Argo CD:</strong></p><ul><li>Watches Git repo</li><li>Auto-sync or manual sync</li><li>Reconciles desired vs live state</li></ul><blockquote><em>Outcome: </em><em>App Health: Healthy, </em><em>Sync Status: Synced</em></blockquote><h3>8. Runtime Validation</h3><p>Check deployments, pods, and services:</p><pre>kubectl get pods -n dso-demo<br>kubectl get svc -n dso-demo</pre><blockquote><em>All resources must show </em><strong><em>Healthy &amp; Running</em></strong><em>.</em></blockquote><h3>9. Dynamic Analysis &amp; E2E</h3><ul><li>DAST: run against live app for runtime vulnerabilities</li><li>E2E tests: validate user flows</li></ul><pre>npm run test:e2e</pre><h3>10. Observed Final State</h3><p>Your pipeline is <strong>complete</strong> when:</p><ul><li>Jenkins passes all gates</li><li>Image is hardened</li><li>GitOps repo updated</li><li>Argo CD shows Healthy &amp; Synced</li><li>E2E tests pass</li></ul><h3>11. Diagram Suggestion</h3><pre>+---------+       +---------+       +---------+       +---------+<br>| Developer| --&gt;  | Jenkins | --&gt;   | GitOps  | --&gt;   | ArgoCD  |<br>+---------+       +---------+       +---------+       +---------+<br>       CI/CD        Security &amp;       Update Manifests     Deploy<br>       Build        Quality Gates                          &amp; Sync</pre><p>13. Bonus: Full Scripts &amp; Commands</p><blockquote><em>For a complete </em><strong><em>hands-on implementation</em></strong><em>, including all YAMLs, Jenkinsfiles, Helm charts, and commands, check the GitHub repo:<br></em><a href="https://github.com/Henrynyarko/sre-platform-infrastructure"><em>https://github.com/Henrynyarko/sre-platform-infrastructure</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28600631a47d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Canary Deploying ML Models on GKE: A Production-Ready Tutorial]]></title>
            <link>https://medium.com/@henryeknyarko/canary-deploying-ml-models-on-gke-a-production-ready-tutorial-772a38734201?source=rss-2cfc5c8aa7a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/772a38734201</guid>
            <dc:creator><![CDATA[Henryeknyarko]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 12:12:25 GMT</pubDate>
            <atom:updated>2025-12-15T12:20:04.300Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8caFFepLngK9UrS_iTX6kg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NBDLZvvhal9O4HvklxOiJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ue_GYLfWilX2rgjQO-rTEw.png" /></figure><p>By <em>Ernest Kwasi Henry Nyarko</em></p><p>In this tutorial, we’ll demonstrate how to deploy a <strong>TensorFlow Serving ML model</strong> on <strong>Google Kubernetes Engine (GKE)</strong> with <strong>Istio service mesh</strong>, implementing <strong>canary deployments</strong> to route a fraction of traffic to a new model version. This setup mimics a production-grade workflow suitable for real-world machine learning systems.</p><h3>Why Canary Deployments Matter</h3><ul><li><strong>Risk mitigation:</strong> Gradually test new models in production.</li><li><strong>Quick rollback:</strong> Only a small portion of traffic sees the new version.</li><li><strong>Observability:</strong> Measure real-world performance using metrics and logs.</li><li>Prerequisites</li></ul><p>Before starting, ensure you have:</p><ul><li>A <strong>GCP project</strong> with billing enabled.</li><li><strong>Cloud Shell</strong> or gcloud CLI access.</li><li><strong>kubectl</strong> configured to connect to your GKE cluster.</li><li><strong>Istio installed</strong> on the cluster with automatic sidecar injection enabled.</li><li>TensorFlow SavedModels for <strong>ResNet50</strong> (stable) and <strong>ResNet101</strong> (canary).</li><li>Basic knowledge of Kubernetes concepts: Pods, Services, Deployments.</li></ul><h3>Step 1: Set Environment Variables</h3><p>We’ll use a <strong>production-grade naming convention</strong> for clarity.</p><pre>export PROJECT_ID=$(gcloud config get-value project)<br>export REGION=us-central1<br>export CLUSTER_NAME=mlops-canary-cluster<br>export GATEWAY_NS=istio-gateway<br>export GATEWAY_URL=$(kubectl get svc istio-ingressgateway -n $GATEWAY_NS -o jsonpath=&#39;{.status.loadBalancer.ingress[0].ip}&#39;)</pre><p><strong>Why:</strong> These variables simplify command execution and make scripts reproducible.</p><h3>Naming Convention (IMPORTANT — use consistently)</h3><p>ComponentNameProjectauto (Qwiklabs)Clustermlops-prod-gkeMeshmlops-prod-meshNamespace (gateway)istio-ingress-prodApp nameimage-classifierModel versionsresnet50-prod, resnet101-canaryBucket&lt;PROJECT_ID&gt;-ml-models</p><p>This <strong>looks like real production</strong> in screenshots.</p><h3>TASK 1 — Project &amp; Environment Setup</h3><h3>1.1 Set region and zone</h3><pre>gcloud config set compute/region us-central1<br>gcloud config set compute/zone us-central1-a</pre><h4>Why this is necessary</h4><ul><li>Ensures <strong>all resources are co-located</strong></li><li>Avoids latency and quota issues</li><li>Standard practice in production</li></ul><h4>Verify</h4><pre>gcloud config list</pre><p><strong>Expected output</strong></p><pre>compute/region = us-central1<br>compute/zone = us-central1-a</pre><h3>1.2 Clone lab repository</h3><pre>cd ~<br>git clone https://github.com/GoogleCloudPlatform/mlops-on-gcp.git<br>cd mlops-on-gcp/workshops/mlep-qwiklabs/tfserving-canary-gke</pre><h4>Why</h4><ul><li>Contains <strong>battle-tested manifests</strong></li><li>Same structure used internally by Google labs</li><li>You’ll customize, not reinvent</li></ul><h4>Verify</h4><pre>ls</pre><p>Expected output includes:</p><pre>tf-serving  payloads  README.md</pre><h3>TASK 2 — Create Production GKE Cluster</h3><h3>Set environment variables</h3><pre>export PROJECT_ID=$(gcloud config get-value project)<br>export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID \<br>  --format=&quot;value(projectNumber)&quot;)</pre><pre>export CLUSTER_NAME=mlops-prod-gke<br>export WORKLOAD_POOL=${PROJECT_ID}.svc.id.goog<br>export MESH_ID=&quot;proj-${PROJECT_NUMBER}&quot;</pre><h4>Why</h4><ul><li>Enables <strong>Workload Identity</strong></li><li>Required for <strong>Cloud Service Mesh</strong></li><li>Matches enterprise best practices</li></ul><h4>Verify</h4><pre>echo $CLUSTER_NAME $WORKLOAD_POOL $MESH_ID</pre><h3>Create GKE cluster</h3><pre>gcloud beta container clusters create $CLUSTER_NAME \<br>  --machine-type=e2-standard-4 \<br>  --num-nodes=5 \<br>  --workload-pool=$WORKLOAD_POOL \<br>  --logging=SYSTEM,WORKLOAD \<br>  --monitoring=SYSTEM \<br>  --subnetwork=default \<br>  --release-channel=stable \<br>  --labels mesh_id=$MESH_ID</pre><h4>Why this matters</h4><ul><li><strong>Stable channel</strong> → predictable upgrades</li><li><strong>Node size</strong> suitable for ML inference</li><li><strong>Mesh label</strong> required by ASM</li></ul><h4>Verify</h4><pre>kubectl get nodes</pre><p>Expected output:</p><pre>NAME                                STATUS   ROLES    AGE<br>gke-mlops-prod-gke-default-pool-*   Ready    &lt;none&gt;   *</pre><h3>Grant cluster admin</h3><pre>kubectl create clusterrolebinding cluster-admin-binding \<br>  --clusterrole=cluster-admin \<br>  --user=$(whoami)@qwiklabs.net</pre><h4>Why</h4><ul><li>Required for installing <strong>service mesh</strong></li><li>Production clusters always have RBAC separation</li></ul><h4>Verify</h4><pre>kubectl auth can-i create deployments</pre><p>Expected output:</p><pre>yes</pre><h3>TASK 3 — Install Cloud Service Mesh (Istio)</h3><h3>Download ASM installer</h3><pre>curl https://storage.googleapis.com/csm-artifacts/asm/asmcli_1.15 &gt; asmcli<br>chmod +x asmcli</pre><h4>Why</h4><ul><li>Google-supported Istio distribution</li><li>Security-patched and enterprise-ready</li></ul><h4>Verify</h4><pre>./asmcli version</pre><h3>Install ASM</h3><pre>./asmcli install \<br>  --project_id $PROJECT_ID \<br>  --cluster_name $CLUSTER_NAME \<br>  --cluster_location us-central1-a \<br>  --fleet_id $PROJECT_ID \<br>  --output_dir ./asm_output \<br>  --enable_all \<br>  --option legacy-default-ingressgateway \<br>  --ca mesh_ca \<br>  --enable_gcp_components</pre><h4>Why</h4><ul><li>Enables <strong>traffic control, observability, security</strong></li><li>Required for <strong>canary routing</strong></li></ul><h4>Verify</h4><pre>kubectl get pods -n istio-system</pre><p>Expected output:</p><pre>istiod-*   Running</pre><h3>TASK 4 — Configure Ingress Gateway (Production Namespace)</h3><h3>Create gateway namespace</h3><pre>kubectl create namespace istio-ingress-prod</pre><h4>Why</h4><ul><li>Separation of concerns</li><li>Gateways should not run in control plane</li></ul><h4>Verify</h4><pre>kubectl get ns | grep istio-ingress-prod</pre><h3>Enable sidecar injection (revision-based)</h3><pre>REVISION=$(kubectl get deploy -n istio-system -l app=istiod \<br>  -o jsonpath=&#39;{.items[*].metadata.labels.istio\.io\/rev}&#39;)</pre><pre>kubectl label namespace istio-ingress-prod istio.io/rev=$REVISION --overwrite</pre><ul><li>Ensures <strong>correct Istio version</strong></li><li>Prevents breaking changes during upgrades</li></ul><h4>Verify</h4><pre>kubectl get ns istio-ingress-prod --show-labels</pre><h3>4 Deploy ingress gateway</h3><pre>cd asm_output<br>kubectl apply -n istio-ingress-prod \<br>  -f samples/gateways/istio-ingressgateway/autoscalingv2</pre><h4>Verify</h4><pre>kubectl get svc -n istio-ingress-prod</pre><p>Expected:</p><pre>istio-ingressgateway   LoadBalancer</pre><h3>TASK 5 — Enable Sidecar Injection for Workloads</h3><pre>kubectl label namespace default istio.io/rev=$REVISION --overwrite</pre><h4>Why</h4><ul><li>Enables traffic interception</li><li>Required for routing &amp; telemetry</li></ul><h4>Verify</h4><pre>kubectl get ns default --show-labels</pre><h3>TASK 6 — Model Storage (Production Bucket)</h3><h3>Create bucket</h3><pre>export MODEL_BUCKET=${PROJECT_ID}-ml-models<br>gsutil mb gs://${MODEL_BUCKET}</pre><h4>Why</h4><ul><li>Centralized model storage</li><li>Standard ML serving pattern</li></ul><h4>Verify</h4><pre>gsutil ls</pre><h3>6. Copy models</h3><pre>gsutil cp -r gs://spls/gsp778/resnet_50 gs://${MODEL_BUCKET}<br>gsutil cp -r gs://spls/gsp778/resnet_101 gs://${MODEL_BUCKET}</pre><h3>Make bucket readable (lab shortcut)</h3><pre>gsutil uniformbucketlevelaccess set on gs://${MODEL_BUCKET}<br>gsutil iam ch allUsers:objectViewer gs://${MODEL_BUCKET}</pre><blockquote><em>In production, use </em><strong><em>Workload Identity</em></strong><em>, not public buckets</em></blockquote><h3>TASK 7 — Deploy ResNet50 (Production Model)</h3><h3>7.1 Create ConfigMap</h3><pre>cd ~/mlops-on-gcp/workshops/mlep-qwiklabs/tfserving-canary-gke<br>sed -i &quot;s@\[\YOUR_BUCKET\]@$MODEL_BUCKET@g&quot; tf-serving/configmap-resnet50.yaml<br>kubectl apply -f tf-serving/configmap-resnet50.yaml</pre><h4>Verify</h4><pre>kubectl get configmap resnet50-configs</pre><h3>7 Deploy TF Serving</h3><pre>kubectl apply -f tf-serving/deployment-resnet50.yaml<br>kubectl apply -f tf-serving/service.yaml</pre><h4>Verify</h4><pre>kubectl get pods -l version=resnet50</pre><p>Expected:</p><pre>image-classifier-resnet50-*   Running</pre><h3>TASK 8 — Expose via Istio Gateway</h3><pre>kubectl apply -f tf-serving/gateway.yaml<br>kubectl apply -f tf-serving/virtualservice.yaml</pre><h4>Verify</h4><pre>kubectl get virtualservice image-classifier</pre><h3>TASK 9 — Test Production Model</h3><h3>9 Get gateway endpoint</h3><pre>export INGRESS_HOST=$(kubectl -n istio-ingress-prod get svc istio-ingressgateway \<br>  -o jsonpath=&#39;{.status.loadBalancer.ingress[0].ip}&#39;)</pre><pre>export INGRESS_PORT=80<br>export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT</pre><h4>Verify</h4><pre>echo $GATEWAY_URL</pre><h3>9.2 Send prediction request</h3><pre>curl -d @payloads/request-body.json \<br>  -X POST http://$GATEWAY_URL/v1/models/image_classifier:predict</pre><ul><li>Response with probabilities</li><li>~45% confidence for “military uniform”</li></ul><h3>TASK 10 — Deploy ResNet101 Canary</h3><h3>10.1 Create ConfigMap</h3><pre>sed -i &quot;s@\[\YOUR_BUCKET\]@$MODEL_BUCKET@g&quot; tf-serving/configmap-resnet101.yaml<br>kubectl apply -f tf-serving/configmap-resnet101.yaml<br>kubectl apply -f tf-serving/deployment-resnet101.yaml</pre><h4>Verify</h4><pre>kubectl get pods -l version=resnet101</pre><h3>TASK 11 — Weighted Canary Routing (70/30)</h3><pre>kubectl apply -f tf-serving/destinationrule.yaml<br>kubectl apply -f tf-serving/virtualservice-weight-70.yaml</pre><h4>Verify</h4><pre>kubectl describe virtualservice image-classifier</pre><h3>Test</h3><pre>for i in {1..10}; do<br>  curl -s -d @payloads/request-body.json \<br>  -X POST http://$GATEWAY_URL/v1/models/image_classifier:predict | grep military<br>done</pre><p>Mixed probabilities (~45% and ~94%)</p><h3>TASK 12 — Header-Based Canary (A/B Testing)</h3><pre>kubectl apply -f tf-serving/virtualservice-focused-routing.yaml</pre><h3>Without header</h3><pre>curl -d @payloads/request-body.json \<br>  -X POST http://$GATEWAY_URL/v1/models/image_classifier:predict</pre><h3>With canary header</h3><pre>curl -d @payloads/request-body.json \<br>  -H &quot;user-group: canary&quot; \<br>  -X POST http://$GATEWAY_URL/v1/models/image_classifier:predict</pre><ul><li>Default → ResNet50</li><li>Canary header → ResNet101 (~94%)</li></ul><h3>Production-grade screenshots</h3><ul><li>Real commands</li><li>Real verif ication</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=772a38734201" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In this tutorial, we’ll walk through how to deploy a scalable, highly available Apache HTTPD web…]]></title>
            <link>https://medium.com/@henryeknyarko/in-this-tutorial-well-walk-through-how-to-deploy-a-scalable-highly-available-apache-httpd-web-49d0e7131e55?source=rss-2cfc5c8aa7a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/49d0e7131e55</guid>
            <dc:creator><![CDATA[Henryeknyarko]]></dc:creator>
            <pubDate>Fri, 17 Oct 2025 12:56:37 GMT</pubDate>
            <atom:updated>2025-10-17T12:56:37.564Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VVFLx8TrTSdtvAF_Xt4VFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wTxo4uvCQeWESTGquTawpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*72VFMkD4atRil1LMPw6i3Q.png" /></figure><h3>Deploying a Highly Available Apache HTTPD Application on AWS ECS with an Application Load Balancer</h3><p>In this tutorial, we’ll walk through how to deploy a scalable, highly available <strong>Apache HTTPD web application</strong> on <strong>Amazon Elastic Container Service (ECS)</strong> using the <strong>EC2 launch type</strong>.</p><p>We’ll configure <strong>security groups</strong>, <strong>key pairs</strong>, a <strong>load balancer</strong>, and <strong>containerized web services</strong> — all using the AWS Console.</p><h3>Architecture Overview</h3><p>The architecture includes:</p><ul><li><strong>ECS Cluster</strong> running EC2 instances hosting Dockerized HTTPD containers.</li><li><strong>Application Load Balancer (ALB)</strong> distributing incoming traffic across multiple containers.</li><li><strong>Security Groups</strong> controlling inbound and outbound network traffic.</li><li><strong>Target Group</strong> for routing and performing health checks.</li><li><strong>High Availability</strong> across multiple Availability Zones (AZs).</li></ul><h3>Prerequisites</h3><ul><li>Active <strong>AWS account</strong> (Free Tier is fine).</li><li>Basic understanding of <strong>EC2, ECS, and ALB</strong>.</li><li><strong>SSH client</strong> access to connect to EC2 instances.</li></ul><h3>Step 1: Sign in to the AWS Management Console</h3><ol><li>Go to the AWS Console.</li><li>Leave the <strong>Account ID</strong> as default.</li><li>Enter your <strong>IAM Username</strong> and <strong>Password</strong> to sign in.</li><li>Set your <strong>default region</strong> to <strong>US East (N. Virginia)</strong> — us-east-1.</li></ol><h3>Step 2: Create a Security Group for the Load Balancer</h3><ol><li>Navigate to <strong>EC2 → Security Groups → Create Security Group</strong>.</li><li>Configure:</li></ol><ul><li><strong>Name:</strong> ALB-SG</li><li><strong>Description:</strong> Security group for the load balancer</li><li><strong>VPC:</strong> Default</li></ul><ol><li>Under <strong>Inbound Rules</strong>, click <strong>Add Rule</strong>:</li></ol><ul><li><strong>Type:</strong> All TCP</li><li><strong>Source:</strong> Anywhere (0.0.0.0/0)</li></ul><p>Click <strong>Create Security Group</strong>.</p><h3>Step 3: Create a Security Group for the ECS Cluster</h3><ol><li>Go to <strong>EC2 → Security Groups → Create Security Group</strong>.</li><li>Configure:</li></ol><ul><li><strong>Name:</strong> ECS-SG</li><li><strong>Description:</strong> Security group for ECS cluster</li><li><strong>VPC:</strong> Default</li></ul><ol><li>Under <strong>Inbound Rules</strong>, click <strong>Add Rule</strong>:</li></ol><ul><li><strong>Type:</strong> SSH — Source: Anywhere (0.0.0.0/0)</li><li><strong>Type:</strong> All TCP — Source: ALB-SG</li></ul><p>Click <strong>Create Security Group</strong>.</p><h3>Step 4: Create a Key Pair for EC2 Instances</h3><ol><li>In the EC2 Console, go to <strong>Key Pairs → Create Key Pair</strong>.</li><li>Configure:</li></ol><ul><li><strong>Name:</strong> ECSKeyPair</li><li><strong>Key Type:</strong> RSA</li><li><strong>Private Key Format:</strong> .pem (for macOS/Linux) or .ppk (for Windows)</li></ul><ol><li>Click <strong>Create Key Pair</strong> and download the file locally.</li></ol><ul><li>Save it securely — you’ll need it to SSH into your EC2 instances.</li></ul><h3>Step 5: Create an Application Load Balancer (ALB)</h3><ol><li>Navigate to <strong>EC2 → Load Balancers → Create Load Balancer → Application Load Balancer</strong>.</li><li>Configure:</li></ol><ul><li><strong>Name:</strong> httpd-alb</li><li><strong>Scheme:</strong> Internet-facing</li><li><strong>IP Type:</strong> IPv4</li><li><strong>Availability Zones:</strong> Select two (e.g., us-east-1a and us-east-1b)</li><li><strong>VPC:</strong> Default</li><li><strong>Security Group:</strong> ALB-SG</li></ul><ol><li>Under <strong>Listeners and Routing</strong>:</li><li><strong>Protocol:</strong> HTTP</li></ol><ul><li><strong>Port:</strong> 80</li></ul><ol><li>Click <strong>Create Target Group</strong>, then configure:</li></ol><ul><li><strong>Target Type:</strong> Instances</li><li><strong>Name:</strong> ecs-target-group</li><li>Leave other options as default → click <strong>Create Target Group</strong>.</li></ul><ol><li>Return to the ALB setup page and select <strong>ecs-target-group</strong>.</li><li>Click <strong>Create Load Balancer</strong>.</li><li>Wait 2–3 minutes until it becomes <strong>Active</strong>.</li></ol><h3>Step 6: Create an ECS Cluster</h3><ol><li>Navigate to <strong>ECS → Clusters → Create Cluster</strong>.</li><li>Configure:</li></ol><ul><li><strong>Cluster Name:</strong> ecs-cluster</li><li><strong>Infrastructure:</strong> Fargate and Self-managed instances</li><li><strong>Provisioning Model:</strong> On-Demand</li><li><strong>AMI:</strong> Amazon Linux 2023</li><li><strong>Instance Type:</strong> t2.micro</li><li><strong>Instance Role:</strong> Select existing ECS instance role</li><li><strong>Key Pair:</strong> ECSKeyPair</li><li><strong>EBS Volume Size:</strong> 30 GiB</li></ul><ol><li>Under <strong>Network Settings</strong>:</li></ol><p><strong>VPC:</strong> Default</p><ul><li><strong>Subnets:</strong> us-east-1a and us-east-1b</li><li><strong>Security Group:</strong> ECS-SG</li><li><strong>Auto-assign Public IP:</strong> Enabled</li></ul><ol><li>Click <strong>Create</strong> and wait for the ECS cluster to provision.</li></ol><h3>Step 7: Create Task Definitions</h3><ol><li>Go to <strong>ECS → Task Definitions → Create New Task Definition</strong>.</li><li>Configure:</li></ol><ul><li><strong>Family:</strong> ecs-httpd-task</li><li><strong>Launch Type:</strong> EC2 (remove Fargate)</li><li><strong>Network Mode:</strong> bridge</li><li><strong>CPU:</strong> 0.25 vCPU</li><li><strong>Memory:</strong> 0.25 GB</li></ul><ol><li>Add a container:</li></ol><ul><li><strong>Container Name:</strong> httpd</li><li><strong>Image:</strong> httpd:2.4</li></ul><ol><li>Click <strong>Create</strong> to save your task definition.</li></ol><h3>🧭 Step 8: Create a Service</h3><ol><li>Go to <strong>ECS → Clusters → ecs-cluster → Services → Create</strong>.</li><li>Configure:</li></ol><ul><li><strong>Task Definition:</strong> ecs-httpd-task</li><li><strong>Service Name:</strong> httpd-service</li><li><strong>Launch Type:</strong> EC2</li><li><strong>Desired Tasks:</strong> 3</li></ul><ol><li>Under <strong>Load Balancing</strong>:</li></ol><ul><li><strong>Enable Load Balancing</strong></li><li><strong>VPC:</strong> Default</li><li><strong>Load Balancer:</strong> httpd-alb</li><li><strong>Listener:</strong> 80:HTTP</li><li><strong>Target Group:</strong> ecs-target-group</li></ul><ol><li>Click <strong>Create Service</strong> and wait for <strong>3/3 tasks</strong> to be running.</li></ol><h3>Step 9: Verify ECS Instances</h3><ol><li>Go to <strong>ECS → Clusters → ecs-cluster → Infrastructure Tab</strong>.</li><li>Click the <strong>Instance ID</strong> to view the EC2 instance details and confirm status.</li></ol><h3>🐳 Step 10: SSH into the ECS Instance</h3><ol><li>Use your downloaded key pair to connect</li></ol><p>ssh -i ECSKeyPair.pem ec2-user@&lt;EC2-Public-IP&gt;</p><ol><li>Gain root access and update packages:</li></ol><ul><li>sudo su yum -y update</li></ul><ol><li>Check running Docker containers:</li></ol><ul><li>docker ps</li></ul><ol><li>You’ll see the ECS agent and 3 running httpd containers on dynamic ports (e.g., 32767–32769).</li><li>Step 11: Access Each Running Container</li><li>Copy a container ID and access it:</li></ol><ul><li>docker exec -it &lt;container_id&gt; /bin/bash</li></ul><ol><li>Customize its homepage to display port info:</li></ol><ul><li>echo &quot;Traffic coming from port 32769&quot; &gt;&gt; htdocs/index.html cat htdocs/index.html</li></ul><ol><li>Repeat for all 3 containers, updating each message for its port.</li></ol><h3>🌍 Step 12: Test the Load Balancer</h3><ol><li>Go to <strong>EC2 → Target Groups → ecs-target-group → Targets</strong>.<br> Wait until all instances show <strong>Healthy</strong>.</li><li>Go to <strong>EC2 → Load Balancers → httpd-alb → Description</strong>.<br> Copy the <strong>DNS name</strong> and open it in your browser:</li></ol><ul><li><a href="http://httpd-alb-xxxxxx.us-east-1.elb.amazonaws.com/">http://httpd-alb-xxxxxx.us-east-1.elb.amazonaws.com</a></li></ul><ol><li>Refresh multiple times — you’ll see responses from different containers, confirming load balancing.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49d0e7131e55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing a Web Application on AWS Using WAF and Application Load Balancer]]></title>
            <link>https://medium.com/@henryeknyarko/securing-a-web-application-on-aws-using-waf-and-application-load-balancer-d874e8a94374?source=rss-2cfc5c8aa7a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d874e8a94374</guid>
            <dc:creator><![CDATA[Henryeknyarko]]></dc:creator>
            <pubDate>Thu, 16 Oct 2025 10:29:27 GMT</pubDate>
            <atom:updated>2025-10-16T10:29:27.119Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jp2_eqG33Gji4CbOE0cyGQ.png" /></figure><h3>Introduction</h3><p>In this project, I built and secured a simple web application hosted on Amazon EC2 instances behind an Application Load Balancer (ALB). I then integrated AWS Web Application Firewall (WAF) to automatically block malicious requests such as SQL injection and suspicious query strings.</p><p>This guide walks you through every step to replicate the same environment — from deployment to validation.</p><h3>Step 1: Create Two EC2 Web Servers</h3><ol><li>Launch two <strong>Amazon Linux 2 EC2 instances</strong> in the same VPC and subnet group.</li><li>Open port <strong>80 (HTTP)</strong> in the security group.</li><li>SSH into each instance and install a simple web server:</li></ol><p>sudo yum install -y httpd sudo systemctl start httpd sudo systemctl enable httpd echo &quot;Welcome to Web Server 1&quot; | sudo tee /var/www/html/index.html</p><ol><li>Do the same for the second instance, changing the text to <strong>Web Server 2</strong>.</li><li>Verify both servers are reachable using their public IPs.</li></ol><h3>Step 2: Create a Target Group</h3><ol><li>Go to <strong>EC2 → Target Groups → Create Target Group</strong>.</li><li>Select <strong>Instances</strong> as the target type and <strong>HTTP (port 80)</strong> as the protocol.</li><li>Register both EC2 instances in the target group.</li><li>Run a health check to confirm both instances show <strong>healthy</strong> status.</li></ol><h3>Step 3: Create an Application Load Balancer (ALB)</h3><ol><li>Navigate to <strong>Load Balancers → Create Load Balancer → Application Load Balancer</strong>.</li><li>Choose <strong>Internet-facing</strong>, <strong>IPv4</strong>, and select your VPC and public subnets.</li><li>Assign a <strong>security group</strong> that allows HTTP (port 80).</li><li>In the <strong>Listeners</strong> section, add a listener for port 80 and forward it to the target group created earlier.</li><li>Once created, open the ALB’s <strong>DNS name</strong> in your browser — you should see responses alternating between <strong>Web Server 1</strong> and <strong>Web Server 2</strong>.</li></ol><h3>🛡️ Step 4: Create and Configure AWS WAF Web ACL</h3><ol><li>Go to <strong>AWS WAF &amp; Shield → Web ACLs → Create Web ACL</strong>.</li><li>Associate it with your <strong>ALB</strong>.</li><li>Add the following <strong>managed rules</strong>:</li></ol><ul><li>AWSManagedRulesCommonRuleSet</li><li>AWSManagedRulesSQLiRuleSet</li></ul><ol><li>Optionally, create a <strong>custom rule</strong> to block specific query strings or IPs.</li><li>Save and deploy the Web ACL.</li></ol><h3>🧪 Step 5: Test the WAF Rules</h3><p>Try accessing your ALB URL with a malicious query:</p><pre>http://&lt;ALB-DNS-Name&gt;/?id=&#39;OR+1=1--</pre><p>You should get a <strong>403 Forbidden</strong> response — confirming that AWS WAF successfully blocked the request.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d874e8a94374" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Securely Expose AKS Applications Using Azure Front Door + Private Link]]></title>
            <link>https://medium.com/@henryeknyarko/how-to-securely-expose-aks-applications-using-azure-front-door-private-link-19b03af27c17?source=rss-2cfc5c8aa7a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/19b03af27c17</guid>
            <dc:creator><![CDATA[Henryeknyarko]]></dc:creator>
            <pubDate>Tue, 12 Aug 2025 11:06:04 GMT</pubDate>
            <atom:updated>2025-08-12T11:06:04.069Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z8QXrOlgD50kPUGFYSzvmQ.png" /></figure><p><strong>A step-by-step guide to building a private, scalable, and secure AKS ingress architecture</strong><br> <em>By Ernest Kwasi Henry Nyarko — Estimated reading time: 9–12 mins</em></p><p><strong>Tags:</strong> Azure, AKS, Azure Front Door, Private Link, Kubernetes, DevOps, security<br> <strong>Alt text:</strong> “Azure architecture: Azure Front Door → Private Endpoint → Private Link → Internal Load Balancer → AKS Ingress → Services”<br> <strong>Caption:</strong> “High-level architecture: public DNS → Azure Front Door (private endpoint) → Private Link → Internal Load Balancer → AKS ingress → application.”</p><h3>TL;DR</h3><p>Build a zero-public-exposure AKS ingress by fronting your cluster with <strong>Azure Front Door</strong> (global entry + WAF), connecting Front Door privately via a <strong>Private Endpoint</strong>, and routing into the AKS <strong>Internal Load Balancer</strong> using a <strong>Private Link Service</strong>. This keeps traffic on the Azure backbone while still serving global traffic.</p><h3>What you’ll build</h3><p>User → Public DNS → Azure Front Door (WAF &amp; CDN) → <strong>Private Endpoint</strong> → <strong>Private Link Service</strong> → Internal Load Balancer (ILB) → Ingress controller → AKS services → Application</p><p>Why this matters:</p><ul><li>Removes public AKS IPs from the internet</li><li>Enables global entry + DDoS/WAF protection</li><li>Keeps traffic on Azure backbone (compliance, lower exposure)</li></ul><h3>Prerequisites</h3><p>Azure subscription and contributor privileges</p><ul><li>Azure CLI v2.53+ (or Azure Cloud Shell)</li><li>kubectl configured</li><li>Basic Kubernetes + networking knowledge</li><li>A registered domain (for custom domain + HTTPS</li></ul><h3>Architecture snapshot (place after prerequisites)</h3><p><strong>Insert the same architecture image here</strong> so readers can reference it as they go.<br> (Use the caption and alt text above.)</p><h3>Step-by-step guide</h3><blockquote><em>Note: replace placeholders</em>1) Create resource group + VNet + subnets</blockquote><p>Commands</p><pre>RG=&quot;aks-secure-rg&quot;<br>LOC=&quot;eastus&quot;<br>VNET=&quot;aks-vnet&quot;<br>SUBNET_AKS=&quot;aks-subnet&quot;<br>SUBNET_PL=&quot;privatelink-subnet&quot;</pre><pre>az group create -n $RG -l $LOC</pre><pre>az network vnet create \<br>  -g $RG -n $VNET --address-prefix 10.10.0.0/16 \<br>  --subnet-name $SUBNET_AKS --subnet-prefix 10.10.1.0/24</pre><pre>az network vnet subnet create \<br>  -g $RG --vnet-name $VNET -n $SUBNET_PL --address-prefix 10.10.2.0/24</pre><pre>az network vnet show -g $RG -n $VNET --query &quot;subnets[].name&quot; -o tsv</pre><h3>2) Deploy AKS as a private cluster using Azure CNI</h3><p>Commands:</p><pre>AKS_NAME=&quot;aks-secure&quot;<br>SUBNET_ID=$(az network vnet subnet show -g $RG -n $SUBNET_AKS --vnet-name $VNET --query id -o tsv)</pre><pre>az aks create \<br>  -g $RG -n $AKS_NAME \<br>  --kubernetes-version &quot;1.28.0&quot; \<br>  --network-plugin azure \<br>  --vnet-subnet-id $SUBNET_ID \<br>  --enable-private-cluster \<br>  --enable-managed-identity \<br>  --generate-ssh-keys</pre><pre>az aks show -g $RG -n $AKS_NAME --query &quot;{fqdn:fqdn,privateCluster:privateCluster}&quot; -o json<br>az aks get-credentials -g $RG -n $AKS_NAME --admin<br>kubectl get nodes</pre><h3>3) Install ingress controller &amp; expose it via an Internal Load Balancer (ILB)</h3><p>Example: NGINX ingress Service annotated for Azure internal LB.</p><p>Kubernetes manifest (service only — assumes you already deployed the ingress pods):</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: nginx-ingress-internal<br>  namespace: ingress-nginx<br>  annotations:<br>    service.beta.kubernetes.io/azure-load-balancer-internal: &quot;true&quot;<br>spec:<br>  type: LoadBalancer<br>  selector:<br>    app.kubernetes.io/name: ingress-nginx<br>  ports:<br>    - name: http<br>      port: 80<br>      targetPort: http<br>    - name: https<br>      port: 443<br>      targetPort: https</pre><p>Apply:</p><pre>kubectl apply -f nginx-ilb-service.yaml<br>kubectl get svc -n ingress-nginx</pre><ul><li>Note the ILB private IP in the AKS VNet (e.g., 10.10.1.10).</li></ul><h3>4) Create a Private Link Service fronting the ILB</h3><p><strong>Goal:</strong> publish a Private Link Service that connects to the ILB’s frontend IP so other Azure services (AFD via Private Endpoint) can connect privately.</p><blockquote><em>Small caveat: creating a Private Link Service from services backed by a Load Balancer requires providing the </em><strong><em>frontend IP configuration resource ID</em></strong><em> of that Azure load balancer. You may choose the Portal if you prefer a step-by-step UI.</em></blockquote><blockquote>CLI (conceptual — replace IDs):</blockquote><pre># 1) Find the resource ID of the ILB frontend IP config (LB created by AKS)<br>LB_NAME=$(az network lb list -g $RG --query &quot;[?contains(name,&#39;kubernetes&#39;)].name|[0]&quot; -o tsv)<br>FRONTEND_CONFIG_ID=$(az network lb frontend-ip show -g $RG --lb-name $LB_NAME -n &quot;LoadBalancerFrontEnd&quot; --query id -o tsv)</pre><pre># 2) Create Private Link Service<br>az network private-link-service create \<br>  -g $RG -n aks-pls \<br>  --vnet-name $VNET \<br>  --subnet $SUBNET_PL \<br>  --lb-frontend-ip-configs $FRONTEND_CONFIG_ID \<br>  --visibility &quot;subscriptions&quot; \<br>  --auto-approve-connection false</pre><p>Verification:</p><pre>az network private-link-service show -g $RG -n aks-pls -o json</pre><p>If you hit friction on frontend-config names, use the Azure Portal to locate the load balancer resource created by AKS and copy the exact frontend IP config ID.</p><h3>5) Deploy Azure Front Door (Standard or Premium)</h3><p>Create the Front Door profile and an initial backend placeholder. We will later create a Private Endpoint to connect AFD to the Private Link Service.</p><pre>AFD_RESOURCE_GROUP=$RG<br>AFD_NAME=&quot;afd-secure&quot;</pre><pre>az network front-door create -g $AFD_RESOURCE_GROUP -n $AFD_NAME \<br>  --backend-address &quot;placeholder.azurefd.net&quot;</pre><p>Then add your custom domain and origin configuration in the Portal or using az network front-door commands. For production, use <strong>Azure Front Door Standard/Premium</strong> (required for Private Link-managed endpoints).</p><h3>6) Create a Private Endpoint for Azure Front Door managed endpoints</h3><p>This creates a private endpoint in your VNet that lets Front Door reach resources via Private Link Service.</p><p>Example:</p><pre># Get Front Door resource id<br>AFD_ID=$(az network front-door show -g $RG -n $AFD_NAME --query id -o tsv)</pre><pre># Create Private Endpoint that points to the AFD managed endpoint group<br>az network private-endpoint create \<br>  -g $RG -n afd-private-endpoint \<br>  --vnet-name $VNET --subnet $SUBNET_PL \<br>  --private-connection-resource-id $AFD_ID \<br>  --group-id &quot;frontDoorHost&quot; \<br>  --connection-name afd-to-aks-conn</pre><p><em>Note:</em> group-id value depends on the target resource type; check az network private-endpoint connection docs. You can also establish the private connection from the Front Door side in the Azure Portal (often simpler).</p><p>Verification</p><pre>az network private-endpoint list -g $RG -o table</pre><h3>7) Wire AFD backend to the Private Link Service</h3><p>In the Front Door configuration (Portal or CLI), add a backend using the <strong>Private Link Service</strong> or the private endpoint IP. For Standard/Premium AFD you can configure Managed Endpoints and Private Link origins.</p><p>Verify:</p><ul><li>AFD backend health shows healthy</li><li>No public AKS IP is exposed</li></ul><h3>8) Add DNS + HTTPS</h3><ol><li>In your DNS provider, create a CNAME from your domain (e.g., app.example.com) to the Front Door default host (e.g., afdname.azurefd.net).</li><li>Enable HTTPS — use Azure managed certificate via Front Door UI or CLI:</li></ol><pre>az network front-door custom-domain https enable \<br>  --resource-group $RG --front-door-name $AFD_NAME --name app.example.com</pre><h3>9) Security hardening</h3><ul><li>Enable Web Application Firewall (WAF) on Front Door:</li></ul><pre>az network front-door waf-policy create -g $RG -n afd-waf --mode Prevention<br># Attach to Front Door in Portal or via CLI</pre><ul><li>Use NSGs to allow traffic only from Private Link ranges and necessary internal services.</li><li>Enable Azure Monitor + Application Insights for the AKS app.</li></ul><h3>10) Test end-to-end</h3><p>From the public Internet:</p><pre>curl -I https://app.example.com</pre><p>Expected:</p><ul><li>TLS handshake with your domain</li><li>Response from your application</li><li>No publicly routable IP for AKS services (verify kubectl get svc shows ClusterIP/ILB private IP only)</li></ul><p>Inside Azure VNet (optional), test connectivity to the ILB private IP to confirm internal routing.</p><h3>Troubleshooting tips</h3><ul><li>If AFD backend shows unhealthy: check NSGs, ILB health probes, and whether the private-link service approves the connection.</li><li>If you can’t find the LB frontend config: check the Azure Load Balancer resources created by AKS (names vary).</li><li>When Private Link requests require approval, accept the connection on the Private Link Service side (Portal or CLI).</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19b03af27c17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab: EC2 Monitoring, CloudWatch Alarms, and Dashboards (SRE-Focused)]]></title>
            <link>https://medium.com/@henryeknyarko/lab-ec2-monitoring-cloudwatch-alarms-and-dashboards-sre-focused-500b0698489c?source=rss-2cfc5c8aa7a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/500b0698489c</guid>
            <dc:creator><![CDATA[Henryeknyarko]]></dc:creator>
            <pubDate>Thu, 07 Aug 2025 11:55:19 GMT</pubDate>
            <atom:updated>2025-08-07T11:55:19.029Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QjSqWDHcskpcXpJQHwInbw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B6dqFXqjMDYCEvA0eahEvA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*piJB1ysJ1oUmCfT4on4IhQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*0eNeijPbCEMJZJbTpRoJGQ.png" /></figure><h3>🏢 Company Context</h3><p>You’re setting up EC2 monitoring and alerting as part of a cloud observability initiative at <strong>Acme Corp</strong>. The aim is to monitor CPU load, trigger alarms based on thresholds, and visualize metrics in a centralized CloudWatch Dashboard. This setup improves <strong>SLIs (Service Level Indicators)</strong> and <strong>ensures fast incident response</strong> as part of your <strong>SRE practices</strong>.</p><h3>Task 1: Sign in to AWS Management Console</h3><h3>Steps:</h3><p>Open the AWS Management Console.</p><p>Sign in using provided IAM credentials (username and password).<strong>Set the default region</strong> to <strong>US East (N. Virginia) — </strong><strong>us-east-1</strong>.</p><p><strong><em>Why?</em></strong><em><br> Standardizing on a region like </em><em>us-east-1 helps maintain consistency in infrastructure deployment and avoids cross-region costs or latency issues.</em></p><p>Task 2: Launch EC2 Instance</p><p>Steps:</p><ol><li>Navigate to <strong>EC2 &gt; Instances &gt; Launch Instance</strong>.</li><li><strong>Name</strong>: MyEC2Server</li><li><strong>AMI</strong>: Choose Amazon Linux 2023 AMI.</li><li><strong>Instance Type</strong>: t2.micro (eligible under free tier).</li><li><strong>Key Pair</strong>:</li></ol><ul><li>Click <strong>Create new key pair</strong>.</li></ul><p>Name: MyEC2Key</p><ul><li>Type: RSA</li><li>Format: .pem</li><li>Download the key for SSH access.</li></ul><ol><li><strong>Network Settings</strong>:</li></ol><ul><li>Click <strong>Edit</strong>.</li><li>Auto-assign public IP: <strong>Enable</strong></li><li>Create a new security group:</li><li>Name: MyEC2Server_SG</li><li>Description: Security Group to allow traffic to EC2</li><li>Add Rule:</li><li>Type: SSH</li><li>Source: Anywhere (0.0.0.0/0)</li></ul><ol><li>Click <strong>Launch Instance</strong>.</li><li>Click <strong>View All Instances</strong>.</li><li>Wait until the instance is in <strong>Running</strong> state and note the <strong>Instance ID</strong>.</li></ol><blockquote><strong><em>Why?</em></strong><em><br> EC2 provides the compute layer. Later steps use it to simulate workload and observe metrics like CPUUtilization in CloudWatch.</em></blockquote><blockquote>Task 3: SSH into EC2 and Install Tools</blockquote><h3>Steps:</h3><ol><li>Use your terminal to SSH into the instance:</li></ol><ul><li>chmod 400 MyEC2Key.pem ssh -i MyEC2Key.pem ec2-user@&lt;Public-IP&gt;</li></ul><ol><li>Switch to root:</li></ol><ul><li>sudo su</li></ul><ol><li>Update system:</li></ol><ul><li>dnf update -y</li></ul><ol><li>Install stress tool:</li></ol><ul><li>dnf install stress-ng -y<em><br> The </em><em>stress-ng tool helps simulate high CPU usage to validate CloudWatch alarms in later steps.</em></li></ul><h3>Task 4: Create SNS Topic for Notifications</h3><h3>Steps</h3><ol><li>Navigate to <strong>SNS &gt; Topics &gt; Create Topic</strong>.</li><li>Type: <strong>Standard</strong></li><li>Name: MyServerMonitor</li><li>Display Name: MyServerMonitor</li><li>Click <strong>Create Topic</strong>.</li></ol><blockquote><strong><em>Why?</em></strong><em><br> SNS is used to </em><strong><em>send alert notifications</em></strong><em> (via email, SMS, etc.) when CloudWatch alarms are triggered.</em></blockquote><blockquote>Task 5: Subscribe Email to SNS Topic</blockquote><h3>Steps:</h3><ol><li>In the SNS topic MyServerMonitor, click <strong>Create Subscription</strong>.</li><li>Protocol: Email</li><li>Endpoint: you@example.com</li><li>Click <strong>Create Subscription</strong>.</li><li>Go to your email and <strong>Confirm the subscription</strong>.</li></ol><blockquote><strong><em>Why?</em></strong><em><br> Subscriptions enable actual human or system recipients to get real-time alert notifications when alarms trigger.</em></blockquote><blockquote>Task 6: View EC2 CPU Metrics in CloudWatch</blockquote><h3>Steps:</h3><ol><li>Navigate to <strong>CloudWatch &gt; Metrics &gt; All Metrics &gt; EC2 &gt; Per-Instance Metrics</strong>.</li><li>Search for your <strong>Instance ID</strong>.</li><li>Click on the <strong>CPUUtilization</strong> metric.</li></ol><blockquote><em>🔍 </em><strong><em>Why?</em></strong><em><br> CPUUtilization is a key SLI. Viewing it over time helps validate performance and guide scaling decisions</em></blockquote><blockquote>Task 7: Create CloudWatch Alarm on CPU Usage</blockquote><h3>Steps:</h3><ol><li>Navigate to <strong>CloudWatch &gt; Alarms &gt; Create Alarm</strong>.</li><li>Click <strong>Select Metric</strong>, then:</li></ol><ul><li>EC2 &gt; Per-Instance Metrics &gt; Choose your <strong>Instance ID</strong></li><li>Select <strong>CPUUtilization</strong></li></ul><ol><li>Set Alarm:</li></ol><ul><li>Period: 1 minute</li><li>Threshold type: Static</li><li>Condition: Greater than 30</li></ul><ol><li>Click <strong>Next</strong>.</li><li>Notification:</li></ol><ul><li>Alarm state trigger: In Alarm</li><li>Select existing SNS topic: MyServerMonitor</li></ul><ol><li>Name: MyServerCPUUtilizationAlarm</li><li>Review and <strong>Create Alarm</strong>.</li></ol><blockquote><em>🔍 </em><strong><em>Why?</em></strong><em><br> Alarms are critical to detect and alert on SLA breaches or infrastructure stress — key to incident management workflows.</em></blockquote><blockquote>Task 8: Trigger Alarm by Stressing CPU</blockquote><h3>Steps:</h3><ol><li>SSH into EC2 again and run:</li></ol><ul><li>sudo stress-ng --cpu 10 -v --timeout 400s</li></ul><ol><li>In a new terminal window, SSH again and run:</li></ol><ul><li>top</li></ul><ol><li>Observe %Cpu near 100%.</li></ol><blockquote><strong><em>Why?</em></strong><em><br> Simulating high CPU allows you to </em><strong><em>test the full alerting pipeline</em></strong><em> — from metric rise to email notification.</em></blockquote><blockquote>Task 9: Check Email for Alarm Notification</blockquote><h3>Steps:</h3><ul><li>Open your inbox.</li><li>Confirm you received a notification email from <strong>MyServerMonitor</strong> regarding MyServerCPUUtilizationAlarm.</li></ul><blockquote><em>🔍 </em><strong><em>Why?</em></strong><em><br> Ensures your alerting setup is working. Missing alerts can delay incident response, impacting SLOs.</em></blockquote><blockquote>Task 10: Review CloudWatch Alarm Graph</blockquote><blockquote>Steps:</blockquote><ol><li>Navigate to <strong>CloudWatch &gt; Alarms</strong>.</li><li>Click on MyServerCPUUtilizationAlarm.</li><li>Review the graph spikes where CPU exceeded 30%.</li></ol><blockquote><strong><em>Why?</em></strong><em><br> Visual confirmation of when the issue occurred helps with postmortems and RCA.</em></blockquote><h3>Task 11: Create CloudWatch Dashboard</h3><h3>Steps:</h3><ol><li>Navigate to <strong>CloudWatch &gt; Dashboards &gt; Create dashboard</strong>.</li><li>Name: MyEC2ServerDashboard</li><li>Add Widget:</li><li>Widget type: Line graph</li></ol><ul><li>Select Metric: EC2 &gt; Per-Instance Metrics &gt; CPUUtilization</li></ul><ol><li>Click <strong>Create Widget</strong> and <strong>Save Dashboard</strong>.<em><br> Dashboards consolidate important metrics into a single view — crucial for on-call engineers and proactive monitoring.</em></li></ol><h3>Optional: Add More Widgets</h3><p>Use <strong>Add widget</strong> to add:</p><ul><li>NetworkIn/Out</li><li>Disk Read/Write</li><li>Memory (via CloudWatch Agent if installed)</li><li>Summary</li></ul><p>By completing this lab, you’ve implemented:</p><ul><li><strong>Compute provisioning (EC2)</strong></li><li><strong>Real-time metric visibility (CloudWatch)</strong></li><li><strong>Automated alerts (SNS + Alarm)</strong></li><li><strong>Visual monitoring (Dashboards)</strong></li></ul><p>This setup forms the foundation of <strong>cloud-native observability</strong>, empowering SRE and DevOps teams to <strong>detect, respond, and improve</strong> reliability effectively.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=500b0698489c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lab: EC2 Monitoring, CloudWatch Alarms, and Dashboards (SRE-Focused)]]></title>
            <link>https://medium.com/@henryeknyarko/lab-ec2-monitoring-cloudwatch-alarms-and-dashboards-sre-focused-33aba08087db?source=rss-2cfc5c8aa7a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/33aba08087db</guid>
            <dc:creator><![CDATA[Henryeknyarko]]></dc:creator>
            <pubDate>Thu, 07 Aug 2025 11:50:34 GMT</pubDate>
            <atom:updated>2025-08-07T11:50:34.739Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*piJB1ysJ1oUmCfT4on4IhQ.png" /></figure><h3>🏢 Company Context</h3><p>You’re setting up EC2 monitoring and alerting as part of a cloud observability initiative at <strong>Acme Corp</strong>. The aim is to monitor CPU load, trigger alarms based on thresholds, and visualize metrics in a centralized CloudWatch Dashboard. This setup improves <strong>SLIs (Service Level Indicators)</strong> and <strong>ensures fast incident response</strong> as part of your <strong>SRE practices</strong>.</p><h3>✅ Task 1: Sign in to AWS Management Console</h3><h3>Steps:</h3><p>Open the AWS Management Console.</p><p>Sign in using provided IAM credentials (username and password).<strong>Set the default region</strong> to <strong>US East (N. Virginia) — </strong><strong>us-east-1</strong>.</p><p><strong><em>Why?</em></strong><em><br> Standardizing on a region like </em><em>us-east-1 helps maintain consistency in infrastructure deployment and avoids cross-region costs or latency issues.</em></p><p>Task 2: Launch EC2 Instance</p><p>Steps:</p><ol><li>Navigate to <strong>EC2 &gt; Instances &gt; Launch Instance</strong>.</li><li><strong>Name</strong>: MyEC2Server</li><li><strong>AMI</strong>: Choose Amazon Linux 2023 AMI.</li><li><strong>Instance Type</strong>: t2.micro (eligible under free tier).</li><li><strong>Key Pair</strong>:</li></ol><ul><li>Click <strong>Create new key pair</strong>.</li></ul><p>Name: MyEC2Key</p><ul><li>Type: RSA</li><li>Format: .pem</li><li>Download the key for SSH access.</li></ul><ol><li><strong>Network Settings</strong>:</li></ol><ul><li>Click <strong>Edit</strong>.</li><li>Auto-assign public IP: <strong>Enable</strong></li><li>Create a new security group:</li><li>Name: MyEC2Server_SG</li><li>Description: Security Group to allow traffic to EC2</li><li>Add Rule:</li><li>Type: SSH</li><li>Source: Anywhere (0.0.0.0/0)</li></ul><ol><li>Click <strong>Launch Instance</strong>.</li><li>Click <strong>View All Instances</strong>.</li><li>Wait until the instance is in <strong>Running</strong> state and note the <strong>Instance ID</strong>.</li></ol><blockquote><strong><em>Why?</em></strong><em><br> EC2 provides the compute layer. Later steps use it to simulate workload and observe metrics like CPUUtilization in CloudWatch.</em></blockquote><blockquote>Task 3: SSH into EC2 and Install Tools</blockquote><h3>Steps:</h3><ol><li>Use your terminal to SSH into the instance:</li></ol><ul><li>chmod 400 MyEC2Key.pem ssh -i MyEC2Key.pem ec2-user@&lt;Public-IP&gt;</li></ul><ol><li>Switch to root:</li></ol><ul><li>sudo su</li></ul><ol><li>Update system:</li></ol><ul><li>dnf update -y</li></ul><ol><li>Install stress tool:</li></ol><ul><li>dnf install stress-ng -y<em><br> The </em><em>stress-ng tool helps simulate high CPU usage to validate CloudWatch alarms in later steps.</em></li></ul><h3>Task 4: Create SNS Topic for Notifications</h3><h3>Steps</h3><ol><li>Navigate to <strong>SNS &gt; Topics &gt; Create Topic</strong>.</li><li>Type: <strong>Standard</strong></li><li>Name: MyServerMonitor</li><li>Display Name: MyServerMonitor</li><li>Click <strong>Create Topic</strong>.</li></ol><blockquote><strong><em>Why?</em></strong><em><br> SNS is used to </em><strong><em>send alert notifications</em></strong><em> (via email, SMS, etc.) when CloudWatch alarms are triggered.</em></blockquote><blockquote>Task 5: Subscribe Email to SNS Topic</blockquote><h3>Steps:</h3><ol><li>In the SNS topic MyServerMonitor, click <strong>Create Subscription</strong>.</li><li>Protocol: Email</li><li>Endpoint: you@example.com</li><li>Click <strong>Create Subscription</strong>.</li><li>Go to your email and <strong>Confirm the subscription</strong>.</li></ol><blockquote><strong><em>Why?</em></strong><em><br> Subscriptions enable actual human or system recipients to get real-time alert notifications when alarms trigger.</em></blockquote><blockquote>Task 6: View EC2 CPU Metrics in CloudWatch</blockquote><h3>Steps:</h3><ol><li>Navigate to <strong>CloudWatch &gt; Metrics &gt; All Metrics &gt; EC2 &gt; Per-Instance Metrics</strong>.</li><li>Search for your <strong>Instance ID</strong>.</li><li>Click on the <strong>CPUUtilization</strong> metric.</li></ol><blockquote><em>🔍 </em><strong><em>Why?</em></strong><em><br> CPUUtilization is a key SLI. Viewing it over time helps validate performance and guide scaling decisions</em></blockquote><blockquote>Task 7: Create CloudWatch Alarm on CPU Usage</blockquote><h3>Steps:</h3><ol><li>Navigate to <strong>CloudWatch &gt; Alarms &gt; Create Alarm</strong>.</li><li>Click <strong>Select Metric</strong>, then:</li></ol><ul><li>EC2 &gt; Per-Instance Metrics &gt; Choose your <strong>Instance ID</strong></li><li>Select <strong>CPUUtilization</strong></li></ul><ol><li>Set Alarm:</li></ol><ul><li>Period: 1 minute</li><li>Threshold type: Static</li><li>Condition: Greater than 30</li></ul><ol><li>Click <strong>Next</strong>.</li><li>Notification:</li></ol><ul><li>Alarm state trigger: In Alarm</li><li>Select existing SNS topic: MyServerMonitor</li></ul><ol><li>Name: MyServerCPUUtilizationAlarm</li><li>Review and <strong>Create Alarm</strong>.</li></ol><blockquote><em>🔍 </em><strong><em>Why?</em></strong><em><br> Alarms are critical to detect and alert on SLA breaches or infrastructure stress — key to incident management workflows.</em></blockquote><blockquote>Task 8: Trigger Alarm by Stressing CPU</blockquote><h3>Steps:</h3><ol><li>SSH into EC2 again and run:</li></ol><ul><li>sudo stress-ng --cpu 10 -v --timeout 400s</li></ul><ol><li>In a new terminal window, SSH again and run:</li></ol><ul><li>top</li></ul><ol><li>Observe %Cpu near 100%.</li></ol><blockquote><strong><em>Why?</em></strong><em><br> Simulating high CPU allows you to </em><strong><em>test the full alerting pipeline</em></strong><em> — from metric rise to email notification.</em></blockquote><blockquote>Task 9: Check Email for Alarm Notification</blockquote><h3>Steps:</h3><ul><li>Open your inbox.</li><li>Confirm you received a notification email from <strong>MyServerMonitor</strong> regarding MyServerCPUUtilizationAlarm.</li></ul><blockquote><em>🔍 </em><strong><em>Why?</em></strong><em><br> Ensures your alerting setup is working. Missing alerts can delay incident response, impacting SLOs.</em></blockquote><blockquote>Task 10: Review CloudWatch Alarm Graph</blockquote><blockquote>Steps:</blockquote><ol><li>Navigate to <strong>CloudWatch &gt; Alarms</strong>.</li><li>Click on MyServerCPUUtilizationAlarm.</li><li>Review the graph spikes where CPU exceeded 30%.</li></ol><blockquote><strong><em>Why?</em></strong><em><br> Visual confirmation of when the issue occurred helps with postmortems and RCA.</em></blockquote><h3>Task 11: Create CloudWatch Dashboard</h3><h3>Steps:</h3><ol><li>Navigate to <strong>CloudWatch &gt; Dashboards &gt; Create dashboard</strong>.</li><li>Name: MyEC2ServerDashboard</li><li>Add Widget:</li><li>Widget type: Line graph</li></ol><ul><li>Select Metric: EC2 &gt; Per-Instance Metrics &gt; CPUUtilization</li></ul><ol><li>Click <strong>Create Widget</strong> and <strong>Save Dashboard</strong>.<em><br> Dashboards consolidate important metrics into a single view — crucial for on-call engineers and proactive monitoring.</em></li></ol><h3>Optional: Add More Widgets</h3><p>Use <strong>Add widget</strong> to add:</p><ul><li>NetworkIn/Out</li><li>Disk Read/Write</li><li>Memory (via CloudWatch Agent if installed)</li><li>Summary</li></ul><p>By completing this lab, you’ve implemented:</p><ul><li><strong>Compute provisioning (EC2)</strong></li><li><strong>Real-time metric visibility (CloudWatch)</strong></li><li><strong>Automated alerts (SNS + Alarm)</strong></li><li><strong>Visual monitoring (Dashboards)</strong></li></ul><p>This setup forms the foundation of <strong>cloud-native observability</strong>, empowering SRE and DevOps teams to <strong>detect, respond, and improve</strong> reliability effectively.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33aba08087db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enhancing SLA, SLO, and SLI Management with Distributed Tracing: An SRE Journey]]></title>
            <link>https://medium.com/@henryeknyarko/enhancing-sla-slo-and-sli-management-with-distributed-tracing-an-sre-journey-4ddf835ea545?source=rss-2cfc5c8aa7a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ddf835ea545</guid>
            <dc:creator><![CDATA[Henryeknyarko]]></dc:creator>
            <pubDate>Mon, 31 Mar 2025 16:04:07 GMT</pubDate>
            <atom:updated>2025-03-31T16:04:07.845Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uBp1Sztcn8RACKPG6lmC5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6dKRuAhAkVIdmOsnqbUvQQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_990tA3HJLphayoNZo_s6g.png" /></figure><p>Distributed tracing is essential for modern Site Reliability Engineering (SRE). It provides full visibility into how user requests flow across a microservices architecture, enabling teams to maintain Service Level Agreements (SLAs), Service Level Objectives (SLOs), and Service Level Indicators (SLIs). Below is an explanation of how the different Kubernetes namespaces and pods work together — and how Jaeger plays a central role — in achieving this goal.</p><h3>Overview of the Cluster Setup</h3><p>Based on the pod listing provided:</p><pre>user@Users-MacBook-Pro-2 day-4 % k get pods -A<br>NAMESPACE     NAME                                    READY   STATUS    RESTARTS   AGE<br>dev           service-a-deployment-d5fc7698b-drqql    1/1     Running   0          14m<br>dev           service-b-deployment-7777446d84-q8dnk   1/1     Running   0          14m<br>kube-system   aws-node-jcb59                          2/2     Running   0          85m<br>kube-system   aws-node-tgftr                          2/2     Running   0          85m<br>kube-system   coredns-64dfc67578-95f4m                1/1     Running   0          91m<br>kube-system   coredns-64dfc67578-rc5nx                1/1     Running   0          91m<br>kube-system   ebs-csi-controller-69b67856f-7wkwv      6/6     Running   0          52m<br>kube-system   ebs-csi-controller-69b67856f-mhjqp      6/6     Running   0          52m<br>kube-system   ebs-csi-node-q9vwt                      3/3     Running   0          52m<br>kube-system   ebs-csi-node-vpc9z                      3/3     Running   0          52m<br>kube-system   kube-proxy-5rt4n                        1/1     Running   0          85m<br>kube-system   kube-proxy-fn4fz                        1/1     Running   0          85m<br>kube-system   metrics-server-7cc788b4c-x54g8          1/1     Running   0          91m<br>kube-system   metrics-server-7cc788b4c-zlzlr          1/1     Running   0          91m<br>logging       elasticsearch-master-0                  1/1     Running   0          51m<br>tracing       jaeger-agent-f6h77                      1/1     Running   0          41m<br>tracing       jaeger-agent-mhxnd                      1/1     Running   0          41m<br>tracing       jaeger-collector-7ff89659d6-ckbtt       1/1     Running   0          41m<br>tracing       jaeger-query-84486c9b9b-xcz85           2/2     Running   0          41m</pre><h3>How Each Namespace and Pod Contributes</h3><h3>1. Dev Namespace: Microservices in Action</h3><ul><li><strong>Pods:</strong></li><li><strong>service-a-deployment-d5fc7698b-drqql</strong></li><li><strong>service-b-deployment-7777446d84-q8dnk</strong></li><li><strong>Role:</strong><br> These pods run your business-critical microservices. They are instrumented to send trace data using libraries such as OpenTelemetry or Jaeger client libraries.</li><li><strong>Impact on SLIs/SLOs/SLAs:</strong></li><li><strong>Data Collection:</strong> Each service logs its performance metrics (e.g., latency, error rates).</li><li><strong>Visibility:</strong> Provides granular details for calculating SLIs.</li><li><strong>Performance Insights:</strong> Helps define realistic SLOs by showing how each service contributes to overall response times and reliability.</li></ul><h3>2. Kube-System Namespace: Core Infrastructure</h3><ul><li><strong>Pods:</strong></li><li><strong>aws-node, coredns, ebs-csi, kube-proxy, metrics-server, etc.</strong></li><li><strong>Role:</strong><br> These pods run critical system components that ensure your Kubernetes cluster remains healthy and responsive. They do not directly handle business logic but provide necessary infrastructure.</li><li><strong>Impact on SLAs:</strong></li><li><strong>Infrastructure Health:</strong> Monitoring these components ensures that underlying network, DNS, and storage issues are caught early.</li><li><strong>Indirect Impact:</strong> Their performance affects the overall latency and reliability of the microservices, and therefore the SLAs.</li></ul><h3>3. Logging Namespace: Centralized Logging</h3><ul><li><strong>Pod:</strong></li><li><strong>elasticsearch-master-0</strong></li><li><strong>Role:</strong><br> Elasticsearch aggregates logs from various parts of your system. These logs complement trace data by providing context, error details, and other critical information.</li><li><strong>Impact on SRE:</strong></li><li><strong>Correlation:</strong> Allows SRE teams to correlate log events with trace data for thorough root cause analysis.</li><li><strong>Historical Analysis:</strong> Helps in identifying trends and anomalies that might affect SLIs and SLOs over time.</li></ul><h3>4. Tracing Namespace: Distributed Tracing with Jaeger</h3><ul><li><strong>Pods:</strong></li><li><strong>jaeger-agent-f6h77 &amp; jaeger-agent-mhxnd:</strong><br> Deployed on each node to collect trace spans from the microservices.</li><li><strong>jaeger-collector-7ff89659d6-ckbtt:</strong><br> Aggregates trace data from the agents.</li><li><strong>jaeger-query-84486c9b9b-xcz85:</strong><br> Provides a user-friendly interface to query and visualize trace data.</li><li><strong>Role:</strong><br> Jaeger’s components work together to capture, collect, and visualize the end-to-end journey of a request. This is the cornerstone of distributed tracing.</li><li><strong>Impact on SLOs/SLIs/SLAs:</strong></li><li><strong>End-to-End Visibility:</strong> Helps track each hop of a request across multiple services, which is crucial for setting accurate SLIs.</li><li><strong>Latency Analysis:</strong> Visualizes where delays occur, informing SLO definitions.</li><li><strong>Rapid Troubleshooting:</strong> When SLA breaches occur, Jaeger provides the detailed trace information needed to quickly locate and resolve issues.</li><li><strong>Dependency Mapping:</strong> Shows how services interact, allowing SRE teams to optimize the overall system performance.</li></ul><h3>How Communication Happens Between Components</h3><ul><li><strong>Trace Propagation:</strong><br> When a request enters the system (e.g., via an API call to service-a), it carries a unique trace identifier. As the request flows from service-a to service-b (and possibly other services), the trace identifier is passed along.</li><li><strong>Data Collection:</strong><br> Each microservice, running in the <strong>dev namespace</strong>, instruments the request handling and sends the trace data to the local <strong>jaeger-agent</strong>.<br> The agents, running on the same nodes as the microservices, then forward this data to the <strong>jaeger-collector</strong>.</li><li><strong>Aggregation &amp; Visualization:</strong><br> The <strong>jaeger-collector</strong> aggregates trace data from all agents. The <strong>jaeger-query</strong> component then makes this aggregated data available via a web UI, where SRE teams can visualize the entire request journey and identify potential issues.</li><li><strong>Logging Integration:</strong><br> If any issues occur, the logs stored in Elasticsearch (in the <strong>logging namespace</strong>) can be cross-referenced with the trace data to understand the full context of a failure or delay.</li></ul><h3>Ensuring SLIs, SLOs, and SLAs Through Distributed Tracing</h3><ul><li><strong>Service Level Indicators (SLIs):</strong></li><li><strong>What They Are:</strong> Measurable values like response time, error rate, and throughput.</li><li><strong>How Tracing Helps:</strong> Provides precise, granular metrics across each microservice, ensuring that SLIs reflect the true user experience.</li><li><strong>Service Level Objectives (SLOs):</strong></li><li><strong>What They Are:</strong> Targets based on SLIs, such as “95% of requests must complete within 200ms.”</li><li><strong>How Tracing Helps:</strong> By identifying bottlenecks and delays, tracing data helps set achievable SLOs. For example, if a particular service consistently delays responses, that service can be tuned to meet the required performance thresholds.</li><li><strong>Service Level Agreements (SLAs):</strong></li><li><strong>What They Are:</strong> Formal commitments to customers regarding service performance and availability.</li><li><strong>How Tracing Helps:</strong> With end-to-end visibility and proactive monitoring, teams can ensure that any deviations from expected performance are quickly identified and corrected, thus maintaining the agreed SLAs.</li></ul><h3>Conclusion</h3><p>This structured setup — spanning the <strong>dev</strong>, <strong>kube-system</strong>, <strong>logging</strong>, and <strong>tracing</strong> namespaces — demonstrates how each component contributes to a robust observability framework. By instrumenting microservices to generate trace data and leveraging Jaeger to collect, aggregate, and visualize these traces, SRE teams gain the insights necessary to:</p><ul><li><strong>Accurately measure SLIs,</strong> ensuring that performance metrics are based on complete, real-world data.</li><li><strong>Define realistic SLOs</strong> that reflect the true capabilities of the system.</li><li><strong>Maintain SLAs</strong> by proactively identifying and resolving performance issues.</li></ul><p>This comprehensive approach not only supports the SRE journey but also drives continuous improvement in system reliability and customer satisfaction.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ddf835ea545" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Kubernetes Observability: How EFK & Prometheus Drive Reliability]]></title>
            <link>https://medium.com/@henryeknyarko/kubernetes-observability-how-efk-prometheus-drive-reliability-05304142753f?source=rss-2cfc5c8aa7a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/05304142753f</guid>
            <dc:creator><![CDATA[Henryeknyarko]]></dc:creator>
            <pubDate>Sun, 30 Mar 2025 14:00:24 GMT</pubDate>
            <atom:updated>2025-03-30T14:00:24.038Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EIEhC3oDN1sk3dfDykkRYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bzHVhWe7dxDJ_7ggox7zjg.png" /></figure><p>In today’s cloud-native world, <strong>observability</strong> is critical for ensuring high availability, security, and performance of applications running in <strong>Kubernetes</strong>. By leveraging <strong>EFK (Elasticsearch, Fluent Bit, Kibana) for logging</strong> and <strong>Prometheus for monitoring</strong>, companies gain <strong>real-time visibility</strong> into their infrastructure and applications, allowing for:</p><p>✅ <strong>Proactive incident management</strong> with automated alerts<br> ✅ <strong>Faster root cause analysis</strong> using correlated logs and metrics<br> ✅ <strong>Optimized performance</strong> through data-driven decision-making<br> ✅ <strong>Improved security and compliance</strong> with detailed audit logs</p><p>By implementing a strong <strong>observability strategy</strong>, businesses can <strong>enhance their Service Level Agreements (SLAs), track Service Level Indicators (SLIs), and meet Service Level Objectives (SLOs)</strong> to ensure <strong>customer satisfaction and operational excellence</strong>.</p><h3>📊 Monitoring: The Role of Prometheus &amp; Grafana</h3><p><strong>Namespace: </strong><strong>monitoring</strong><br> This namespace is dedicated to <strong>metrics collection, alerting, and visualization</strong>, ensuring <strong>proactive monitoring</strong> of Kubernetes workloads.</p><h3>🔹 Key Monitoring Components</h3><ul><li>✅ <strong>prometheus-monitoring-kube-prometheus-prometheus-0</strong> → Collects real-time system and application metrics.</li><li>✅ <strong>monitoring-kube-state-metrics</strong> → Exposes Kubernetes object states (e.g., deployments, pods, nodes) to track system health.</li><li>✅ <strong>monitoring-prometheus-node-exporter-*</strong> → Captures infrastructure-level metrics (CPU, memory, disk usage).</li><li>✅ <strong>alertmanager-monitoring-kube-prometheus-alertmanager-0</strong> → Manages alerting rules and integrates with <strong>Slack, PagerDuty, and email notifications</strong>.</li><li>✅ <strong>monitoring-grafana</strong> → Provides dashboards for <strong>tracking SLIs and SLOs</strong>, helping teams detect anomalies.</li></ul><p>📌 <strong>Business Impact</strong>:<br> ✔ <strong>Proactive monitoring</strong> prevents downtime and ensures <strong>high availability</strong>.<br> ✔ <strong>Automated alerts</strong> enable teams to respond quickly to performance issues.<br> ✔ <strong>Real-time visualization</strong> improves decision-making with actionable insights.</p><h3>📂 Logging: The Power of EFK (Elasticsearch, Fluent Bit, Kibana)</h3><p><strong>Namespace: </strong><strong>logging</strong><br> This namespace is responsible for <strong>log aggregation, indexing, and visualization</strong>, ensuring deep insights into <strong>application behavior, security, and failures</strong>.</p><h3>🔹 Key Logging Components</h3><ul><li>✅ <strong>fluent-bit-*</strong> → Collects logs from Kubernetes containers and forwards them to <strong>Elasticsearch</strong>.</li><li>✅ <strong>elasticsearch-master-0</strong> → Stores and indexes logs for fast <strong>searchability and forensic analysis</strong>.</li><li>✅ <strong>kibana-kibana-*</strong> → Provides an interactive dashboard for <strong>log analysis and troubleshooting</strong>.</li></ul><p>📌 <strong>Business Impact</strong>:<br> ✔ <strong>Faster incident resolution</strong> → Engineers can quickly search logs in Kibana.<br> ✔ <strong>Security &amp; compliance</strong> → Audit logs help detect unauthorized access and anomalies.<br> ✔ <strong>Reduced Mean Time to Resolution (MTTR)</strong> → Correlating logs with metrics speeds up debugging.</p><p>🔍 <strong>Example from Kibana</strong>: The logs captured in Kibana (as seen in the screenshot) provide real-time visibility into service-a container restarts, allowing teams to <strong>detect patterns and prevent service disruptions</strong>.</p><h3>🚀 Application Observability: Correlating Metrics &amp; Logs</h3><p><strong>Namespace: </strong><strong>dev</strong><br> This namespace represents running applications, with observability ensuring <strong>performance, reliability, and resilience</strong>.</p><h3>🔹 Application-Level Insights</h3><ul><li>✅ <strong>service-a-deployment</strong> → Running but has restarted <strong>3 times</strong>, indicating a <strong>potential resource issue</strong>.</li><li>✅ <strong>service-b-deployment</strong> → Running normally with no restarts.</li></ul><p>📌 <strong>How Observability Supports SLOs &amp; SLIs</strong>:</p><ul><li><strong>Prometheus tracks container restarts</strong> (kube_pod_container_status_restarts_total) as an <strong>SLI</strong>.</li><li><strong>Fluent Bit ensures logs are indexed</strong>, enabling engineers to <strong>trace issues to root causes</strong>.</li><li><strong>Grafana visualizes performance trends</strong>, helping teams <strong>maintain SLOs</strong>.</li></ul><p>📈 <strong>Business Impact</strong>:<br> ✔ <strong>Data-driven optimization</strong> → Engineers can refine applications based on usage patterns.<br> ✔ <strong>SLA compliance</strong> → Observability ensures service uptime commitments are met.<br> ✔ <strong>Improved reliability</strong> → Detect and resolve failures before they affect users.</p><h3>🛠️ SLAs, SLOs, and SLIs: Why They Matter</h3><p><strong>✔ SLIs (Service Level Indicators)</strong> → <strong>Metrics that define system health</strong> (e.g., response time, error rate).<br> <strong>✔ SLOs (Service Level Objectives)</strong> → <strong>Targets based on SLIs</strong> (e.g., 99.9% uptime).<br> <strong>✔ SLAs (Service Level Agreements)</strong> → <strong>Customer commitments</strong> based on SLOs.</p><h3>Example: How Observability Supports SLAs</h3><p><strong>Scenario:</strong><br> If service-a experiences <strong>frequent restarts</strong>, Prometheus triggers an <strong>alert</strong>, while Kibana logs reveal <strong>the root cause</strong>—whether it’s <strong>an out-of-memory error, crash loop, or failed dependency</strong>.</p><p>🔹 <strong>SLI</strong>: Restart rate of service-a measured by Prometheus.<br> 🔹 <strong>SLO</strong>: Restart rate should not exceed <strong>3 times per hour</strong>.<br> 🔹 <strong>SLA</strong>: If service-a exceeds the restart threshold and causes downtime, the company may <strong>owe service credits</strong> to customers.</p><p>📌 <strong>Business Benefit</strong>:<br> ✔ <strong>Early detection prevents SLA breaches</strong>.<br> ✔ <strong>Real-time observability improves reliability and customer trust</strong>.<br> ✔ <strong>Teams can optimize performance based on historical data</strong>.</p><h3>🔑 Key Takeaways for Companies &amp; Recruiters</h3><p>✔ <strong>EFK Stack</strong> → Essential for <strong>log aggregation, security audits, and troubleshooting</strong>.<br> ✔ <strong>Prometheus &amp; Grafana</strong> → Provide <strong>metrics, alerts, and performance visualization</strong>.<br> ✔ <strong>Full observability</strong> → Enables <strong>faster incident response, lower MTTR, and improved SLAs</strong>.<br> ✔ <strong>SLIs &amp; SLOs alignment</strong> → Ensures <strong>services meet reliability and performance standards</strong>.<br> ✔ <strong>SRE best practices</strong> → Implement <strong>automated monitoring and self-healing systems</strong>.</p><p>💡 <strong>Want to improve Kubernetes observability?</strong> Implement <strong>EFK + Prometheus</strong> today to gain complete visibility into <strong>logs, metrics, and service health</strong> — empowering your teams to <strong>deliver high-performing, reliable applications</strong>! 🚀</p><p>#DevOps #Kubernetes #EFK #Prometheus #Observability #SRE #SLA #SLO #SLI #Cloud #Monitoring #Logging</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05304142753f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Kubernetes Networking: Key Takeaways from “Kubernetes: Service Mesh with Istio”]]></title>
            <link>https://medium.com/@henryeknyarko/mastering-kubernetes-networking-key-takeaways-from-kubernetes-service-mesh-with-istio-c5b4eaca4878?source=rss-2cfc5c8aa7a5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5b4eaca4878</guid>
            <dc:creator><![CDATA[Henryeknyarko]]></dc:creator>
            <pubDate>Fri, 14 Mar 2025 09:25:53 GMT</pubDate>
            <atom:updated>2025-03-14T09:25:53.949Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ht208PQYORst4fy0TJ1osw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*Na0J-1Pi4VxtHabwqsRktA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d95gJIWBGHiGDyAGPEm3ow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P_-5ZOaHw7nDnY1Fu824Pw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t9QPA45Tn1yqWJ_lspcIrw.png" /></figure><p>Microservices provide scalability and flexibility, but they also introduce challenges in <strong>networking, security, and observability</strong>. <strong>Istio</strong>, a powerful service mesh for Kubernetes, simplifies these complexities. I recently completed the <em>Kubernetes: Service Mesh with Istio</em> course by <strong>Bukola Johnson on LinkedIn Learning</strong>, and here’s a breakdown of what I learned.</p><p>If you’re interested in diving into Istio and improving your Kubernetes networking skills, you can check out the course here:<br> 👉 <a href="https://www.linkedin.com/learning/kubernetes-service-mesh-with-istio-25332503/making-microservices-simple-with-istio?u=357094282">Kubernetes: Service Mesh with Istio</a></p><h3>📌 Course Topics &amp; Key Insights</h3><h3>1️⃣ Introduction to Istio &amp; Service Mesh</h3><p>✅ What is a <strong>service mesh</strong>, and why is it needed in Kubernetes?<br> ✅ How Istio helps with <strong>traffic management, security, and observability</strong>.<br> ✅ Key components of Istio: <strong>Control Plane</strong> (Pilot, Citadel, Galley).<br> ✅ Role of the <strong>Data Plane</strong>, powered by <strong>Envoy proxies</strong>.<br> ✅ Difference between <strong>Ingress controllers and Istio Gateways</strong>.<br> ✅ How Istio simplifies <strong>service-to-service communication</strong>.<br> ✅ The benefits of <strong>decoupling networking logic</strong> from application code.</p><h3>2️⃣ Installing Istio on Kubernetes</h3><p>✅ Setting up Istio using <strong>Istioctl</strong> for installation and management.<br> ✅ Understanding <strong>Istio profiles</strong> and choosing the right one for deployment.<br> ✅ Enabling <strong>automatic sidecar injection</strong> for seamless proxy management.<br> ✅ Deploying a <strong>sample microservices application</strong> to test Istio’s functionality.<br> ✅ Using <strong>kubectl and Istio commands</strong> to verify installation.<br> ✅ Configuring <strong>Istio namespaces and labels</strong> for better resource management.<br> ✅ Troubleshooting <strong>common Istio installation issues</strong>.</p><h3>3️⃣ Traffic Management in Istio</h3><p>✅ Understanding <strong>VirtualServices</strong> for fine-grained traffic control.<br> ✅ Configuring <strong>DestinationRules</strong> for advanced routing strategies.<br> ✅ Implementing <strong>Canary Deployments</strong> for progressive rollouts.<br> ✅ Using <strong>Gateways</strong> for secure ingress and egress traffic.<br> ✅ Applying <strong>Traffic Splitting</strong> for A/B testing and gradual feature rollouts.<br> ✅ Managing <strong>Load Balancing</strong> across multiple versions of a service.<br> ✅ Handling <strong>timeouts and retries</strong> to improve microservices resilience.</p><h3>4️⃣ Security &amp; Authentication in Istio</h3><p>✅ Enabling <strong>mutual TLS (mTLS)</strong> for encrypted service-to-service communication.<br> ✅ Defining <strong>Authentication Policies</strong> to enforce secure access controls.<br> ✅ Configuring <strong>RBAC (Role-Based Access Control)</strong> for granular permissions.<br> ✅ Managing <strong>Service Identity</strong> through Istio certificates.<br> ✅ Using <strong>Authorization Policies</strong> to restrict access between services.<br> ✅ Handling <strong>JWT authentication</strong> for API security.<br> ✅ Preventing unauthorized access with <strong>Network Policies</strong>.</p><h3>5️⃣ Observability &amp; Monitoring with Kiali &amp; Prometheus</h3><p>✅ Using <strong>Kiali</strong> to visualize Istio-managed service-to-service traffic.<br> ✅ Collecting <strong>metrics and logs</strong> with <strong>Prometheus &amp; Grafana</strong>.<br> ✅ Implementing <strong>distributed tracing</strong> with <strong>Jaeger</strong> to analyze service behavior.<br> ✅ Understanding <strong>Envoy proxy logs</strong> for debugging Istio traffic.<br> ✅ Using <strong>Service Dashboards</strong> in Kiali for real-time traffic monitoring.<br> ✅ Configuring <strong>alerts and notifications</strong> in Prometheus for potential failures.<br> ✅ Improving <strong>troubleshooting workflows</strong> using Istio telemetry tools.</p><h3>6️⃣ Advanced Istio Features</h3><p>✅ Implementing <strong>Circuit Breaking</strong> to prevent cascading failures.<br> ✅ Using <strong>Fault Injection</strong> to simulate network failures and latency.<br> ✅ Configuring <strong>Rate Limits</strong> to control traffic spikes.<br> ✅ Handling <strong>traffic mirroring</strong> for testing changes in production.<br> ✅ Optimizing <strong>sidecar proxy configurations</strong> for better performance.<br> ✅ Securing <strong>external services</strong> with Istio egress gateways.<br> ✅ Exploring <strong>Istio Ambient Mesh</strong> for improved performance and security.</p><h3>🚀 Final Thoughts</h3><p>Istio is a <strong>must-have tool for Kubernetes</strong> when managing microservices. This course provided in-depth knowledge of <strong>traffic management, security, and observability</strong>, making Kubernetes deployments more robust and scalable.</p><p>If you’re working with Kubernetes, <strong>learning Istio is essential</strong> for production-ready microservices. You can take the same course I completed and level up your cloud-native skills:<br> 👉 <a href="https://www.linkedin.com/learning/kubernetes-service-mesh-with-istio-25332503/making-microservices-simple-with-istio?u=357094282">Kubernetes: Service Mesh with Istio</a></p><p>Let’s connect and discuss how you’re using Istio in your cloud-native projects! 💡</p><p>#Kubernetes #Istio #ServiceMesh #CloudNative #DevOps #Microservices #Kiali #Prometheus</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5b4eaca4878" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>