<?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 Mohamed Achraf Sabbagh on Medium]]></title>
        <description><![CDATA[Stories by Mohamed Achraf Sabbagh on Medium]]></description>
        <link>https://medium.com/@mohamedachraf.sabbagh?source=rss-dca0179e46a3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YLJs6HLM5qX-jHcz-HUnsw.png</url>
            <title>Stories by Mohamed Achraf Sabbagh on Medium</title>
            <link>https://medium.com/@mohamedachraf.sabbagh?source=rss-dca0179e46a3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 13:14:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohamedachraf.sabbagh/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[Helm Home Lab: Hands-On Practice Guide]]></title>
            <link>https://medium.com/@mohamedachraf.sabbagh/helm-home-lab-hands-on-practice-guide-7e4656663601?source=rss-dca0179e46a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e4656663601</guid>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[helm-chart]]></category>
            <dc:creator><![CDATA[Mohamed Achraf Sabbagh]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 15:55:53 GMT</pubDate>
            <atom:updated>2026-08-17T15:55:53.655Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a practical companion to the Helm article, continuing on the same Ubuntu 22.04 + kind cluster from the Kubernetes lab. You’ll install Helm, deploy a real chart from a public repository, then write and evolve your own chart from scratch.</p><p><strong>Prerequisite:</strong> the kind cluster and kubectl setup from the Kubernetes home lab. If you deleted your cluster, recreate it first:</p><pre>kind create cluster --name homelab<br>kubectl get nodes</pre><h4>0. Install Helm on Ubuntu 22.04</h4><pre>curl -fsSL https://packages.buildkite.com/helm-linux/helm-debian/gpgkey | \<br>  gpg --dearmor | \<br>  sudo tee /usr/share/keyrings/helm.gpg &gt; /dev/null<br>echo &quot;deb [signed-by=/usr/share/keyrings/helm.gpg] https://packages.buildkite.com/helm-linux/helm-debian/any/ any main&quot; | \<br>  sudo tee /etc/apt/sources.list.d/helm-stable-debian.list<br>sudo apt update<br>sudo apt install helm</pre><p>Verify:</p><pre>health@health-virtual-machine:~$ helm version<br>version.BuildInfo{Version:&quot;v4.2.3&quot;, GitCommit:&quot;43e8b7feece8beb0fcba47059ec9b522f  d929a64&quot;, GitTreeState:&quot;clean&quot;, GoVersion:&quot;go1.26.5&quot;, KubeClientVersion:&quot;v1.36&quot;}</pre><h4>1. Install a Real Chart from a Public Repository</h4><p>Add the Bitnami chart repository, one of the most widely used sources of production-ready charts:</p><pre>helm repo add bitnami https://charts.bitnami.com/bitnami<br>helm repo update<br>helm search repo nginx</pre><p>Install nginx as a named release:</p><pre>helm install my-nginx bitnami/nginx --set service.type=ClusterIP</pre><p>Check what Helm actually created:</p><pre>helm list<br>kubectl get all -l app.kubernetes.io/instance=my-nginx</pre><p>Output :</p><pre>health@health-virtual-machine:~$ helm list<br>NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION<br>my-nginx        default         1               2026-08-17 16:06:20.041267909 +0100 CET deployed        nginx-25.0.21   1.31.3<br>health@health-virtual-machine:~$ kubectl get all -l app.kubernetes.io/instance=my-nginx<br>NAME                           READY   STATUS     RESTARTS   AGE<br>pod/my-nginx-7f78f848b-89x5p   0/1     Init:0/1   0          30s<br><br>NAME               TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE<br>service/my-nginx   ClusterIP   10.96.19.240   &lt;none&gt;        80/TCP,443/TCP   30s<br><br>NAME                       READY   UP-TO-DATE   AVAILABLE   AGE<br>deployment.apps/my-nginx   0/1     1            0           30s<br><br>NAME                                 DESIRED   CURRENT   READY   AGE<br>replicaset.apps/my-nginx-7f78f848b   1         1         0       30s</pre><p>Notice this single command produced a Deployment, Service, and possibly a ServiceAccount and ConfigMap — all from one chart, with sane defaults you didn’t have to write yourself.</p><p>Port-forward and confirm it’s serving traffic:</p><pre>health@health-virtual-machine:~$ kubectl port-forward svc/my-nginx 8080:80<br>Forwarding from 127.0.0.1:8080 -&gt; 8080<br>Forwarding from [::1]:8080 -&gt; 8080<br>Handling connection for 8080</pre><p>Visit <a href="http://localhost:8080.">http://localhost:8080.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_MeFWR8cwNmXqX5hKsOFxw.png" /></figure><h4>2. Upgrade the Release with Different Values</h4><p>Change the replica count without touching a single YAML file yourself:</p><pre>helm upgrade my-nginx bitnami/nginx --set replicaCount=3 --set service.type=ClusterIP<br>kubectl get pods -l app.kubernetes.io/instance=my-nginx</pre><p>You should see 3 Pods now, all managed under the same release name.</p><p>Check the release history:</p><pre>helm history my-nginx</pre><p>Output :</p><pre>health@health-virtual-machine:~$ helm history my-nginx<br>REVISION        UPDATED                         STATUS          CHART           APP VERSION     DESCRIPTION<br>1               Mon Aug 17 16:06:20 2026        superseded      nginx-25.0.21   1.31.3          Install complete<br>2               Mon Aug 17 16:10:38 2026        superseded      nginx-25.0.21   1.31.3          Upgrade complete<br>3               Mon Aug 17 16:10:51 2026        deployed        nginx-25.0.21   1.31.3          Upgrade complete<br>health@health-virtual-machine:~$ kubectl get pods -l app.kubernetes.io/instance=my-nginx<br>NAME                       READY   STATUS    RESTARTS   AGE<br>my-nginx-7f78f848b-62r76   1/1     Running   0          96s<br>my-nginx-7f78f848b-89x5p   1/1     Running   0          5m54s<br>my-nginx-7f78f848b-mn627   1/1     Running   0          96s</pre><p>Clean up before moving on:</p><pre>helm uninstall my-nginx</pre><h4>3. Scaffold Your Own Chart</h4><pre>helm create hello-chart</pre><p>Look at what was generated:</p><pre>health@health-virtual-machine:~$ find hello-chart -type f<br>hello-chart/Chart.yaml<br>hello-chart/.helmignore<br>hello-chart/values.yaml<br>hello-chart/templates/serviceaccount.yaml<br>hello-chart/templates/httproute.yaml<br>hello-chart/templates/hpa.yaml<br>hello-chart/templates/_helpers.tpl<br>hello-chart/templates/deployment.yaml<br>hello-chart/templates/tests/test-connection.yaml<br>hello-chart/templates/NOTES.txt<br>hello-chart/templates/service.yaml<br>hello-chart/templates/ingress.yaml</pre><p>You’ll see Chart.yaml, values.yaml, and a templates/ directory with a working Deployment, Service, and a disabled Ingress — a fully functional starting point.</p><p>Install it as-is to prove it works out of the box:</p><pre>helm install hello-test ./hello-chart<br>kubectl get pods -l app.kubernetes.io/instance=hello-test<br>helm uninstall hello-test</pre><p>Output :</p><pre>health@health-virtual-machine:~$ kubectl get pods -l app.kubernetes.io/instance=hello-test<br>NAME                                      READY   STATUS    RESTARTS   AGE<br>hello-test-hello-chart-6d7c84b699-h8cbj   1/1     Running   0          49s<br>health@health-virtual-machine:~$ helm uninstall hello-test<br>release &quot;hello-test&quot; uninstalled</pre><h4>4. Simplify and Customize the Chart</h4><p>Open hello-chart/values.yaml and trim it down to the essentials for this exercise:</p><pre>replicaCount: 2<br><br>image:<br>  repository: nginxdemos/hello<br>  tag: latest<br>  pullPolicy: IfNotPresent<br><br>service:<br>  type: ClusterIP<br>  port: 80<br><br>resources:<br>  requests:<br>    cpu: 100m<br>    memory: 64Mi<br>  limits:<br>    cpu: 200m<br>    memory: 128Mi</pre><p>Open hello-chart/templates/deployment.yaml and confirm the container section references these values (the default scaffold already does this, using .Values.image.repository, .Values.replicaCount, etc. — read through it once so the connection between values.yaml and the template is concrete).</p><p>Dry-run to see the fully rendered YAML before touching the cluster:</p><pre>helm install hello-test ./hello-chart --dry-run --debug</pre><p>Read through the output — this is the exact manifest Helm would send to the Kubernetes API, with every {{ }} placeholder already substituted.</p><p>Now actually install it:</p><pre>helm install hello-test ./hello-chart<br>kubectl get pods -l app.kubernetes.io/instance=hello-test</pre><p>Output :</p><pre>health@health-virtual-machine:~$ helm install hello-test ./hello-chart<br>NAME: hello-test<br>LAST DEPLOYED: Mon Aug 17 16:31:21 2026<br>NAMESPACE: default<br>STATUS: deployed<br>REVISION: 1<br>DESCRIPTION: Install complete<br>NOTES:<br>1. Get the application URL by running these commands:<br>  export POD_NAME=$(kubectl get pods --namespace default -l &quot;app.kubernetes.io/name=hello-chart,app.kubernetes.io/instance=hello-test&quot; -o jsonpath=&quot;{.items[0].metadata.name}&quot;)<br>  export CONTAINER_PORT=$(kubectl get pod --namespace default $POD_NAME -o jsonpath=&quot;{.spec.containers[0].ports[0].containerPort}&quot;)<br>  echo &quot;Visit http://127.0.0.1:8080 to use your application&quot;<br>  kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORT<br>health@health-virtual-machine:~$ kubectl get pods -l app.kubernetes.io/instance=hello-test<br>NAME                                      READY   STATUS    RESTARTS   AGE<br>hello-test-hello-chart-68c644df55-2xt7w   1/1     Running   0          17s<br>hello-test-hello-chart-68c644df55-4ls8h   1/1     Running   0          17s<br>health@health-virtual-machine:~$</pre><h4>5. Add a Values Override File Per Environment</h4><p>Instead of relying only on the chart’s defaults, create values-dev.yaml:</p><pre>replicaCount: 1</pre><p>And values-prod.yaml:</p><pre>replicaCount: 4<br>resources:<br>  requests:<br>    cpu: 250m<br>    memory: 128Mi<br>  limits:<br>    cpu: 500m<br>    memory: 256Mi</pre><p>Upgrade your existing release using the prod-style overrides:</p><pre>cd hello-chart<br>helm upgrade hello-test . -f values-prod.yaml<br>health@health-virtual-machine:~/hello-chart$ kubectl get pods -l app.kubernetes.io/instance=hello-test<br>NAME                                      READY   STATUS    RESTARTS   AGE<br>hello-test-hello-chart-68c644df55-2xt7w   1/1     Running   0          15m<br>hello-test-hello-chart-68c644df55-49qwz   1/1     Running   0          3m14s<br>hello-test-hello-chart-68c644df55-4ls8h   1/1     Running   0          15m<br>hello-test-hello-chart-7f4bb49cdf-p2kh8   0/1     Pending   0          3m14s<br>hello-test-hello-chart-7f4bb49cdf-zk8p2   0/1     Pending   0          3m14s</pre><p>Then switch it back to dev-style:</p><pre>helm upgrade hello-test . -f values-dev.yaml<br>health@health-virtual-machine:~/hello-chart$ kubectl get pods -l app.kubernetes.io/instance=hello-test<br>NAME                                      READY   STATUS    RESTARTS   AGE<br>hello-test-hello-chart-68c644df55-2xt7w   1/1     Running   0          17m</pre><p>Same chart, same templates, two completely different deployment shapes — just by swapping which values file you pass in.</p><h4>6. Add Conditional Templating (the Ingress Toggle)</h4><p>Open hello-chart/values.yaml and find the ingress: block — by default enabled: false. Confirm the Ingress won&#39;t render:</p><pre>helm template hello-test ./hello-chart | grep -A2 &quot;kind: Ingress&quot;</pre><p>(Should show nothing, since it’s disabled.)</p><p>Now enable it:</p><pre>helm upgrade hello-test ./hello-chart --set ingress.enabled=true --set ingress.hosts[0].host=hello.local<br>helm template hello-test ./hello-chart --set ingress.enabled=true --set ingress.hosts[0].host=hello.local | grep -A5 &quot;kind: Ingress&quot;</pre><p>You should now see a real Ingress object rendered. This is the {{- if .Values.ingress.enabled }} conditional from the article in action — one chart serving two very different needs based purely on values.</p><h4>7. Clean Up</h4><pre>helm uninstall hello-test<br>helm repo remove bitnami<br>kind delete cluster --name homelab</pre><h4>Suggested Order to Redo This on Your Own</h4><ol><li>Install any public Bitnami chart you haven’t tried (Redis, PostgreSQL, RabbitMQ) and inspect everything it creates with kubectl get all.</li><li>Scaffold a chart with helm create, then delete everything in templates/ except the Deployment and Service, and rebuild the values file from scratch to match only what you kept.</li><li>Break an upgrade on purpose (set an invalid value, like a non-existent image tag) and practice reading helm history plus helm rollback to recover — the same &quot;break it, diagnose it, fix it&quot; loop from the Kubernetes lab, now at the release level instead of the Pod level.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e4656663601" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Helm Explained: The Complete Beginner-to-Intermediate Guide (with Kubernetes)]]></title>
            <link>https://medium.com/@mohamedachraf.sabbagh/helm-explained-the-complete-beginner-to-intermediate-guide-with-kubernetes-e0956be595c7?source=rss-dca0179e46a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0956be595c7</guid>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[helm-chart]]></category>
            <category><![CDATA[k8s]]></category>
            <dc:creator><![CDATA[Mohamed Achraf Sabbagh]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 14:50:17 GMT</pubDate>
            <atom:updated>2026-08-17T14:50:17.581Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve spent any time with Kubernetes, you’ve probably felt the pain of raw YAML: the same Deployment, Service, and ConfigMap boilerplate copy-pasted across dev, staging, and prod, with just a few values changed each time. Helm is the tool the Kubernetes ecosystem built to solve exactly this problem.</p><h4>1. Why Helm Exists</h4><p>Kubernetes manifests are declarative and powerful, but they’re static. If you want to deploy the same application to three environments with different replica counts, resource limits, and image tags, you either:</p><ul><li>maintain three near-duplicate sets of YAML files, or</li><li>write your own templating/scripting layer to generate them.</li></ul><p>Both get messy fast, especially once an app grows to a dozen or more interrelated Kubernetes objects (Deployment, Service, Ingress, ConfigMap, Secret, PVC…).</p><p><strong>Helm</strong> is often called “the package manager for Kubernetes.” It lets you:</p><ul><li>Package a full set of Kubernetes manifests into a reusable unit called a <strong>chart</strong>.</li><li>Parameterize that chart with <strong>values</strong> so the same chart can be deployed differently per environment.</li><li>Install, upgrade, roll back, and uninstall that whole package as a single unit called a <strong>release</strong>.</li><li>Share charts via <strong>chart repositories</strong>, the same way apt or npm share packages.</li></ul><p>If Kubernetes objects are your building blocks, Helm is what lets you package a finished structure and hand it to someone else (or your future self) to assemble with one command.</p><h4>2. Core Concepts</h4><p>A chart is a directory (or packaged .tgz archive) containing templated Kubernetes manifests plus metadata. It&#39;s the unit of packaging — think of it like an npm package or a Debian .deb, but for a Kubernetes application.</p><p>A minimal chart looks like this:</p><pre>mychart/<br>  Chart.yaml          # metadata: name, version, description<br>  values.yaml         # default configuration values<br>  templates/          # templated Kubernetes manifests<br>    deployment.yaml<br>    service.yaml<br>    _helpers.tpl       # reusable template snippets<br>  charts/             # optional: bundled sub-charts (dependencies)</pre><h4>Release</h4><p>When you install a chart into a cluster, Helm creates a <strong>release</strong> — a specific, named, running instance of that chart with a particular set of values. You can install the same chart multiple times with different release names and different values (e.g., myapp-dev and myapp-staging from the same chart).</p><h4>Values</h4><p>values.yaml holds the default configuration for a chart. Anyone installing the chart can override these defaults — via a custom values file, or --set key=value on the command line — without touching the templates themselves.</p><h4>Templates</h4><p>Templates are Kubernetes YAML files with placeholders, written in Go’s templating syntax. Helm renders them by substituting in values before sending the final YAML to the Kubernetes API.</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: {{ .Release.Name }}-app<br>spec:<br>  replicas: {{ .Values.replicaCount }}<br>  template:<br>    spec:<br>      containers:<br>      - name: app<br>        image: &quot;{{ .Values.image.repository }}:{{ .Values.image.tag }}&quot;</pre><p>Here, .Values.replicaCount and .Values.image.* pull straight from values.yaml (or whatever overrides you pass at install time), and .Release.Name is injected automatically by Helm based on the release name you chose.</p><h4>Chart Repository</h4><p>A chart repository is just an HTTP server hosting an index.yaml and packaged chart archives — similar in spirit to a package registry. Public repositories like <a href="https://artifacthub.io/">Artifact Hub</a> index thousands of community charts (Bitnami&#39;s being some of the most widely used) for common software: databases, message queues, monitoring stacks, and more.</p><h4>3. The Helm Workflow</h4><p>The core commands you’ll use constantly:</p><pre># Add a chart repository<br>helm repo add bitnami https://charts.bitnami.com/bitnami<br>helm repo update<br><br># Search for a chart<br>helm search repo nginx<br><br># Install a chart as a named release<br>helm install my-release bitnami/nginx<br><br># See what&#39;s installed<br>helm list<br><br># Inspect the rendered manifests before installing (dry run)<br>helm install my-release bitnami/nginx --dry-run --debug<br><br># Override default values<br>helm install my-release bitnami/nginx --set replicaCount=3<br><br># Or use a custom values file<br>helm install my-release bitnami/nginx -f my-values.yaml<br><br># Upgrade a release (new values, new chart version, or both)<br>helm upgrade my-release bitnami/nginx -f my-values.yaml<br><br># Roll back to a previous release revision<br>helm rollback my-release 1<br><br># See release history<br>helm history my-release<br><br># Uninstall a release<br>helm uninstall my-release</pre><p>Notice the parallel to kubectl rollout undo from raw Deployments — Helm keeps a revision history per release, so a bad upgrade is one command away from being undone, but now that safety net covers your <em>entire application</em> (every object in the chart), not just a single Deployment.</p><h4>4. Writing Your Own Chart</h4><p>You rarely start from a blank folder — helm create scaffolds a working starter chart:</p><pre>helm create mychart</pre><p>This generates the structure shown earlier, pre-filled with a working Deployment, Service, Ingress (disabled by default), and a sensible values.yaml. From here, the actual skill of writing charts is mostly:</p><ol><li><strong>Deciding what should be configurable</strong> (image tag, replica count, resource limits, whether to enable an Ingress) and exposing those as values.</li><li><strong>Templating conditionally.</strong> Helm templates support if, range, and other Go template constructs:</li></ol><pre>{{- if .Values.ingress.enabled }}<br>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: {{ .Release.Name }}-ingress<br>spec:<br>  rules:<br>  - host: {{ .Values.ingress.host }}<br>    ...<br>{{- end }}</pre><p>This means the Ingress object is only rendered at all if ingress.enabled: true is set — letting one chart serve both &quot;just give me a ClusterIP Service&quot; and &quot;expose this publicly&quot; use cases.</p><ol><li><strong>Using named templates (</strong><strong>_helpers.tpl)</strong> to avoid repeating boilerplate like standard labels across every manifest:</li></ol><pre>{{- define &quot;mychart.labels&quot; -}}<br>app.kubernetes.io/name: {{ .Chart.Name }}<br>app.kubernetes.io/instance: {{ .Release.Name }}<br>{{- end -}}</pre><p>then referenced elsewhere as {{ include &quot;mychart.labels&quot; . }}.</p><h4>5. Chart Versioning and Dependencies</h4><p>Chart.yaml tracks two separate version numbers:</p><ul><li>version — the chart&#39;s own version (increment when you change templates/values structure).</li><li>appVersion — the version of the actual application the chart deploys (e.g., the app&#39;s Docker image tag), tracked for information purposes.</li></ul><p>Charts can also declare <strong>dependencies</strong> on other charts (e.g., your app chart depending on a Bitnami PostgreSQL chart) in a Chart.yaml dependencies: block, then pulled with:</p><pre>helm dependency update</pre><p>This is how you compose a “my full app stack” chart out of your own application chart plus off-the-shelf charts for its infrastructure dependencies.</p><h4>6. Hooks</h4><p>Helm supports <strong>lifecycle hooks</strong> — Kubernetes Jobs that run at specific points in a release’s lifecycle, like pre-install, post-install, pre-upgrade, or pre-delete. A common use: running a database migration Job before the new application version&#39;s Pods start receiving traffic.</p><pre>apiVersion: batch/v1<br>kind: Job<br>metadata:<br>  name: {{ .Release.Name }}-migrate<br>  annotations:<br>    &quot;helm.sh/hook&quot;: pre-upgrade</pre><h4>7. Helm vs. Kustomize (a Quick Note)</h4><p>Both solve “manage the same manifests across environments,” but differently:</p><ul><li><strong>Helm</strong> templates YAML with variables and packages it as a versioned, shareable, installable unit with release history.</li><li><strong>Kustomize</strong> (built into kubectl) takes plain, valid YAML and applies <strong>patches/overlays</strong> on top — no templating language, no packaging concept.</li></ul><p>Many teams use both: Helm for third-party/shared software (databases, ingress controllers, monitoring stacks), and Kustomize (or plain manifests) for their own application-specific overlays. Neither replaces the other completely — pick based on whether you need packaging/sharing (Helm) or simple overlay patches on manifests you already fully control (Kustomize).</p><h4>Summary</h4><p>Helm doesn’t replace anything you learned about Kubernetes objects — a Helm chart still ultimately produces the same Deployments, Services, and ConfigMaps you’d write by hand. What it adds is a packaging and templating layer on top: parameterize once, deploy many times with different values, track every deployment as a versioned release you can roll back, and pull entire pre-built application stacks from public chart repositories instead of writing every manifest yourself.</p><p>Start with helm install against public charts to get comfortable with releases and values. Then move to helm create and write your own chart once you have an app whose manifests you&#39;re duplicating across more than one environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0956be595c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Home Lab: Hands-On Practice Guide]]></title>
            <link>https://medium.com/@mohamedachraf.sabbagh/kubernetes-home-lab-hands-on-practice-guide-155a61a65695?source=rss-dca0179e46a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/155a61a65695</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[minikube]]></category>
            <category><![CDATA[system-administration]]></category>
            <category><![CDATA[k8s]]></category>
            <dc:creator><![CDATA[Mohamed Achraf Sabbagh]]></dc:creator>
            <pubDate>Sun, 19 Jul 2026 17:25:58 GMT</pubDate>
            <atom:updated>2026-07-19T17:25:58.312Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a practical companion to the Kubernetes guide — a self-contained lab that starts from a <strong>fresh Ubuntu 22.04 (Jammy) install with nothing on it</strong> and ends with a scaled, self-healing, exposed Kubernetes app. No cloud account required, everything runs locally.</p><h4>0. Setting Up a Virgin Ubuntu 22.04 (Jammy) Box</h4><p>Start to finish, assuming a fresh apt-only system with no Docker, no kubectl, nothing. Run these as a normal user with sudo rights (not directly as root, ideally).</p><p><strong>0.1 Update the system</strong></p><pre>sudo apt update &amp;&amp; sudo apt upgrade -y<br>sudo apt install -y ca-certificates curl gnupg lsb-release apt-transport-https software-properties-common</pre><p><strong>0.2 Install Docker Engine<br></strong>Ubuntu’s own repos ship an old Docker version, so use Docker’s official repo instead:</p><pre># Add Docker&#39;s official GPG key<br>sudo install -m 0755 -d /etc/apt/keyrings<br>curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg<br>sudo chmod a+r /etc/apt/keyrings/docker.gpg<br><br># Add the repository<br>echo \<br>  &quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \<br>  $(. /etc/os-release &amp;&amp; echo &quot;$VERSION_CODENAME&quot;) stable&quot; | \<br>  sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null<br><br>sudo apt update<br>sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin</pre><p>Let your user run Docker without sudo every time:</p><pre>sudo usermod -aG docker $USER</pre><p><strong>Log out and back in (or reboot)</strong> for the group change to take effect. Then verify:</p><pre>docker run hello-world</pre><p>If you see “Hello from Docker!”, you’re good.</p><p><strong>0.3 Install kubectl</strong></p><pre>curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.31/deb/Release.key | \<br>  sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg<br><br>echo &#39;deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.31/deb/ /&#39; | \<br>  sudo tee /etc/apt/sources.list.d/kubernetes.list<br><br>sudo apt update<br>sudo apt install -y kubectl</pre><p>Verify:</p><pre>kubectl version --client</pre><p>Output :</p><pre>health@health-virtual-machine:~$ kubectl version --client<br>Client Version: v1.31.14<br>Kustomize Version: v5.4.2</pre><p><strong>0.4 Install kind (Kubernetes IN Docker)</strong></p><p>This is what actually creates your local cluster, running each “node” as a Docker container — no VM, no cloud account needed.</p><pre>curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64<br>chmod +x ./kind<br>sudo mv ./kind /usr/local/bin/kind</pre><p>Verify:</p><pre>kind version</pre><p>Output:</p><pre>health@health-virtual-machine:~$ kind version<br>kind v0.33.0-alpha+303577ca00b379 go1.26.3 linux/amd64</pre><p>At this point you have everything the rest of this lab needs: Docker, kubectl, and kind.</p><blockquote><strong><em>Why kind instead of minikube?</em></strong><em> Both work fine for learning. kind is lighter and starts faster because it runs Kubernetes nodes as plain Docker containers rather than a VM. If you already prefer minikube, that’s a fine substitute — just adjust the cluster-creation command in the next section.</em></blockquote><h4>1. Create Your Cluster</h4><pre>kind create cluster --name homelab<br>kubectl cluster-info --context kind-homelab<br>kubectl get nodes</pre><p>You should see one node in Ready status. That&#39;s your entire cluster — control plane and worker combined into a single container, for simplicity.</p><p><strong>Try this:</strong> run kubectl get pods -A (the -A flag means all namespaces). You&#39;ll see Kubernetes&#39; own system Pods (CoreDNS, kube-proxy, etc.) already running — proof the control plane is alive and managing itself the same way it&#39;ll manage your apps.</p><p>Output :</p><pre>health@health-virtual-machine:~$ kind create cluster --name homelab<br>Creating cluster &quot;homelab&quot; ...<br> ✓ Ensuring node image (kindest/node:v1.36.1) 🖼<br> ✓ Preparing nodes 📦<br> ✓ Writing configuration 📜<br> ✓ Starting control-plane 🕹️<br> ✓ Installing CNI 🔌<br> ✓ Installing StorageClass 💾<br>Set kubectl context to &quot;kind-homelab&quot;<br>You can now use your cluster with:<br><br>kubectl cluster-info --context kind-homelab<br><br>Thanks for using kind! 😊<br>health@health-virtual-machine:~$ kubectl cluster-info --context kind-homelab<br>Kubernetes control plane is running at https://127.0.0.1:33627<br>CoreDNS is running at https://127.0.0.1:33627/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy<br><br>To further debug and diagnose cluster problems, use &#39;kubectl cluster-info dump&#39;.<br>health@health-virtual-machine:~$ kubectl get nodes<br>NAME                    STATUS   ROLES           AGE   VERSION<br>homelab-control-plane   Ready    control-plane   53m   v1.36.1<br>health@health-virtual-machine:~$ kubectl get pods -A<br>NAMESPACE            NAME                                            READY   STATUS    RESTARTS   AGE<br>kube-system          coredns-589f44dc88-fdn24                        1/1     Running   0          53m<br>kube-system          coredns-589f44dc88-s86cl                        1/1     Running   0          53m<br>kube-system          etcd-homelab-control-plane                      1/1     Running   0          53m<br>kube-system          kindnet-rnjws                                   1/1     Running   0          53m<br>kube-system          kube-apiserver-homelab-control-plane            1/1     Running   0          53m<br>kube-system          kube-controller-manager-homelab-control-plane   1/1     Running   0          53m<br>kube-system          kube-proxy-tf5j9                                1/1     Running   0          53m<br>kube-system          kube-scheduler-homelab-control-plane            1/1     Running   0          53m<br>local-path-storage   local-path-provisioner-855c7b7774-c8q5d         1/1     Running   0          53m<br>health@health-virtual-machine:~$ Mohamed Achraf Sabbagh</pre><h4>2. Deploy Your First Pod</h4><p>Create a file pod.yaml:</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: hello-pod<br>  labels:<br>    app: hello<br>spec:<br>  containers:<br>  - name: hello<br>    image: nginxdemos/hello<br>    ports:<br>    - containerPort: 80</pre><p>Apply it and inspect it:</p><pre>kubectl apply -f pod.yaml<br>kubectl get pods<br>kubectl describe pod hello-pod<br>kubectl logs hello-pod</pre><p>Output :</p><pre>health@health-virtual-machine:~$ nano pod.yaml<br>health@health-virtual-machine:~$ kubectl apply -f pod.yaml<br>pod/hello-pod created<br>health@health-virtual-machine:~$ kubectl get pods<br>NAME        READY   STATUS              RESTARTS   AGE<br>hello-pod   0/1     ContainerCreating   0          6s<br>health@health-virtual-machine:~$ kubectl describe pod hello-pod<br>Name:             hello-pod<br>Namespace:        default<br>Priority:         0<br>Service Account:  default<br>Node:             homelab-control-plane/172.18.0.2<br>Start Time:       Sun, 19 Jul 2026 16:40:29 +0100<br>Labels:           app=hello<br>Annotations:      &lt;none&gt;<br>Status:           Pending<br>IP:<br>IPs:              &lt;none&gt;<br>Containers:<br>  hello:<br>    Container ID:<br>    Image:          nginxdemos/hello<br>    Image ID:<br>    Port:           80/TCP<br>    Host Port:      0/TCP<br>    State:          Waiting<br>      Reason:       ContainerCreating<br>    Ready:          False<br>    Restart Count:  0<br>    Environment:    &lt;none&gt;<br>    Mounts:<br>      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-8pp6t (ro)<br>Conditions:<br>  Type                        Status<br>  PodReadyToStartContainers   True<br>  Initialized                 True<br>  Ready                       False<br>  ContainersReady             False<br>  PodScheduled                True<br>Volumes:<br>  kube-api-access-8pp6t:<br>    Type:                    Projected (a volume that contains injected data from multiple sources)<br>    TokenExpirationSeconds:  3607<br>    ConfigMapName:           kube-root-ca.crt<br>    ConfigMapOptional:       &lt;nil&gt;<br>    DownwardAPI:             true<br>QoS Class:                   BestEffort<br>Node-Selectors:              &lt;none&gt;<br>Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s<br>                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s<br>Events:<br>  Type    Reason     Age   From               Message<br>  ----    ------     ----  ----               -------<br>  Normal  Scheduled  11s   default-scheduler  Successfully assigned default/hello-pod to homelab-control-plane<br>  Normal  Pulling    10s   kubelet            Pulling image &quot;nginxdemos/hello&quot;<br>health@health-virtual-machine:~$ kubectl logs hello-pod<br>/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration<br>/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/<br>/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh<br>10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist<br>/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh<br>/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh<br>/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh<br>/docker-entrypoint.sh: Configuration complete; ready for start up<br>2026/07/19 15:40:53 [notice] 1#1: using the &quot;epoll&quot; event method<br>2026/07/19 15:40:53 [notice] 1#1: nginx/1.29.1<br>2026/07/19 15:40:53 [notice] 1#1: built by gcc 14.2.0 (Alpine 14.2.0)<br>2026/07/19 15:40:53 [notice] 1#1: OS: Linux 6.8.0-134-generic<br>2026/07/19 15:40:53 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1073741816:1073741816<br>2026/07/19 15:40:53 [notice] 1#1: start worker processes<br>2026/07/19 15:40:53 [notice] 1#1: start worker process 27<br>2026/07/19 15:40:53 [notice] 1#1: start worker process 28</pre><p><strong><em>Exercise — kill it and watch nothing happen:</em></strong></p><pre>kubectl delete pod hello-pod<br>kubectl get pods</pre><p>Output:</p><pre>health@health-virtual-machine:~$ kubectl delete pod hello-pod<br>pod &quot;hello-pod&quot; deleted<br>health@health-virtual-machine:~$ kubectl get pods<br>No resources found in default namespace.</pre><p>It’s gone. Nobody brought it back — a bare Pod has no controller watching over it. This is exactly why you don’t run Pods directly in real life. Keep this in mind for the next step.</p><h4>3. Deploy with a Deployment Instead</h4><p>Create deployment.yaml:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: hello-deployment<br>spec:<br>  replicas: 3<br>  selector:<br>    matchLabels:<br>      app: hello<br>  template:<br>    metadata:<br>      labels:<br>        app: hello<br>    spec:<br>      containers:<br>      - name: hello<br>        image: nginxdemos/hello<br>        ports:<br>        - containerPort: 80</pre><pre>kubectl apply -f deployment.yaml<br>kubectl get deployments<br>kubectl get pods -o wide</pre><p>You should see 3 Pods spread across (or piled onto, since you have 1 node) your cluster.</p><p>Output:</p><pre>health@health-virtual-machine:~$ nano deployment.yaml<br>health@health-virtual-machine:~$ kubectl apply -f deployment.yaml<br>deployment.apps/hello-deployment created<br>health@health-virtual-machine:~$ kubectl get deployments<br>NAME               READY   UP-TO-DATE   AVAILABLE   AGE<br>hello-deployment   2/3     3            2           5s<br>health@health-virtual-machine:~$ kubectl get pods -o wide<br>NAME                                READY   STATUS    RESTARTS   AGE   IP           NODE                    NOMINATED NODE   READINESS GATES<br>hello-deployment-6bc77bd69d-6qzg6   1/1     Running   0          12s   10.244.0.6   homelab-control-plane   &lt;none&gt;           &lt;none&gt;<br>hello-deployment-6bc77bd69d-grwkz   1/1     Running   0          12s   10.244.0.7   homelab-control-plane   &lt;none&gt;           &lt;none&gt;<br>hello-deployment-6bc77bd69d-m2xxb   1/1     Running   0          12s   10.244.0.8   homelab-control-plane   &lt;none&gt;           &lt;none&gt;</pre><p><strong><em>Exercise — self-healing:</em></strong></p><pre>kubectl delete pod &lt;one-of-the-hello-pod-names&gt;<br>kubectl get pods</pre><p>Output :</p><pre>health@health-virtual-machine:~$ kubectl delete pod hello-deployment-6bc77bd69d-6qzg6<br>pod &quot;hello-deployment-6bc77bd69d-6qzg6&quot; deleted<br>health@health-virtual-machine:~$ kubectl get pods<br>NAME                                READY   STATUS    RESTARTS   AGE<br>hello-deployment-6bc77bd69d-2cf7n   1/1     Running   0          5s<br>hello-deployment-6bc77bd69d-grwkz   1/1     Running   0          2m22s<br>hello-deployment-6bc77bd69d-m2xxb   1/1     Running   0          2m22s<br>health@health-virtual-machine:~$</pre><h4>4. Expose It with a Service</h4><p>Right now the Pods have IPs, but those IPs change every time a Pod restarts. Create service.yaml:</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: hello-service<br>spec:<br>  selector:<br>    app: hello<br>  ports:<br>  - port: 80<br>    targetPort: 80<br>  type: ClusterIP</pre><pre>kubectl apply -f service.yaml<br>kubectl get services</pre><p>port-forward to your own machine and hit it in a browser:</p><pre>kubectl port-forward service/hello-service 8080:80</pre><p>Output :</p><pre>health@health-virtual-machine:~$ nano service.yaml<br>health@health-virtual-machine:~$ kubectl apply -f service.yaml<br>service/hello-service created<br>health@health-virtual-machine:~$ kubectl get services<br>NAME            TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE<br>hello-service   ClusterIP   10.96.68.204   &lt;none&gt;        80/TCP    5s<br>kubernetes      ClusterIP   10.96.0.1      &lt;none&gt;        443/TCP   127m<br>health@health-virtual-machine:~$ kubectl port-forward service/hello-service 8080:80<br>Forwarding from 127.0.0.1:8080 -&gt; 80<br>Forwarding from [::1]:8080 -&gt; 80<br>Handling connection for 8080</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QqAyLQFZavx-_IRnG2WG_w.png" /></figure><p>Visit http://localhost:8080 — you should see the nginx demo page, and refreshing repeatedly will show you which of the 3 Pods answered each request (the demo image displays its own hostname).</p><p><strong>This is the core lesson of Services:</strong> you never talked to a Pod IP directly. You talked to a stable name, and Kubernetes load-balanced across whichever Pods happen to exist right now.</p><h4>5. Roll Out a Change (and Roll It Back)</h4><p>Update the image tag in deployment.yaml, or just run:</p><pre>kubectl set image deployment/hello-deployment hello=nginxdemos/hello:0.3<br>kubectl rollout status deployment/hello-deployment<br>kubectl rollout history deployment/hello-deployment</pre><p>Watch old Pods terminate and new ones start — a rolling update, not an all-at-once swap (which would cause downtime).</p><p>Output :</p><pre>health@health-virtual-machine:~$ kubectl set image deployment/hello-deployment hello=nginxdemos/hello:0.3<br>deployment.apps/hello-deployment image updated<br>health@health-virtual-machine:~$ kubectl rollout status deployment/hello-deployment<br>Waiting for deployment &quot;hello-deployment&quot; rollout to finish: 1 out of 3 new replicas have been updated...<br>Waiting for deployment &quot;hello-deployment&quot; rollout to finish: 1 out of 3 new replicas have been updated...<br>Waiting for deployment &quot;hello-deployment&quot; rollout to finish: 1 out of 3 new replicas have been updated...<br>Waiting for deployment &quot;hello-deployment&quot; rollout to finish: 2 out of 3 new replicas have been updated...<br>Waiting for deployment &quot;hello-deployment&quot; rollout to finish: 2 out of 3 new replicas have been updated...<br>Waiting for deployment &quot;hello-deployment&quot; rollout to finish: 2 out of 3 new replicas have been updated...<br>Waiting for deployment &quot;hello-deployment&quot; rollout to finish: 2 out of 3 new replicas have been updated...<br>Waiting for deployment &quot;hello-deployment&quot; rollout to finish: 1 old replicas are pending termination...<br>Waiting for deployment &quot;hello-deployment&quot; rollout to finish: 1 old replicas are pending termination...<br>Waiting for deployment &quot;hello-deployment&quot; rollout to finish: 1 old replicas are pending termination...<br>deployment &quot;hello-deployment&quot; successfully rolled out<br>health@health-virtual-machine:~$ kubectl rollout history deployment/hello-deployment<br>deployment.apps/hello-deployment<br>REVISION  CHANGE-CAUSE<br>1         &lt;none&gt;<br>2         &lt;none&gt;<br>health@health-virtual-machine:~$ Mohamed Achraf Sabbagh</pre><p><strong><em>Exercise — simulate a bad deploy and roll back:</em></strong></p><pre>kubectl set image deployment/hello-deployment hello=nginxdemos/hello:does-not-exist<br>kubectl get pods</pre><p>You’ll see Pods stuck in ImagePullBackOff. Now undo it:</p><pre>health@health-virtual-machine:~$ kubectl get pods<br>NAME                                READY   STATUS             RESTARTS   AGE<br>hello-deployment-64c5d64c99-ltzkp   0/1     ImagePullBackOff   0          54s</pre><pre>kubectl rollout undo deployment/hello-deployment<br>kubectl get pods</pre><p>Output :</p><pre>health@health-virtual-machine:~$ kubectl set image deployment/hello-deployment hello=nginxdemos/hello:does-not-exist<br>deployment.apps/hello-deployment image updated<br>health@health-virtual-machine:~$ kubectl get pods<br>NAME                                READY   STATUS         RESTARTS   AGE<br>hello-deployment-64c5d64c99-ltzkp   0/1     ErrImagePull   0          9s<br>hello-deployment-b579d9577-hbmrq    1/1     Running        0          2m14s<br>hello-deployment-b579d9577-sgpnn    1/1     Running        0          107s<br>hello-deployment-b579d9577-w8ptc    1/1     Running        0          108s<br>health@health-virtual-machine:~$ kubectl rollout undo deployment/hello-deployment<br>deployment.apps/hello-deployment rolled back<br>health@health-virtual-machine:~$ kubectl get pods<br>NAME                               READY   STATUS    RESTARTS   AGE<br>hello-deployment-b579d9577-hbmrq   1/1     Running   0          3m47s<br>hello-deployment-b579d9577-sgpnn   1/1     Running   0          3m20s<br>hello-deployment-b579d9577-w8ptc   1/1     Running   0          3m21s</pre><p>Everything recovers. This is the same mechanism you’d use in production after a bad release.</p><h4>6. Add Configuration with a ConfigMap</h4><p>Create configmap.yaml:</p><pre>apiVersion: v1<br>kind: ConfigMap<br>metadata:<br>  name: hello-config<br>data:<br>  GREETING: &quot;Hello from your home lab!&quot;</pre><p>Update your Deployment’s container spec to consume it:</p><pre>env:<br>        - name: GREETING<br>          valueFrom:<br>            configMapKeyRef:<br>              name: hello-config<br>              key: GREETING</pre><p>Apply both, then check a Pod picked up the environment variable:</p><pre>kubectl apply -f configmap.yaml<br>kubectl apply -f deployment.yaml<br>kubectl exec -it &lt;a-hello-pod-name&gt; -- env | grep GREETING</pre><p>Output :</p><pre>health@health-virtual-machine:~$ nano configmap.yaml<br>health@health-virtual-machine:~$ kubectl apply -f configmap.yaml<br>configmap/hello-config created<br>health@health-virtual-machine:~$ nano deployment.yaml<br>health@health-virtual-machine:~$ kubectl apply -f deployment.yaml<br>deployment.apps/hello-deployment configured<br>health@health-virtual-machine:~$ kubectl exec -it hello-deployment-b579d9577-hbmrq -- env | grep GREETING</pre><h4>7. Add Health Checks</h4><p>Add probes to the Deployment’s container spec:</p><pre>readinessProbe:<br>          httpGet:<br>            path: /<br>            port: 80<br>          initialDelaySeconds: 2<br>          periodSeconds: 5<br>        livenessProbe:<br>          httpGet:<br>            path: /<br>            port: 80<br>          initialDelaySeconds: 5<br>          periodSeconds: 10</pre><p>Apply and check:</p><pre>kubectl apply -f deployment.yaml<br>kubectl describe pod &lt;a-hello-pod-name&gt;</pre><p>Ouput</p><pre>health@health-virtual-machine:~$ nano deployment.yaml<br>health@health-virtual-machine:~$ kubectl apply -f deployment.yaml<br>deployment.apps/hello-deployment configured<br>health@health-virtual-machine:~$ kubectl get pods<br>NAME                                READY   STATUS    RESTARTS   AGE<br>hello-deployment-6bbd44cff8-dksmj   1/1     Running   0          31s<br>hello-deployment-6bbd44cff8-hvh2q   1/1     Running   0          16s<br>hello-deployment-6bbd44cff8-jmdml   1/1     Running   0          24s<br>health@health-virtual-machine:~$ kubectl describe pod hello-deployment-6bbd44cff8-dksmj<br>Name:             hello-deployment-6bbd44cff8-dksmj<br>Namespace:        default<br>Priority:         0<br>Service Account:  default<br>Node:             homelab-control-plane/172.18.0.2<br>Start Time:       Sun, 19 Jul 2026 17:57:48 +0100<br>Labels:           app=hello<br>                  pod-template-hash=6bbd44cff8<br>Annotations:      &lt;none&gt;<br>Status:           Running<br>IP:               10.244.0.18<br>IPs:<br>  IP:           10.244.0.18<br>Controlled By:  ReplicaSet/hello-deployment-6bbd44cff8<br>Containers:<br>  hello:<br>    Container ID:   containerd://fe59a035544afc45a3507a86fb4ff2e8ccf1180d3a77fdd7eb53e59a006eb670<br>    Image:          nginxdemos/hello<br>    Image ID:       docker.io/nginxdemos/hello@sha256:b28d1e16c676896aaa98ed9c36d406cc4f4289558487f15e37e04354720f807a<br>    Port:           80/TCP<br>    Host Port:      0/TCP<br>    State:          Running<br>      Started:      Sun, 19 Jul 2026 17:57:50 +0100<br>    Ready:          True<br>    Restart Count:  0<br>    Liveness:       http-get http://:80/ delay=5s timeout=1s period=10s #success=1 #failure=3<br>    Readiness:      http-get http://:80/ delay=2s timeout=1s period=5s #success=1 #failure=3<br>    Environment:<br>      GREETING:  &lt;set to the key &#39;GREETING&#39; of config map &#39;hello-config&#39;&gt;  Optional: false<br>    Mounts:<br>      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-8w87b (ro)<br>Conditions:<br>  Type                        Status<br>  PodReadyToStartContainers   True<br>  Initialized                 True<br>  Ready                       True<br>  ContainersReady             True<br>  PodScheduled                True<br>Volumes:<br>  kube-api-access-8w87b:<br>    Type:                    Projected (a volume that contains injected data from multiple sources)<br>    TokenExpirationSeconds:  3607<br>    ConfigMapName:           kube-root-ca.crt<br>    ConfigMapOptional:       &lt;nil&gt;<br>    DownwardAPI:             true<br>QoS Class:                   BestEffort<br>Node-Selectors:              &lt;none&gt;<br>Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s<br>                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s<br>Events:<br>  Type    Reason     Age   From               Message<br>  ----    ------     ----  ----               -------<br>  Normal  Scheduled  47s   default-scheduler  Successfully assigned default/hello-deployment-6bbd44cff8-dksmj to homelab-control-plane<br>  Normal  Pulling    47s   kubelet            Pulling image &quot;nginxdemos/hello&quot;<br>  Normal  Pulled     45s   kubelet            Successfully pulled image &quot;nginxdemos/hello&quot; in 1.434s (1.434s including waiting). Image size: 22480048 bytes.<br>  Normal  Created    45s   kubelet            Container created<br>  Normal  Started    45s   kubelet            Container started</pre><h4>8. Set Resource Requests and Limits</h4><p>Add to the container spec:</p><pre>resources:<br>          requests:<br>            cpu: &quot;100m&quot;<br>            memory: &quot;64Mi&quot;<br>          limits:<br>            cpu: &quot;200m&quot;<br>            memory: &quot;128Mi&quot;</pre><pre>kubectl apply -f deployment.yaml<br>kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml #Install Metrics Server<br>kubectl get pods -n kube-system<br>kubectl top nodes</pre><p>Output :</p><pre>health@health-virtual-machine:~$ nano deployment.yaml<br>health@health-virtual-machine:~$ kubectl apply -f deployment.yaml<br>deployment.apps/hello-deployment configured<br>health@health-virtual-machine:~$ kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml<br>serviceaccount/metrics-server created<br>clusterrole.rbac.authorization.k8s.io/system:aggregated-metrics-reader created<br>clusterrole.rbac.authorization.k8s.io/system:metrics-server created<br>rolebinding.rbac.authorization.k8s.io/metrics-server-auth-reader created<br>clusterrolebinding.rbac.authorization.k8s.io/metrics-server:system:auth-delegator created<br>clusterrolebinding.rbac.authorization.k8s.io/system:metrics-server created<br>service/metrics-server created<br>deployment.apps/metrics-server created<br>apiservice.apiregistration.k8s.io/v1beta1.metrics.k8s.io created<br>health@health-virtual-machine:~$ kubectl get pods -n kube-system<br>NAME                                            READY   STATUS    RESTARTS   AGE<br>coredns-589f44dc88-fdn24                        1/1     Running   0          3h24m<br>coredns-589f44dc88-s86cl                        1/1     Running   0          3h24m<br>etcd-homelab-control-plane                      1/1     Running   0          3h24m<br>kindnet-rnjws                                   1/1     Running   0          3h24m<br>kube-apiserver-homelab-control-plane            1/1     Running   0          3h24m<br>kube-controller-manager-homelab-control-plane   1/1     Running   0          3h24m<br>kube-proxy-tf5j9                                1/1     Running   0          3h24m<br>kube-scheduler-homelab-control-plane            1/1     Running   0          3h24m<br>metrics-server-687f9dc499-4lbxg                 0/1     Running   0          5m3s #takes some time <br>health@health-virtual-machine:~$ kubectl top nodes<br>Exepected : <br>NAME                    CPU(cores)   CPU%   MEMORY(bytes)<br>homelab-control-plane   250m         12%    1800Mi<br>health@health-virtual-machine:~$ kubectl top pods<br>Exepected :<br>NAME                              CPU   MEMORY<br>hello-deployment-xxxxx            2m    15Mi<br>hello-deployment-yyyyy            2m    15Mi<br>hello-deployment-zzzzz            2m    15Mi</pre><h4>9. Scale Manually, Then Automatically</h4><p>Manual scaling:</p><pre>kubectl scale deployment hello-deployment --replicas=6<br>kubectl get pods</pre><p>If you installed the metrics server, try autoscaling:</p><pre>kubectl autoscale deployment hello-deployment --cpu-percent=50 --min=2 --max=6<br>kubectl get hpa</pre><p>Even without live traffic to trigger it, this shows you the HPA object watching your Deployment and ready to act.</p><p>Output :</p><pre>health@health-virtual-machine:~$ kubectl scale deployment hello-deployment --replicas=6<br>deployment.apps/hello-deployment scaled<br>health@health-virtual-machine:~$ kubectl get pods<br>NAME                                READY   STATUS    RESTARTS   AGE<br>hello-deployment-569ff4d8b7-d7zb2   1/1     Running   0          18m<br>hello-deployment-569ff4d8b7-lgfxp   0/1     Running   0          14s<br>hello-deployment-569ff4d8b7-lnppx   0/1     Running   0          14s<br>hello-deployment-569ff4d8b7-nqfc7   1/1     Running   0          14s<br>hello-deployment-569ff4d8b7-v2mm2   1/1     Running   0          18m<br>hello-deployment-569ff4d8b7-z5cg7   1/1     Running   0          18m<br>health@health-virtual-machine:~$ kubectl autoscale deployment hello-deployment --cpu-percent=50 --min=2 --max=6<br>horizontalpodautoscaler.autoscaling/hello-deployment autoscaled<br>health@health-virtual-machine:~$ kubectl get hpa<br>NAME               REFERENCE                     TARGETS              MINPODS   MAXPODS   REPLICAS   AGE<br>hello-deployment   Deployment/hello-deployment   cpu: &lt;unknown&gt;/50%   2         6         0          4s</pre><h4>10. Clean Up</h4><p>This tears down everything — no leftover cloud bills, no lingering containers.</p><pre>kind delete cluster --name homelab</pre><h4>Suggested Order to Redo This on Your Own</h4><p>Once you’ve followed along once, the real learning comes from doing it again without the copy-paste:</p><ol><li>Spin up a kind cluster.</li><li>Write a Deployment manifest from memory for any small container image you like.</li><li>Expose it with a Service.</li><li>Break something on purpose (delete a Pod, push a bad image tag, misspell a label selector) and use kubectl describe and kubectl logs to diagnose it before looking anything up.</li><li>Fix it and roll forward.</li></ol><p>That loop — deploy, break, diagnose, fix — is most of what working with Kubernetes day-to-day actually feels like.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=155a61a65695" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Explained: The Complete Beginner-to-Intermediate Guide]]></title>
            <link>https://medium.com/@mohamedachraf.sabbagh/kubernetes-explained-the-complete-beginner-to-intermediate-guide-d977db22f97a?source=rss-dca0179e46a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d977db22f97a</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[system-administration]]></category>
            <dc:creator><![CDATA[Mohamed Achraf Sabbagh]]></dc:creator>
            <pubDate>Sun, 19 Jul 2026 12:56:34 GMT</pubDate>
            <atom:updated>2026-07-19T12:56:34.683Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve worked with containers, you’ve probably heard that “you need Kubernetes to run this in production.” But the jump from “I have a Docker container” to “I understand Kubernetes” feels huge. This guide closes that gap — from first principles to the concepts you need to actually operate a cluster.</p><h4>1. Why Kubernetes Exists</h4><p>Docker solved a real problem: packaging an app with its dependencies so it runs the same everywhere. But Docker alone doesn’t answer questions like:</p><ul><li>What happens when a container crashes at 3 a.m.?</li><li>How do I run 50 copies of my app and load-balance traffic across them?</li><li>How do I roll out a new version without downtime?</li><li>How do containers on different machines talk to each other?</li><li>How do I scale up during a traffic spike and scale down after?</li></ul><p>Kubernetes (often shortened to <strong>K8s</strong> — “K,” 8 letters, “s”) is a <strong>container orchestration platform</strong>. It takes a fleet of machines and turns them into a single pool of compute that automatically runs, heals, scales, and networks your containers based on a description you provide.</p><p>Google created it internally (as “Borg”) to run its own infrastructure, then open-sourced a rewritten version in 2014. It’s now maintained by the Cloud Native Computing Foundation (CNCF) and is the de facto standard for container orchestration.</p><h4>2. The Core Idea: Declarative, Desired State</h4><p>This is the single most important mental model in Kubernetes. <br>You don’t tell Kubernetes <em>how</em> to do things step by step. Instead, you describe the <strong>desired state</strong> — “I want 3 replicas of this app running, using this image, exposing this port” — and Kubernetes continuously works to make reality match that description.</p><p>This loop — compare desired state to actual state, then act to reconcile the difference — is called a <strong>control loop</strong>, and it’s baked into everything Kubernetes does. If a container dies, the control loop notices reality no longer matches the desired state and starts a new one. You don’t write that logic; it’s built into the system.</p><h4>3. Kubernetes Architecture</h4><p>A Kubernetes cluster has two types of nodes:</p><p><strong>Control Plane (the brain)</strong></p><ul><li><strong>kube-apiserver</strong> — the front door. Every request (from kubectl, dashboards, or internal components) goes through the API server. It validates requests and stores state.</li><li><strong>etcd</strong> — a distributed key-value store holding the entire cluster’s state. If etcd is lost, the cluster’s memory is lost.</li><li><strong>kube-scheduler</strong> — decides which node a new Pod should run on, based on resource needs, constraints, and node availability.</li><li><strong>kube-controller-manager</strong> — runs the control loops (node controller, replication controller, etc.) that keep actual state matching desired state.</li><li><strong>cloud-controller-manager</strong> — integrates with your cloud provider (AWS, GCP, Azure) for things like load balancers and storage volumes.</li></ul><p><strong>Worker Nodes (where your apps run)</strong></p><ul><li><strong>kubelet</strong> — an agent on every node that talks to the API server and makes sure containers described in Pod specs are actually running.</li><li><strong>kube-proxy</strong> — handles networking rules so traffic gets routed to the right Pods.</li><li><strong>Container runtime</strong> — the software that actually runs containers (containerd is the modern standard; Docker Engine used to be common, but Kubernetes now talks to runtimes via the Container Runtime Interface, or CRI).</li></ul><p>You interact with all of this through <strong>kubectl</strong>, the command-line tool that sends your commands to the API server.</p><h4>4. The Building Blocks (Objects)</h4><p>Kubernetes is built from a set of composable objects. Understanding these is 80% of understanding Kubernetes.</p><p><strong>Pod<br></strong>The smallest deployable unit. A Pod wraps <strong>one or more containers</strong> that share networking (same IP address) and storage. Most Pods run a single container, but sidecar patterns (e.g., a logging agent alongside your app) use multiple.</p><p>You almost never create Pods directly in production — you let higher-level objects manage them.</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: my-app<br>spec:<br>  containers:<br>  - name: my-app<br>    image: nginx:1.27<br>    ports:<br>    - containerPort: 80</pre><p><strong>Deployment<br></strong>Manages a set of identical Pods (a “ReplicaSet” under the hood) and handles rolling updates, rollbacks, and self-healing. This is what you’ll use for almost every stateless application.</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: my-app<br>spec:<br>  replicas: 3<br>  selector:<br>    matchLabels:<br>      app: my-app<br>  template:<br>    metadata:<br>      labels:<br>        app: my-app<br>    spec:<br>      containers:<br>      - name: my-app<br>        image: myrepo/my-app:1.2.0<br>        ports:<br>        - containerPort: 8080</pre><p>If a Pod dies, the Deployment’s controller notices and creates a replacement. If you update the image tag and re-apply, it performs a rolling update automatically.</p><p><strong>Service<br></strong>Pods are ephemeral — they get new IPs when recreated. A <strong>Service</strong> gives a stable network identity (a fixed IP and DNS name) to a group of Pods, and load-balances traffic across them.</p><p>Common Service types:</p><ul><li><strong>ClusterIP</strong> (default) — internal-only, reachable within the cluster.</li><li><strong>NodePort</strong> — exposes the Service on a static port on every node.</li><li><strong>LoadBalancer</strong> — provisions an external cloud load balancer (used on AWS/GCP/Azure).</li></ul><p><strong>Namespace<br></strong>A way to divide a cluster into virtual sub-clusters — useful for separating teams, environments (dev/staging/prod), or projects within the same physical cluster.</p><p><strong>ConfigMap and Secret</strong></p><ul><li><strong>ConfigMap</strong> — stores non-sensitive configuration (environment variables, config files) separately from your container image, so you don’t rebuild images just to change config.</li><li><strong>Secret</strong> — same idea, but for sensitive data (passwords, tokens, keys). Note: by default Secrets are only base64-encoded, not encrypted, so real security requires additional measures (encryption at rest, RBAC, or tools like Sealed Secrets/Vault).</li></ul><p><strong>StatefulSet<br></strong>Like a Deployment, but for stateful applications (databases, message queues) that need stable network identities and persistent storage per Pod, plus ordered, predictable scaling and deployment.</p><p><strong>DaemonSet<br></strong>Ensures a copy of a Pod runs on every (or selected) node — common for log collectors, monitoring agents, or networking components.</p><p><strong>Job and CronJob</strong></p><ul><li><strong>Job</strong> — runs a Pod to completion, for one-off or batch tasks.</li><li><strong>CronJob</strong> — runs Jobs on a schedule, like a distributed cron.</li></ul><p><strong>Ingress<br></strong>Manages external HTTP/HTTPS access to Services inside the cluster, typically with host- or path-based routing (e.g., api.example.com → one Service, app.example.com → another). Requires an Ingress Controller (like NGINX Ingress or Traefik) to actually do the work.</p><h4><strong>5. Labels, Selectors, and Annotations</strong></h4><p><strong>Labels</strong> are key-value pairs attached to objects (e.g., app: my-app, env: production). <br><strong>Selectors</strong> let other objects (like Services and Deployments) find Pods by their labels rather than by name or IP. This decoupling is what allows Kubernetes&#39; dynamic, self-healing behavior.<br><strong>Annotations</strong> are similar but for non-identifying metadata — things like build version, contact info, or tool-specific configuration.</p><h4><strong>6. Networking Basics</strong></h4><p>Kubernetes networking follows a few rules:</p><ul><li>Every Pod gets its own IP address.</li><li>Pods can communicate with all other Pods across nodes without NAT.</li><li>Nodes can communicate with all Pods without NAT.</li></ul><p>This is implemented by a <strong>CNI (Container Network Interface) plugin</strong> — Calico, Cilium, and Flannel are common choices. You don’t usually write this yourself, but you do choose and configure a CNI plugin when setting up a cluster.</p><p>DNS is also built in: every Service gets a DNS name automatically (my-app-service.my-namespace.svc.cluster.local), so Pods can reach each other by name instead of IP.</p><h4><strong>7. Storage</strong></h4><p>Containers are ephemeral by default — data disappears when a container restarts. For anything that needs to persist:</p><ul><li><strong>Volume</strong> — storage tied to a Pod’s lifecycle.</li><li><strong>PersistentVolume (PV)</strong> — a piece of storage provisioned in the cluster (could be a cloud disk, NFS share, etc.), independent of any specific Pod.</li><li><strong>PersistentVolumeClaim (PVC)</strong> — a request for storage by a user/app; Kubernetes binds it to a matching PV.</li><li><strong>StorageClass</strong> — defines <em>how</em> storage gets dynamically provisioned (e.g., “fast SSD” vs “standard HDD” on your cloud provider).</li></ul><p>The typical flow: you define a PVC in your app’s spec, Kubernetes finds or provisions a matching PV, and your Pod mounts it.</p><h4><strong>8. Health, Scaling, and Self-Healing</strong></h4><p><strong>Probes<br></strong>Kubernetes needs to know if your app is actually healthy, not just running:</p><ul><li><strong>Liveness probe</strong> — “is this container alive?” If it fails, Kubernetes restarts the container.</li><li><strong>Readiness probe</strong> — “is this container ready to receive traffic?” If it fails, the Pod is removed from Service load-balancing (but not restarted).</li><li><strong>Startup probe</strong> — for slow-starting apps, delays liveness/readiness checks until startup completes.</li></ul><p><strong>Resource Requests and Limits<br></strong>You specify how much CPU/memory a container needs (<strong>requests</strong>, used for scheduling decisions) and the maximum it’s allowed to use (<strong>limits</strong>, enforced at runtime). Getting this right avoids both wasted capacity and noisy-neighbor problems.</p><pre>resources:<br>  requests:<br>    cpu: &quot;250m&quot;<br>    memory: &quot;256Mi&quot;<br>  limits:<br>    cpu: &quot;500m&quot;<br>    memory: &quot;512Mi&quot;</pre><p><strong>Autoscaling</strong></p><ul><li><strong>Horizontal Pod Autoscaler (HPA)</strong> — adds/removes Pod replicas based on CPU, memory, or custom metrics.</li><li><strong>Vertical Pod Autoscaler (VPA)</strong> — adjusts a Pod’s resource requests/limits over time.</li><li><strong>Cluster Autoscaler</strong> — adds/removes entire nodes based on whether Pods can be scheduled.</li></ul><h4>9. A Typical Workflow with kubectl</h4><pre># Apply a manifest (create or update resources)<br>kubectl apply -f deployment.yaml<br><br># See what&#39;s running<br>kubectl get pods<br>kubectl get deployments<br>kubectl get services<br><br># Inspect a specific object in detail<br>kubectl describe pod my-app-7d9f8c6b7-x2z9k<br><br># Check logs<br>kubectl logs my-app-7d9f8c6b7-x2z9k<br><br># Shell into a running container<br>kubectl exec -it my-app-7d9f8c6b7-x2z9k -- /bin/sh<br><br># Scale a deployment<br>kubectl scale deployment my-app --replicas=5<br><br># Roll out a new image version<br>kubectl set image deployment/my-app my-app=myrepo/my-app:1.3.0<br><br># Roll back if something breaks<br>kubectl rollout undo deployment/my-app<br><br># Delete resources<br>kubectl delete -f deployment.yaml</pre><p>Most real-world teams don’t run kubectl apply by hand in production — they use GitOps tools (like Argo CD or Flux) or CI/CD pipelines that apply manifests automatically when code is merged, keeping the cluster state in sync with a Git repository.</p><h4>10. Managing Configuration at Scale: Helm and Kustomize</h4><p>Writing raw YAML for every environment (dev, staging, prod) gets repetitive fast. Two tools solve this:</p><ul><li><strong>Helm</strong> — a package manager for Kubernetes. You define a “chart” (a templated set of manifests plus configurable values), and Helm renders and installs it. Great for reusable, shareable application packages.</li><li><strong>Kustomize</strong> — built into kubectl, it lets you layer environment-specific overrides on top of a base set of manifests without templating — just patches.</li></ul><h4>11. Security Basics</h4><ul><li><strong>RBAC (Role-Based Access Control)</strong> — controls who (users, service accounts) can do what (verbs like get/list/create/delete) on which resources.</li><li><strong>Network Policies</strong> — firewall rules for Pod-to-Pod traffic; by default, all Pods can talk to all other Pods, which is often too permissive.</li><li><strong>Pod Security Standards</strong> — restrict what containers can do (e.g., prevent running as root, restrict host access).</li><li><strong>Service Accounts</strong> — identities Pods use to talk to the Kubernetes API, separate from human user accounts.</li></ul><p>A common beginner mistake is leaving the default, wide-open configuration in place — it’s convenient for learning, dangerous in production.</p><h4>12. Observability</h4><p>Once you have more than a couple of Pods, you need visibility:</p><ul><li><strong>Metrics</strong> — Prometheus is the standard for collecting cluster and application metrics; Grafana for dashboards.</li><li><strong>Logs</strong> — centralize logs (Fluentd/Fluent Bit shipping to Elasticsearch, Loki, or a cloud logging service) since Pods and their local logs disappear when they’re deleted.</li><li><strong>Tracing</strong> — tools like Jaeger or OpenTelemetry help trace requests across microservices.</li></ul><h4>13. Common Beginner Mistakes</h4><ul><li><strong>Not setting resource requests/limits</strong> — leads to unpredictable scheduling and noisy-neighbor issues.</li><li><strong>Treating Pods as permanent</strong> — Pods die and get recreated with new IPs; always talk to them via Services, never directly.</li><li><strong>Ignoring readiness probes</strong> — traffic gets sent to Pods that aren’t actually ready yet.</li><li><strong>Storing secrets in plain ConfigMaps or committed YAML</strong> — use Secrets (and ideally an external secrets manager) instead.</li><li><strong>Running everything in the </strong><strong>default namespace</strong> — makes cleanup and access control harder as things grow.</li><li><strong>Manually editing cluster state instead of updating manifests</strong> — your Git repo and cluster state drift apart, causing confusion later.</li></ul><h4>Summary</h4><p>Kubernetes is, at its core, a system that keeps reconciling what you <em>want</em> (declared in YAML) with what’s actually running — restarting failed containers, load-balancing traffic, rolling out updates, and scaling resources up and down. Pods are the atomic unit, Deployments manage groups of them, Services give them stable network identities, and a constellation of supporting objects (ConfigMaps, Secrets, Ingress, PVCs) handle configuration, storage, and external access.</p><p>You don’t need to memorize every object type to get productive — start with Pods, Deployments, and Services, get comfortable with kubectl, then layer in the rest as real problems demand them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d977db22f97a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PowerShell for System Administrators: A Practical Introduction]]></title>
            <link>https://medium.com/@mohamedachraf.sabbagh/powershell-for-system-administrators-a-practical-introduction-df706f5f1eef?source=rss-dca0179e46a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/df706f5f1eef</guid>
            <category><![CDATA[windows-server]]></category>
            <category><![CDATA[powershell]]></category>
            <category><![CDATA[microsoft-365]]></category>
            <category><![CDATA[windows-powershell]]></category>
            <category><![CDATA[powershell-script]]></category>
            <dc:creator><![CDATA[Mohamed Achraf Sabbagh]]></dc:creator>
            <pubDate>Wed, 08 Jul 2026 16:26:58 GMT</pubDate>
            <atom:updated>2026-07-08T16:26:58.851Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why every IT professional managing Windows environments should be comfortable with PowerShell — and where to start</h4><p>If you work in IT infrastructure, system administration, or DevOps, you’ve probably heard the same advice over and over: “learn PowerShell.” It’s repeated so often that it’s easy to nod along without really knowing where to begin. This article is meant to change that — a practical, no-fluff walkthrough of what PowerShell actually is, why it matters, and the core concepts that will get you productive quickly.</p><h4>What PowerShell Actually Is</h4><p>PowerShell is Microsoft’s task automation and configuration management framework. It combines a command-line shell with a full scripting language, built on top of the .NET framework. It ships by default on every modern Windows machine and is also available on Linux and macOS, making it genuinely cross-platform.<br>What sets PowerShell apart from traditional shells isn’t the syntax — it’s the pipeline. Most shells pass plain text between commands, which means every tool downstream has to parse that text to make sense of it. PowerShell instead passes structured <strong>objects</strong>. When you run a command, the result isn’t just lines of text — it’s a collection of objects, each carrying properties and methods that the next command in the pipeline can use directly. This single design decision is why so much of PowerShell “just works” once you understand it.</p><h4>The Verb-Noun Convention: PowerShell’s Secret Weapon</h4><p>Every PowerShell command — called a cmdlet — follows a strict naming pattern: Verb-Noun. This isn&#39;t just a style guideline; it&#39;s enforced consistently across the entire ecosystem, including third-party modules.</p><pre>Get-Service         # retrieve information about services<br>Set-ExecutionPolicy # configure the execution policy <br>Restart-Service     # restart a running service <br>New-Item            # create a new file, folder, or registry key <br>Remove-Item         # delete a file or folder </pre><p>Once you internalize a handful of common verbs — Get, Set, New, Remove, Start, Stop, Restart, Invoke — you can often guess what an unfamiliar cmdlet does just by reading its name. That predictability is one of PowerShell&#39;s biggest usability wins, especially for people managing systems they don&#39;t touch every day.</p><h4>Variables and the Object Pipeline</h4><p>Variables and the Object Pipeline</p><pre>$user = &quot;Achraf&quot;<br>Write-Host &quot;Hello, $user&quot;</pre><p>What’s more interesting is what happens when you assign the output of a cmdlet to a variable:</p><pre>$services = Get-Service<br>$services[0].Status</pre><p>$services isn&#39;t a block of text — it&#39;s a collection of Service objects, each with properties like Name, Status, and DisplayName that you can access directly with dot notation. This is the foundation that everything else in PowerShell builds on.</p><h4>Filtering and Selecting: Where-Object and Select-Object</h4><p>Two cmdlets do most of the heavy lifting once you start working with real data: Where-Object for filtering, and Select-Object for choosing which properties to display.</p><pre># Only show services that are currently running<br>Get-Service | Where-Object { $_.Status -eq &quot;Running&quot; }<br><br># Show only the Name and Status columns<br>Get-Service | Select-Object Name, Status<br><br># Combine both: running services, name and status only<br>Get-Service | Where-Object { $_.Status -eq &quot;Running&quot; } | Select-Object Name, Status</pre><p>This is the pattern you’ll use constantly: retrieve data, filter it down to what matters, then select only the fields you need. Once this clicks, most administrative tasks in PowerShell start to feel like variations on the same theme.</p><h4>Managing Processes and Services</h4><p>Processes and services are the bread and butter of day-to-day administration.</p><pre># Processes<br>Get-Process<br>Stop-Process -Name &quot;notepad&quot;<br>Stop-Process -Id 4532 -Force<br><br># Services<br>Get-Service<br>Start-Service -Name &quot;Spooler&quot;<br>Restart-Service -Name &quot;Spooler&quot;</pre><p>These map closely to concepts every administrator already knows: listing what’s running, restarting something that’s misbehaving, or force-killing a stuck process.</p><h4>Working with Files and Folders</h4><p>File system operations follow the same predictable Verb-Noun logic:</p><pre>Get-ChildItem -Path &quot;C:\Logs&quot; -Recurse   # list contents recursively<br>Copy-Item -Path &quot;C:\file.txt&quot; -Destination &quot;D:\backup\&quot;<br>Move-Item -Path &quot;C:\file.txt&quot; -Destination &quot;D:\archive\&quot;<br>Remove-Item -Path &quot;C:\temp\old_folder&quot; -Recurse -Force</pre><h4>Loops and Conditions</h4><p>PowerShell supports the control-flow structures you’d expect from any scripting language:</p><pre>$cpu = 85<br>if ($cpu -gt 90) {<br>    Write-Host &quot;Critical&quot;<br>} elseif ($cpu -gt 70) {<br>    Write-Host &quot;Warning&quot;<br>} else {<br>    Write-Host &quot;OK&quot;<br>}<br><br>$users = &quot;alice&quot;, &quot;bob&quot;, &quot;carol&quot;<br>foreach ($user in $users) {<br>    Write-Host &quot;Processing user: $user&quot;<br>}</pre><p>A subtlety worth knowing: foreach is a language keyword used inside scripts, while ForEach-Object is a cmdlet used inside a pipeline. They look similar but serve different roles.</p><h4>Scripts, Execution Policy, and Automation</h4><p>PowerShell scripts are saved as .ps1 files and run much like shell scripts:</p><pre>.\script.ps1</pre><p>One thing that catches newcomers off guard is the <strong>execution policy</strong> — a security feature with no real equivalent in other shells. By default, Windows restricts which scripts can run. Set-ExecutionPolicy RemoteSigned, for example, allows locally created scripts to run freely while requiring downloaded scripts to be signed. Understanding this is essential before writing your first automation script.</p><h4>Remote Administration</h4><p>PowerShell Remoting lets you manage other machines without physically logging into them:</p><pre># Interactive session on a single remote computer<br>Enter-PSSession -ComputerName &quot;Server01&quot;<br><br># Run a command against multiple computers at once<br>Invoke-Command -ComputerName &quot;Server01&quot;, &quot;Server02&quot; -ScriptBlock {<br>    Get-Service | Where-Object { $_.Status -eq &quot;Stopped&quot; }<br>}</pre><p>Invoke-Command in particular is powerful for applying the same change or check across an entire fleet of servers in one call, rather than logging into each one individually.</p><h4>PowerShell and Microsoft 365 / Entra ID</h4><p>Beyond the local operating system, PowerShell is the standard tool for automating identity and license management in Microsoft 365 and Entra ID (formerly Azure Active Directory). Tasks like onboarding a batch of new employees, assigning licenses in bulk, or disabling a list of departing users are far faster and less error-prone when scripted:</p><pre># Creating a new user<br>New-MgUser -DisplayName &quot;Jane Doe&quot; -UserPrincipalName &quot;jane@company.com&quot;<br><br># Assigning a license<br>Set-MgUserLicense -UserId &quot;jane@company.com&quot; -AddLicenses $license<br><br># Bulk operation from a CSV file<br>Import-Csv &quot;users.csv&quot; | ForEach-Object {<br>    Disable-MgUser -UserId $_.UserPrincipalName<br>}</pre><p>You don’t need to memorize the entire Microsoft Graph SDK to be effective here — the important part is recognizing the pattern: read structured input (like a CSV), loop through it, and apply a cmdlet to each row.</p><h4>Final Thoughts</h4><p>PowerShell has a reputation for being intimidating, but most of that reputation comes from unfamiliarity rather than actual complexity. Once you internalize the object pipeline and the Verb-Noun convention, the rest of the language becomes remarkably consistent and predictable. You don’t need to master every cmdlet — you need to recognize the patterns, know where to look things up (Get-Help is always there), and build from there.</p><p>If you’re managing Windows infrastructure, Microsoft 365, or Entra ID in any capacity, investing a few focused hours in PowerShell fundamentals will pay for itself many times over.</p><blockquote>If you found this useful, feel free to connect or follow for more practical guides on system administration, automation, infrastructure and cybersecurity .</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df706f5f1eef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Load Balancer — HAProxy]]></title>
            <link>https://medium.com/@mohamedachraf.sabbagh/load-balancer-haproxy-5ef15e05306d?source=rss-dca0179e46a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ef15e05306d</guid>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[debian]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[haproxy]]></category>
            <dc:creator><![CDATA[Mohamed Achraf Sabbagh]]></dc:creator>
            <pubDate>Mon, 25 May 2026 15:14:09 GMT</pubDate>
            <atom:updated>2026-05-25T15:14:52.967Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Understanding Load Balancers and HAProxy in Modern Infrastructure</strong></h3><p>In modern web infrastructures, ensuring high availability and performance is critical.<br> As websites and applications grow, a single server often becomes insufficient to handle all incoming traffic. This is where load balancers become essential.</p><h3><strong>What Is a Load Balancer?</strong></h3><p>A load balancer is a system that distributes incoming network traffic across multiple backend servers.</p><p>Instead of sending every request to a single machine, the load balancer intelligently spreads the traffic between several servers to avoid overload and improve reliability.</p><p>A simple architecture looks like this:</p><pre>Users<br>   │<br>   ▼<br>Load Balancer<br> ├── Web Server 1<br> ├── Web Server 2<br> └── Web Server 3</pre><h3><strong>Why Are Load Balancers Important?</strong></h3><p>Load balancers provide several major advantages:</p><h4>High Availability</h4><p>If one backend server fails, the service can continue running using the remaining servers.</p><h4>Scalability</h4><p>New servers can be added easily to support more traffic.</p><h4>Better Performance</h4><p>Traffic is distributed efficiently, reducing server overload.</p><h4>Security and Traffic Control</h4><p>Some load balancers can filter requests, terminate SSL/TLS, or protect against certain attacks.</p><h3><strong>Common Types of Load Balancers</strong></h3><p>There are many load balancing solutions used in production environments.</p><p>Some popular examples include:</p><ul><li>HAProxy</li><li>NGINX</li><li>Traefik</li><li>Envoy</li><li>F5 BIG-IP</li><li>AWS Elastic Load Balancer</li><li>Cloudflare Load Balancing</li></ul><p>Each solution has its own strengths depending on the infrastructure and use case.</p><h3><strong>Introducing HAProxy</strong></h3><p>HAProxy is one of the most popular open-source load balancers and reverse proxies used in modern infrastructures.</p><p>It is widely known for:</p><ul><li>High performance</li><li>Reliability</li><li>Low latency</li><li>Advanced traffic management</li><li>Production stability</li></ul><p>Many large-scale platforms and enterprise infrastructures use HAProxy to manage millions of requests.</p><p>HAProxy supports:</p><ul><li>HTTP load balancing</li><li>TCP load balancing</li><li>SSL/TLS termination</li><li>Health checks</li><li>Session persistence</li><li>Failover mechanisms</li></ul><h3><strong>How HAProxy Works</strong></h3><p>HAProxy sits between clients and backend servers.</p><p>When a user sends a request:</p><ol><li>HAProxy receives the request</li><li>It selects a backend server</li><li>The request is forwarded</li><li>The response is returned to the client</li></ol><p>Example:</p><pre>Client Request<br>       │<br>       ▼<br>    HAProxy<br>   ├── App Server 1<br>   ├── App Server 2<br>   └── App Server 3</pre><p>HAProxy can distribute traffic using multiple algorithms such as:</p><ul><li>Round Robin</li><li>Least Connections</li><li>Source IP Hashing</li></ul><h3><strong>Installing HAProxy</strong></h3><p>On Debian/Ubuntu:</p><pre>sudo apt update<br>sudo apt install haproxy<br>systemctl status haproxy<br>sudo systemctl enable haproxy</pre><p><strong>Basic HAProxy Configuration<br></strong>The main configuration file is usually located at:</p><pre>/etc/haproxy/haproxy.cfg</pre><p>A simple configuration example:</p><pre>frontend http_front<br>    bind *:80<br>    default_backend web_servers<br><br>backend web_servers<br>    balance roundrobin<br><br>    server web1 192.168.1.10:80 check<br>    server web2 192.168.1.11:80 check</pre><p><strong>Understanding the Configuration</strong></p><p><strong>Frontend<br></strong>The frontend receives incoming client requests.</p><pre>frontend http_front</pre><p>HAProxy listens on port 80.</p><pre>bind *:80</pre><p>Requests are forwarded to the backend pool named web_servers.</p><pre>backend web_servers</pre><p><strong>Backend</strong></p><p>Defines the backend server group.</p><pre>backend web_servers</pre><p>Traffic is distributed evenly between servers.</p><pre>balance roundrobin</pre><p>Defines a backend server and enables health checking.</p><pre>server web1 192.168.1.10:80 check</pre><h3><strong>Health Checks</strong></h3><p>One of HAProxy’s most important features is health monitoring.</p><p>If a server becomes unavailable, HAProxy automatically removes it from rotation until it becomes healthy again.</p><p>This helps prevent downtime and improves service reliability.</p><h3>Conclusion</h3><p>Load balancers are a fundamental part of modern infrastructures.</p><p>They improve:</p><ul><li>scalability</li><li>reliability</li><li>performance</li><li>availability</li></ul><p>Among the many available solutions, HAProxy remains one of the most trusted and powerful tools for managing traffic in production environments.</p><p>Whether for small projects or enterprise architectures, understanding how HAProxy works is an important skill for system administrators, DevOps engineers, and infrastructure professionals.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ef15e05306d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache on Debian: What You Actually Need to Know]]></title>
            <link>https://medium.com/@mohamedachraf.sabbagh/apache-on-debian-what-you-actually-need-to-know-d6dbb2527b26?source=rss-dca0179e46a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6dbb2527b26</guid>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[debian]]></category>
            <dc:creator><![CDATA[Mohamed Achraf Sabbagh]]></dc:creator>
            <pubDate>Sun, 12 Apr 2026 16:31:55 GMT</pubDate>
            <atom:updated>2026-04-12T16:31:55.635Z</atom:updated>
            <content:encoded><![CDATA[<p>Apache has been powering the web for nearly three decades — and for good reason. It’s modular, battle-tested, and Debian makes it surprisingly clean to manage. But most guides stop at “install it and it works.” Here’s what actually matters in production.</p><h3><strong>1. Pick the right MPM</strong></h3><p>Apache’s Multi-Processing Module (MPM) determines how it handles connections. There are three: <strong>Prefork</strong> (one process per connection), <strong>Worker</strong> (threads + processes), and <strong>Event</strong> (asynchronous). In 2024, the answer is almost always <strong>Event MPM</strong> — it handles KeepAlive connections efficiently and scales far better under load.</p><pre>sudo a2dismod mpm_prefork<br>sudo a2enmod mpm_event php8.2-fpm<br>sudo systemctl restart apache2</pre><h3><strong>2. Understand Debian’s config layout</strong></h3><p>Debian splits Apache’s configuration into clean, symlink-managed directories. Sites, modules, and global snippets each live in an *-available/ folder; enabling them just creates a link in the matching *-enabled/ folder. This structure is perfect for Ansible or CI/CD pipelines.</p><pre>/etc/apache2/<br>├── sites-available/   ← define vhosts here<br>├── sites-enabled/     ← symlinks to active ones<br>├── mods-available/    ← all modules<br>└── mods-enabled/      ← active modules</pre><p>Always test before reloading: apache2ctl configtest. Reload (not restart) in production — it&#39;s graceful and drops no connections.</p><h3>3. Virtual hosts and reverse proxy</h3><p>Name-based virtual hosts let one server handle dozens of domains. The more interesting pattern for modern stacks is the reverse proxy — placing Apache in front of a Node.js, Python, or Java backend:</p><pre>&lt;VirtualHost *:80&gt;<br>    ServerName api.example.com<br>    ProxyPreserveHost On<br>    ProxyPass        / http://127.0.0.1:3000/<br>    ProxyPassReverse / http://127.0.0.1:3000/<br>&lt;/VirtualHost&gt;</pre><p>Add mod_proxy_balancer with multiple BalancerMember entries if you need simple load balancing across backend instances.</p><h3>4. TLS is non-negotiable — and there’s a right way</h3><p>Let’s Encrypt via Certbot is the standard for free, auto-renewing certificates. But enabling HTTPS isn’t enough — you also need to harden the protocol itself:</p><pre># Disable legacy protocols<br>SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1<br><br># HSTS — tell browsers HTTPS is permanent<br>Header always set Strict-Transport-Security \<br>  &quot;max-age=63072000; includeSubDomains; preload&quot;<br><br># OCSP Stapling — faster cert validation<br>SSLUseStapling on<br>SSLStaplingCache shmcb:/var/run/ocsp(128000)</pre><h3>5. Security headers and WAF</h3><p>A few response headers go a long way. Enable mod_headers and add them to your virtual host:</p><pre>Header always set X-Frame-Options &quot;SAMEORIGIN&quot;<br>Header always set X-Content-Type-Options &quot;nosniff&quot;<br>Header always set Referrer-Policy &quot;strict-origin-when-cross-origin&quot;</pre><p>For a proper firewall layer, install <strong>ModSecurity</strong> with the OWASP Core Rule Set. It blocks SQL injection, XSS, and path traversal attacks before they ever reach your application. One package install and a config flip: SecRuleEngine On.</p><h3>6. Performance: the quick wins</h3><p>Three modules, big impact:</p><p><strong>mod_deflate</strong> — GZIP-compress HTML, CSS, JS, and JSON. Typical savings: 60–80% on text assets. <strong>mod_expires</strong> — set long cache lifetimes on static files so browsers don’t re-fetch them. <strong>mod_http2</strong> — enable HTTP/2 for multiplexed requests and header compression. Requires TLS and Event MPM.</p><pre>sudo a2enmod deflate expires http2<br># Then in your VirtualHost:<br>Protocols h2 http/1.1</pre><h3>7. Logs you’ll actually use</h3><p>The default log format works, but adding %D (response time in microseconds) to your LogFormat is a small change with a big diagnostic payoff. For modern observability, log in JSON and ship to Elasticsearch or Loki — then alert on error rates and slow requests instead of grepping files.</p><pre>LogFormat &quot;{ \&quot;status\&quot;:\&quot;%&gt;s\&quot;, \&quot;uri\&quot;:\&quot;%U\&quot;, \<br>\&quot;duration\&quot;:\&quot;%D\&quot;, \&quot;ip\&quot;:\&quot;%h\&quot; }&quot; json_log<br>CustomLog /var/log/apache2/access-json.log json_log</pre><h3>8. Conclusion</h3><p>Apache doesn’t demand much to run well — but the gap between a default install and a production-hardened server is mostly just knowing which levers to pull. Event MPM, proper TLS, a handful of security headers, and a structured log format will take you further than most tutorials suggest.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6dbb2527b26" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Installation and Usage] Shannon: Your AI-Powered Assistant for Work and Learning]]></title>
            <link>https://medium.com/@mohamedachraf.sabbagh/installation-and-usage-shannon-your-ai-powered-assistant-for-work-and-learning-e539b50aba21?source=rss-dca0179e46a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e539b50aba21</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[shannon]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mohamed Achraf Sabbagh]]></dc:creator>
            <pubDate>Sun, 08 Feb 2026 16:46:33 GMT</pubDate>
            <atom:updated>2026-02-08T17:09:10.746Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Shannon Installation Steps ( </strong>Ubuntu 22.04 )</h4><ol><li>Update System</li></ol><blockquote>sudo apt update &amp;&amp; sudo apt upgrade -y</blockquote><p>2. Install Dependencies</p><blockquote>sudo apt install -y ca-certificates curl gnupg lsb-release git</blockquote><p>3. Add Docker Official Repository</p><blockquote>sudo mkdir -p /etc/apt/keyrings</blockquote><blockquote>curl -fsSL <a href="https://download.docker.com/linux/ubuntu/gpg">https://download.docker.com/linux/ubuntu/gpg</a> | sudo gpg — dearmor -o /etc/apt/keyrings/docker.gpg</blockquote><blockquote>echo \<br>“deb [arch=$(dpkg — print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \<br><a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> \<br>$(lsb_release -cs) stable” | sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null</blockquote><p>4. Install Docker &amp; Compose Plugin</p><blockquote>sudo apt update</blockquote><blockquote>sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin</blockquote><p>5. Start Docker and Enable It</p><blockquote>sudo systemctl start docker</blockquote><blockquote>sudo systemctl enable docker</blockquote><p>6.Clone Shannon Repository</p><blockquote>cd ~</blockquote><blockquote>git clone <a href="https://github.com/KeygraphHQ/shannon.git">https://github.com/KeygraphHQ/shannon.git</a></blockquote><blockquote>cd shannon</blockquote><p>7.Configure AI Key</p><p>Create .env file:</p><blockquote>nano .env</blockquote><p>Add:</p><blockquote>ANTHROPIC_API_KEY=YOUR_API_KEY_HERE</blockquote><blockquote>CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000</blockquote><p>8. Build &amp; Start Shannon</p><blockquote>docker compose up — build</blockquote><p>9. Confirm Installation</p><blockquote>./shannon version</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x1IIO_UpPU9gW3eAIxy95Q.png" /></figure><h4>Shannon Usage</h4><ol><li>Run a Vulnerable Test Website</li></ol><blockquote>docker run -d -p 3000:3000 bkimminich/juice-shop</blockquote><p>Now open in browser: <a href="http://localhost:3000/">http://localhost:3000</a> or <a href="http://localhost:3000/">http://YOURIP:3000</a></p><p>2. (Optional but Recommended) Get Source Code</p><blockquote>cd ~<br>git clone <a href="https://github.com/juice-shop/juice-shop.git">https://github.com/juice-shop/juice-shop.git</a></blockquote><p>3. Run Shannon Against the Test Site</p><h4>Best Mode (URL + REPO) :</h4><blockquote>./shannon start \<br> URL=<a href="http://localhost:3000/">http://localhost:3000</a> \<br> REPO=/home/shannon/juice-shop</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jBvSrLtQPCHFWR_pGEuQtA.png" /></figure><h4>Black-Box Only (URL Only):</h4><blockquote>./shannon start URL=<a href="http://localhost:3000/">http://localhost:3000</a></blockquote><p>4. Monitor the Test</p><blockquote>./shannon logs</blockquote><p>or</p><blockquote>./shannon query</blockquote><p>It will show:</p><ul><li>Recon</li><li>Scanning</li><li>Exploitation</li><li>Reporting</li></ul><p>This can take a few <strong>minutes</strong>.</p><p>5. View Results</p><blockquote>ls shannon/deliverables/</blockquote><blockquote>cat deliverables/final_report.md</blockquote><p>or</p><blockquote>/shannon/sample-reports/final_report.md</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D6nrI5mXGDTihmXFgktclA.png" /></figure><p>You’ll see:</p><ul><li>Found vulnerabilities</li><li>Severity</li><li>Proof of Concept</li><li>Fix suggestions</li></ul><h3>Important Rules (Professional Pentester Rule)</h3><p>❌ Do NOT test random websites<br> ❌ Do NOT test banks, companies, schools<br> ❌ Do NOT test without permission</p><p>✔️ Only labs, your own sites, staging</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e539b50aba21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Introduction ] Shannon: Your AI-Powered Assistant for Work and Learning]]></title>
            <link>https://medium.com/@mohamedachraf.sabbagh/introduction-shannon-your-ai-powered-assistant-for-work-and-learning-861270b9ea77?source=rss-dca0179e46a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/861270b9ea77</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[shannon-ia-pentesting]]></category>
            <dc:creator><![CDATA[Mohamed Achraf Sabbagh]]></dc:creator>
            <pubDate>Sun, 08 Feb 2026 16:24:55 GMT</pubDate>
            <atom:updated>2026-02-08T16:25:56.389Z</atom:updated>
            <content:encoded><![CDATA[<p>With the rapid evolution of cyber threats, traditional security testing methods are no longer enough to protect modern systems. Organizations today need faster, smarter, and more adaptive tools to identify vulnerabilities before attackers do. This is where <strong>Shannon</strong>, an AI-powered penetration testing tool, comes into play.</p><p>Shannon combines artificial intelligence with cybersecurity methodologies to help security professionals automate, analyze, and optimize penetration testing activities.</p><h3>What is Shannon?</h3><p><strong>Shannon</strong> is an intelligent penetration testing and security assessment tool that leverages large language models and AI-driven analysis to assist in discovering vulnerabilities, misconfigurations, and security weaknesses in digital systems.</p><p>Unlike traditional scanners that rely only on predefined signatures, Shannon uses AI to understand system behavior, analyze results, and adapt testing strategies dynamically.</p><p>It acts as a smart assistant for ethical hackers, security engineers, and penetration testers.</p><h3>How Shannon Works?</h3><p>Shannon operates by integrating artificial intelligence with standard penetration testing workflows.</p><h4>Theoretical Workflow:</h4><ol><li><strong>Target Definition</strong><br> The user specifies the scope of the assessment (IP ranges, domains, applications, or infrastructure).</li><li><strong>Data Collection</strong><br> Shannon gathers technical information using reconnaissance and scanning techniques.</li><li><strong>AI Analysis</strong><br> The collected data is sent to an AI model through a secure API connection.<br> The AI analyzes patterns, configurations, and anomalies.</li><li><strong>Vulnerability Identification</strong><br> Based on the analysis, Shannon highlights potential security weaknesses.</li><li><strong>Contextual Interpretation</strong><br> Instead of only showing raw results, Shannon explains findings in human-readable language.</li><li><strong>Reporting and Recommendations</strong><br> Shannon generates structured reports with risk levels and remediation guidance.</li></ol><p>This AI-assisted approach improves both speed and accuracy in security assessments.</p><h3>Role of AI in Shannon</h3><p>Artificial intelligence is the core engine behind Shannon’s capabilities.</p><p>Through advanced language models, Shannon can:</p><ul><li>Interpret scan outputs and logs</li><li>Correlate vulnerabilities across systems</li><li>Prioritize high-risk findings</li><li>Suggest exploitation paths (theoretically)</li><li>Recommend mitigation strategies</li></ul><p>This makes Shannon more than a simple scanner — it becomes an intelligent security analysis platform.</p><h3>API Integration and Model Access</h3><p>To function, Shannon requires access to external AI models through API keys (such as Anthropic Claude or similar providers).</p><p>These APIs provide:</p><ul><li>Natural language processing</li><li>Pattern recognition</li><li>Intelligent reasoning</li><li>Contextual understanding</li></ul><p>The API-based architecture allows Shannon to remain lightweight while benefiting from powerful cloud-based AI engines.</p><h3>The Future of AI in Pentesting</h3><p>Shannon represents a new generation of security tools where artificial intelligence complements human expertise. As cyber threats become more sophisticated, AI-driven pentesting will play a critical role in proactive defense strategies.</p><p>By combining automation, intelligence, and ethical practices, tools like Shannon are shaping the future of cybersecurity.</p><h3>Conclusion</h3><p>Shannon is an innovative AI-powered penetration testing tool that enhances traditional security assessments with intelligent analysis and automation. By integrating advanced AI models, it enables security professionals to detect vulnerabilities more efficiently and understand risks more clearly.</p><p>In a world of constantly evolving threats, Shannon stands as a powerful ally in building resilient and secure systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=861270b9ea77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CrowdSec Deep Dive (Part 3): Deploying WAF Mode with Nginx, AppSec, and nftables]]></title>
            <link>https://medium.com/@mohamedachraf.sabbagh/crowdsec-deep-dive-part-3-deploying-waf-mode-with-nginx-appsec-and-nftables-37aa521a3e99?source=rss-dca0179e46a3------2</link>
            <guid isPermaLink="false">https://medium.com/p/37aa521a3e99</guid>
            <category><![CDATA[crowdsec]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ids-ips]]></category>
            <dc:creator><![CDATA[Mohamed Achraf Sabbagh]]></dc:creator>
            <pubDate>Sat, 01 Nov 2025 13:15:02 GMT</pubDate>
            <atom:updated>2025-11-01T13:15:02.962Z</atom:updated>
            <content:encoded><![CDATA[<p>In this third part of my CrowdSec series, we focus on the <strong>WAF mode</strong>.<br> This is where CrowdSec goes beyond “block malicious IPs” and becomes a real Web Application Firewall with HTTP traffic inspection, virtual patching, SQLi detection, XSS detection, etc.</p><p>This implementation uses:</p><ul><li><strong>Nginx</strong> as the web server</li><li><strong>CrowdSec AppSec</strong> for deep HTTP request inspection</li><li><strong>nftables</strong> for IPS enforcement at network layer</li></ul><blockquote><em>Result: a full modern WAF stack, fully open-source.</em></blockquote><h3>1 — Prerequisites</h3><ul><li>Ubuntu / Debian server</li><li>sudo/root access</li><li>Basic Linux skills</li></ul><h3>2 — Install base system + nginx + nftables</h3><pre>sudo apt update &amp;&amp; sudo apt upgrade -y<br>sudo apt install -y curl wget git nginx lua5.1 libnginx-mod-http-lua luarocks lua-cjson nftables</pre><p>Enable nftables:</p><pre>sudo systemctl enable nftables --now</pre><p>Apply a basic nftables config (CrowdSec will dynamically insert bans):</p><pre>sudo tee /etc/nftables.conf &gt; /dev/null &lt;&lt; &#39;EOF&#39;<br>#!/usr/sbin/nft -f<br>flush ruleset<br>table inet filter {<br>    chain input {<br>        type filter hook input priority 0; policy accept;<br>        iifname &quot;lo&quot; accept<br>        ct state established,related accept<br>        tcp dport { 22,80,443 } accept<br>    }<br>}<br>EOF<br>sudo nft -f /etc/nftables.conf</pre><h3>3 — Install CrowdSec Engine + WAF capability</h3><pre>curl -s https://packagecloud.io/install/repositories/crowdsec/crowdsec/script.deb.sh | sudo bash<br>sudo apt install crowdsec</pre><p>Now install the collections that enable AppSec:</p><pre>sudo cscli collections install crowdsecurity/appsec-virtual-patching<br>sudo cscli collections install crowdsecurity/appsec-generic-rules<br>sudo cscli collections install crowdsecurity/nginx<br>sudo cscli collections install crowdsecurity/base-http-scenarios</pre><p>Create AppSec acquisition:</p><pre>sudo mkdir -p /etc/crowdsec/acquis.d/</pre><pre>sudo tee /etc/crowdsec/acquis.d/appsec.yaml &gt; /dev/null &lt;&lt; &#39;EOF&#39;<br>appsec_config: crowdsecurity/appsec-default<br>labels:<br>  type: appsec<br>listen_addr: 127.0.0.1:7422<br>source: appsec<br>EOF</pre><pre>sudo systemctl restart crowdsec</pre><h3>4 — IPS Enforcement with nftables</h3><pre>sudo apt install crowdsec-firewall-bouncer-nftables<br>sudo cscli bouncers add crowdsec-firewall-bouncer-nftables</pre><p>This bouncer will automatically push CrowdSec ban decisions into nftables sets.</p><h3>5 — Nginx Integration (WAF mode)</h3><p>Install nginx bouncer:</p><pre>sudo apt install crowdsec-nginx-bouncer</pre><p>Generate API key:</p><pre>API_KEY=$(sudo cscli bouncers add crowdsec-nginx-bouncer | grep &quot;API key&quot; | cut -d&#39;:&#39; -f2 | tr -d &#39; &#39;)</pre><p>Add Nginx bouncer config:</p><pre>sudo sed -i &quot;s/API_KEY=.*/API_KEY=$API_KEY/&quot; /etc/crowdsec/bouncers/crowdsec-nginx-bouncer.conf</pre><p>Now enable the Nginx integration:</p><pre>sudo tee /etc/nginx/conf.d/crowdsec_nginx.conf &gt; /dev/null &lt;&lt; &#39;EOF&#39;<br>...<br># (the nginx config content goes here)<br>...<br>EOF</pre><pre>sudo nginx -t<br>sudo systemctl restart nginx</pre><p><em>(In my case, I kept all the advanced LUA config, caching, stream mode enabled — as shown in the raw implementation)</em></p><h3>Verification</h3><ul><li>sudo cscli metrics → shows AppSec active</li><li>curl with SQLi payload → blocked with HTTP 403</li><li>sudo nft list ruleset → attacker IP appears in blacklist sets</li></ul><h3>Final Result</h3><p>At this point, we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*CqG2xoSmywTGxsmbk5-How.png" /></figure><p>So CrowdSec is now behaving like both an <strong>actual WAF</strong> + <strong>IPS firewall system</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37aa521a3e99" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>