<?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 Mendel Sabbagh on Medium]]></title>
        <description><![CDATA[Stories by Mendel Sabbagh on Medium]]></description>
        <link>https://medium.com/@mendel.sabb27?source=rss-13001b62630b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*A2KG0nISZ0vxt9WjC8-82w@2x.jpeg</url>
            <title>Stories by Mendel Sabbagh on Medium</title>
            <link>https://medium.com/@mendel.sabb27?source=rss-13001b62630b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 18:06:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mendel.sabb27/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[Argo CD Promotion by Pull Request: Build Once, Roll Back by PR (Part 3)]]></title>
            <link>https://medium.com/@mendel.sabb27/argo-cd-promotion-by-pull-request-build-once-roll-back-by-pr-part-3-d2198630a95f?source=rss-13001b62630b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2198630a95f</guid>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Mendel Sabbagh]]></dc:creator>
            <pubDate>Mon, 30 Nov 2026 16:01:03 GMT</pubDate>
            <atom:updated>2026-11-30T16:01:03.997Z</atom:updated>
            <content:encoded><![CDATA[<p>Part 3 of 3. Follow one commit to prod: CI builds once, prod gets the same digest by pull request, and rollback is a PR too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*42JNbiQwilDbxhybwTvt5Q.png" /><figcaption>Image by author. Photo: Dietmar Rabich, CC BY-SA 4.0, via Wikimedia Commons. Argo logo by the CNCF.</figcaption></figure><p>6,000 requests, 0 failed. That’s what a test client saw while prod in my test cluster moved from version 1.2.0 to 1.3.0. Then I rolled it back: 43 seconds, 0 failed out of 3,600. Nobody ran kubectl, and nobody clicked anything in Argo CD. Each step was a commit that changed one small file.</p><p>Most pipelines don’t work like that. They rebuild the image for prod, or deploy :latest, and rollback means &quot;find the old tag and hope&quot;. Here you&#39;ll follow one commit from merge to prod and see the few lines that make each step safe, on any CI and any cluster. It builds on Part 1, <em>Argo CD + Helm for Beginners</em>, and Part 2, <em>Argo CD ApplicationSet: One Helm Chart, Many Environments</em>, where each environment became a folder.</p><h3>The whole path in one picture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FJWq3p0CsxN8izar3dXZ5w.png" /><figcaption>Image by author</figcaption></figure><p>The example is my <a href="https://github.com/mendelsabb/release-notes-devops">Release Notes project</a>: FastAPI, Postgres, one Helm chart. (My test cluster used a local Git server and registry instead of GitHub and GHCR. The flow is the same.) Next to each environment’s values.yaml sits one more file:</p><pre># gitops/environments/dev/image.yaml<br>image:<br>  repository: ghcr.io/mendelsabb/release-notes<br>  digest: &quot;sha256:f12915e667d6...&quot;<br>  version: &quot;1.2.0&quot;</pre><p>image.yaml is the only file automation may change. Config stays in values.yaml, which people edit. So rolling an image back never undoes a config fix.</p><h3>Stop 1: CI builds once and never touches the cluster</h3><p>On every merge to main, GitHub Actions runs lint, tests and a vulnerability scan, pushes the image and commits its digest to dev/image.yaml. That&#39;s the whole deploy step. CI has no cluster credentials. Argo CD sees the commit and deploys dev.</p><p>One trap: the bot’s commit is a push to main, so it starts CI again, which commits again. The Argo CD docs warn about this loop and recommend a separate config repo. Release Notes keeps one repo and breaks the loop in the workflow:</p><pre># .github/workflows/ci.yml (excerpt)<br>push:<br>  branches: [main]<br>  paths-ignore: [&quot;gitops/environments/*/image.yaml&quot;]</pre><h3>Stop 2: Why a digest and not a tag</h3><p>A tag like 1.3.0 is a label, and anyone with push access can move it. A digest is a hash of the image&#39;s content, so it can&#39;t point to anything else.</p><p>I tested it. With dev running 1.3.0, I rebuilt the image and pushed it under the same tag. The tag now pointed to sha256:94bdb538…, while Git and dev still said sha256:cdd4099f…. Promote by tag, and prod gets bytes nobody tested in dev.</p><p>The chart renders repository@digest, so the cluster pulls exactly what Git names.</p><h3>Stop 3: Promotion is a pull request</h3><p>Promoting means copying dev’s digest into prod/image.yaml. The project&#39;s promote.sh first checks that dev is <em>Synced</em> and <em>Healthy</em> and really running that digest. Then it opens a pull request with this diff:</p><pre>-  digest: &quot;sha256:92352987969851...&quot;<br>-  version: &quot;1.2.0&quot;<br>+  digest: &quot;sha256:cdd4099ff6bdc0...&quot;<br>+  version: &quot;1.3.0&quot;</pre><p>Merging is the approval, so prod can keep auto-sync on: the gate is the reviewed pull request, not a button. Add branch protection with a required reviewer and the merge is a human decision.</p><h3>Stop 4: The database goes first</h3><p>The new version may need a new column. So the migration runs as a Job that Argo CD treats as a sync hook:</p><pre>annotations:<br>  argocd.argoproj.io/hook: Sync<br>  argocd.argoproj.io/sync-wave: &quot;1&quot;</pre><p>Argo CD applies resources wave by wave, lowest first: Postgres is wave 0, the migration 1, the app 2. In my test sync, the migration ran from 06:36:33 to 06:36:38, and the first new app pod started at 06:36:43.</p><p>Two rules come with this:</p><ul><li><strong>Expand, then contract.</strong> Old pods keep serving while new ones start, so a migration may only add things. Drop the old column in a later release.</li><li><strong>Make it safe to run twice.</strong> The Argo CD docs point out that hooks run on every sync, including self-heals. Migration tools like Alembic track what they’ve already applied, so a second run does nothing.</li></ul><h3>Stop 5: A rollout nobody notices</h3><p>These are the settings in the chart, and what each one is for:</p><ul><li>maxSurge: 1, maxUnavailable: 0: start a new pod before an old one goes away.</li><li>A readiness check that queries the database: no traffic until the pod can really answer.</li><li>minReadySeconds: 5: a new pod must stay ready for 5 seconds before the next old pod goes.</li><li>A 5-second preStop sleep, then up to 20 seconds of draining: an old pod keeps answering while the Service stops sending it traffic.</li><li>terminationGracePeriodSeconds: 35: longer than 5 + 20, so Kubernetes doesn&#39;t kill a pod mid-drain.</li></ul><p>I measured it with a client inside the cluster: 40 requests per second, a new connection each time. During the promotion, 6,000 requests went through, 0 failed, with a p95 of 21.7 ms. For about 20 seconds, both versions answered side by side.</p><p>It isn’t magic. The project’s notes list what still breaks it: a crash skips the drain, clients that keep connections open saw 11 failures in 6,003 requests, and cloud load balancers need a longer preStop.</p><h3>Stop 6: Rollback is a pull request too</h3><p>rollback.sh reads the Git history of prod/image.yaml, finds the previous digest and commits it. Under the same traffic, prod was <em>Healthy</em> and serving 1.2.0 again 43 seconds after I started it, with 0 failed out of 3,600 requests.</p><p>What about Argo CD’s own <em>Rollback</em> button? On an app with auto-sync on, it refuses:</p><pre>rollback cannot be initiated when auto-sync is enabled</pre><p>Good. A rollback that skips Git makes Git stop being the truth. And the database doesn’t roll back: expand/contract is what lets the old image run on the newer schema.</p><h3>What I’d do on Monday morning</h3><ol><li>Add an image.yaml per environment and make it the only file your CI writes.</li><li>Make CI commit digests, not tags, and take its cluster credentials away.</li><li>Run one rollback by pull request while nothing is on fire, and time it.</li></ol><p>That’s the series. Part 1: one app deployed from Git, with habits you can trust. Part 2: one chart and one folder per environment. Part 3: one digest that moves only by pull request.</p><p>How does your team roll back today: a pull request, a button, or re-running last week’s pipeline?</p><p><em>I used AI tools to help research and draft this post. Facts and commands were checked against the official docs as of November 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2198630a95f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Argo CD ApplicationSet: One Helm Chart, Many Environments (Part 2)]]></title>
            <link>https://medium.com/@mendel.sabb27/argo-cd-applicationset-one-helm-chart-many-environments-part-2-490ca6fca790?source=rss-13001b62630b------2</link>
            <guid isPermaLink="false">https://medium.com/p/490ca6fca790</guid>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Mendel Sabbagh]]></dc:creator>
            <pubDate>Fri, 27 Nov 2026 16:01:03 GMT</pubDate>
            <atom:updated>2026-11-27T16:01:03.970Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 2 of 3. Run dev and prod from one Helm chart with one ApplicationSet, then add staging by adding a folder. Every step tested.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T7voEhe2pregpKUU9a_j7Q.png" /><figcaption>Image by author. Photo: The National Archives (UK), CC BY 3.0, via Wikimedia Commons. Argo and Helm logos by the CNCF.</figcaption></figure><p>You copy the dev Application YAML, rename it to prod, and change two lines. A month later there are four copies. One still points at an old branch, and nobody knows which file is the real one.</p><p>That’s the problem an <strong>ApplicationSet</strong> solves. In Part 1, <em>Argo CD + Helm for Beginners</em>, you deployed one Helm chart as one Argo CD app. By the end of this post the same chart runs as dev and prod from one file, and adding staging means adding a folder. Nothing in the UI, no YAML copied. It works on any cluster: EKS, GKE, AKS, k3s or a laptop.</p><h3>How it works</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7o3qfbj_cyyDkpr6kjk4Yw.png" /><figcaption>Image by author</figcaption></figure><p>An ApplicationSet is a template for Argo CD apps plus a <strong>generator</strong>, the part that decides how many apps to make. The <strong>Git directory generator</strong> looks at your repo and makes one app per folder that matches a pattern. The ApplicationSet controller that does this ships with Argo CD, so the standard install already runs it.</p><p>So your environments become folders, and each folder holds only what differs: a values.yaml.</p><h3>Step 1: Give each environment a folder</h3><p>In your fork of argocd-example-apps from Part 1, add two files next to the helm-guestbook chart:</p><pre># environments/dev/values.yaml<br>replicaCount: 1</pre><pre># environments/prod/values.yaml<br>replicaCount: 3</pre><p>Commit and push. Why folders and not a branch per environment? With branches, moving a change to prod means a merge, and merges carry along whatever else changed. With folders, everything is on one branch, and diff environments/dev/values.yaml environments/prod/values.yaml shows every difference between dev and prod.</p><h3>Step 2: Build the fence first</h3><p>Create the two namespaces, then a project that may deploy only there:</p><pre>kubectl create namespace guestbook-dev<br>kubectl create namespace guestbook-prod</pre><pre>apiVersion: argoproj.io/v1alpha1<br>kind: AppProject<br>metadata:<br>  name: guestbook-envs<br>  namespace: argocd<br>spec:<br>  sourceRepos:<br>    - https://github.com/YOUR_USER/argocd-example-apps.git<br>  destinations:<br>    - server: https://kubernetes.default.svc<br>      namespace: guestbook-dev<br>    - server: https://kubernetes.default.svc<br>      namespace: guestbook-prod</pre><p>Creating the namespaces by hand is on purpose. A project with no clusterResourceWhitelist can&#39;t create cluster-wide things like namespaces, so a new folder in Git can never deploy somewhere you didn&#39;t allow.</p><h3>Step 3: One ApplicationSet for all of them</h3><pre>apiVersion: argoproj.io/v1alpha1<br>kind: ApplicationSet<br>metadata:<br>  name: guestbook<br>  namespace: argocd<br>spec:<br>  goTemplate: true<br>  goTemplateOptions: [&quot;missingkey=error&quot;]<br>  generators:<br>    - git:<br>        repoURL: https://github.com/YOUR_USER/argocd-example-apps.git<br>        revision: master<br>        directories:<br>          - path: environments/*<br>  template:<br>    metadata:<br>      name: &quot;guestbook-{{ .path.basename }}&quot;<br>    spec:<br>      project: guestbook-envs<br>      source:<br>        repoURL: https://github.com/YOUR_USER/argocd-example-apps.git<br>        targetRevision: master<br>        path: helm-guestbook<br>        helm:<br>          valueFiles:<br>            - &quot;../environments/{{ .path.basename }}/values.yaml&quot;<br>      destination:<br>        server: https://kubernetes.default.svc<br>        namespace: &quot;guestbook-{{ .path.basename }}&quot;<br>      syncPolicy:<br>        automated:<br>          prune: true<br>          selfHeal: true<br>  syncPolicy:<br>    preserveResourcesOnDeletion: true</pre><p>The lines that matter:</p><ul><li>{{ .path.basename }} is the folder name, dev or prod. It names the app and picks the namespace.</li><li>The values path is relative to the chart folder, hence ../. Every environment renders the same chart. Only the values differ.</li><li>missingkey=error makes a typo in a {{ }} fail loudly instead of quietly rendering an empty string. The Argo CD docs recommend it.</li><li>project is fixed, never templated. The docs warn that a templated project lets whoever controls the folders pick their own permissions.</li><li>preserveResourcesOnDeletion gets its own step below.</li></ul><p>Apply both files with kubectl apply -f. In my test, guestbook-dev (1 pod) and guestbook-prod (3 pods) were both <em>Synced</em> and <em>Healthy</em> 4 seconds later (the image was already on the node).</p><h3>Step 4: Add staging with a folder</h3><p>To check this on something bigger than a demo, I ran my <a href="https://github.com/mendelsabb/release-notes-devops">Release Notes project</a> (FastAPI + Postgres, one Helm chart, dev and prod) on a test cluster. Its environments work exactly like this. I added staging with two files and pushed. No webhook, no clicks. The new app appeared 124 seconds later and was <em>Healthy</em> at 155 seconds.</p><p>The first time, I skipped the project. The app appeared anyway, but it couldn’t deploy:</p><pre>application destination server &#39;https://kubernetes.default.svc&#39;<br>and namespace &#39;staging&#39; do not match any of the allowed<br>destinations in project &#39;release-notes&#39;</pre><p>That’s the fence doing its job. The fix is one line in the project’s destinations, in the same pull request as the folder. Fixed in a separate push, it took 6 minutes 48 seconds to go green, because two things were checking Git every 3 minutes, one after the other. The webhook from Part 1 cuts that to seconds.</p><h3>Step 5: Deleting a folder deletes the app</h3><p>The generator works both ways. Remove a folder and its app goes away. The question is what happens to the pods and the database.</p><p>By default, the ApplicationSet deletes everything the app deployed. I tested it: within 15 seconds of the app disappearing, the Deployment, the Postgres StatefulSet and every pod were gone. Only the database’s volume survived, because Kubernetes keeps StatefulSet volumes by default. With preserveResourcesOnDeletion: true, the same delete removed the app and nothing else. The app and the database kept running.</p><p>Part 1 said to add a finalizer so deleting an app cleans up. That’s the right habit for one app you delete on purpose. An ApplicationSet deletes apps for you, and a bad merge or a folder rename counts as a delete. Keep the brake on, and clean up the namespace yourself when you’re sure.</p><h3>What it looks like in a real project</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VMULnnDjfiMkSThCWTAzIw.png" /><figcaption>Image by author, on my test cluster with a local Git server</figcaption></figure><p>In Release Notes, even the ApplicationSet lives in Git. One <em>root</em> app, the only one created by hand, syncs the project and the ApplicationSet. This is called <strong>app of apps</strong>. One kubectl apply brought dev and prod up, Postgres and database migration included, in 43 seconds.</p><p>Each environment folder also has an image.yaml next to values.yaml, holding the exact image to run. That&#39;s Part 3.</p><p>Before you push a values change, render what each environment will get:</p><pre>helm template app helm/release-notes \<br>  -f gitops/environments/prod/values.yaml \<br>  -f gitops/environments/prod/image.yaml</pre><p>On the real repo, dev renders 8 objects and prod renders 10: the autoscaler and the disruption budget exist only in prod. You see that before Argo CD does.</p><p>Save this for your setup:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nq4_4pf1a7nLmrCYri86SQ.png" /><figcaption>Image by author</figcaption></figure><h3>Coming next</h3><p>Part 3: CI builds the image once, writes its digest to dev’s image.yaml, and prod gets the same bytes by pull request. Rollback is a pull request too.</p><p>Folders or branches: what does your team use for environments, and would you switch?</p><p><em>I used AI tools to help research and draft this post. Facts and commands were checked against the official docs as of November 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=490ca6fca790" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Argo CD + Helm for Beginners: How It Works and 6 Best Practices (Part 1)]]></title>
            <link>https://medium.com/@mendel.sabb27/argo-cd-helm-for-beginners-how-it-works-and-6-best-practices-part-1-932cdc0db423?source=rss-13001b62630b------2</link>
            <guid isPermaLink="false">https://medium.com/p/932cdc0db423</guid>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Mendel Sabbagh]]></dc:creator>
            <pubDate>Wed, 25 Nov 2026 16:01:02 GMT</pubDate>
            <atom:updated>2026-11-25T16:01:02.898Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 1 of 3. How Argo CD and Helm work together, your first Helm app deployed from Git, and six habits that make it a setup you can trust.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K6RmLjucfCNHayR8fWxILw.png" /><figcaption>Image by author. Photo: Markus Spiske, CC0, via Wikimedia Commons. Argo and Helm logos by the CNCF.</figcaption></figure><p>Most Argo CD tutorials end at the magic moment: you push to Git, and your app updates by itself. Then the demo habits follow you into a real cluster. Everyone logs in as admin. Apps can deploy anywhere. Deleting an app leaves its pods running, with nobody watching them.</p><p>By the end of this post you’ll have a real Helm chart running in Argo CD, set up the right way from the start. It works the same on EKS, GKE, AKS, k3s or a laptop, and I tested every step on a real cluster.</p><h3>How Argo CD works</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3HzyIIh5Mmuk4IDf4Ly1uA.png" /><figcaption>Image by author</figcaption></figure><p>Git holds the truth about what should run. Argo CD lives inside your cluster, compares Git with what’s actually running, and fixes the difference. That’s all GitOps means. Four words you’ll see everywhere:</p><ul><li><strong>Application</strong>: one thing Argo CD manages. “Take this folder in this repo, run it in this namespace.”</li><li><strong>Sync</strong>: making the cluster match Git. <em>OutOfSync</em> means they differ.</li><li><strong>Prune</strong>: deleting what you removed from Git.</li><li><strong>Self-heal</strong>: undoing changes someone made by hand in the cluster.</li></ul><h3>Where Helm fits</h3><p>Most real apps don’t ship as plain YAML. They ship as a <strong>Helm chart</strong>: templates plus a values.yaml with the settings you change, like the number of replicas or the image tag.</p><p>The two tools split the work. <strong>Helm describes the app. Argo CD delivers it.</strong> Argo CD runs helm template to turn the chart into plain Kubernetes files, then applies them itself. Two things surprise every beginner:</p><ul><li>helm list shows nothing. Argo CD never ran helm install, so Helm doesn&#39;t know the release exists. Look in Argo CD instead.</li><li>You never run helm upgrade again. To change the app, you change values.yaml in Git.</li></ul><h3>Your first Helm app in 4 steps</h3><p><strong>1. Install Argo CD.</strong> Two official commands, on any cluster:</p><pre>kubectl create namespace argocd<br>kubectl apply -n argocd --server-side --force-conflicts \<br>  -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml</pre><p>Keep --server-side: one of Argo CD&#39;s definitions is too big for a normal kubectl apply.</p><p><strong>2. Get a chart in Git.</strong> Fork github.com/argoproj/argocd-example-apps. Its helm-guestbook folder is a small Helm chart: Chart.yaml, templates/ and a values.yaml that sets replicaCount: 1.</p><p><strong>3. Apply two files.</strong> First a <em>project</em>, a fence saying which repo this app may use and where it may deploy (habit 3 explains why):</p><pre>apiVersion: argoproj.io/v1alpha1<br>kind: AppProject<br>metadata:<br>  name: guestbook<br>  namespace: argocd<br>spec:<br>  sourceRepos:<br>    - https://github.com/YOUR_USER/argocd-example-apps.git<br>  destinations:<br>    - server: https://kubernetes.default.svc<br>      namespace: guestbook<br>  clusterResourceWhitelist:<br>    - group: &quot;&quot;<br>      kind: Namespace<br>      name: guestbook</pre><p>Then the Application. The helm block tells Argo CD which values file to use. Every other line is one of the six habits:</p><pre>apiVersion: argoproj.io/v1alpha1<br>kind: Application<br>metadata:<br>  name: guestbook<br>  namespace: argocd<br>  finalizers:<br>    - resources-finalizer.argocd.argoproj.io<br>spec:<br>  project: guestbook<br>  source:<br>    repoURL: https://github.com/YOUR_USER/argocd-example-apps.git<br>    targetRevision: master<br>    path: helm-guestbook<br>    helm:<br>      valueFiles:<br>        - values.yaml<br>  destination:<br>    server: https://kubernetes.default.svc<br>    namespace: guestbook<br>  syncPolicy:<br>    automated:<br>      prune: true<br>      selfHeal: true<br>    syncOptions:<br>      - CreateNamespace=true</pre><p>Save both under argocd/ in your repo, commit them (so your Argo CD setup lives in Git too), and apply:</p><pre>kubectl apply -f argocd/project.yaml -f argocd/guestbook.yaml</pre><p><strong>4. Watch it work.</strong> Open the UI with kubectl port-forward svc/argocd-server -n argocd 8080:443, then https://localhost:8080 (the certificate is self-signed, so accept the warning). The user is admin, and the first password is in a Secret:</p><pre>kubectl -n argocd get secret argocd-initial-admin-secret \<br>  -o jsonpath=&quot;{.data.password}&quot; | base64 -d</pre><p>The app shows <em>Synced</em> and <em>Healthy</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9byuiJf3-fPktkZs8qtK-w.png" /><figcaption>Image by author, on my test cluster with a local Git server</figcaption></figure><p>Now edit helm-guestbook/values.yaml on GitHub, change replicaCount: 1 to 3, and commit. Don&#39;t touch the cluster, and don&#39;t run Helm. In my test, three pods were running 119 seconds later:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A2xo5_JcqDuNidZKWgJ8BQ.png" /><figcaption>Image by author</figcaption></figure><p>That’s the whole loop: change a value in Git, and Argo CD renders the chart and rolls it out. Now the habits that keep it trustworthy.</p><h3>1. Admin is for day one only</h3><p>The first password is stored in clear text in the argocd-initial-admin-secret Secret. Read it once, change it under <em>User Info</em>, then delete the Secret. The official docs say it serves no other purpose. Once you add SSO or real users, turn admin off with admin.enabled: &quot;false&quot; in the argocd-cm ConfigMap.</p><h3>2. Git is the only way in</h3><p>With self-heal on, hand edits don’t last. I deleted the app’s Deployment by hand, and Argo CD had all three pods back in 1.5 seconds. Every change becomes a commit with an author and a reason, and so does every rollback. With auto-sync on, the UI’s rollback button refuses. You git revert and push.</p><h3>3. Every app gets a fence</h3><p>The built-in default project lets an app deploy anything, from any repo, anywhere. That&#39;s why step 3 created its own project. Its last four lines matter. Without them, sync fails with resource :Namespace is not permitted in project guestbook, because a namespace is cluster-wide and must be allowed by name. And never deploy into the default namespace: CreateNamespace=truegives the app its own.</p><h3>4. Know exactly what you deploy</h3><p>targetRevision: HEAD means &quot;whatever the default branch is right now&quot;. Name a branch for dev (this repo&#39;s is master), and a tag or commit for production. Keep your charts and values in a config repo, separate from your app&#39;s code, as the Argo CD docs strongly recommend.</p><h3>5. Add the finalizer</h3><p>Without the deletion finalizer, deleting an Application leaves everything it deployed running, managed by nobody. I tested both ways. Without it, the Deployment stayed. With it, the namespace was empty about 4 seconds later.</p><h3>6. Webhooks, not waiting</h3><p>By default Argo CD checks Git every 3 minutes, which is why step 4 took two minutes. In GitHub, open your repo’s <em>Settings → Webhooks → Add webhook</em>. Set the URL to https://&lt;your-argocd&gt;/api/webhook and the content type to application/json(not GitHub&#39;s default). Syncs then start in seconds. GitHub must be able to reach Argo CD, so this is for a real cluster, not a laptop.</p><p>One rule above all six: no passwords in that repo, ever, not even in values.yaml. Git remembers forever. Use Sealed Secrets or External Secrets.</p><p>Save this one for your next setup:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Eb6wyC4HNKuxK2AeLp6-w.png" /><figcaption>Image by author</figcaption></figure><h3>Coming next</h3><p>Right now your chart runs once. Part 2 runs the same chart as dev and prod from one file: each environment becomes a folder with its own values.yaml, and an ApplicationSet turns each folder into its own app. Part 3: CI builds an image once, and the same image reaches production by pull request, and so does the rollback. Both are built on my Release Notes project.</p><p>Which of these six would your current setup fail today?</p><p><em>I used AI tools to help research and draft this post. Facts and commands were checked against the official docs as of November 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=932cdc0db423" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nginx in Front of Your Docker App: 6 Traps Between 502 and HTTPS]]></title>
            <link>https://medium.com/@mendel.sabb27/nginx-in-front-of-your-docker-app-6-traps-between-502-and-https-bf2484730cdf?source=rss-13001b62630b------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf2484730cdf</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[nginx]]></category>
            <dc:creator><![CDATA[Mendel Sabbagh]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 16:01:03 GMT</pubDate>
            <atom:updated>2026-11-23T16:01:03.644Z</atom:updated>
            <content:encoded><![CDATA[<h4>I built the config every tutorial shows, then broke it six ways in a lab. Here’s each failure with its real error, and the file that fixes all six.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LkHjqsh6YtUJQIM9f4QRmw.png" /><figcaption>Image by author. Photo: Dennis van Zuijlekom, CC BY-SA 2.0, via Wikimedia Commons. Nginx logo by Igor Sysoev (public domain).</figcaption></figure><p>Most Nginx-in-front-of-Docker tutorials stop at the first 200 OK. That&#39;s exactly where the bugs start hiding: uploads that die at 1 MB, reports that die at 60 seconds, an app port anyone can reach, and a proxy that stops working after your next deploy.</p><p>I built the usual setup on a fresh Ubuntu 24.04 box with Nginx 1.30.6 and a tiny Python app, then broke it on purpose. Below is the “before”, what each mistake looks like in the logs, and the “after” you can copy.</p><h3>The config everyone copies</h3><pre>services:<br>  app:<br>    image: my-app<br>    ports:<br>      - &quot;8080:8080&quot;<br>  nginx:<br>    image: nginx:1.30-alpine<br>    ports:<br>      - &quot;80:80&quot;<br>    volumes:<br>      - ./default.conf:/etc/nginx/conf.d/default.conf:ro</pre><pre>server {<br>    listen 80;<br>    server_name app.example.com;<br>    location / {<br>        proxy_pass http://localhost:8080;<br>    }<br>}</pre><p>It returns a 502 on the first request.</p><h3>1. localhost is the Nginx container</h3><pre>connect() failed (111: Connection refused) while connecting<br>to upstream ... upstream: &quot;http://127.0.0.1:8080/whoami&quot;</pre><p>Inside a container, localhost means that container. Nginx is knocking on its own door. Use the Compose service name, proxy_pass http://app:8080;, which Docker&#39;s DNS resolves on the Compose network.</p><p>An annoying one I hit while fixing it: after sed -i on default.conf, the container still showed the old localhost line. sed -i writes a new file, and a single-file bind mount keeps pointing at the old one. Mount the directory (./conf.d:/etc/nginx/conf.d:ro) and run nginx -t before every reload.</p><h3>2. Your app thinks every visitor is Nginx</h3><p>With the name fixed, the app answered. Here’s what it saw:</p><pre>{&quot;client_ip&quot;: &quot;172.18.0.3&quot;, &quot;host&quot;: &quot;app:8080&quot;,<br> &quot;x_forwarded_for&quot;: null, &quot;x_forwarded_proto&quot;: null}</pre><p>Every user has the Nginx container’s IP, and the app can’t tell the request came over HTTPS. Logs, rate limits and URLs the app builds are now wrong. Four lines fix it:</p><pre>proxy_set_header Host              $host;<br>proxy_set_header X-Real-IP         $remote_addr;<br>proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;<br>proxy_set_header X-Forwarded-Proto $scheme;</pre><p>Your framework may also need to be told to trust these headers. Check its “behind a proxy” setting.</p><h3>3. Two quiet defaults: 1 MB and 60 seconds</h3><p>I uploaded a 5 MB file and asked for a report that takes 75 seconds:</p><pre>HTTP/1.1 413 Request Entity Too Large<br>client intended to send too large body: 5000000 bytes</pre><pre>504 after 60.061641s<br>upstream timed out (110: Operation timed out)</pre><p>client_max_body_size defaults to 1 MB and proxy_read_timeout to 60 seconds. Neither error reaches your app logs, so the developers will swear the app is fine. Set both to what the app really needs, not &quot;unlimited&quot;.</p><h3>4. The app port is open to the internet</h3><pre>SERVICE   PORTS<br>app       0.0.0.0:8080-&gt;8080/tcp</pre><p>curl http://127.0.0.1:8080 went straight to the app, skipping Nginx, TLS and every header above. On a real server that&#39;s the public IP too, and a ufw deny won&#39;t help: Docker&#39;s own docs say published ports are diverted before the chains ufw uses. Delete the app&#39;s ports: block. Nginx reaches it over the Compose network anyway.</p><h3>5. Nginx remembers yesterday’s IP</h3><p>This is the one I didn’t expect. I recreated the app container, a normal deploy, and it got a new IP. Nginx kept using the old one:</p><pre>connect() failed (111: Connection refused) ...<br>upstream: &quot;http://172.18.0.2:8080/whoami&quot;</pre><p>Nginx resolves app once, at startup, and that 502 stays until you reload. Worse, if the app is down when Nginx starts, Nginx refuses to start at all: host not found in upstream &quot;app&quot;.</p><p>Since Nginx 1.27.3, the free version can re-resolve names, a feature that used to be paid-only:</p><pre>resolver 127.0.0.11 valid=10s;   # Docker&#39;s DNS</pre><pre>upstream app {<br>    zone app 64k;<br>    server app:8080 resolve;<br>}</pre><p>Same test after the change, one request every 2 seconds: 502 502 502 502 502 200 200 200. It healed itself in about 10 seconds, the valid=10s. Nginx now also starts when the app is down.</p><h3>6. HTTPS has a chicken-and-egg problem</h3><p>Add the listen 443 ssl block before the certificate exists and Nginx won&#39;t start:</p><pre>nginx: [emerg] cannot load certificate<br>&quot;/etc/letsencrypt/live/app.example.com/fullchain.pem&quot;</pre><p>Do it in order. First, run with only the port 80 block, serving /.well-known/acme-challenge/ from a shared folder. Then ask Certbot for the certificate:</p><pre>docker run --rm \<br>  -v ./certs:/etc/letsencrypt -v ./www:/var/www/certbot \<br>  certbot/certbot certonly --webroot -w /var/www/certbot \<br>  -d app.example.com -m you@example.com --agree-tos</pre><p>Then add the 443 block and reload. The Certbot container doesn’t renew anything by itself, so add a daily cron job that runs certbot renew and then nginx -s reload. Plan for shorter certificates too: Let&#39;s Encrypt moves its default from 90 to 64 days on February 10, 2027.</p><p>My lab had no public domain, so it used a self-signed certificate for the same paths. The Certbot command is checked against certbot --help (version 5.10.0), not run against Let&#39;s Encrypt.</p><h3>The whole file, after</h3><pre>resolver 127.0.0.11 valid=10s;</pre><pre>upstream app {<br>    zone app 64k;<br>    server app:8080 resolve;<br>}</pre><pre>server {<br>    listen 80;<br>    server_name app.example.com;<br>    location /.well-known/acme-challenge/ {<br>        root /var/www/certbot;<br>    }<br>    location / {<br>        return 301 <a href="https://$host$request_uri;/">https://$host$request_uri;</a><br>    }<br>}</pre><pre>server {<br>    listen 443 ssl;<br>    http2 on;<br>    server_name app.example.com;<br>    ssl_certificate     /etc/letsencrypt/live/app.example.com/fullchain.pem;<br>    ssl_certificate_key /etc/letsencrypt/live/app.example.com/privkey.pem;<br>    client_max_body_size 25m;</pre><pre>    location / {<br>        proxy_pass <a href="http://app;/">http://app;</a><br>        proxy_set_header Host              $host;<br>        proxy_set_header X-Real-IP         $remote_addr;<br>        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;<br>        proxy_set_header X-Forwarded-Proto $scheme;<br>        proxy_read_timeout 120s;<br>    }<br>}</pre><p>Against this file, all six tests pass: HTTP redirects to HTTPS, the app sees &quot;x_forwarded_proto&quot;: &quot;https&quot;, the upload and the 75-second report return 200, port 8080 refuses connections, and a recreated app heals itself.</p><h3>What this file still doesn’t solve</h3><p>Those 10 seconds of 502s after a deploy are still real. Lower valid= and you query DNS more often. Run two replicas and you avoid the gap, but now you&#39;re building a small orchestrator by hand. That&#39;s when many people switch to Caddy or Traefik, which handle certificates and container changes for you.</p><p>So where do you draw the line: hand-written Nginx because you understand every line, or a proxy that does it for you? Tell me in the comments.</p><p><em>I used AI tools to help research and draft this post. Facts and commands were checked against the official docs as of November 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf2484730cdf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[8 Dockerfile Mistakes That Make Your Images 8x Bigger (Measured)]]></title>
            <link>https://medium.com/@mendel.sabb27/8-dockerfile-mistakes-that-make-your-images-8x-bigger-measured-89dd83d9cc0c?source=rss-13001b62630b------2</link>
            <guid isPermaLink="false">https://medium.com/p/89dd83d9cc0c</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Mendel Sabbagh]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 14:31:01 GMT</pubDate>
            <atom:updated>2026-11-20T14:31:01.836Z</atom:updated>
            <content:encoded><![CDATA[<h4>Same Python API, 2.91 GB or 349 MB. I built every mistake in a lab and measured what each fix saves.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GUB5nLlvU1eWQ5zGFttl3A.png" /><figcaption>Image by author. Photo: AgainErick, CC BY-SA 4.0, via Wikimedia Commons. Docker logo by dotCloud, Inc.</figcaption></figure><pre>$ docker images lab:before<br>IMAGE        ID             DISK USAGE   CONTENT SIZE   EXTRA<br>lab:before   08d4076ed2c1       2.91GB          888MB<br>$ docker images lab:after<br>IMAGE       ID             DISK USAGE   CONTENT SIZE   EXTRA<br>lab:after   1379ab9c3f92        349MB          117MB</pre><p>Same tiny FastAPI app. Same code, same dependencies, same 60 MB asset folder. The only difference is the Dockerfile (plus a .dockerignore).</p><p>A 2.9 GB image isn&#39;t just ugly. Every new node pulls it, every deploy waits for it, every registry stores it. And nobody notices, because it grew 50 MB at a time.</p><p>So I built each classic mistake on its own in a throwaway lab (Docker Engine 29.9, python:3.15, golang:1.27, ubuntu:24.04) and measured it. Here is what each one costs you and the line that fixes it.</p><p>One thing first. On a fresh Docker 29 install, docker images shows two numbers. DISK USAGE is what the image takes on this machine. CONTENT SIZE is the compressed size that gets pushed and pulled. I quote DISK USAGE below unless I say otherwise.</p><h3>1. Starting from the full base image</h3><p>python:3.15 is 1.65 GB on disk. python:3.15-slim is 184 MB. With my app on top: 1.67 GB vs 223 MB.</p><p>The full image ships gcc, headers and 470 Debian packages (slim has 88), because it&#39;s built for compiling things. Your API doesn&#39;t compile anything at runtime.</p><pre>FROM python:3.15-slim</pre><p>If a dependency really needs gcc to install, that&#39;s what mistake 7 is about.</p><h3>2. No .dockerignore</h3><p>COPY . . copies everything in the folder: your local .venv, .git, that database dump you forgot about. In my lab that one line made a 385 MB layer. With a .dockerignore it was 63 MB, and the image dropped from 835 MB to 349 MB.</p><pre>.git<br>.venv<br>*.sql<br>__pycache__<br>.env</pre><p>Size is the smaller problem. Anything in the build context can end up in the image, including .env files with real secrets.</p><h3>3. RUN chown -R after COPY</h3><p>This one surprises people. A layer can&#39;t edit the layer below it, so chown writes a full second copy of every file it touches.</p><pre>$ docker history --format &#39;table {{.Size}}\t{{.CreatedBy}}&#39; lab:chown<br>SIZE      CREATED BY<br>0B        CMD [&quot;uvicorn&quot; &quot;main:app&quot; &quot;--host&quot; &quot;0.0.0.0&quot;]<br>0B        USER app<br>62.9MB    RUN /bin/sh -c chown -R app:app /app # build…<br>31.4MB    RUN /bin/sh -c pip install --no-cache-dir -r…<br>62.9MB    COPY . . # buildkit</pre><p>Same 62.9 MB, twice. The image went from 349 MB to 475 MB. In the &quot;before&quot; image, where nothing was ignored, it was 385 MB twice. The fix is a flag:</p><pre>COPY --chown=app:app . .</pre><h3>4. Keeping pip&#39;s cache</h3><p>By default, pip install keeps what it downloaded in /root/.cache/pip, and that folder ships inside your image. For my tiny API that was only 6.7 MB. With pandas added it was 29 MB of cache, and the image went from 405 MB to 465 MB.</p><pre>RUN pip install --no-cache-dir -r requirements.txt</pre><p>Small per image, but it&#39;s free to fix and it adds up across every service you build.</p><h3>5. Letting apt install &quot;recommended&quot; packages</h3><p>On ubuntu:24.04, apt-get install -y python3-pip also installs everything pip <em>recommends</em>, including build-essential. I didn&#39;t ask for a C compiler. I got one anyway.</p><p>The numbers: a 528 MB layer and 233 packages, vs 126 MB and 112 packages with one extra flag.</p><pre>RUN apt-get update \<br> &amp;&amp; apt-get install -y --no-install-recommends python3-pip \<br> &amp;&amp; rm -rf /var/lib/apt/lists/*</pre><p>That rm at the end is the next mistake.</p><h3>6. Cleaning up in a separate RUN</h3><p>apt-get update downloads package lists: 53 MB in my test. Delete them in the same RUN and the layer is 70.3 MB. Delete them in the <em>next</em> RUN and nothing happens:</p><pre>$ docker history --format &#39;table {{.Size}}\t{{.CreatedBy}}&#39; lab:split<br>SIZE      CREATED BY<br>20.5kB    RUN /bin/sh -c rm -rf /var/lib/apt/lists/* #…<br>126MB     RUN /bin/sh -c apt-get update  &amp;&amp; apt-get in…</pre><p>The files are hidden, not gone. The image stayed at 302 MB. Same rule for downloaded tarballs, build tools you apt-get purge later, anything: create and delete in one RUN, or it still ships.</p><h3>7. Shipping the compiler</h3><p>This is the big one. A Go service built in golang:1.27 and run from the same image: 1.43 GB. The same service with a multi-stage build: 15 MB.</p><pre>FROM golang:1.27 AS build<br>WORKDIR /src<br>COPY . .<br>RUN CGO_ENABLED=0 go build -ldflags=&quot;-s -w&quot; -o /app .<br><br>FROM gcr.io/distroless/static-debian13<br>COPY --from=build /app /app<br>USER nonroot<br>CMD [&quot;/app&quot;]</pre><p>The first stage has the full toolchain. Only the binary moves to the second stage, which has no shell and no package manager. CGO_ENABLED=0 makes the binary static, so it runs without libc. I curled its /health endpoint to be sure: ok.</p><p>Same idea works for Python: install into a virtualenv in a python:3.15 builder stage (it has gcc), then COPY --from=build only the virtualenv into python:3.15-slim. My test of that came out at 352 MB.</p><h3>8. Guessing instead of looking</h3><p>When an image is too big, people start deleting random lines. Don&#39;t. Ask Docker:</p><pre>$ docker history --format &#39;table {{.Size}}\t{{.CreatedBy}}&#39; lab:before<br>SIZE      CREATED BY<br>0B        CMD [&quot;uvicorn&quot; &quot;main:app&quot; &quot;--host&quot; &quot;0.0.0.0&quot;]<br>0B        USER app<br>385MB     RUN /bin/sh -c chown -R app:app /app # build…<br>38.4MB    RUN /bin/sh -c pip install -r requirements.t…<br>385MB     COPY . . # buildkit</pre><p>Three lines and you can see mistakes 2, 3 and 4. Read it from the top, find the biggest number, ask why that layer exists. Then fix one thing and build again. Evidence first, edits second.</p><h3>What I&#39;d do Monday morning</h3><ul><li>Run docker history on your biggest image and read the top five lines.</li><li>Add a .dockerignore to every repo that has a Dockerfile.</li><li>Move one compiled service to a multi-stage build and compare the two numbers.</li></ul><p>What&#39;s the biggest image you&#39;ve found in your registry, and what was inside it?</p><p><em>I used AI tools to help research and draft this post. Facts and commands were checked against the official docs as of November 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89dd83d9cc0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Disk Full on Your Linux Server? 8 Commands to Find What Ate It]]></title>
            <link>https://medium.com/@mendel.sabb27/disk-full-on-your-linux-server-8-commands-to-find-what-ate-it-2b4039b2b597?source=rss-13001b62630b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b4039b2b597</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[command-line]]></category>
            <dc:creator><![CDATA[Mendel Sabbagh]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 14:31:01 GMT</pubDate>
            <atom:updated>2026-11-17T14:31:01.528Z</atom:updated>
            <content:encoded><![CDATA[<h4>I broke a test server’s disk six different ways. Each one needs a different command, and two of them fool du completely.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Qten7A-VSgGycijYumzKg.png" /><figcaption>Image by author. Photo: PiDatacenters, CC BY-SA 4.0, via Wikimedia Commons. Tux by Larry Ewing, Simon Budig, Garrett LeSage.</figcaption></figure><p>What’s the first thing you do when the alert says “No space left on device”?</p><p>If the answer is “run du and delete the biggest folder&quot;, you&#39;ll fix it most of the time. The other times, du shows a nearly empty disk, you delete nothing useful, and the alert comes back. A full disk has five or six common causes, and each one hides from a different tool.</p><p>So I built a lab. A 1 GB ext4 disk mounted at /srv on Ubuntu 24.04, filled on purpose in four different ways, plus Docker and journald running on the same machine. Every output below is copied from that lab. Work through these eight commands in order and one of them will find your culprit.</p><h3>1. df -h: which disk is actually full</h3><p>Before you hunt, find the right filesystem. /, /var and /home are often separate disks, and the full one isn&#39;t always the one you&#39;d guess.</p><pre>$ df -h /srv<br>Filesystem      Size  Used Avail Use% Mounted on<br>/dev/loop1      974M  958M     0 100% /srv</pre><p>Look closely: 958M used of 974M, and yet 0 available. That’s not a bug. ext4 reserves 5% of the blocks for root by default, so normal users hit the wall first while root-owned services keep writing a little longer. Useful to know when your app user gets “disk full” but sudo can still write.</p><h3>2. df -i: the disk with free space that’s still full</h3><p>This is the one that wastes an afternoon. I created empty session files until writes failed:</p><pre>$ touch /srv/test.txt<br>touch: cannot touch &#39;/srv/test.txt&#39;: No space left on device<br>$ df -h /srv<br>Filesystem      Size  Used Avail Use% Mounted on<br>/dev/loop1      974M  2.0M  905M   1% /srv<br>$ df -i /srv<br>Filesystem     Inodes IUsed IFree IUse% Mounted on<br>/dev/loop1      65536 65536     0  100% /srv</pre><p>905 MB free, 1% used, and nothing can be written. Every file needs an inode, and ext4 fixes the number when the filesystem is created. Millions of tiny files (PHP sessions, mail queues, cache shards) run out of inodes long before bytes. To find the folder that has them:</p><pre>$ sudo find /srv -xdev -type f | cut -d/ -f2-4 | sort | uniq -c | sort -rn | head -3<br>  65523 srv/app/sessions</pre><h3>3. du -xh — max-depth=1: walk down one level at a time</h3><p>The classic, with two flags that matter. -x stays on one filesystem, so you don&#39;t crawl /proc or a network mount. sort -hunderstands &quot;391M&quot; and &quot;1.2G&quot;.</p><pre>$ sudo du -xh --max-depth=1 /srv | sort -h<br>16K /srv/lost+found<br>391M    /srv/app<br>568M    /srv/backups<br>958M    /srv</pre><p>Then run it again on the biggest folder, and again. Three levels down you usually have your answer. If you’d rather click around, ncdu -x / does the same thing interactively (it was #4 in my <a href="https://medium.com/@mendel.sabb27/15-linux-tools-id-install-on-every-server-in-2026-4c0e1f1d6048">Linux tools post</a>).</p><h3>4. find -size: the biggest single files</h3><p>Sometimes it’s not a folder full of junk but three huge files. Skip the walking:</p><pre>$ sudo find /srv -xdev -type f -size +100M -exec ls -lh {} +<br>-rw-r--r-- 1 root root 310M Nov 14 16:51 /srv/app/logs/app.log<br>-rw-r--r-- 1 root root 420M Nov 14 16:51 /srv/backups/db-2026-11-01.sql.gz<br>-rw-r--r-- 1 root root 148M Nov 14 16:51 /srv/backups/db-2026-11-08.sql.gz</pre><p>Look at the last one: 148M, not the 300M it should be. The backup ran out of space halfway and left a broken file behind. Check your newest backups after a disk-full event; they may be the ones you can’t restore.</p><h3>5. lsof +L1: the file you deleted that still takes space</h3><p>Here df and du disagree by 600 MB:</p><pre>$ df -h /srv<br>Filesystem      Size  Used Avail Use% Mounted on<br>/dev/loop1      974M  601M  307M  67% /srv<br>$ sudo du -sh /srv<br>24K /srv</pre><p>Someone deleted a big log while a process still had it open. Linux frees the space only when the last process closes the file, so it’s gone from every folder but still on the disk. +L1 lists open files with zero links, which means deleted:</p><pre>$ sudo lsof -a +L1 /srv<br>COMMAND   PID USER   FD   TYPE DEVICE  SIZE/OFF NLINK NODE NAME<br>python3 28659 root    3w   REG    7,1 629145600     0   13 /srv/app/worker.log (deleted)</pre><p>Restarting the process frees it. If you can’t restart right now, empty the file through the process’s file descriptor (PID 28659, FD 3 above):</p><pre>$ sudo truncate -s 0 /proc/28659/fd/3<br>$ df -h /srv<br>Filesystem      Size  Used Avail Use% Mounted on<br>/dev/loop1      974M   28K  907M   1% /srv</pre><p>Next time, run truncate -s 0 app.log instead of rm app.log on a log a service is writing to.</p><h3>6. mount — bind: the files hiding under a mount</h3><p>Now df says 501M used, and du finds 20K:</p><pre>$ sudo du -xh --max-depth=1 /srv | sort -h<br>16K /srv/lost+found<br>20K /srv</pre><p>Before a second disk was mounted at /srv/uploads, an app had written 500 MB into the plain /srv/uploads folder. The mount covers those files: they still use space, but no path can reach them. Bind-mount the parent somewhere else to look underneath:</p><pre>$ sudo mkdir -p /mnt/peek<br>$ sudo mount --bind /srv /mnt/peek<br>$ sudo du -sh /mnt/peek/uploads<br>501M    /mnt/peek/uploads</pre><p>Move or delete what you find, then sudo umount /mnt/peek. The usual way you get here: a volume mounts late at boot, or someone unmounts it for maintenance while the app keeps writing.</p><h3>7. journalctl — disk-usage: the system logs</h3><p>journald limits itself to 10% of the filesystem by default (capped at 4 GB), which on a 40 GB root disk is still 4 GB of logs. Check and trim:</p><pre>$ journalctl --disk-usage<br>Archived and active journals take up 32.7M in the file system.<br>$ sudo journalctl --vacuum-size=10M<br>...<br>$ journalctl --disk-usage<br>Archived and active journals take up 8.0M in the file system.</pre><p>Vacuum only deletes archived files, never the active one, so you may not get all the way down to your number. For a permanent limit, set SystemMaxUse=500M in /etc/systemd/journald.conf and restart systemd-journald.</p><h3>8. Docker’s container logs: what docker system df doesn’t show</h3><p>I ran one container that writes access-log lines in a loop, with Docker 29.9.2 defaults, for 10 seconds:</p><pre>$ docker system df<br>TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE<br>Images          1         1         12.86MB   0B (0%)<br>Containers      1         0         4.096kB   4.096kB (100%)<br>...<br>$ sudo sh -c &#39;du -h /var/lib/docker/containers/*/*-json.log&#39;<br>694M    /var/lib/docker/containers/175ae5.../175ae5...-json.log</pre><p>694 MB in ten seconds, and docker system df reports the container as 4 kB. The default json-file driver never rotates logs unless you tell it to. Fix it for every new container in /etc/docker/daemon.json:</p><pre>{<br>  &quot;log-driver&quot;: &quot;json-file&quot;,<br>  &quot;log-opts&quot;: { &quot;max-size&quot;: &quot;10m&quot;, &quot;max-file&quot;: &quot;3&quot; }<br>}</pre><p>Restart Docker, and know the catch: existing containers keep their old settings until you recreate them. With those limits, my same container sat at 21 MB after 15 seconds and never grew past three files.</p><h3>Run this one now, before the alert</h3><p>You don’t need to wait for a full disk to check the two causes nobody looks for. On any server you own:</p><pre>df -h; df -i; sudo lsof -a +L1 / | head</pre><p>Bytes, inodes, deleted-but-open files: ten seconds, and you’ll know if a surprise is building. Which of the eight has burned you? Tell me in the comments. I’m curious how many people have met #6 for real.</p><p><em>I used AI tools to help research and draft this post. Facts and commands were checked against the official docs as of November 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b4039b2b597" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes for Docker Users: The 8 Concepts You Actually Need]]></title>
            <link>https://medium.com/@mendel.sabb27/kubernetes-for-docker-users-the-8-concepts-you-actually-need-e2bb4e0874c3?source=rss-13001b62630b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2bb4e0874c3</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Mendel Sabbagh]]></dc:creator>
            <pubDate>Sun, 15 Nov 2026 14:31:01 GMT</pubDate>
            <atom:updated>2026-11-15T14:31:01.843Z</atom:updated>
            <content:encoded><![CDATA[<h4>I moved a two-service Compose app onto a real cluster, one line at a time. Most of it maps cleanly. Three parts will bite you.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lq7VeK2JTvlA2mgQA9fYMA.png" /><figcaption>Image by author. Photo: The National Archives (UK), CC BY 3.0, via Wikimedia Commons. Kubernetes logo by Google, Inc. (public domain).</figcaption></figure><p>Your compose.yaml works. docker compose up and you&#39;re done. Then the team says &quot;we&#39;re moving to Kubernetes,&quot; and someone sends you 300 lines of YAML full of ReplicaSets and EndpointSlices.</p><p>Here’s the honest part: you already know most of Kubernetes. It just uses different names. I took a small Compose app and rebuilt it on a local cluster (Kubernetes 1.37 in kind, on a cloud sandbox), one concept at a time. For each of the 8 concepts below you get the Compose line it replaces, a command you can run, and the output I got. Three of them don’t translate cleanly, and those are where Docker people lose an afternoon.</p><h3>The starting point</h3><p>A Python web app that counts visits in Redis. Nothing fancy:</p><pre>services:<br>  web:<br>    image: counter:1.0<br>    ports: [&quot;8080:8000&quot;]<br>    environment:<br>      REDIS_PASSWORD: s3cret-pass<br>    depends_on: [redis]<br>    restart: always<br>    healthcheck:<br>      test: [&quot;CMD&quot;, &quot;python&quot;, &quot;-c&quot;, &quot;...urlopen(&#39;/healthz&#39;)&quot;]<br>  redis:<br>    image: redis:8-alpine<br>    command: [&quot;redis-server&quot;, &quot;--requirepass&quot;, &quot;s3cret-pass&quot;]<br>    volumes: [&quot;redis-data:/data&quot;]<br>volumes:<br>  redis-data:</pre><p>First trap before any YAML: the cluster can’t see images you built locally. With kind you push them in with kind load docker-image counter:1.0. On Docker 29 with the containerd image store, that failed for me with content digest ... not found. This worked:</p><pre>docker save --platform linux/amd64 counter:1.0 -o counter.tar<br>kind load image-archive counter.tar</pre><h3>1. Pod: a container that nobody watches</h3><p>A Pod is one or more containers sharing a network. It’s the closest thing to docker run, and it has the same weakness:</p><pre>$ kubectl run web --image=counter:1.0<br>$ kubectl delete pod web<br>$ kubectl get pods<br>No resources found in counter namespace.</pre><p>Deleted means gone. You almost never create Pods by hand.</p><h3>2. Deployment: restart: always plus replicas</h3><p>A Deployment keeps N copies of a Pod alive. Delete one, and a new one shows up with a new name:</p><pre>$ kubectl delete pod web-798bcf5974-5hqmj<br>$ kubectl get pods -l app=web<br>web-798bcf5974-7wg8h   1/1   Running   0   118s<br>web-798bcf5974-qs5h8   1/1   Running   0   36s<br>web-798bcf5974-vwqrc   1/1   Running   0   118s</pre><p>Look at that 36s. The delete itself took <strong>30.9 seconds</strong>. My Python app ran as PID 1 and ignored SIGTERM, so Kubernetes waited out the default 30-second grace period and then killed it. Every rollout leaves old Pods hanging for those 30 seconds. One line in the app fixed it:</p><pre>signal.signal(signal.SIGTERM, lambda *_: sys.exit(0))</pre><p>The next delete took 0.8 seconds.</p><h3>3. Service: the DNS name Compose gave you for free</h3><p>In Compose, redis resolves because it&#39;s a service name. In Kubernetes, a Pod name changes every restart, so you create a Service: a stable name and IP in front of every Pod with a matching label (app: web). Labels are the glue. Get one character wrong and the Service points at nothing.</p><p>Six requests to http://web/ from inside the cluster hit all three Pods:</p><pre>hello from web-798bcf5974-7wg8h, visit #7<br>hello from web-798bcf5974-vwqrc, visit #8<br>hello from web-798bcf5974-5hqmj, visit #9</pre><h3>4. ports: has no single twin</h3><p>8080:8000 in Compose turns into one of three things. kubectl port-forward svc/web 8080:80 for your laptop. A Service of type: LoadBalancer on a cloud. Or Gateway API for real HTTP routing (the Kubernetes docs now recommend Gateway over Ingress, which is frozen).</p><p>The port-forward surprise: it’s not load-balanced. Four requests through it, one Pod every time:</p><pre>hello from web-798bcf5974-5hqmj, visit #13<br>hello from web-798bcf5974-5hqmj, visit #14<br>hello from web-798bcf5974-5hqmj, visit #15<br>hello from web-798bcf5974-5hqmj, visit #16</pre><p>If you’re testing load balancing, port-forward will lie to you.</p><h3>5. ConfigMap: your environment: block</h3><p>Non-secret settings move into a ConfigMap, and envFrom loads all of it as environment variables. Same idea as env_file, except it lives in the cluster, not on disk.</p><h3>6. Secret: base64 is not encryption</h3><p>A Secret looks safer than a ConfigMap. It isn’t, by default:</p><pre>$ kubectl get secret redis-auth -o jsonpath={.data.password}<br>czNjcmV0LXBhc3M=<br>$ ... | base64 -d<br>s3cret-pass</pre><p>Anyone who can read Secrets in the namespace can read your password, and the docs say Secrets sit unencrypted in etcd unless you turn on encryption at rest. Lock down who can get secrets, and don&#39;t commit Secret YAML to Git.</p><h3>7. PersistentVolumeClaim: your named volume</h3><p>redis-data: becomes a PersistentVolumeClaim: &quot;I need 1 Gi, mounted at /data.&quot; kind&#39;s default storage class created the disk for me. I deleted the Redis Pod, then scaled Redis to zero and back. The counter carried on from where it stopped (visit #17, then #18). The data lives in the claim, not the Pod.</p><h3>8. Probes: healthcheck: split in two</h3><p>This is the one that matters most. Docker’s healthcheck only <em>labels</em> a container. I stopped Redis under Compose and waited:</p><pre>counter-web-1   Up 39 seconds (unhealthy)<br>health=unhealthy restarts=0 running=true</pre><p>Docker kept sending traffic to it. Kubernetes splits the job into two probes. A <strong>readiness</strong> probe failing takes the Pod out of the Service. With Redis gone, all three went 0/1 and stopped getting traffic, with zero restarts. When Redis came back, they rejoined by themselves.</p><p>A <strong>liveness</strong> probe failing restarts the container. So the classic mistake is pointing liveness at an endpoint that checks the database. I did exactly that, killed Redis, and waited 90 seconds:</p><pre>web-7b8c6f5464-r2qcs   0/1   Running   4 (32s ago)<br>web-7b8c6f5464-r47xs   0/1   Running   4 (31s ago)<br>web-7b8c6f5464-snp7t   0/1   Running   4 (33s ago)</pre><p>One dependency down, and every web Pod is in a restart loop that fixes nothing. Liveness checks “is <em>this process</em> stuck?” (a TCP check on its own port is plenty). Readiness checks “can I serve right now?”</p><h3>And depends_on?</h3><p>It doesn’t exist. I deployed the web app before Redis on purpose. The Pods started, sat at 0/1 because readiness failed, and joined the Service the moment Redis was up. Kubernetes doesn&#39;t give you startup order. It expects your app to retry, and readiness to hide it until it can.</p><h3>So, do you need to relearn everything?</h3><p>No. Pod, Deployment, Service, ConfigMap, Secret and volume claim are your Compose file with new names. That’s a weekend with kind. The real learning is in the three that don’t translate: probes, Secrets, and how traffic actually reaches a Pod. Get those right before you migrate anything that pays the bills.</p><p>Which Compose habit hurt you most when you moved to Kubernetes? Tell me in the comments.</p><p><em>I used AI tools to help research and draft this post. Facts and commands were checked against the official docs as of November 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2bb4e0874c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GitHub Blocks pull_request_target on December 2. You’re Still Not Safe]]></title>
            <link>https://medium.com/@mendel.sabb27/github-blocks-pull-request-target-on-december-2-youre-still-not-safe-dd56ca08deaa?source=rss-13001b62630b------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd56ca08deaa</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Mendel Sabbagh]]></dc:creator>
            <pubDate>Fri, 13 Nov 2026 15:31:02 GMT</pubDate>
            <atom:updated>2026-11-13T15:31:02.639Z</atom:updated>
            <content:encoded><![CDATA[<h4>Public repos lose the trigger by default. I tested three workflows, and the most dangerous one isn’t on GitHub’s list.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BPfn0Ip73aXUyO3mFk-rwA.png" /><figcaption>Image by author. Photo: Dietmar Rabich, CC BY-SA 4.0, via Wikimedia Commons. GitHub logo by GitHub.</figcaption></figure><p>GitHub is about to switch off a workflow trigger that a lot of open source bots depend on, and most maintainers will find out from a red X.</p><p>From December 2, 2026, workflows triggered by pull_request_target are blocked by default in public repositories. GitHub scheduled two test outages (&quot;brownouts&quot;) before that, on November 9 and 16, 16:00 to 18:00 UTC. If a labeler or welcome bot failed in one of those windows, that was the rehearsal.</p><p>The block is a good idea. But it’s aimed at the trigger, not the mistake, so some safe workflows break and some dangerous ones keep running. Here’s how to tell which of yours is which, before the 2nd.</p><h3>What exactly changes?</h3><p>For public repos on GitHub Free, Team and Enterprise Cloud, GitHub adds a default Actions policy that blocks pull_request_target. Private and internal repos are not affected. Neither is GitHub Enterprise Server. If you already have your own event policy, it is not replaced.</p><p>Until December 2 the default policy runs in “evaluate” mode: runs continue, but <strong>Settings → Actions → Policy insights</strong>shows which ones would be blocked. Look there first.</p><h3>Why is GitHub doing this?</h3><p>pull_request_target runs with your repo&#39;s secrets and a write token, even when the PR comes from a stranger&#39;s fork. That&#39;s safe as long as you only run your own code. The classic mistake looks like this:</p><pre>on: pull_request_target<br>jobs:<br>  test:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - uses: actions/checkout@v7<br>        with:<br>          ref: ${{ github.event.pull_request.head.sha }}<br>      - run: npm ci &amp;&amp; npm test<br>        env:<br>          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}</pre><p>The checkout pulls the fork’s code. Then npm test runs it, with your token in the environment. The attacker only has to edit package.json. It&#39;s called a &quot;pwn request&quot;, and GitHub&#39;s own docs name it as the root cause of several supply-chain compromises.</p><h3>How do I find mine?</h3><p>I built a small lab repo with three typical workflows: a labeler, the fork CI above, and a /test comment bot. Then I ran two checks in my sandbox.</p><p>First, what GitHub will block:</p><pre>$ grep -lE &#39;pull_request_target&#39; before/*.yml<br>before/fork-ci.yml<br>before/labeler.yml</pre><p>Second, what is actually dangerous, with zizmor 1.32.0 (pip install zizmor, works offline):</p><pre>$ zizmor --offline before/*.yml | grep -A1 &#39;^error\[dangerous&#39;<br>error[dangerous-triggers]: use of fundamentally insecure workflow trigger<br> --&gt; before/fork-ci.yml:2:1<br>--<br>error[dangerous-triggers]: use of fundamentally insecure workflow trigger<br> --&gt; before/slash-test.yml:2:1</pre><p>Read those two lists side by side. The labeler only adds labels, never touches the PR’s code, and has a two-line permissions:block. zizmor had no trigger complaint about it, yet GitHub will block it. The comment bot is the opposite: zizmor flags it, and GitHub won&#39;t touch it, because it runs on issue_comment.</p><h3>Can I just switch to pull_request?</h3><p>For fork CI, yes, and you should. pull_request runs fork PRs with a read-only token and no secrets:</p><pre>on: pull_request<br>permissions:<br>  contents: read</pre><p>After the change, the trigger finding disappeared from my zizmor run. If your tests truly need a secret, they shouldn’t run on strangers’ code until a maintainer has read it.</p><h3>What if I really need it?</h3><p>A labeler or a “thanks for your first PR” bot is a fair use. Allow it on purpose: <strong>Settings → Actions → Policies</strong>, create an event policy that allows pull_request_target, and target that one workflow file, not the whole repo. Everything else stays blocked.</p><h3>So after December 2, am I safe?</h3><p>No. This is the part most write-ups skip.</p><p>My /test bot checks out refs/pull/&lt;number&gt;/head and runs make test with a deploy key. On a public repo, anyone with a GitHub account can comment /test. GitHub&#39;s docs say it plainly: issue_comment and workflow_run can be pwn requests too. The December 2 block doesn&#39;t cover them.</p><p>There is a second guard. Since v7.0.0, actions/checkout refuses to check out fork PR code in pull_request_target and workflow_rununless you set allow-unsafe-pr-checkout: true. I read the v7.0.1 source: the check only fires for those two events. In issue_comment, it never runs. It also can&#39;t see a git fetch or gh pr checkout in a run: step.</p><p>So for comment bots: check github.event.comment.author_association before doing anything, keep secrets out of the job, and never execute PR code that a maintainer hasn&#39;t read.</p><h3>What’s still unsolved</h3><p>GitHub blocks a trigger name. The real bug is “run a stranger’s code with your secrets”, and no default can see that in YAML. A static checker in CI and a reviewer who knows the pattern still matter more than any policy.</p><p>Before the 2nd: check Policy insights, move fork CI to pull_request, allow the one bot that needs it, then grep for issue_comment.</p><p>Which of your workflows would you have bet was safe?</p><p><em>I used AI tools to help research and draft this post. Facts and commands were checked against the official docs as of November 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd56ca08deaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your GitLab Has a CVSS 10 Problem. Patching Is the Easy Part]]></title>
            <link>https://medium.com/@mendel.sabb27/your-gitlab-has-a-cvss-10-problem-patching-is-the-easy-part-f6164bc4fda4?source=rss-13001b62630b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6164bc4fda4</guid>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Mendel Sabbagh]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 15:31:01 GMT</pubDate>
            <atom:updated>2026-11-11T15:31:01.637Z</atom:updated>
            <content:encoded><![CDATA[<h4>GitLab shipped two max-severity fixes in nine days. I patched a lab in four minutes, then found what the patch doesn’t change.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sDUKLEMVm-QQCka5j0MMmw.png" /><figcaption>Image by author. Photo: NOIRLab/NSF/AURA/T. Slovinský, CC BY 4.0, via Wikimedia Commons.</figcaption></figure><pre>$ curl -s -o /dev/null -w &#39;%{http_code}\n&#39; localhost:8929/users/sign_up<br>200</pre><p>That&#39;s a fresh GitLab 19.5.0 I started in a sandbox this morning, default settings. Anyone who can reach it gets a sign-up page. And 19.5.0 is one of the versions GitLab now rates CVSS 10.</p><p>Quick recap of October. On the 12th, GitLab fixed CVE-2026-97229: under &quot;certain conditions&quot;, an unauthenticated user could run code on the server through a crafted regular expression in a CI/CD config. On the 21st came CVE-2026-110264, the same family, also 10.0, affecting every version since 7.0. On the 29th, CISA added the first one to its list of bugs exploited in the wild.</p><p>On November 2, BleepingComputer reported Shadowserver&#39;s count: more than 11,300 of the roughly 39,000 GitLab servers it tracks were still open to the second bug.</p><p>So I ran the whole fix in a lab: check, back up, upgrade, harden. Here&#39;s how to get out of that 11,300, plus one surprise.</p><h3>Note 1: the version you need is higher than you think</h3><p>The October 12 patch does not fix the October 21 bug. If you patched once and moved on, you&#39;re still exposed.</p><p>The first versions fixed for both, from GitLab&#39;s own CVE record: <strong>19.5.1, 19.4.3, 19.3.6, 19.2.9, 19.1.9, 19.0.10, 18.11.13</strong>.</p><p>On 18.10 or older, there&#39;s no fix on your line at all. GitLab normally backports security fixes only to the current release and the two before it. This time it went back to 18.11, and stopped there.</p><p>Check what you run on the server itself (the version API needs a token):</p><pre>sudo gitlab-rake gitlab:env:info | grep -A1 &#39;GitLab information&#39;<br># Docker:<br>docker exec gitlab cat /opt/gitlab/embedded/service/gitlab-rails/VERSION</pre><p>I put the list in a small script, so nobody compares versions by eye at midnight:</p><pre>$ ./check-version.sh 19.4.2<br>19.4.2: VULNERABLE (needs &gt;= 19.4.3)<br>$ ./check-version.sh 18.10.5<br>18.10.5: VULNERABLE, no fix on this line. Upgrade to a supported line.</pre><p>Don&#39;t stop at the minimum. GitLab shipped another round at the end of October (19.5.3, 19.4.5 and friends). Take the latest patch of your line.</p><h3>Note 2: what the upgrade actually cost</h3><p>Backup first. gitlab-backup create took 40 seconds on my empty instance and ended with a warning worth reading twice: gitlab.rb and gitlab-secrets.json are not in the backup. The secrets file holds the key to your CI/CD variables and 2FA data. Copy /etc/gitlab somewhere safe yourself.</p><p>Then the upgrade: stop the 19.5.0 container, start 19.5.3 on the same volumes. <strong>245 seconds</strong> until the sign-in page answered again.</p><p>That&#39;s an empty instance on 4 CPUs; a real one with data takes longer. Still, minutes of downtime against a 10.0.</p><p>Several versions behind? Don&#39;t jump straight to the latest. GitLab has required upgrade stops (19.2, 19.5, 19.8, 19.11), and background migrations must finish at each.</p><h3>Note 3: ruby -v won&#39;t tell you anything</h3><p>The real bug lives in Onigmo, Ruby&#39;s regex engine. Ruby released fixes on October 23 in 4.0.9, 3.4.12 and 3.3.13. So I checked the Ruby inside both GitLab images:</p><pre>19.5.0  ruby 3.3.12 (2026-07-16 revision 0581089df9)<br>19.5.3  ruby 3.3.12 (2026-07-16 revision 0581089df9)</pre><p>Same string on the fixed build. GitLab patched the Ruby it ships without bumping the version (the libruby.so checksums differ). Trust the GitLab version, not ruby -v.</p><p>The flip side: if you write Ruby, this is your bug too. Ruby&#39;s advisory says any app that compiles a regex from a string an attacker controls is affected, Regexp.timeout doesn&#39;t help, and short patterns can trigger it. Find those spots:</p><pre>grep -rnE &#39;Regexp\.(new|union|compile)\(|/[^/]*#\{&#39; \<br>  --include=&#39;*.rb&#39; app lib</pre><p>On a two-file test app it caught both the Regexp.new(params[:q]) and the /#{s}/ I planted. Then upgrade Ruby.</p><h3>Note 4: close the doors you don&#39;t use</h3><p>GitLab hasn&#39;t published the &quot;certain conditions&quot;. I don&#39;t know them, and I won&#39;t guess. Ruby&#39;s advisory does say the bug fires when the server compiles a regex someone else wrote. So every stranger who can put text into your GitLab is a possible author.</p><p>My fresh instance came with sign-up enabled (admin approval on), public projects allowed and an open explore page. If your GitLab is for your team only, one admin API call shuts that:</p><pre>curl -X PUT -H &quot;PRIVATE-TOKEN: $ADMIN_TOKEN&quot; \<br>  &quot;https://gitlab.example.com/api/v4/application/settings&quot; \<br>  --data &quot;signup_enabled=false&quot; \<br>  --data &quot;restricted_visibility_levels[]=public&quot;</pre><p>After it, /users/sign_up and /explore/projects both answered 302, a redirect to the login page.</p><p>The bigger question: does it need to be on the internet at all? A VPN or IP allowlist won&#39;t replace the patch. It makes the next one a Tuesday task, not a midnight one.</p><h3>Monday morning</h3><ol><li>Run the version check. Below the list? Copy /etc/gitlab, back up, take the latest patch of your line tonight.</li><li>On 18.10 or older? Plan the upgrade path today. There is no patch coming for you.</li><li>Turn off sign-up and public projects unless you really use them, then ask who decided this server should face the internet.</li></ol><p>Is your GitLab reachable from the internet, and does anyone on your team remember why?</p><p><em>I used AI tools to help research and draft this post. Facts and commands were checked against the official docs as of November 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6164bc4fda4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your Logs Cost More Than Your Servers. Here’s a 92% Cut, Tested]]></title>
            <link>https://medium.com/@mendel.sabb27/your-logs-cost-more-than-your-servers-heres-a-92-cut-tested-e7a641ebe7c0?source=rss-13001b62630b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7a641ebe7c0</guid>
            <category><![CDATA[logging]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[opentelemetry]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Mendel Sabbagh]]></dc:creator>
            <pubDate>Mon, 09 Nov 2026 15:31:01 GMT</pubDate>
            <atom:updated>2026-11-09T15:31:01.599Z</atom:updated>
            <content:encoded><![CDATA[<h4>I built the simplest logging pipeline that works, measured it, then rebuilt it in four steps. Every error survived.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0rHegR_ivvpjSXiHeTcLSg.png" /><figcaption>Image by author. Photo: Siarhei Besarab, CC BY-SA 4.0, via Wikimedia Commons.</figcaption></figure><p>57%. That’s the share of 2,050 ITOps and engineering people in Splunk’s State of Observability 2026 who said their telemetry costs more than the infrastructure it watches.</p><p>Read that again. More than half are paying more to look at their servers than to run them.</p><p>My guess is that a lot of that bill is lines nobody will ever read. I wanted to see how much, so I built a noisy service in a lab and pushed its logs through the simplest OpenTelemetry Collector setup that works. Then I rebuilt the pipeline one piece at a time and measured each step. You’ll leave with the config, and a one-liner that finds your own worst offenders.</p><h3>The pipeline everyone starts with</h3><p>The lab: a fake checkout service with three replicas and one hour of JSON logs. About one real request per second, four debug lines per request, Kubernetes probes, load balancer health checks, and a three-minute Redis blip where every replica logs every retry. I chose that mix, so your percentages will differ. The method won’t.</p><p>The starting config is the shortest one that works: read the file, parse the JSON, ship it.</p><pre>receivers:<br>  file_log:<br>    include: [/lab/app.log]<br>    start_at: beginning<br>    operators:<br>      - type: json_parser</pre><p>The log file was 7.1 MB. What the collector sent out (measured as its JSON output) was 26.8 MB, 33,152 records. Yes, bigger than the input.</p><h3>First, find out what you’re paying for</h3><p>Before you touch a config, measure. This groups lines by level and path (or message) and sums their bytes:</p><pre>jq -rR &#39;fromjson? | [.level, (.path // .msg), (tostring|length)] | @tsv&#39; app.log |<br>  awk -F&#39;\t&#39; &#39;{b[$1&quot; &quot;$2]+=$3; n[$1&quot; &quot;$2]++; t+=$3}<br>    END {for (k in b) printf &quot;%5.1f%% %6d lines  %s\n&quot;, 100*b[k]/t, n[k], k}&#39; |<br>  sort -rn | head -8</pre><pre>40.1%   3600 lines  info /api/checkout<br> 20.5%  10803 lines  error redis: connection refused, retrying<br>  7.7%   3240 lines  info /healthz<br>  7.5%   3600 lines  debug price rules applied<br>  ...</pre><p>This was the part I didn’t expect. By line count, the retry storm and the debug lines win. By bytes, the winner is the real checkout request, because every one carries the full request headers, cookie included.</p><p>You need both views, because vendors bill both. Datadog, for example, lists $0.10 per GB ingested and $1.70 per million log events indexed (15-day retention, billed annually). Bytes and line counts are two different bills.</p><h3>Rebuilding it, one change at a time</h3><h3>Stop shipping every line twice</h3><p>That 26.8 MB has a boring cause. json_parser copies the fields into attributes, but the original line stays in the body. Every record travels twice. Move the message into the body and drop the raw timestamp:</p><pre>- type: json_parser<br>        timestamp:<br>          parse_from: attributes.ts<br>          layout: &#39;%Y-%m-%dT%H:%M:%S.%LZ&#39;<br>        severity:<br>          parse_from: attributes.level<br>      - type: move<br>        from: attributes.msg<br>        to: body<br>      - type: remove<br>        field: attributes.ts</pre><p>26.8 MB down to 18.1 MB. Zero information lost.</p><h3>Drop what nobody reads</h3><pre>filter/noise:<br>    error_mode: ignore<br>    logs:<br>      log_record:<br>        - log.attributes[&quot;path&quot;] == &quot;/healthz&quot; and log.attributes[&quot;status&quot;] == 200<br>        - log.attributes[&quot;path&quot;] == &quot;/readyz&quot; and log.attributes[&quot;status&quot;] == 200<br>        - log.severity_number &lt; SEVERITY_NUMBER_INFO</pre><p>Only health checks that passed get dropped. A failing probe still gets through, and that’s the one you want. Records: 33,152 down to 14,432.</p><h3>Collapse the retry storm</h3><pre>log_dedup:<br>    interval: 10s<br>    log_count_attribute: repeat_count<br>    conditions:<br>      - log.severity_number &gt;= SEVERITY_NUMBER_ERROR</pre><p>I replayed the Redis blip in real time for this one. 10,803 identical retry lines became 57 records, each with repeat_count: 200or so. Two things to know: the deduplicated line is emitted at the end of each 10-second window, and it carries the collector&#39;s time plus first_observed_timestamp and last_observed_timestamp, not your app&#39;s timestamps. Fine for a retry loop. Think twice before deduplicating anything you alert on to the second.</p><p>The other error in the lab, a payment timeout, has a unique request ID per line, so it passed through untouched.</p><h3>Cut the fat fields</h3><pre>transform/trim:<br>    error_mode: ignore<br>    log_statements:<br>      - delete_key(log.attributes, &quot;headers&quot;)</pre><p>When did you last search your logs for an accept-language header? The request ID stays, so you can still follow a request.</p><h3>Before and after</h3><pre>records    collector output<br>starting config        33,152    26.8 MB<br>body fix               33,152    18.1 MB<br>+ drop noise           14,432     9.7 MB<br>+ dedup retries         3,686     5.4 MB<br>+ trim headers          3,686     2.2 MB</pre><p>That’s 92% fewer bytes and 89% fewer records. To be fair about it: a third of the byte cut is just undoing the double-shipping. Against the fixed baseline, the real cleanup is still 88%.</p><p>What survived: every failed request, every error (counted), every checkout with its request ID.</p><p>Two small annoyances on collector v0.164.0: filelog and logdedup still work but log deprecation warnings (the new names are file_log and log_dedup), and OTTL rewrites attributes[...] to log.attributes[...] with an info message. Write the new forms and the logs stay quiet. Validate before you deploy with otelcol-contrib validate --config your.yaml.</p><h3>Run this before your next bill</h3><p>You don’t need the collector to start. Save an hour of logs from one pod and run the same one-liner on the file:</p><pre>kubectl logs deploy/&lt;your-app&gt; --since=1h &gt; app.log</pre><p>Whatever sits at the top is your first filter rule. It takes five minutes, and it’s the difference between “logs are expensive” and knowing exactly which line costs you money.</p><p>What’s at the top of yours? I’d bet on health checks, but I’d love to be proven wrong in the comments.</p><p><em>I used AI tools to help research and draft this post. Facts and commands were checked against the official docs as of November 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7a641ebe7c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>