<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>saint</title>
    <link>https://avys.group.lt/saint/</link>
    <description>scrapbook of a sysadmin</description>
    <pubDate>Mon, 13 Apr 2026 22:01:45 +0000</pubDate>
    <item>
      <title>When Free Isn&#39;t Forever: Navigating the Bitnami Deprecation</title>
      <link>https://avys.group.lt/saint/when-free-isnt-forever-navigating-the-bitnami-deprecation</link>
      <description>&lt;![CDATA[Date: November 21, 2025&#xA;Author: Infrastructure Team @ River.group.lt&#xA;Tags: Infrastructure, Open Source, Vendor Lock-in, Lessons Learned&#xA;&#xA;---&#xA;&#xA;TL;DR&#xA;&#xA;Broadcom&#39;s acquisition of VMware (and Bitnami) resulted in the deprecation of free container images, affecting thousands of production deployments worldwide. Our Mastodon instance at river.group.lt was impacted, but we turned this crisis into an opportunity to build more resilient infrastructure. Here&#39;s what happened and what we learned.&#xA;&#xA;---&#xA;&#xA;The Wake-Up Call&#xA;&#xA;On November 21st, 2025, while upgrading our Mastodon instance from v4.5.1 to v4.5.2, we discovered something concerning: several Elasticsearch pods were stuck in CrashLoopBackOff. The error was cryptic:&#xA;&#xA;/bin/bash: line 1: sysctl: command not found&#xA;&#xA;This wasn&#39;t a configuration issue or a bug in our deployment. This was the canary in the coal mine for a much larger industry-wide problem.&#xA;&#xA;What Actually Happened&#xA;&#xA;The Bitnami Story&#xA;&#xA;If you&#39;ve deployed anything on Kubernetes in the past few years, you&#39;ve probably used Bitnami Helm charts. They were convenient, well-maintained, and free. The PostgreSQL chart, Redis chart, Elasticsearch chart—all trusted by thousands of organizations.&#xA;&#xA;Then came the acquisition:&#xA;August 2021: VMware acquired Bitnami&#xA;2024: Broadcom acquired VMware&#xA;August 28, 2025: Bitnami stopped publishing free Debian-based container images&#xA;September 29, 2025: All images moved to a read-only &#34;legacy&#34; repository&#xA;&#xA;The new pricing? $50,000 to $72,000 per year for &#34;Bitnami Secure&#34; subscriptions.&#xA;&#xA;Our Impact&#xA;&#xA;Our entire Elasticsearch cluster was running on Bitnami images:&#xA;4 Elasticsearch pods failing to start&#xA;Search functionality degraded&#xA;Running on unmaintained images with no security updates&#xA;Init containers expecting tools that no longer existed in the slimmed-down legacy images&#xA;&#xA;But we weren&#39;t alone. This affected:&#xA;Major Kubernetes distributions&#xA;Thousands of Helm chart deployments&#xA;Production instances worldwide&#xA;&#xA;The Detective Work&#xA;&#xA;The debugging journey was educational:&#xA;&#xA;Pod events → Init container crashes&#xA;Container logs → Missing sysctl command in debian:stable-slim&#xA;Web research → Discovered the Bitnami deprecation&#xA;Community investigation → Found Mastodon&#39;s response (new official chart)&#xA;System verification → Realized our node already had correct kernel settings&#xA;&#xA;The init container was trying to set vm.maxmapcount=262144 for Elasticsearch, but:&#xA;The container image no longer included the required tools&#xA;Our node already had the correct settings&#xA;The init container was solving a problem that didn&#39;t exist&#xA;&#xA;Classic case of inherited configuration outliving its purpose.&#xA;&#xA;The Fix (and the Plan)&#xA;&#xA;We took a two-phase approach:&#xA;&#xA;Phase 1: Immediate Stabilization&#xA;&#xA;What we did right away:&#xA;Disabled the unnecessary init container&#xA;Scaled down to single-node Elasticsearch (appropriate for our size)&#xA;Cleared old cluster state by deleting persistent volumes&#xA;Rebuilt the search index from scratch&#xA;&#xA;Result: All systems operational within 2 hours, search functionality restored.&#xA;&#xA;Phase 2: Strategic Migration&#xA;&#xA;We didn&#39;t just patch the problem—we planned a proper solution:&#xA;&#xA;Created comprehensive migration plan (MIGRATION-TO-NEW-CHART.md):&#xA;Migrate to official Mastodon Helm chart (removes all Bitnami dependencies)&#xA;Deploy OpenSearch instead of Elasticsearch (Apache 2.0 licensed)&#xA;Keep our existing DragonflyDB (we were already ahead of the curve!)&#xA;Timeline: Phased approach over next quarter&#xA;&#xA;The new Mastodon chart removes bundled dependencies entirely, expecting you to provide your own:&#xA;PostgreSQL → CloudNativePG or managed service&#xA;Redis → DragonflyDB, Valkey, or managed service&#xA;Elasticsearch → OpenSearch or Elastic&#39;s official operator&#xA;&#xA;This is actually better architecture—no magic, full control, and proper separation of concerns.&#xA;&#xA;What We Learned&#xA;&#xA;1. Vendor Lock-in Happens Gradually&#xA;&#xA;We didn&#39;t consciously choose vendor lock-in. We just used convenient, well-maintained Helm charts. Before we knew it:&#xA;PostgreSQL: Bitnami&#xA;Redis: Bitnami&#xA;Elasticsearch: Bitnami&#xA;&#xA;One vendor decision affected our entire stack.&#xA;&#xA;New rule: Diversify dependency sources. Use official images where possible.&#xA;&#xA;2. &#34;Open Source&#34; Doesn&#39;t Mean &#34;Free Forever&#34;&#xA;&#xA;Recent examples of this pattern:&#xA;HashiCorp → IBM (Terraform moved to BSL license)&#xA;Redis → Redis Labs (licensing restrictions added)&#xA;Elasticsearch → Elastic NV (moved to SSPL)&#xA;Bitnami → Broadcom (deprecated free tier)&#xA;&#xA;The pattern: Company acquisition → Business model change → Service monetization&#xA;&#xA;New rule: For critical infrastructure, always have a migration plan ready.&#xA;&#xA;3. Community Signals are Early Warnings&#xA;&#xA;The Mastodon community started discussing this in August 2025. The official chart team had already removed Bitnami dependencies months before our incident. We could have been proactive instead of reactive.&#xA;&#xA;New rule: Subscribe to community channels for critical dependencies. Monitor GitHub issues, Reddit discussions, and release notes.&#xA;&#xA;4. Version Pinning Isn&#39;t Optional&#xA;&#xA;We were using elasticsearch:8 instead of elasticsearch:8.18.0. When the vendor deprecated tags, we had no control over what :8 meant anymore.&#xA;&#xA;New rule: Always pin to specific versions. Use image digests for critical services.&#xA;&#xA;5. Init Containers Need Regular Audits&#xA;&#xA;Our init container was setting kernel parameters that:&#xA;Were already set on the host&#xA;May have been necessary years ago&#xA;Nobody had questioned recently&#xA;&#xA;New rule: Audit init containers quarterly. Verify they&#39;re still necessary.&#xA;&#xA;The Bigger Picture&#xA;&#xA;This incident is part of a broader trend in the cloud-native ecosystem:&#xA;&#xA;The Consolidation Era:&#xA;Big Tech acquiring open-source companies&#xA;Monetization pressure from private equity&#xA;Shift from &#34;community-first&#34; to &#34;enterprise-first&#34;&#xA;&#xA;The Community Response:&#xA;OpenTofu (Terraform fork)&#xA;Valkey (Redis fork)&#xA;OpenSearch (Elasticsearch fork)&#xA;New Mastodon chart (Bitnami-free)&#xA;&#xA;The open-source community is resilient. When a vendor tries to close the garden, the community forks and continues.&#xA;&#xA;Our Action Plan&#xA;&#xA;Immediate (Done ✅)&#xA;[x] Fixed Elasticsearch crashes&#xA;[x] Restored search functionality&#xA;[x] Documented everything&#xA;[x] Created migration plan&#xA;&#xA;Short-term &#xA;[ ] Add monitoring alerts for pod failures&#xA;[ ] Pin all container image versions&#xA;[ ] Deploy OpenSearch for testing&#xA;&#xA;Long-term &#xA;[ ] Migrate to official Mastodon chart&#xA;[ ] Consider CloudNativePG for PostgreSQL&#xA;[ ] Regular dependency health audits&#xA;&#xA;What You Should Do&#xA;&#xA;If you&#39;re running infrastructure on Kubernetes:&#xA;&#xA;1. Audit Your Dependencies&#xA;&#xA;Find all Bitnami images&#xA;kubectl get pods --all-namespaces -o json | \&#xA;  jq -r &#39;.items[].spec.containers[].image&#39; | \&#xA;  grep bitnami | sort -u&#xA;&#xA;2. Check Your Helm Charts&#xA;&#xA;List all Helm releases using Bitnami charts&#xA;helm list --all-namespaces -o json | \&#xA;  jq -r &#39;.[] | select(.chart | contains(&#34;bitnami&#34;))&#39;&#xA;&#xA;3. Create Migration Plans&#xA;&#xA;Don&#39;t panic-migrate. Create proper plans:&#xA;Document current state&#xA;Research alternatives&#xA;Test migrations in non-production&#xA;Schedule maintenance windows&#xA;Have rollback procedures ready&#xA;&#xA;4. Learn from Our Mistakes&#xA;&#xA;We&#39;ve documented everything:&#xA;Migration plan: Step-by-step guide to official Mastodon chart&#xA;Retrospective: What went wrong and why&#xA;Lessons learned: Patterns to avoid vendor lock-in&#xA;&#xA;Resources&#xA;&#xA;If you&#39;re dealing with similar issues:&#xA;&#xA;Bitnami Alternatives:&#xA;PostgreSQL: Official images, CloudNativePG&#xA;Redis: DragonflyDB, Valkey&#xA;Elasticsearch: OpenSearch, ECK&#xA;&#xA;Mastodon Resources:&#xA;New Official Chart&#xA;Migration Guide&#xA;&#xA;Community Discussion:&#xA;Bitnami Deprecation Issue&#xA;Reddit Discussion&#xA;&#xA;Closing Thoughts&#xA;&#xA;This incident reminded us of an important principle: Infrastructure should be boring. We want our database to just work, our cache to be reliable, and our search to be fast. We don&#39;t want vendor drama.&#xA;&#xA;The irony? Bitnami made things &#34;boring&#34; by providing convenient, pre-packaged solutions. But convenience can become dependency. Dependency can become lock-in. And lock-in can become a crisis when business models change.&#xA;&#xA;The path forward is clear:&#xA;Use official images where possible&#xA;Diversify dependency sources&#xA;Pin versions explicitly&#xA;Monitor community signals&#xA;Always have a Plan B&#xA;&#xA;Our Mastodon instance at river.group.lt is now healthier than before. All pods are green, search is working, and we have a clear migration path to even better infrastructure.&#xA;&#xA;Sometimes a crisis is just the push you need to build something more resilient.&#xA;&#xA;---&#xA;&#xA;Discussion&#xA;&#xA;We&#39;d love to hear your experiences:&#xA;Have you been affected by the Bitnami deprecation?&#xA;What alternatives are you using?&#xA;What lessons have you learned about vendor dependencies?&#xA;&#xA;---&#xA;&#xA;About the Author: This post is from the infrastructure team maintaining river.group.lt, a Mastodon instance running the glitch-soc fork. We believe in transparent operations and sharing knowledge with the community.&#xA;&#xA;License: This post and associated migration documentation are published under CC BY-SA 4.0. Feel free to adapt for your own use.&#xA;&#xA;Updates:&#xA;2025-11-21: Initial publication&#xA;Search index rebuild completed successfully&#xA;All systems operational&#xA;&#xA;---&#xA;&#xA;P.S. - If you&#39;re running a Mastodon instance and need help with migration planning, reach out. We&#39;ve documented everything and we&#39;re happy to help.&#xA;&#xA;Comment in the Fediverse @saint@river.group.lt]]&gt;</description>
      <content:encoded><![CDATA[<p><strong>Date</strong>: November 21, 2025
<strong>Author</strong>: Infrastructure Team @ River.group.lt
<strong>Tags</strong>: Infrastructure, Open Source, Vendor Lock-in, Lessons Learned</p>

<hr>

<h2 id="tl-dr">TL;DR</h2>

<p>Broadcom&#39;s acquisition of VMware (and Bitnami) resulted in the deprecation of free container images, affecting thousands of production deployments worldwide. Our Mastodon instance at river.group.lt was impacted, but we turned this crisis into an opportunity to build more resilient infrastructure. Here&#39;s what happened and what we learned.</p>

<hr>

<h2 id="the-wake-up-call">The Wake-Up Call</h2>

<p>On November 21st, 2025, while upgrading our Mastodon instance from v4.5.1 to v4.5.2, we discovered something concerning: several Elasticsearch pods were stuck in <code>CrashLoopBackOff</code>. The error was cryptic:</p>

<pre><code>/bin/bash: line 1: sysctl: command not found
</code></pre>

<p>This wasn&#39;t a configuration issue or a bug in our deployment. This was the canary in the coal mine for a much larger industry-wide problem.</p>

<h2 id="what-actually-happened">What Actually Happened</h2>

<h3 id="the-bitnami-story">The Bitnami Story</h3>

<p>If you&#39;ve deployed anything on Kubernetes in the past few years, you&#39;ve probably used Bitnami Helm charts. They were convenient, well-maintained, and free. The PostgreSQL chart, Redis chart, Elasticsearch chart—all trusted by thousands of organizations.</p>

<p>Then came the acquisition:
– <strong>August 2021</strong>: VMware acquired Bitnami
– <strong>2024</strong>: Broadcom acquired VMware
– <strong>August 28, 2025</strong>: Bitnami stopped publishing free Debian-based container images
– <strong>September 29, 2025</strong>: All images moved to a read-only “legacy” repository</p>

<p>The new pricing? <strong>$50,000 to $72,000 per year</strong> for “Bitnami Secure” subscriptions.</p>

<h3 id="our-impact">Our Impact</h3>

<p>Our entire Elasticsearch cluster was running on Bitnami images:
– 4 Elasticsearch pods failing to start
– Search functionality degraded
– Running on unmaintained images with no security updates
– Init containers expecting tools that no longer existed in the slimmed-down legacy images</p>

<p>But we weren&#39;t alone. This affected:
– Major Kubernetes distributions
– Thousands of Helm chart deployments
– Production instances worldwide</p>

<h2 id="the-detective-work">The Detective Work</h2>

<p>The debugging journey was educational:</p>
<ol><li><strong>Pod events</strong> → Init container crashes</li>
<li><strong>Container logs</strong> → Missing <code>sysctl</code> command in <code>debian:stable-slim</code></li>
<li><strong>Web research</strong> → Discovered the Bitnami deprecation</li>
<li><strong>Community investigation</strong> → Found Mastodon&#39;s response (new official chart)</li>
<li><strong>System verification</strong> → Realized our node already had correct kernel settings</li></ol>

<p>The init container was trying to set <code>vm.max_map_count=262144</code> for Elasticsearch, but:
– The container image no longer included the required tools
– Our node already had the correct settings
– The init container was solving a problem that didn&#39;t exist</p>

<p>Classic case of inherited configuration outliving its purpose.</p>

<h2 id="the-fix-and-the-plan">The Fix (and the Plan)</h2>

<p>We took a two-phase approach:</p>

<h3 id="phase-1-immediate-stabilization">Phase 1: Immediate Stabilization</h3>

<p><strong>What we did right away:</strong>
1. Disabled the unnecessary init container
2. Scaled down to single-node Elasticsearch (appropriate for our size)
3. Cleared old cluster state by deleting persistent volumes
4. Rebuilt the search index from scratch</p>

<p><strong>Result</strong>: All systems operational within 2 hours, search functionality restored.</p>

<h3 id="phase-2-strategic-migration">Phase 2: Strategic Migration</h3>

<p>We didn&#39;t just patch the problem—we planned a proper solution:</p>

<p><strong>Created comprehensive migration plan</strong> (<code>MIGRATION-TO-NEW-CHART.md</code>):
– Migrate to official Mastodon Helm chart (removes all Bitnami dependencies)
– Deploy OpenSearch instead of Elasticsearch (Apache 2.0 licensed)
– Keep our existing DragonflyDB (we were already ahead of the curve!)
– Timeline: Phased approach over next quarter</p>

<p>The new Mastodon chart removes bundled dependencies entirely, expecting you to provide your own:
– PostgreSQL → CloudNativePG or managed service
– Redis → DragonflyDB, Valkey, or managed service
– Elasticsearch → OpenSearch or Elastic&#39;s official operator</p>

<p>This is actually <strong>better architecture</strong>—no magic, full control, and proper separation of concerns.</p>

<h2 id="what-we-learned">What We Learned</h2>

<h3 id="1-vendor-lock-in-happens-gradually">1. <strong>Vendor Lock-in Happens Gradually</strong></h3>

<p>We didn&#39;t consciously choose vendor lock-in. We just used convenient, well-maintained Helm charts. Before we knew it:
– PostgreSQL: Bitnami
– Redis: Bitnami
– Elasticsearch: Bitnami</p>

<p>One vendor decision affected our entire stack.</p>

<p><strong>New rule</strong>: Diversify dependency sources. Use official images where possible.</p>

<h3 id="2-open-source-doesn-t-mean-free-forever">2. <strong>“Open Source” Doesn&#39;t Mean “Free Forever”</strong></h3>

<p>Recent examples of this pattern:
– <strong>HashiCorp</strong> → IBM (Terraform moved to BSL license)
– <strong>Redis</strong> → Redis Labs (licensing restrictions added)
– <strong>Elasticsearch</strong> → Elastic NV (moved to SSPL)
– <strong>Bitnami</strong> → Broadcom (deprecated free tier)</p>

<p>The pattern: Company acquisition → Business model change → Service monetization</p>

<p><strong>New rule</strong>: For critical infrastructure, always have a migration plan ready.</p>

<h3 id="3-community-signals-are-early-warnings">3. <strong>Community Signals are Early Warnings</strong></h3>

<p>The Mastodon community started discussing this in August 2025. The official chart team had already removed Bitnami dependencies months before our incident. We could have been proactive instead of reactive.</p>

<p><strong>New rule</strong>: Subscribe to community channels for critical dependencies. Monitor GitHub issues, Reddit discussions, and release notes.</p>

<h3 id="4-version-pinning-isn-t-optional">4. <strong>Version Pinning Isn&#39;t Optional</strong></h3>

<p>We were using <code>elasticsearch:8</code> instead of <code>elasticsearch:8.18.0</code>. When the vendor deprecated tags, we had no control over what <code>:8</code> meant anymore.</p>

<p><strong>New rule</strong>: Always pin to specific versions. Use image digests for critical services.</p>

<h3 id="5-init-containers-need-regular-audits">5. <strong>Init Containers Need Regular Audits</strong></h3>

<p>Our init container was setting kernel parameters that:
– Were already set on the host
– May have been necessary years ago
– Nobody had questioned recently</p>

<p><strong>New rule</strong>: Audit init containers quarterly. Verify they&#39;re still necessary.</p>

<h2 id="the-bigger-picture">The Bigger Picture</h2>

<p>This incident is part of a broader trend in the cloud-native ecosystem:</p>

<p><strong>The Consolidation Era</strong>:
– Big Tech acquiring open-source companies
– Monetization pressure from private equity
– Shift from “community-first” to “enterprise-first”</p>

<p><strong>The Community Response</strong>:
– OpenTofu (Terraform fork)
– Valkey (Redis fork)
– OpenSearch (Elasticsearch fork)
– New Mastodon chart (Bitnami-free)</p>

<p>The open-source community is resilient. When a vendor tries to close the garden, the community forks and continues.</p>

<h2 id="our-action-plan">Our Action Plan</h2>

<h3 id="immediate-done">Immediate (Done ✅)</h3>
<ul><li>[x] Fixed Elasticsearch crashes</li>
<li>[x] Restored search functionality</li>
<li>[x] Documented everything</li>
<li>[x] Created migration plan</li></ul>

<h3 id="short-term">Short-term</h3>
<ul><li>[ ] Add monitoring alerts for pod failures</li>
<li>[ ] Pin all container image versions</li>
<li>[ ] Deploy OpenSearch for testing</li></ul>

<h3 id="long-term">Long-term</h3>
<ul><li>[ ] Migrate to official Mastodon chart</li>
<li>[ ] Consider CloudNativePG for PostgreSQL</li>
<li>[ ] Regular dependency health audits</li></ul>

<h2 id="what-you-should-do">What You Should Do</h2>

<p>If you&#39;re running infrastructure on Kubernetes:</p>

<h3 id="1-audit-your-dependencies">1. Audit Your Dependencies</h3>

<pre><code class="language-bash"># Find all Bitnami images
kubectl get pods --all-namespaces -o json | \
  jq -r &#39;.items[].spec.containers[].image&#39; | \
  grep bitnami | sort -u
</code></pre>

<h3 id="2-check-your-helm-charts">2. Check Your Helm Charts</h3>

<pre><code class="language-bash"># List all Helm releases using Bitnami charts
helm list --all-namespaces -o json | \
  jq -r &#39;.[] | select(.chart | contains(&#34;bitnami&#34;))&#39;
</code></pre>

<h3 id="3-create-migration-plans">3. Create Migration Plans</h3>

<p>Don&#39;t panic-migrate. Create proper plans:
– Document current state
– Research alternatives
– Test migrations in non-production
– Schedule maintenance windows
– Have rollback procedures ready</p>

<h3 id="4-learn-from-our-mistakes">4. Learn from Our Mistakes</h3>

<p>We&#39;ve documented everything:
– <strong>Migration plan</strong>: Step-by-step guide to official Mastodon chart
– <strong>Retrospective</strong>: What went wrong and why
– <strong>Lessons learned</strong>: Patterns to avoid vendor lock-in</p>

<h2 id="resources">Resources</h2>

<p>If you&#39;re dealing with similar issues:</p>

<p><strong>Bitnami Alternatives:</strong>
– PostgreSQL: <a href="https://hub.docker.com/_/postgres" rel="nofollow">Official images</a>, <a href="https://cloudnative-pg.io/" rel="nofollow">CloudNativePG</a>
– Redis: <a href="https://www.dragonflydb.io/" rel="nofollow">DragonflyDB</a>, <a href="https://valkey.io/" rel="nofollow">Valkey</a>
– Elasticsearch: <a href="https://opensearch.org/" rel="nofollow">OpenSearch</a>, <a href="https://www.elastic.co/elastic-cloud-kubernetes" rel="nofollow">ECK</a></p>

<p><strong>Mastodon Resources:</strong>
– <a href="https://github.com/mastodon/helm-charts" rel="nofollow">New Official Chart</a>
– <a href="https://github.com/mastodon/helm-charts/blob/main/charts/mastodon/MIGRATION.md" rel="nofollow">Migration Guide</a></p>

<p><strong>Community Discussion:</strong>
– <a href="https://github.com/bitnami/charts/issues/35164" rel="nofollow">Bitnami Deprecation Issue</a>
– <a href="https://www.reddit.com/r/kubernetes/comments/bitnami" rel="nofollow">Reddit Discussion</a></p>

<h2 id="closing-thoughts">Closing Thoughts</h2>

<p>This incident reminded us of an important principle: <strong>Infrastructure should be boring</strong>. We want our database to just work, our cache to be reliable, and our search to be fast. We don&#39;t want vendor drama.</p>

<p>The irony? Bitnami made things “boring” by providing convenient, pre-packaged solutions. But convenience can become dependency. Dependency can become lock-in. And lock-in can become a crisis when business models change.</p>

<p>The path forward is clear:
1. Use official images where possible
2. Diversify dependency sources
3. Pin versions explicitly
4. Monitor community signals
5. Always have a Plan B</p>

<p>Our Mastodon instance at <a href="https://river.group.lt" rel="nofollow">river.group.lt</a> is now healthier than before. All pods are green, search is working, and we have a clear migration path to even better infrastructure.</p>

<p>Sometimes a crisis is just the push you need to build something more resilient.</p>

<hr>

<h2 id="discussion">Discussion</h2>

<p>We&#39;d love to hear your experiences:
– Have you been affected by the Bitnami deprecation?
– What alternatives are you using?
– What lessons have you learned about vendor dependencies?</p>

<hr>

<p><strong>About the Author</strong>: This post is from the infrastructure team maintaining river.group.lt, a Mastodon instance running the glitch-soc fork. We believe in transparent operations and sharing knowledge with the community.</p>

<p><strong>License</strong>: This post and associated migration documentation are published under CC BY-SA 4.0. Feel free to adapt for your own use.</p>

<p><strong>Updates</strong>:
– 2025-11-21: Initial publication
– Search index rebuild completed successfully
– All systems operational</p>

<hr>

<p><em>P.S. – If you&#39;re running a Mastodon instance and need help with migration planning, reach out. We&#39;ve documented everything and we&#39;re happy to help.</em></p>

<p>Comment in the Fediverse <a href="https://avys.group.lt/@/saint@river.group.lt" class="u-url mention" rel="nofollow">@<span>saint@river.group.lt</span></a></p>
]]></content:encoded>
      <guid>https://avys.group.lt/saint/when-free-isnt-forever-navigating-the-bitnami-deprecation</guid>
      <pubDate>Fri, 21 Nov 2025 22:57:17 +0000</pubDate>
    </item>
    <item>
      <title>How a Single Docker Tag Cost Us 51 Minutes of Downtime</title>
      <link>https://avys.group.lt/saint/how-a-single-docker-tag-cost-us-51-minutes-of-downtime</link>
      <description>&lt;![CDATA[A Tale of Kubernetes Image Caching and What We Learned&#xA;&#xA;TL;DR: Rebuilt a Docker image with the same tag. Kubernetes cached the old broken image. Pods crashed for 51 minutes. The fix? One line: imagePullPolicy: Always. Here&#39;s the full story.&#xA;&#xA;---&#xA;&#xA;The Setup&#xA;&#xA;It was a Sunday morning. We were upgrading BookWyrm (a federated social reading platform) from v0.8.1 to v0.8.2 on our Kubernetes cluster. The plan was simple:&#xA;&#xA;Update the version tag&#xA;Trigger the GitHub Actions workflow&#xA;Wait for the build&#xA;Deploy&#xA;Celebrate&#xA;&#xA;What could go wrong?&#xA;&#xA;---&#xA;&#xA;Everything Goes Wrong&#xA;&#xA;9:20 AM: The Deployment&#xA;&#xA;I triggered the workflow. GitHub Actions spun up, built the Docker image, pushed it to the registry, and deployed to Kubernetes.&#xA;&#xA;✓ Build complete&#xA;✓ Image pushed: release-0.8.2&#xA;✓ Deployment applied&#xA;&#xA;Looking good! I watched the pods start rolling out.&#xA;&#xA;9:24 AM: The Crash&#xA;&#xA;NAME                   READY   STATUS&#xA;web-86f4676f8b-zwgfs   0/1     CrashLoopBackOff&#xA;&#xA;Every. Single. Pod. Crashed.&#xA;&#xA;I pulled the logs:&#xA;&#xA;ModuleNotFoundError: No module named &#39;bookwyrm&#39;&#xA;&#xA;The entire BookWyrm application was missing from the container.&#xA;&#xA;The Investigation&#xA;&#xA;I dove into the Dockerfile. We had accidentally used the upstream bookwyrm/Dockerfile instead of our custom one. That Dockerfile only copied requirements.txt - not the actual application code.&#xA;&#xA;The broken Dockerfile&#xA;FROM python:3.10&#xA;COPY requirements.txt .&#xA;RUN pip install -r requirements.txt&#xA;... but WHERE&#39;S THE CODE? 😱&#xA;&#xA;Classic. Easy fix!&#xA;&#xA;---&#xA;&#xA;The First &#34;Fix&#34; (That Wasn&#39;t)&#xA;&#xA;10:37 AM: The Quick Fix&#xA;&#xA;I created a fix commit that switched to the correct Dockerfile:&#xA;&#xA;The correct Dockerfile&#xA;FROM python:3.10&#xA;RUN git clone https://github.com/bookwyrm-social/bookwyrm .&#xA;RUN git checkout v0.8.2&#xA;RUN pip install -r requirements.txt&#xA;Now we have the code!&#xA;&#xA;I committed the changes... and forgot to push to GitHub.&#xA;&#xA;Then I triggered the workflow again.&#xA;&#xA;Naturally, GitHub Actions built from the old code (because I hadn&#39;t pushed). The broken image was rebuilt and redeployed.&#xA;&#xA;Pods still crashing. Facepalm moment #1.&#xA;&#xA;10:55 AM: Actually Pushed This Time&#xA;&#xA;I realized my mistake, pushed the commits, and triggered the workflow again.&#xA;&#xA;This time the build actually used the fixed Dockerfile. I watched it clone BookWyrm, install dependencies, everything. The build logs looked perfect:&#xA;&#xA;9 [ 5/10] RUN git clone https://github.com/bookwyrm-social/bookwyrm .&#xA;9 0.153 Cloning into &#39;.&#39;...&#xA;9 DONE 5.1s&#xA;&#xA;Success! The image was built correctly and pushed.&#xA;&#xA;I watched the pods roll out... and they crashed again.&#xA;&#xA;ModuleNotFoundError: No module named &#39;bookwyrm&#39;&#xA;&#xA;The exact same error.&#xA;&#xA;This made no sense. The image was built correctly. I verified the build logs. The code was definitely in the image. What was happening?&#xA;&#xA;---&#xA;&#xA;The Real Problem&#xA;&#xA;I checked what image the pods were actually running:&#xA;&#xA;kubectl get pod web-c98d458c4-x5p6z -o jsonpath=&#39;{.status.containerStatuses[0].imageID}&#39;&#xA;&#xA;ghcr.io/nycterent/ziurkes/bookwyrm@sha256:934ea0399adad...&#xA;&#xA;Then I checked what digest we just pushed:&#xA;&#xA;release-0.8.2: digest: sha256:0a2242691956c24c687cc05d...&#xA;&#xA;Different digests. The pods were running the OLD image!&#xA;&#xA;The Kubernetes Image Cache Trap&#xA;&#xA;Here&#39;s what I didn&#39;t know (but definitely know now):&#xA;&#xA;When you specify an image in Kubernetes without :latest:&#xA;&#xA;image: myregistry.com/app:v1.0.0&#xA;&#xA;Kubernetes defaults to imagePullPolicy: IfNotPresent. This means:&#xA;&#xA;If the image tag exists locally on the node → use cached version&#xA;If the image tag doesn&#39;t exist → pull from registry&#xA;&#xA;We rebuilt the image with the same tag (release-0.8.2). The node already had an image with that tag (the broken one). So Kubernetes said &#34;great, I already have release-0.8.2&#34; and used the cached broken image.&#xA;&#xA;Even when I ran kubectl rollout restart, it created new pods... which immediately used the same cached image.&#xA;&#xA;Why This Happens&#xA;&#xA;This behavior makes sense for immutable tags. If release-0.8.2 is supposed to be immutable, there&#39;s no reason to re-pull it every time.&#xA;&#xA;But we had mutated the tag by rebuilding it with the same name.&#xA;&#xA;But Wait - What&#39;s the REAL Root Cause?&#xA;&#xA;At this point, you might think &#34;Ah, the root cause is image caching!&#34;&#xA;&#xA;Not quite.&#xA;&#xA;The image caching is what broke. But the root cause is why could this happen in the first place?&#xA;&#xA;Root cause analysis isn&#39;t about what failed—it&#39;s about what we can change to prevent it from happening again.&#xA;&#xA;The actual root causes:&#xA;&#xA;No deployment validation - Nothing checked if our image contained application code&#xA;No image management policy - We had no rules about tag reuse or imagePullPolicy&#xA;No process guardrails - Our workflow let us deploy untested changes to production&#xA;No automated testing - No smoke tests, no staging environment, no safety net&#xA;&#xA;The wrong Dockerfile and the image caching were symptoms. The root cause was missing processes that would have caught these mistakes.&#xA;&#xA;---&#xA;&#xA;The Solution&#xA;&#xA;The fix ended up being multi-part:&#xA;&#xA;1. Migrate to Harbor Registry&#xA;&#xA;We consolidated all images into our Harbor registry instead of split between GitHub Container Registry and Harbor. This gave us better control over image management.&#xA;&#xA;2. Add imagePullPolicy: Always&#xA;&#xA;The critical fix in every deployment:&#xA;&#xA;spec:&#xA;  containers:&#xA;    name: web&#xA;      image: uostas/ziurkes/bookwyrm:release-0.8.2&#xA;      imagePullPolicy: Always  # ← This one line&#xA;&#xA;With imagePullPolicy: Always, Kubernetes pulls the image every time, regardless of what&#39;s cached.&#xA;&#xA;3. Update imagePullSecrets&#xA;&#xA;Since we moved to Harbor, we needed to update the registry credentials:&#xA;&#xA;imagePullSecrets:&#xA;  name: uostas-registry  # Harbor credentials&#xA;&#xA;We deployed these changes and... 🎉&#xA;&#xA;NAME                     READY   STATUS    RESTARTS   AGE&#xA;web-5cd76dfd5b-qv4ln     1/1     Running   0          51s&#xA;celery-worker-...        1/1     Running   0          73s&#xA;celery-beat-...          1/1     Running   0          74s&#xA;flower-...               1/1     Running   0          65s&#xA;&#xA;All pods healthy! Service restored!&#xA;&#xA;---&#xA;&#xA;Lessons Learned&#xA;&#xA;1. Build Process Validation (Prevention   Detection)&#xA;&#xA;The Real Lesson: We had no validation that our images contained working code.&#xA;&#xA;What we should have had:&#xA;&#xA;In Dockerfile - fail build if app code missing&#xA;RUN test -f /app/bookwyrm/init.py || \&#xA;    (echo &#34;ERROR: BookWyrm code not found!&#34; &amp;&amp; exit 1)&#xA;&#xA;In deployment - fail pod startup if app broken&#xA;livenessProbe:&#xA;  exec:&#xA;    command: [&#34;python&#34;, &#34;-c&#34;, &#34;import bookwyrm&#34;]&#xA;&#xA;If we&#39;d had these, the broken image would never have reached production.&#xA;&#xA;2. Image Management Policy (Not Just Best Practices)&#xA;&#xA;The Real Lesson: &#34;Best practices&#34; aren&#39;t enough - you need enforced policies.&#xA;&#xA;What we implemented:&#xA;&#xA;✅ Required: imagePullPolicy: Always in all deployments&#xA;✅ Required: Images must go to Harbor registry (not ghcr.io)&#xA;✅ Recommended: Include git SHA in tags: release-0.8.2-a1b2c3d&#xA;✅ Alternative: Pin to digest: image@sha256:abc123...&#xA;&#xA;These aren&#39;t suggestions - they&#39;re now requirements in our deployment YAMLs.&#xA;&#xA;3. Deployment Guardrails (Make Mistakes Impossible)&#xA;&#xA;The Real Lesson: Manual processes need automated checks.&#xA;&#xA;What we added:&#xA;&#xA;Pre-deployment checks (automated)&#xA;Commits pushed to remote? ✅&#xA;CI build passed? ✅&#xA;Image exists at expected digest? ✅&#xA;Staging environment healthy? ✅&#xA;&#xA;Can&#39;t deploy to production without passing all checks.&#xA;&#xA;4. The &#34;Five Whys&#34; Actually Works&#xA;&#xA;The incident:&#xA;Pods crashed → Why? Missing code&#xA;Missing code → Why? Wrong Dockerfile&#xA;Wrong Dockerfile → Why? Unclear which to use&#xA;Unclear → Why? Inadequate documentation&#xA;Inadequate docs → Why? No review process for critical changes&#xA;&#xA;The root cause wasn&#39;t &#34;wrong Dockerfile&#34; - it was no process to prevent deploying wrong Dockerfiles.&#xA;&#xA;5. Root Cause vs. Proximate Cause&#xA;&#xA;Proximate causes (what broke):&#xA;Used wrong Dockerfile&#xA;Reused image tag&#xA;Forgot to push commits&#xA;&#xA;Root causes (what we can change):&#xA;No validation of build artifacts&#xA;No image management policy&#xA;No deployment guardrails&#xA;&#xA;Fix the proximate causes: You solve this incident.&#xA;Fix the root causes: You prevent the whole class of incidents.&#xA;&#xA;---&#xA;&#xA;The Cost&#xA;&#xA;Downtime: 51 minutes (9:24 - 10:15 AM)&#xA;Total investigation time: ~70 minutes&#xA;Number of failed deployment attempts: 3&#xA;Lesson learned: Priceless&#xA;&#xA;But seriously - this was a production outage for a social platform people rely on. 51 minutes of &#34;sorry, we&#39;re down&#34; is not acceptable.&#xA;&#xA;---&#xA;&#xA;Prevention Checklist&#xA;&#xA;Here&#39;s what we now do before every deployment:&#xA;&#xA;Pre-Deployment&#xA;[ ] Changes committed and pushed to remote&#xA;[ ] CI build passed successfully&#xA;[ ] Image tag is unique (includes git SHA or build number)&#xA;[ ] Or: imagePullPolicy: Always is set&#xA;[ ] Smoke tests verify app code exists in image&#xA;&#xA;During Deployment&#xA;[ ] Watch pod status (kubectl get pods -w)&#xA;[ ] Check logs immediately if crashes occur&#xA;[ ] Verify image digest matches what was built&#xA;&#xA;Post-Deployment&#xA;[ ] All pods healthy&#xA;[ ] Health endpoints responding&#xA;[ ] Run database migrations if needed&#xA;[ ] Check error tracking (Sentry) for issues&#xA;&#xA;---&#xA;&#xA;The Technical Details&#xA;&#xA;For those who want to reproduce this behavior (in a safe environment!):&#xA;&#xA;Build image v1&#xA;docker build -t myapp:v1.0.0 .&#xA;docker push myregistry.com/myapp:v1.0.0&#xA;&#xA;Deploy to Kubernetes&#xA;kubectl apply -f deployment.yaml&#xA;Pods start with image from registry&#xA;&#xA;Now rebuild THE SAME TAG with different code&#xA;docker build -t myapp:v1.0.0 .  # Different code!&#xA;docker push myregistry.com/myapp:v1.0.0&#xA;&#xA;Try to redeploy&#xA;kubectl rollout restart deployment/myapp&#xA;&#xA;Pods will use CACHED image (old v1.0.0), not new one&#xA;Because imagePullPolicy defaults to IfNotPresent&#xA;&#xA;Fix it:&#xA;&#xA;spec:&#xA;  template:&#xA;    spec:&#xA;      containers:&#xA;        name: myapp&#xA;          image: myregistry.com/myapp:v1.0.0&#xA;          imagePullPolicy: Always  # Now it works!&#xA;&#xA;---&#xA;&#xA;Resources&#xA;&#xA;Kubernetes Image Pull Policy Docs&#xA;Docker Image Tagging Best Practices&#xA;Why You Shouldn&#39;t Use :latest Tag&#xA;&#xA;---&#xA;&#xA;Conclusion&#xA;&#xA;A single line - imagePullPolicy: Always - would have prevented 51 minutes of downtime.&#xA;&#xA;The silver lining? We learned this lesson in a relatively low-stakes environment, documented it thoroughly, and now have processes to prevent it from happening again.&#xA;&#xA;And hopefully, by sharing this story, we&#39;ve saved someone else from the same headache.&#xA;&#xA;The next time you rebuild a Docker image with the same tag, remember this story. And add that one line.&#xA;&#xA;---&#xA;&#xA;Have you encountered similar Kubernetes caching issues? How did you solve them? Drop a comment on Mastodon.&#xA;&#xA;---&#xA;&#xA;Update: Migration Complete ✅&#xA;&#xA;After all pods came up healthy, we still needed to run database migrations for BookWyrm v0.8.2. Migration 0220 took about 10 minutes to complete (it was a large data migration). Once finished, the service was fully operational.&#xA;&#xA;Final timeline: 70 minutes from first crash to fully operational service.&#xA;&#xA;---&#xA;&#xA;Tags: #kubernetes #docker #devops #incident-response #lessons-learned #image-caching #imagepullpolicy #bookwyrm #harbor-registry #troubleshooting&#xA;&#xA;---&#xA;&#xA;This post is based on a real production incident on 2025-11-16. Names and some details have been preserved because documenting failures helps everyone learn.&#xA;&#xA;Comment in the Fediverse @saint@river.group.lt]]&gt;</description>
      <content:encoded><![CDATA[<h2 id="a-tale-of-kubernetes-image-caching-and-what-we-learned">A Tale of Kubernetes Image Caching and What We Learned</h2>

<p><strong>TL;DR</strong>: Rebuilt a Docker image with the same tag. Kubernetes cached the old broken image. Pods crashed for 51 minutes. The fix? One line: <code>imagePullPolicy: Always</code>. Here&#39;s the full story.</p>

<hr>

<h2 id="the-setup">The Setup</h2>

<p>It was a Sunday morning. We were upgrading BookWyrm (a federated social reading platform) from v0.8.1 to v0.8.2 on our Kubernetes cluster. The plan was simple:</p>
<ol><li>Update the version tag</li>
<li>Trigger the GitHub Actions workflow</li>
<li>Wait for the build</li>
<li>Deploy</li>
<li>Celebrate</li></ol>

<p>What could go wrong?</p>

<hr>

<h2 id="everything-goes-wrong">Everything Goes Wrong</h2>

<h3 id="9-20-am-the-deployment">9:20 AM: The Deployment</h3>

<p>I triggered the workflow. GitHub Actions spun up, built the Docker image, pushed it to the registry, and deployed to Kubernetes.</p>

<pre><code class="language-bash">✓ Build complete
✓ Image pushed: release-0.8.2
✓ Deployment applied
</code></pre>

<p>Looking good! I watched the pods start rolling out.</p>

<h3 id="9-24-am-the-crash">9:24 AM: The Crash</h3>

<pre><code>NAME                   READY   STATUS
web-86f4676f8b-zwgfs   0/1     CrashLoopBackOff
</code></pre>

<p>Every. Single. Pod. Crashed.</p>

<p>I pulled the logs:</p>

<pre><code class="language-python">ModuleNotFoundError: No module named &#39;bookwyrm&#39;
</code></pre>

<p>The <strong>entire BookWyrm application was missing</strong> from the container.</p>

<h3 id="the-investigation">The Investigation</h3>

<p>I dove into the Dockerfile. We had accidentally used the upstream <code>bookwyrm/Dockerfile</code> instead of our custom one. That Dockerfile only copied <code>requirements.txt</code> – not the actual application code.</p>

<pre><code class="language-dockerfile"># The broken Dockerfile
FROM python:3.10
COPY requirements.txt .
RUN pip install -r requirements.txt
# ... but WHERE&#39;S THE CODE? 😱
</code></pre>

<p>Classic. Easy fix!</p>

<hr>

<h2 id="the-first-fix-that-wasn-t">The First “Fix” (That Wasn&#39;t)</h2>

<h3 id="10-37-am-the-quick-fix">10:37 AM: The Quick Fix</h3>

<p>I created a fix commit that switched to the correct Dockerfile:</p>

<pre><code class="language-dockerfile"># The correct Dockerfile
FROM python:3.10
RUN git clone https://github.com/bookwyrm-social/bookwyrm .
RUN git checkout v0.8.2
RUN pip install -r requirements.txt
# Now we have the code!
</code></pre>

<p>I committed the changes... and forgot to push to GitHub.</p>

<p>Then I triggered the workflow again.</p>

<p>Naturally, GitHub Actions built from the old code (because I hadn&#39;t pushed). The broken image was rebuilt and redeployed.</p>

<p>Pods still crashing. Facepalm moment #1.</p>

<h3 id="10-55-am-actually-pushed-this-time">10:55 AM: Actually Pushed This Time</h3>

<p>I realized my mistake, pushed the commits, and triggered the workflow again.</p>

<p>This time the build actually used the fixed Dockerfile. I watched it clone BookWyrm, install dependencies, everything. The build logs looked perfect:</p>

<pre><code>#9 [ 5/10] RUN git clone https://github.com/bookwyrm-social/bookwyrm .
#9 0.153 Cloning into &#39;.&#39;...
#9 DONE 5.1s
</code></pre>

<p>Success! The image was built correctly and pushed.</p>

<p>I watched the pods roll out... and they crashed again.</p>

<pre><code class="language-python">ModuleNotFoundError: No module named &#39;bookwyrm&#39;
</code></pre>

<p><strong>The exact same error.</strong></p>

<p>This made no sense. The image was built correctly. I verified the build logs. The code was definitely in the image. What was happening?</p>

<hr>

<h2 id="the-real-problem">The Real Problem</h2>

<p>I checked what image the pods were actually running:</p>

<pre><code class="language-bash">kubectl get pod web-c98d458c4-x5p6z -o jsonpath=&#39;{.status.containerStatuses[0].imageID}&#39;
</code></pre>

<pre><code>ghcr.io/nycterent/ziurkes/bookwyrm@sha256:934ea0399adad...
</code></pre>

<p>Then I checked what digest we just pushed:</p>

<pre><code>release-0.8.2: digest: sha256:0a2242691956c24c687cc05d...
</code></pre>

<p><strong>Different digests.</strong> The pods were running the OLD image!</p>

<h3 id="the-kubernetes-image-cache-trap">The Kubernetes Image Cache Trap</h3>

<p>Here&#39;s what I didn&#39;t know (but definitely know now):</p>

<p>When you specify an image in Kubernetes without <code>:latest</code>:</p>

<pre><code class="language-yaml">image: myregistry.com/app:v1.0.0
</code></pre>

<p>Kubernetes defaults to <code>imagePullPolicy: IfNotPresent</code>. This means:</p>
<ul><li>If the image tag exists locally on the node → <strong>use cached version</strong></li>
<li>If the image tag doesn&#39;t exist → pull from registry</li></ul>

<p>We rebuilt the image with the <strong>same tag</strong> (<code>release-0.8.2</code>). The node already had an image with that tag (the broken one). So Kubernetes said “great, I already have <code>release-0.8.2</code>” and used the cached broken image.</p>

<p>Even when I ran <code>kubectl rollout restart</code>, it created new pods... which immediately used the same cached image.</p>

<h3 id="why-this-happens">Why This Happens</h3>

<p>This behavior makes sense for immutable tags. If <code>release-0.8.2</code> is supposed to be immutable, there&#39;s no reason to re-pull it every time.</p>

<p>But we had <strong>mutated</strong> the tag by rebuilding it with the same name.</p>

<h3 id="but-wait-what-s-the-real-root-cause">But Wait – What&#39;s the REAL Root Cause?</h3>

<p>At this point, you might think “Ah, the root cause is image caching!”</p>

<p><strong>Not quite.</strong></p>

<p>The image caching is what <em>broke</em>. But the root cause is <strong>why could this happen in the first place?</strong></p>

<p>Root cause analysis isn&#39;t about what failed—it&#39;s about <strong>what we can change</strong> to prevent it from happening again.</p>

<p>The actual root causes:</p>
<ol><li><strong>No deployment validation</strong> – Nothing checked if our image contained application code</li>
<li><strong>No image management policy</strong> – We had no rules about tag reuse or <code>imagePullPolicy</code></li>
<li><strong>No process guardrails</strong> – Our workflow let us deploy untested changes to production</li>
<li><strong>No automated testing</strong> – No smoke tests, no staging environment, no safety net</li></ol>

<p>The wrong Dockerfile and the image caching were <em>symptoms</em>. The root cause was <strong>missing processes that would have caught these mistakes</strong>.</p>

<hr>

<h2 id="the-solution">The Solution</h2>

<p>The fix ended up being multi-part:</p>

<h3 id="1-migrate-to-harbor-registry">1. Migrate to Harbor Registry</h3>

<p>We consolidated all images into our Harbor registry instead of split between GitHub Container Registry and Harbor. This gave us better control over image management.</p>

<h3 id="2-add-imagepullpolicy-always">2. Add imagePullPolicy: Always</h3>

<p>The critical fix in every deployment:</p>

<pre><code class="language-yaml">spec:
  containers:
    - name: web
      image: uostas/ziurkes/bookwyrm:release-0.8.2
      imagePullPolicy: Always  # ← This one line
</code></pre>

<p>With <code>imagePullPolicy: Always</code>, Kubernetes pulls the image every time, regardless of what&#39;s cached.</p>

<h3 id="3-update-imagepullsecrets">3. Update imagePullSecrets</h3>

<p>Since we moved to Harbor, we needed to update the registry credentials:</p>

<pre><code class="language-yaml">imagePullSecrets:
  - name: uostas-registry  # Harbor credentials
</code></pre>

<p>We deployed these changes and... 🎉</p>

<pre><code>NAME                     READY   STATUS    RESTARTS   AGE
web-5cd76dfd5b-qv4ln     1/1     Running   0          51s
celery-worker-...        1/1     Running   0          73s
celery-beat-...          1/1     Running   0          74s
flower-...               1/1     Running   0          65s
</code></pre>

<p>All pods healthy! Service restored!</p>

<hr>

<h2 id="lessons-learned">Lessons Learned</h2>

<h3 id="1-build-process-validation-prevention-detection">1. Build Process Validation (Prevention &gt; Detection)</h3>

<p><strong>The Real Lesson</strong>: We had no validation that our images contained working code.</p>

<p><strong>What we should have had:</strong></p>

<pre><code class="language-dockerfile"># In Dockerfile - fail build if app code missing
RUN test -f /app/bookwyrm/__init__.py || \
    (echo &#34;ERROR: BookWyrm code not found!&#34; &amp;&amp; exit 1)
</code></pre>

<pre><code class="language-yaml"># In deployment - fail pod startup if app broken
livenessProbe:
  exec:
    command: [&#34;python&#34;, &#34;-c&#34;, &#34;import bookwyrm&#34;]
</code></pre>

<p>If we&#39;d had these, the broken image would never have reached production.</p>

<h3 id="2-image-management-policy-not-just-best-practices">2. Image Management Policy (Not Just Best Practices)</h3>

<p><strong>The Real Lesson</strong>: “Best practices” aren&#39;t enough – you need enforced policies.</p>

<p><strong>What we implemented:</strong></p>
<ul><li>✅ <strong>Required</strong>: <code>imagePullPolicy: Always</code> in all deployments</li>
<li>✅ <strong>Required</strong>: Images must go to Harbor registry (not ghcr.io)</li>
<li>✅ <strong>Recommended</strong>: Include git SHA in tags: <code>release-0.8.2-a1b2c3d</code></li>
<li>✅ <strong>Alternative</strong>: Pin to digest: <code>image@sha256:abc123...</code></li></ul>

<p>These aren&#39;t suggestions – they&#39;re now requirements in our deployment YAMLs.</p>

<h3 id="3-deployment-guardrails-make-mistakes-impossible">3. Deployment Guardrails (Make Mistakes Impossible)</h3>

<p><strong>The Real Lesson</strong>: Manual processes need automated checks.</p>

<p><strong>What we added:</strong></p>

<pre><code class="language-bash"># Pre-deployment checks (automated)
- Commits pushed to remote? ✅
- CI build passed? ✅
- Image exists at expected digest? ✅
- Staging environment healthy? ✅
</code></pre>

<p>Can&#39;t deploy to production without passing all checks.</p>

<h3 id="4-the-five-whys-actually-works">4. The “Five Whys” Actually Works</h3>

<p><strong>The incident:</strong>
– Pods crashed → Why? Missing code
– Missing code → Why? Wrong Dockerfile
– Wrong Dockerfile → Why? Unclear which to use
– Unclear → Why? Inadequate documentation
– Inadequate docs → Why? <strong>No review process for critical changes</strong></p>

<p>The root cause wasn&#39;t “wrong Dockerfile” – it was <strong>no process to prevent deploying wrong Dockerfiles</strong>.</p>

<h3 id="5-root-cause-vs-proximate-cause">5. Root Cause vs. Proximate Cause</h3>

<p><strong>Proximate causes</strong> (what broke):
– Used wrong Dockerfile
– Reused image tag
– Forgot to push commits</p>

<p><strong>Root causes</strong> (what we can change):
– No validation of build artifacts
– No image management policy
– No deployment guardrails</p>

<p><strong>Fix the proximate causes</strong>: You solve this incident.
<strong>Fix the root causes</strong>: You prevent the whole class of incidents.</p>

<hr>

<h2 id="the-cost">The Cost</h2>

<p><strong>Downtime</strong>: 51 minutes (9:24 – 10:15 AM)
<strong>Total investigation time</strong>: ~70 minutes
<strong>Number of failed deployment attempts</strong>: 3
<strong>Lesson learned</strong>: Priceless</p>

<p>But seriously – this was a production outage for a social platform people rely on. 51 minutes of “sorry, we&#39;re down” is not acceptable.</p>

<hr>

<h2 id="prevention-checklist">Prevention Checklist</h2>

<p>Here&#39;s what we now do before every deployment:</p>

<h3 id="pre-deployment">Pre-Deployment</h3>
<ul><li>[ ] Changes committed <strong>and pushed</strong> to remote</li>
<li>[ ] CI build passed successfully</li>
<li>[ ] Image tag is unique (includes git SHA or build number)</li>
<li>[ ] Or: <code>imagePullPolicy: Always</code> is set</li>
<li>[ ] Smoke tests verify app code exists in image</li></ul>

<h3 id="during-deployment">During Deployment</h3>
<ul><li>[ ] Watch pod status (<code>kubectl get pods -w</code>)</li>
<li>[ ] Check logs immediately if crashes occur</li>
<li>[ ] Verify image digest matches what was built</li></ul>

<h3 id="post-deployment">Post-Deployment</h3>
<ul><li>[ ] All pods healthy</li>
<li>[ ] Health endpoints responding</li>
<li>[ ] Run database migrations if needed</li>
<li>[ ] Check error tracking (Sentry) for issues</li></ul>

<hr>

<h2 id="the-technical-details">The Technical Details</h2>

<p>For those who want to reproduce this behavior (in a safe environment!):</p>

<pre><code class="language-bash"># Build image v1
docker build -t myapp:v1.0.0 .
docker push myregistry.com/myapp:v1.0.0

# Deploy to Kubernetes
kubectl apply -f deployment.yaml
# Pods start with image from registry

# Now rebuild THE SAME TAG with different code
docker build -t myapp:v1.0.0 .  # Different code!
docker push myregistry.com/myapp:v1.0.0

# Try to redeploy
kubectl rollout restart deployment/myapp

# Pods will use CACHED image (old v1.0.0), not new one
# Because imagePullPolicy defaults to IfNotPresent
</code></pre>

<p>Fix it:</p>

<pre><code class="language-yaml">spec:
  template:
    spec:
      containers:
        - name: myapp
          image: myregistry.com/myapp:v1.0.0
          imagePullPolicy: Always  # Now it works!
</code></pre>

<hr>

<h2 id="resources">Resources</h2>
<ul><li><a href="https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy" rel="nofollow">Kubernetes Image Pull Policy Docs</a></li>
<li><a href="https://docs.docker.com/develop/dev-best-practices/" rel="nofollow">Docker Image Tagging Best Practices</a></li>
<li><a href="https://vsupalov.com/docker-latest-tag/" rel="nofollow">Why You Shouldn&#39;t Use :latest Tag</a></li></ul>

<hr>

<h2 id="conclusion">Conclusion</h2>

<p>A single line – <code>imagePullPolicy: Always</code> – would have prevented 51 minutes of downtime.</p>

<p>The silver lining? We learned this lesson in a relatively low-stakes environment, documented it thoroughly, and now have processes to prevent it from happening again.</p>

<p>And hopefully, by sharing this story, we&#39;ve saved someone else from the same headache.</p>

<p><strong>The next time you rebuild a Docker image with the same tag, remember this story. And add that one line.</strong></p>

<hr>

<p><em>Have you encountered similar Kubernetes caching issues? How did you solve them? Drop a comment on Mastodon.</em></p>

<hr>

<h2 id="update-migration-complete">Update: Migration Complete ✅</h2>

<p>After all pods came up healthy, we still needed to run database migrations for BookWyrm v0.8.2. Migration 0220 took about 10 minutes to complete (it was a large data migration). Once finished, the service was fully operational.</p>

<p><strong>Final timeline</strong>: 70 minutes from first crash to fully operational service.</p>

<hr>

<p><strong>Tags</strong>: <a href="/saint/tag:kubernetes" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">kubernetes</span></a> <a href="/saint/tag:docker" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">docker</span></a> <a href="/saint/tag:devops" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">devops</span></a> <a href="/saint/tag:incident" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">incident</span></a>-response <a href="/saint/tag:lessons" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">lessons</span></a>-learned <a href="/saint/tag:image" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">image</span></a>-caching <a href="/saint/tag:imagepullpolicy" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">imagepullpolicy</span></a> <a href="/saint/tag:bookwyrm" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">bookwyrm</span></a> <a href="/saint/tag:harbor" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">harbor</span></a>-registry <a href="/saint/tag:troubleshooting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">troubleshooting</span></a></p>

<hr>

<p><em>This post is based on a real production incident on 2025-11-16. Names and some details have been preserved because documenting failures helps everyone learn.</em></p>

<p>Comment in the Fediverse <a href="https://avys.group.lt/@/saint@river.group.lt" class="u-url mention" rel="nofollow">@<span>saint@river.group.lt</span></a></p>
]]></content:encoded>
      <guid>https://avys.group.lt/saint/how-a-single-docker-tag-cost-us-51-minutes-of-downtime</guid>
      <pubDate>Mon, 17 Nov 2025 06:50:19 +0000</pubDate>
    </item>
    <item>
      <title>Configuring Character Limits in glitch-soc</title>
      <link>https://avys.group.lt/saint/configuring-character-limits-in-glitch-soc</link>
      <description>&lt;![CDATA[Environment: Kubernetes, Helm, glitch-soc v4.5.1&#xA;&#xA;Problem&#xA;&#xA;Default character limit: 500&#xA;&#xA;Investigation&#xA;&#xA;Checked glitch-soc documentation. Character limits are configurable via MAXTOOTCHARS environment variable.&#xA;&#xA;Verified chart template handling:&#xA;&#xA;$ grep -r &#34;extraEnvVars&#34; templates/&#xA;templates/configmap-env.yaml:  {{- range $k, $v := .Values.mastodon.extraEnvVars }}&#xA;templates/configmap-env.yaml:  {{ $k }}: {{ quote $v }}&#xA;&#xA;Chart iterates over mastodon.extraEnvVars and renders into ConfigMap. Deployments load via envFrom.&#xA;&#xA;Configuration&#xA;&#xA;values-river.yaml&#xA;mastodon:&#xA;  extraEnvVars:&#xA;    MAXTOOTCHARS: &#34;42069&#34;&#xA;&#xA;Pre-deployment Verification&#xA;&#xA;$ helm template river-mastodon . -f values-river.yaml | grep MAXTOOTCHARS&#xA;MAXTOOTCHARS: &#34;42069&#34;&#xA;&#xA;Template renders correctly.&#xA;&#xA;Deployment&#xA;&#xA;$ helm upgrade river-mastodon . -n mastodon -f values-river.yaml&#xA;Release &#34;river-mastodon&#34; has been upgraded. Happy Helming!&#xA;REVISION: 167&#xA;&#xA;$ kubectl rollout status deployment/river-mastodon-web -n mastodon&#xA;deployment &#34;river-mastodon-web&#34; successfully rolled out&#xA;&#xA;$ kubectl rollout status deployment/river-mastodon-sidekiq-all-queues -n mastodon&#xA;deployment &#34;river-mastodon-sidekiq-all-queues&#34; successfully rolled out&#xA;&#xA;$ kubectl rollout status deployment/river-mastodon-streaming -n mastodon&#xA;deployment &#34;river-mastodon-streaming&#34; successfully rolled out&#xA;&#xA;Post-deployment Verification&#xA;&#xA;$ kubectl exec -n mastodon deployment/river-mastodon-web -- env | grep MAXTOOTCHARS&#xA;MAXTOOTCHARS=42069&#xA;&#xA;$ kubectl get pods -n mastodon | grep river-mastodon-web&#xA;river-mastodon-web-67586b449d-r5v2q   1/1   Running   0   32s&#xA;&#xA;Result&#xA;&#xA;Character limit: 500 → 42069&#xA;Downtime: 0s&#xA;Issues: None&#xA;&#xA;Notes for Other Admins&#xA;&#xA;Works with standard Mastodon Helm chart. The extraEnvVars pattern:&#xA;&#xA;Add to values file&#xA;Chart renders into ConfigMap&#xA;Pods load via envFrom&#xA;Rolling update applies change&#xA;&#xA;No chart modifications needed.&#xA;&#xA;---&#xA;&#xA;Deployed on river.group.lt&#xA;&#xA;Comment in the Fediverse @saint@river.group.lt]]&gt;</description>
      <content:encoded><![CDATA[<p><strong>Environment:</strong> Kubernetes, Helm, glitch-soc v4.5.1</p>

<h2 id="problem">Problem</h2>

<p>Default character limit: 500</p>

<h2 id="investigation">Investigation</h2>

<p>Checked glitch-soc documentation. Character limits are configurable via <code>MAX_TOOT_CHARS</code> environment variable.</p>

<p>Verified chart template handling:</p>

<pre><code class="language-bash">$ grep -r &#34;extraEnvVars&#34; templates/
templates/configmap-env.yaml:  {{- range $k, $v := .Values.mastodon.extraEnvVars }}
templates/configmap-env.yaml:  {{ $k }}: {{ quote $v }}
</code></pre>

<p>Chart iterates over <code>mastodon.extraEnvVars</code> and renders into ConfigMap. Deployments load via <code>envFrom</code>.</p>

<h2 id="configuration">Configuration</h2>

<pre><code class="language-yaml"># values-river.yaml
mastodon:
  extraEnvVars:
    MAX_TOOT_CHARS: &#34;42069&#34;
</code></pre>

<h2 id="pre-deployment-verification">Pre-deployment Verification</h2>

<pre><code class="language-bash">$ helm template river-mastodon . -f values-river.yaml | grep MAX_TOOT_CHARS
MAX_TOOT_CHARS: &#34;42069&#34;
</code></pre>

<p>Template renders correctly.</p>

<h2 id="deployment">Deployment</h2>

<pre><code class="language-bash">$ helm upgrade river-mastodon . -n mastodon -f values-river.yaml
Release &#34;river-mastodon&#34; has been upgraded. Happy Helming!
REVISION: 167

$ kubectl rollout status deployment/river-mastodon-web -n mastodon
deployment &#34;river-mastodon-web&#34; successfully rolled out

$ kubectl rollout status deployment/river-mastodon-sidekiq-all-queues -n mastodon
deployment &#34;river-mastodon-sidekiq-all-queues&#34; successfully rolled out

$ kubectl rollout status deployment/river-mastodon-streaming -n mastodon
deployment &#34;river-mastodon-streaming&#34; successfully rolled out
</code></pre>

<h2 id="post-deployment-verification">Post-deployment Verification</h2>

<pre><code class="language-bash">$ kubectl exec -n mastodon deployment/river-mastodon-web -- env | grep MAX_TOOT_CHARS
MAX_TOOT_CHARS=42069

$ kubectl get pods -n mastodon | grep river-mastodon-web
river-mastodon-web-67586b449d-r5v2q   1/1   Running   0   32s
</code></pre>

<h2 id="result">Result</h2>

<p>Character limit: 500 → 42069
Downtime: 0s
Issues: None</p>

<h2 id="notes-for-other-admins">Notes for Other Admins</h2>

<p>Works with standard Mastodon Helm chart. The <code>extraEnvVars</code> pattern:</p>
<ol><li>Add to values file</li>
<li>Chart renders into ConfigMap</li>
<li>Pods load via <code>envFrom</code></li>
<li>Rolling update applies change</li></ol>

<p>No chart modifications needed.</p>

<hr>

<p><em>Deployed on river.group.lt</em></p>

<p>Comment in the Fediverse <a href="https://avys.group.lt/@/saint@river.group.lt" class="u-url mention" rel="nofollow">@<span>saint@river.group.lt</span></a></p>
]]></content:encoded>
      <guid>https://avys.group.lt/saint/configuring-character-limits-in-glitch-soc</guid>
      <pubDate>Sat, 15 Nov 2025 15:17:04 +0000</pubDate>
    </item>
    <item>
      <title>Upgrading Mastodon to v4.5.1: A Journey in Automation and Security</title>
      <link>https://avys.group.lt/saint/upgrading-mastodon-to-v4-5-1-a-journey-in-automation-and-security</link>
      <description>&lt;![CDATA[Published: November 13, 2025&#xA;Author: River Instance Team&#xA;Reading Time: 8 minutes&#xA;&#xA;---&#xA;&#xA;The Mission&#xA;&#xA;Today we upgraded our Mastodon instance (river.group.lt) from version 4.5.0 to 4.5.1. While this might sound like a routine patch update, we used it as an opportunity to make our infrastructure more secure and our deployment process more automated. Here&#39;s what we learned along the way.&#xA;&#xA;---&#xA;&#xA;Why Upgrade?&#xA;&#xA;When glitch-soc (our preferred Mastodon variant) released version 4.5.1, we reviewed the changelog and found 10 bug fixes, including:&#xA;&#xA;Better keyboard navigation in the Alt text modal&#xA;Fixed issues with quote posts appearing as &#34;unquotable&#34;&#xA;Improved filter application in detailed views&#xA;Build fixes for ARM64 architecture&#xA;&#xA;More importantly: no database migrations, no breaking changes, and no new features that could introduce instability. This is what we call a &#34;safe upgrade&#34; - the perfect candidate for improving our processes while updating.&#xA;&#xA;---&#xA;&#xA;The Starting Point&#xA;&#xA;Our Mastodon setup isn&#39;t quite standard. We run:&#xA;&#xA;glitch-soc variant (Mastodon fork with extra features)&#xA;Custom Docker images with Sentry monitoring baked in&#xA;Kubernetes deployment via Helm charts&#xA;AMD64 architecture (important for cross-platform builds)&#xA;&#xA;This means we can&#39;t just pull the latest official image - we need to rebuild our custom images with each new version.&#xA;&#xA;---&#xA;&#xA;The Problem We Solved&#xA;&#xA;Before this upgrade, our build process looked like this:&#xA;&#xA;Find Harbor registry credentials (where?)&#xA;Copy-paste username and password&#xA;docker login registry.example.com&#xA;Enter credentials manually&#xA;Update version in 4 different files&#xA;Hope they all match&#xA;./build.sh&#xA;Wait for builds to complete&#xA;Manually verify everything worked&#xA;&#xA;The issues:&#xA;Credentials stored in shell history (security risk)&#xA;Manual steps prone to typos&#xA;No automation = easy to forget steps&#xA;Credentials sitting in ~/.docker/config.json unencrypted&#xA;&#xA;We knew we could do better.&#xA;&#xA;---&#xA;&#xA;The Solution: Infisical Integration&#xA;&#xA;Infisical is a secrets management platform - think of it as a secure vault for credentials that your applications can access automatically. Instead of storing Harbor registry credentials on our laptop, we:&#xA;&#xA;Stored credentials in Infisical (one-time setup)&#xA;Updated our build script to fetch credentials automatically&#xA;Automated the Docker login process&#xA;&#xA;Now our build script looks like this:&#xA;&#xA;!/bin/bash&#xA;set -e&#xA;&#xA;VERSION=&#34;v4.5.1&#34;&#xA;REGISTRY=&#34;registry.example.com/library&#34;&#xA;PROJECTID=&#34;your-infisical-project-id&#34;&#xA;&#xA;echo &#34;🔑 Logging in to Harbor registry...&#34;&#xA;Fetch credentials from Infisical&#xA;HARBORUSERNAME=$(infisical secrets get \&#xA;  --domain https://secrets.example.com/api \&#xA;  --projectId ${PROJECTID} \&#xA;  --env prod HARBORUSERNAME \&#xA;  --silent -o json | jq -r &#39;.[0].secretValue&#39;)&#xA;&#xA;HARBORPASSWORD=$(infisical secrets get \&#xA;  --domain https://secrets.example.com/api \&#xA;  --projectId ${PROJECTID} \&#xA;  --env prod HARBORPASSWORD \&#xA;  --silent -o json | jq -r &#39;.[0].secretValue&#39;)&#xA;&#xA;Automatic login&#xA;echo &#34;${HARBORPASSWORD}&#34; | docker login ${REGISTRY} \&#xA;  --username &#34;${HARBORUSERNAME}&#34; --password-stdin&#xA;&#xA;Build and push images...&#xA;&#xA;  Note: Code examples use placeholder values. Replace registry.example.com, secrets.example.com, and your-infisical-project-id with your actual infrastructure endpoints.&#xA;&#xA;The benefits:&#xA;✅ No credentials in shell history&#xA;✅ No manual copy-pasting&#xA;✅ Audit trail of when credentials were accessed&#xA;✅ Easy credential rotation&#xA;✅ Works the same on any machine with Infisical access&#xA;&#xA;---&#xA;&#xA;The Upgrade Process&#xA;&#xA;With our improved automation in place, the actual upgrade was straightforward:&#xA;&#xA;Step 1: Research&#xA;&#xA;We used AI assistance to research the glitch-soc v4.5.1 release:&#xA;Confirmed it was a patch release (low risk)&#xA;Verified no database migrations required&#xA;Reviewed all 10 bug fixes&#xA;Checked for breaking changes (none found)&#xA;&#xA;Lesson: Always research before executing. 15 minutes of reading can prevent hours of rollback.&#xA;&#xA;Step 2: Update Version References&#xA;&#xA;We needed to update the version in exactly 4 places:&#xA;&#xA;docker-assets/build.sh - Build script version variable&#xA;docker-assets/Dockerfile.mastodon-sentry - Base image version&#xA;docker-assets/Dockerfile.streaming-sentry - Streaming image version&#xA;values-river.yaml - Helm values for both image tags&#xA;&#xA;Lesson: Keep a checklist of version locations. It&#39;s easy to miss one.&#xA;&#xA;Step 3: Build Custom Images&#xA;&#xA;cd docker-assets&#xA;./build.sh&#xA;&#xA;The script now:&#xA;Fetches credentials from Infisical ✓&#xA;Logs into Harbor registry ✓&#xA;Builds both images with --platform linux/amd64 ✓&#xA;Pushes to registry ✓&#xA;Provides clear success/failure messages ✓&#xA;&#xA;Build time: ~5 seconds (thanks to Docker layer caching!)&#xA;&#xA;Step 4: Deploy to Kubernetes&#xA;&#xA;cd ..&#xA;helm upgrade river-mastodon . -n mastodon -f values-river.yaml&#xA;&#xA;Helm performed a rolling update:&#xA;Old pods kept running while new ones started&#xA;New pods pulled v4.5.1 images&#xA;Old pods terminated once new ones were healthy&#xA;Zero downtime for our users&#xA;&#xA;Step 5: Verify&#xA;&#xA;kubectl exec -n mastodon deployment/river-mastodon-web -- tootctl version&#xA;Output: 4.5.1+glitch&#xA;&#xA;All three pod types (web, streaming, sidekiq) now running the new version. Success! 🎉&#xA;&#xA;---&#xA;&#xA;What We Learned&#xA;&#xA;1. Automation Compounds Over Time&#xA;&#xA;The Infisical integration took about 60 minutes to implement. The actual version bump took 30 minutes. That might seem like overkill for a &#34;simple&#34; upgrade.&#xA;&#xA;But here&#39;s the math:&#xA;Manual process: 5 minutes per build to manage credentials&#xA;Automated process: 0 minutes&#xA;Builds per year: ~20 upgrades and tests&#xA;Time saved annually: 100 minutes&#xA;Payback period: 12 builds (~6 months)&#xA;&#xA;Plus, we eliminated a security risk. The real value isn&#39;t just time - it&#39;s confidence and safety.&#xA;&#xA;2. Separate Upstream from Custom&#xA;&#xA;We keep the upstream Helm chart (Chart.yaml) completely untouched. Our customizations live in:&#xA;Custom Dockerfiles (add Sentry)&#xA;Values overrides (values-river.yaml)&#xA;Build scripts&#xA;&#xA;Why this matters: We can pull upstream chart updates without conflicts. Our changes are additive, not modifications.&#xA;&#xA;3. Test Incrementally&#xA;&#xA;We didn&#39;t just run the full build and hope it worked. We tested:&#xA;&#xA;✓ Credential retrieval from Infisical&#xA;✓ JSON parsing with jq&#xA;✓ Docker login with retrieved credentials&#xA;✓ Image builds&#xA;✓ Image pushes to registry&#xA;✓ Kubernetes deployment&#xA;✓ Running version verification&#xA;&#xA;Each step validated before moving forward. When something broke (initial credential permissions), we caught it immediately.&#xA;&#xA;4. Documentation Is for Future You&#xA;&#xA;We wrote a comprehensive retrospective covering:&#xA;What went well&#xA;What we learned&#xA;What we&#39;d do differently next time&#xA;Troubleshooting guides for common issues&#xA;&#xA;In 6 months when we upgrade to v4.6.0, we&#39;ll thank ourselves for this documentation.&#xA;&#xA;5. Version Numbers Tell a Story&#xA;&#xA;Understanding semantic versioning helps assess risk:&#xA;&#xA;v4.5.0 → v4.5.1 = Patch release (bug fixes only, low risk)&#xA;v4.5.x → v4.6.0 = Minor release (new features, moderate risk)&#xA;v4.x.x → v5.0.0 = Major release (breaking changes, high risk)&#xA;&#xA;This informed our decision to proceed quickly with minimal testing.&#xA;&#xA;---&#xA;&#xA;What We&#39;d Do Differently Next Time&#xA;&#xA;Despite the success, we identified improvements:&#xA;&#xA;High Priority&#xA;&#xA;1. Validate credentials before building&#xA;&#xA;Currently, we discover authentication failures during the image push (after building). Better:&#xA;&#xA;Test login BEFORE building&#xA;if ! docker login ...; then&#xA;  echo &#34;❌ Auth failed&#34;&#xA;  exit 1&#xA;fi&#xA;&#xA;2. Initialize Infisical project config&#xA;&#xA;Running infisical init in the project directory creates a .infisical.json file, eliminating the need for --projectId flags in every command.&#xA;&#xA;3. Add version consistency checks&#xA;&#xA;A simple script to verify all 4 files have matching versions before building would catch human errors.&#xA;&#xA;Medium Priority&#xA;&#xA;4. Automated deployment verification&#xA;&#xA;Replace manual kubectl checks with a script that:&#xA;Waits for pods to be ready&#xA;Extracts running version&#xA;Compares to expected version&#xA;Reports success/failure&#xA;&#xA;5. Dry-run mode for build script&#xA;&#xA;Test the script logic without actually building or pushing images. Useful for testing changes to the script itself.&#xA;&#xA;---&#xA;&#xA;The Impact&#xA;&#xA;Before this session:&#xA;Manual credential management&#xA;5+ minutes per build for login&#xA;Credentials in shell history (security risk)&#xA;No audit trail&#xA;&#xA;After this session:&#xA;Automated credential retrieval&#xA;0 minutes per build for login&#xA;Credentials never exposed (security improvement)&#xA;Full audit trail in Infisical&#xA;Repeatable process documented&#xA;&#xA;Plus: We&#39;re running Mastodon v4.5.1 with 10 bug fixes, making our instance more stable for our users.&#xA;&#xA;---&#xA;&#xA;Lessons for Other Mastodon Admins&#xA;&#xA;If you run a Mastodon instance, here&#39;s what we learned that might help you:&#xA;&#xA;For Small Instances&#xA;&#xA;Even if you&#39;re running standard Mastodon without customizations:&#xA;&#xA;Document your upgrade process - Your future self will thank you&#xA;Test in staging first - If you don&#39;t have staging, test with dry-run/simulation&#xA;Always check release notes - 5 minutes of reading prevents hours of debugging&#xA;Use semantic versioning to assess risk - Patch releases are usually safe&#xA;&#xA;For Custom Deployments&#xA;&#xA;If you run custom images like we do:&#xA;&#xA;Separate upstream from custom - Keep modifications isolated and additive&#xA;Automate credential management - Shell history is not secure storage&#xA;Use Docker layer caching - Speeds up builds dramatically&#xA;Platform flags matter - --platform linux/amd64 if deploying to different architecture&#xA;Verify the running version - Don&#39;t assume deployment worked, check it&#xA;&#xA;For Kubernetes Deployments&#xA;&#xA;If you deploy to Kubernetes:&#xA;&#xA;Rolling updates are your friend - Zero downtime is achievable&#xA;Helm revisions enable easy rollback - helm rollback is simple and fast&#xA;Verify pod image versions - Check what&#39;s actually running, not just deployed&#xA;Monitor during rollout - Watch pod status, don&#39;t just fire and forget&#xA;&#xA;---&#xA;&#xA;The Numbers&#xA;&#xA;Session Duration: 90 minutes total&#xA;Research: 15 minutes&#xA;Version updates: 10 minutes&#xA;Infisical integration: 60 minutes&#xA;Build &amp; deploy: 5 minutes&#xA;&#xA;Deployment Stats:&#xA;Downtime: 0 seconds (rolling update)&#xA;Pods affected: 3 (web, streaming, sidekiq)&#xA;Helm revision: 166&#xA;Rollback complexity: Low (single command)&#xA;&#xA;Lines of code changed: 18 lines across 4 files&#xA;Lines of documentation written: 629 lines (retrospective)&#xA;Security improvements: 1 major (credential management)&#xA;&#xA;---&#xA;&#xA;Final Thoughts&#xA;&#xA;What started as a simple patch upgrade turned into a significant infrastructure improvement. The version bump was almost trivial - the real work was automating away manual steps and eliminating security risks.&#xA;&#xA;This is what good ops work looks like: using routine maintenance as an opportunity to make systems better. The 60 minutes we spent on Infisical integration will pay dividends on every future build. The documentation we wrote will help the next person (or future us) upgrade with confidence.&#xA;&#xA;Mastodon v4.5.1 is running smoothly, our build process is more secure, and we learned lessons that will make the next upgrade even smoother.&#xA;&#xA;---&#xA;&#xA;Resources&#xA;&#xA;For Mastodon Admins:&#xA;Mastodon Upgrade Documentation&#xA;glitch-soc Releases&#xA;&#xA;For Infrastructure:&#xA;Infisical (Secrets Management)&#xA;Docker Build Best Practices&#xA;Helm Upgrade Documentation&#xA;&#xA;Our Instance:&#xA;river.group.lt - Live Mastodon instance&#xA;Running glitch-soc v4.5.1+glitch&#xA;Kubernetes + Helm deployment&#xA;Custom images with Sentry monitoring&#xA;&#xA;---&#xA;&#xA;Questions?&#xA;&#xA;If you&#39;re running a Mastodon instance and have questions about:&#xA;Upgrading glitch-soc variants&#xA;Custom Docker image workflows&#xA;Kubernetes deployments&#xA;Secrets management with Infisical&#xA;Zero-downtime upgrades&#xA;&#xA;Feel free to reach out! We&#39;re happy to share what we&#39;ve learned.&#xA;&#xA;---&#xA;&#xA;Tags: #mastodon #glitch-soc #kubernetes #devops #infrastructure #security #automation&#xA;&#xA;---&#xA;&#xA;This blog post is part of our infrastructure documentation series. We believe in sharing knowledge to help others running similar systems. All technical details are from our actual upgrade session on November 13, 2025.&#xA;&#xA;Comment in the Fediverse @saint@river.group.lt]]&gt;</description>
      <content:encoded><![CDATA[<p><strong>Published:</strong> November 13, 2025
<strong>Author:</strong> River Instance Team
<strong>Reading Time:</strong> 8 minutes</p>

<hr>

<h2 id="the-mission">The Mission</h2>

<p>Today we upgraded our Mastodon instance (river.group.lt) from version 4.5.0 to 4.5.1. While this might sound like a routine patch update, we used it as an opportunity to make our infrastructure more secure and our deployment process more automated. Here&#39;s what we learned along the way.</p>

<hr>

<h2 id="why-upgrade">Why Upgrade?</h2>

<p>When glitch-soc (our preferred Mastodon variant) released version 4.5.1, we reviewed the changelog and found 10 bug fixes, including:</p>
<ul><li>Better keyboard navigation in the Alt text modal</li>
<li>Fixed issues with quote posts appearing as “unquotable”</li>
<li>Improved filter application in detailed views</li>
<li>Build fixes for ARM64 architecture</li></ul>

<p>More importantly: no database migrations, no breaking changes, and no new features that could introduce instability. This is what we call a “safe upgrade” – the perfect candidate for improving our processes while updating.</p>

<hr>

<h2 id="the-starting-point">The Starting Point</h2>

<p>Our Mastodon setup isn&#39;t quite standard. We run:</p>
<ul><li><strong>glitch-soc variant</strong> (Mastodon fork with extra features)</li>
<li><strong>Custom Docker images</strong> with Sentry monitoring baked in</li>
<li><strong>Kubernetes deployment</strong> via Helm charts</li>
<li><strong>AMD64 architecture</strong> (important for cross-platform builds)</li></ul>

<p>This means we can&#39;t just pull the latest official image – we need to rebuild our custom images with each new version.</p>

<hr>

<h2 id="the-problem-we-solved">The Problem We Solved</h2>

<p>Before this upgrade, our build process looked like this:</p>

<pre><code class="language-bash"># Find Harbor registry credentials (where?)
# Copy-paste username and password
docker login registry.example.com
# Enter credentials manually
# Update version in 4 different files
# Hope they all match
./build.sh
# Wait for builds to complete
# Manually verify everything worked
</code></pre>

<p><strong>The issues:</strong>
– Credentials stored in shell history (security risk)
– Manual steps prone to typos
– No automation = easy to forget steps
– Credentials sitting in <code>~/.docker/config.json</code> unencrypted</p>

<p>We knew we could do better.</p>

<hr>

<h2 id="the-solution-infisical-integration">The Solution: Infisical Integration</h2>

<p><a href="https://infisical.com/" rel="nofollow">Infisical</a> is a secrets management platform – think of it as a secure vault for credentials that your applications can access automatically. Instead of storing Harbor registry credentials on our laptop, we:</p>
<ol><li><strong>Stored credentials in Infisical</strong> (one-time setup)</li>
<li><strong>Updated our build script</strong> to fetch credentials automatically</li>
<li><strong>Automated the Docker login</strong> process</li></ol>

<p>Now our build script looks like this:</p>

<pre><code class="language-bash">#!/bin/bash
set -e

VERSION=&#34;v4.5.1&#34;
REGISTRY=&#34;registry.example.com/library&#34;
PROJECT_ID=&#34;&lt;your-infisical-project-id&gt;&#34;

echo &#34;🔑 Logging in to Harbor registry...&#34;
# Fetch credentials from Infisical
HARBOR_USERNAME=$(infisical secrets get \
  --domain https://secrets.example.com/api \
  --projectId ${PROJECT_ID} \
  --env prod HARBOR_USERNAME \
  --silent -o json | jq -r &#39;.[0].secretValue&#39;)

HARBOR_PASSWORD=$(infisical secrets get \
  --domain https://secrets.example.com/api \
  --projectId ${PROJECT_ID} \
  --env prod HARBOR_PASSWORD \
  --silent -o json | jq -r &#39;.[0].secretValue&#39;)

# Automatic login
echo &#34;${HARBOR_PASSWORD}&#34; | docker login ${REGISTRY} \
  --username &#34;${HARBOR_USERNAME}&#34; --password-stdin

# Build and push images...
</code></pre>

<blockquote><p><strong>Note:</strong> Code examples use placeholder values. Replace <code>registry.example.com</code>, <code>secrets.example.com</code>, and <code>&lt;your-infisical-project-id&gt;</code> with your actual infrastructure endpoints.</p></blockquote>

<p><strong>The benefits:</strong>
– ✅ No credentials in shell history
– ✅ No manual copy-pasting
– ✅ Audit trail of when credentials were accessed
– ✅ Easy credential rotation
– ✅ Works the same on any machine with Infisical access</p>

<hr>

<h2 id="the-upgrade-process">The Upgrade Process</h2>

<p>With our improved automation in place, the actual upgrade was straightforward:</p>

<h3 id="step-1-research">Step 1: Research</h3>

<p>We used AI assistance to research the glitch-soc v4.5.1 release:
– Confirmed it was a patch release (low risk)
– Verified no database migrations required
– Reviewed all 10 bug fixes
– Checked for breaking changes (none found)</p>

<p><strong>Lesson:</strong> Always research before executing. 15 minutes of reading can prevent hours of rollback.</p>

<h3 id="step-2-update-version-references">Step 2: Update Version References</h3>

<p>We needed to update the version in exactly 4 places:</p>
<ol><li><code>docker-assets/build.sh</code> – Build script version variable</li>
<li><code>docker-assets/Dockerfile.mastodon-sentry</code> – Base image version</li>
<li><code>docker-assets/Dockerfile.streaming-sentry</code> – Streaming image version</li>
<li><code>values-river.yaml</code> – Helm values for both image tags</li></ol>

<p><strong>Lesson:</strong> Keep a checklist of version locations. It&#39;s easy to miss one.</p>

<h3 id="step-3-build-custom-images">Step 3: Build Custom Images</h3>

<pre><code class="language-bash">cd docker-assets
./build.sh
</code></pre>

<p>The script now:
– Fetches credentials from Infisical ✓
– Logs into Harbor registry ✓
– Builds both images with <code>--platform linux/amd64</code> ✓
– Pushes to registry ✓
– Provides clear success/failure messages ✓</p>

<p>Build time: ~5 seconds (thanks to Docker layer caching!)</p>

<h3 id="step-4-deploy-to-kubernetes">Step 4: Deploy to Kubernetes</h3>

<pre><code class="language-bash">cd ..
helm upgrade river-mastodon . -n mastodon -f values-river.yaml
</code></pre>

<p>Helm performed a rolling update:
– Old pods kept running while new ones started
– New pods pulled v4.5.1 images
– Old pods terminated once new ones were healthy
– <strong>Zero downtime</strong> for our users</p>

<h3 id="step-5-verify">Step 5: Verify</h3>

<pre><code class="language-bash">kubectl exec -n mastodon deployment/river-mastodon-web -- tootctl version
# Output: 4.5.1+glitch
</code></pre>

<p>All three pod types (web, streaming, sidekiq) now running the new version. Success! 🎉</p>

<hr>

<h2 id="what-we-learned">What We Learned</h2>

<h3 id="1-automation-compounds-over-time">1. Automation Compounds Over Time</h3>

<p>The Infisical integration took about 60 minutes to implement. The actual version bump took 30 minutes. That might seem like overkill for a “simple” upgrade.</p>

<p>But here&#39;s the math:
– <strong>Manual process:</strong> 5 minutes per build to manage credentials
– <strong>Automated process:</strong> 0 minutes
– <strong>Builds per year:</strong> ~20 upgrades and tests
– <strong>Time saved annually:</strong> 100 minutes
– <strong>Payback period:</strong> 12 builds (~6 months)</p>

<p>Plus, we eliminated a security risk. The real value isn&#39;t just time – it&#39;s confidence and safety.</p>

<h3 id="2-separate-upstream-from-custom">2. Separate Upstream from Custom</h3>

<p>We keep the upstream Helm chart (<code>Chart.yaml</code>) completely untouched. Our customizations live in:
– Custom Dockerfiles (add Sentry)
– Values overrides (<code>values-river.yaml</code>)
– Build scripts</p>

<p><strong>Why this matters:</strong> We can pull upstream chart updates without conflicts. Our changes are additive, not modifications.</p>

<h3 id="3-test-incrementally">3. Test Incrementally</h3>

<p>We didn&#39;t just run the full build and hope it worked. We tested:</p>
<ol><li>✓ Credential retrieval from Infisical</li>
<li>✓ JSON parsing with <code>jq</code></li>
<li>✓ Docker login with retrieved credentials</li>
<li>✓ Image builds</li>
<li>✓ Image pushes to registry</li>
<li>✓ Kubernetes deployment</li>
<li>✓ Running version verification</li></ol>

<p>Each step validated before moving forward. When something broke (initial credential permissions), we caught it immediately.</p>

<h3 id="4-documentation-is-for-future-you">4. Documentation Is for Future You</h3>

<p>We wrote a comprehensive retrospective covering:
– What went well
– What we learned
– What we&#39;d do differently next time
– Troubleshooting guides for common issues</p>

<p>In 6 months when we upgrade to v4.6.0, we&#39;ll thank ourselves for this documentation.</p>

<h3 id="5-version-numbers-tell-a-story">5. Version Numbers Tell a Story</h3>

<p>Understanding semantic versioning helps assess risk:</p>
<ul><li><strong>v4.5.0 → v4.5.1</strong> = Patch release (bug fixes only, low risk)</li>
<li><strong>v4.5.x → v4.6.0</strong> = Minor release (new features, moderate risk)</li>
<li><strong>v4.x.x → v5.0.0</strong> = Major release (breaking changes, high risk)</li></ul>

<p>This informed our decision to proceed quickly with minimal testing.</p>

<hr>

<h2 id="what-we-d-do-differently-next-time">What We&#39;d Do Differently Next Time</h2>

<p>Despite the success, we identified improvements:</p>

<h3 id="high-priority">High Priority</h3>

<p><strong>1. Validate credentials before building</strong></p>

<p>Currently, we discover authentication failures during the image push (after building). Better:</p>

<pre><code class="language-bash"># Test login BEFORE building
if ! docker login ...; then
  echo &#34;❌ Auth failed&#34;
  exit 1
fi
</code></pre>

<p><strong>2. Initialize Infisical project config</strong></p>

<p>Running <code>infisical init</code> in the project directory creates a <code>.infisical.json</code> file, eliminating the need for <code>--projectId</code> flags in every command.</p>

<p><strong>3. Add version consistency checks</strong></p>

<p>A simple script to verify all 4 files have matching versions before building would catch human errors.</p>

<h3 id="medium-priority">Medium Priority</h3>

<p><strong>4. Automated deployment verification</strong></p>

<p>Replace manual <code>kubectl</code> checks with a script that:
– Waits for pods to be ready
– Extracts running version
– Compares to expected version
– Reports success/failure</p>

<p><strong>5. Dry-run mode for build script</strong></p>

<p>Test the script logic without actually building or pushing images. Useful for testing changes to the script itself.</p>

<hr>

<h2 id="the-impact">The Impact</h2>

<p><strong>Before this session:</strong>
– Manual credential management
– 5+ minutes per build for login
– Credentials in shell history (security risk)
– No audit trail</p>

<p><strong>After this session:</strong>
– Automated credential retrieval
– 0 minutes per build for login
– Credentials never exposed (security improvement)
– Full audit trail in Infisical
– Repeatable process documented</p>

<p><strong>Plus:</strong> We&#39;re running Mastodon v4.5.1 with 10 bug fixes, making our instance more stable for our users.</p>

<hr>

<h2 id="lessons-for-other-mastodon-admins">Lessons for Other Mastodon Admins</h2>

<p>If you run a Mastodon instance, here&#39;s what we learned that might help you:</p>

<h3 id="for-small-instances">For Small Instances</h3>

<p>Even if you&#39;re running standard Mastodon without customizations:</p>
<ol><li><strong>Document your upgrade process</strong> – Your future self will thank you</li>
<li><strong>Test in staging first</strong> – If you don&#39;t have staging, test with dry-run/simulation</li>
<li><strong>Always check release notes</strong> – 5 minutes of reading prevents hours of debugging</li>
<li><strong>Use semantic versioning to assess risk</strong> – Patch releases are usually safe</li></ol>

<h3 id="for-custom-deployments">For Custom Deployments</h3>

<p>If you run custom images like we do:</p>
<ol><li><strong>Separate upstream from custom</strong> – Keep modifications isolated and additive</li>
<li><strong>Automate credential management</strong> – Shell history is not secure storage</li>
<li><strong>Use Docker layer caching</strong> – Speeds up builds dramatically</li>
<li><strong>Platform flags matter</strong> – <code>--platform linux/amd64</code> if deploying to different architecture</li>
<li><strong>Verify the running version</strong> – Don&#39;t assume deployment worked, check it</li></ol>

<h3 id="for-kubernetes-deployments">For Kubernetes Deployments</h3>

<p>If you deploy to Kubernetes:</p>
<ol><li><strong>Rolling updates are your friend</strong> – Zero downtime is achievable</li>
<li><strong>Helm revisions enable easy rollback</strong> – <code>helm rollback</code> is simple and fast</li>
<li><strong>Verify pod image versions</strong> – Check what&#39;s actually running, not just deployed</li>
<li><strong>Monitor during rollout</strong> – Watch pod status, don&#39;t just fire and forget</li></ol>

<hr>

<h2 id="the-numbers">The Numbers</h2>

<p><strong>Session Duration:</strong> 90 minutes total
– Research: 15 minutes
– Version updates: 10 minutes
– Infisical integration: 60 minutes
– Build &amp; deploy: 5 minutes</p>

<p><strong>Deployment Stats:</strong>
– <strong>Downtime:</strong> 0 seconds (rolling update)
– <strong>Pods affected:</strong> 3 (web, streaming, sidekiq)
– <strong>Helm revision:</strong> 166
– <strong>Rollback complexity:</strong> Low (single command)</p>

<p><strong>Lines of code changed:</strong> 18 lines across 4 files
<strong>Lines of documentation written:</strong> 629 lines (retrospective)
<strong>Security improvements:</strong> 1 major (credential management)</p>

<hr>

<h2 id="final-thoughts">Final Thoughts</h2>

<p>What started as a simple patch upgrade turned into a significant infrastructure improvement. The version bump was almost trivial – the real work was automating away manual steps and eliminating security risks.</p>

<p>This is what good ops work looks like: using routine maintenance as an opportunity to make systems better. The 60 minutes we spent on Infisical integration will pay dividends on every future build. The documentation we wrote will help the next person (or future us) upgrade with confidence.</p>

<p>Mastodon v4.5.1 is running smoothly, our build process is more secure, and we learned lessons that will make the next upgrade even smoother.</p>

<hr>

<h2 id="resources">Resources</h2>

<p><strong>For Mastodon Admins:</strong>
– <a href="https://docs.joinmastodon.org/admin/upgrading/" rel="nofollow">Mastodon Upgrade Documentation</a>
– <a href="https://github.com/glitch-soc/mastodon/releases" rel="nofollow">glitch-soc Releases</a></p>

<p><strong>For Infrastructure:</strong>
– <a href="https://infisical.com/" rel="nofollow">Infisical (Secrets Management)</a>
– <a href="https://docs.docker.com/develop/develop-images/dockerfile_best-practices/" rel="nofollow">Docker Build Best Practices</a>
– <a href="https://helm.sh/docs/helm/helm_upgrade/" rel="nofollow">Helm Upgrade Documentation</a></p>

<p><strong>Our Instance:</strong>
– <a href="https://river.group.lt/" rel="nofollow">river.group.lt</a> – Live Mastodon instance
– Running glitch-soc v4.5.1+glitch
– Kubernetes + Helm deployment
– Custom images with Sentry monitoring</p>

<hr>

<h2 id="questions">Questions?</h2>

<p>If you&#39;re running a Mastodon instance and have questions about:
– Upgrading glitch-soc variants
– Custom Docker image workflows
– Kubernetes deployments
– Secrets management with Infisical
– Zero-downtime upgrades</p>

<p>Feel free to reach out! We&#39;re happy to share what we&#39;ve learned.</p>

<hr>

<p><strong>Tags:</strong> <a href="/saint/tag:mastodon" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">mastodon</span></a> <a href="/saint/tag:glitch" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">glitch</span></a>-soc <a href="/saint/tag:kubernetes" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">kubernetes</span></a> <a href="/saint/tag:devops" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">devops</span></a> <a href="/saint/tag:infrastructure" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">infrastructure</span></a> <a href="/saint/tag:security" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">security</span></a> <a href="/saint/tag:automation" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">automation</span></a></p>

<hr>

<p><em>This blog post is part of our infrastructure documentation series. We believe in sharing knowledge to help others running similar systems. All technical details are from our actual upgrade session on November 13, 2025.</em></p>

<p>Comment in the Fediverse <a href="https://avys.group.lt/@/saint@river.group.lt" class="u-url mention" rel="nofollow">@<span>saint@river.group.lt</span></a></p>
]]></content:encoded>
      <guid>https://avys.group.lt/saint/upgrading-mastodon-to-v4-5-1-a-journey-in-automation-and-security</guid>
      <pubDate>Thu, 13 Nov 2025 22:31:41 +0000</pubDate>
    </item>
    <item>
      <title>Upgrading River Mastodon to v4.5.0: A Journey Through Architecture Mismatches</title>
      <link>https://avys.group.lt/saint/upgrading-river-mastodon-to-v4-5-0-a-journey-through-architecture-mismatches</link>
      <description>&lt;![CDATA[We recently upgraded our Mastodon instance from v4.4.4 to v4.5.0, bumping the Helm chart from 6.5.3 to 6.6.0. While the upgrade itself was straightforward, we encountered an interesting challenge that&#39;s worth sharing.&#xA;&#xA;What&#39;s New in Mastodon v4.5.0?&#xA;&#xA;The v4.5.0 release brings some exciting features:&#xA;&#xA;✨ Quote Posts - Full support for authoring and displaying quotes&#xA;🔄 Dynamic Reply Fetching - Better conversation threading in the web UI&#xA;🚫 Username Blocking - Server-wide username filtering&#xA;🎨 Custom Emoji Overhaul - Complete rendering system rewrite&#xA;📊 Enhanced Moderation Tools - Improved admin/moderator interface&#xA;⚡ Performance Improvements - Optimized database queries&#xA;&#xA;The Architecture Gotcha&#xA;&#xA;Everything seemed perfect during the upgrade process. We:&#xA;&#xA;Merged the upstream chart cleanly&#xA;Updated our custom configurations (LibreTranslate, Sentry integration)&#xA;Built new Docker images with Sentry monitoring&#xA;Pushed to our registry&#xA;&#xA;But when we deployed, pods started crashing with a cryptic error:&#xA;&#xA;exec /usr/local/bundle/bin/bundle: exec format error&#xA;&#xA;The Root Cause&#xA;&#xA;The issue? Architecture mismatch. We built our Docker images on an ARM64 Mac (Apple Silicon), but our Kubernetes cluster runs on AMD64 (x86_64) nodes. The images were perfectly valid—just for the wrong architecture!&#xA;&#xA;The Fix&#xA;&#xA;The solution was simple but important:&#xA;&#xA;docker build --platform linux/amd64 \&#xA;  -f Dockerfile.mastodon-sentry \&#xA;  -t registry.example.com/mastodon-sentry:v4.5.0 \&#xA;  . --push&#xA;&#xA;By explicitly specifying --platform linux/amd64, Docker builds images compatible with our cluster architecture, even when building on ARM64 hardware.&#xA;&#xA;We updated our build script to always include this flag, preventing future issues:&#xA;&#xA;Build for AMD64 (cluster architecture)&#xA;docker build --platform linux/amd64 \&#xA;  -f Dockerfile.mastodon-sentry \&#xA;  -t ${REGISTRY}/mastodon-sentry:${VERSION} \&#xA;  . --push&#xA;&#xA;Deployment Results&#xA;&#xA;After rebuilding with the correct architecture:&#xA;&#xA;✅ All pods running healthy (web, streaming, sidekiq)&#xA;✅ Elasticsearch cluster rolled out successfully&#xA;✅ PostgreSQL remained stable&#xA;✅ Zero data loss, minimal downtime&#xA;✅ All customizations preserved (LibreTranslate, Sentry, custom log levels)&#xA;&#xA;Deployment Stats:&#xA;Total time: ~2 hours (including troubleshooting)&#xA;Downtime: Minimal (rolling update)&#xA;&#xA;Lessons Learned&#xA;&#xA;Always specify target platform when building images for deployment, especially in cross-architecture development environments&#xA;Build scripts should be architecture-aware to prevent silent failures&#xA;Test deployments catch issues early - the error appeared immediately during pod startup&#xA;Keep customizations isolated - Our values-river.yaml approach made the upgrade smooth&#xA;&#xA;What&#39;s Next?&#xA;&#xA;We still need to reindex Elasticsearch for the new search features:&#xA;&#xA;kubectl exec -n mastodon deployment/river-mastodon-web -- \&#xA;  tootctl search deploy&#xA;&#xA;This will update search indices for all accounts, statuses, and tags to take advantage of v4.5.0&#39;s improved search capabilities.&#xA;&#xA;Key Takeaway&#xA;&#xA;Modern development often happens on ARM64 Macs while production runs on AMD64 servers. Docker&#39;s multi-platform build support makes this seamless—but only if you remember to use it! A simple --platform flag saved us from a much longer debugging session.&#xA;&#xA;Happy federating! 🐘&#xA;&#xA;---&#xA;&#xA;Resources:&#xA;Mastodon v4.5.0 Release Notes&#xA;Docker Multi-Platform Builds&#xA;Mastodon Helm Chart&#xA;&#xA;---&#xA;&#xA;Our instance runs on Kubernetes with custom Sentry monitoring, LibreTranslate integration, and an alternative Redis implementation. All chart templates remain identical to upstream, with customizations isolated in our values file.&#xA;&#xA;Comment in the Fediverse @saint@river.group.lt]]&gt;</description>
      <content:encoded><![CDATA[<p>We recently upgraded our Mastodon instance from v4.4.4 to v4.5.0, bumping the Helm chart from 6.5.3 to 6.6.0. While the upgrade itself was straightforward, we encountered an interesting challenge that&#39;s worth sharing.</p>

<h2 id="what-s-new-in-mastodon-v4-5-0">What&#39;s New in Mastodon v4.5.0?</h2>

<p>The v4.5.0 release brings some exciting features:</p>
<ul><li>✨ <strong>Quote Posts</strong> – Full support for authoring and displaying quotes</li>
<li>🔄 <strong>Dynamic Reply Fetching</strong> – Better conversation threading in the web UI</li>
<li>🚫 <strong>Username Blocking</strong> – Server-wide username filtering</li>
<li>🎨 <strong>Custom Emoji Overhaul</strong> – Complete rendering system rewrite</li>
<li>📊 <strong>Enhanced Moderation Tools</strong> – Improved admin/moderator interface</li>
<li>⚡ <strong>Performance Improvements</strong> – Optimized database queries</li></ul>

<h2 id="the-architecture-gotcha">The Architecture Gotcha</h2>

<p>Everything seemed perfect during the upgrade process. We:</p>
<ol><li>Merged the upstream chart cleanly</li>
<li>Updated our custom configurations (LibreTranslate, Sentry integration)</li>
<li>Built new Docker images with Sentry monitoring</li>
<li>Pushed to our registry</li></ol>

<p>But when we deployed, pods started crashing with a cryptic error:</p>

<pre><code>exec /usr/local/bundle/bin/bundle: exec format error
</code></pre>

<h3 id="the-root-cause">The Root Cause</h3>

<p>The issue? <strong>Architecture mismatch</strong>. We built our Docker images on an ARM64 Mac (Apple Silicon), but our Kubernetes cluster runs on AMD64 (x86_64) nodes. The images were perfectly valid—just for the wrong architecture!</p>

<h3 id="the-fix">The Fix</h3>

<p>The solution was simple but important:</p>

<pre><code class="language-bash">docker build --platform linux/amd64 \
  -f Dockerfile.mastodon-sentry \
  -t registry.example.com/mastodon-sentry:v4.5.0 \
  . --push
</code></pre>

<p>By explicitly specifying <code>--platform linux/amd64</code>, Docker builds images compatible with our cluster architecture, even when building on ARM64 hardware.</p>

<p>We updated our build script to always include this flag, preventing future issues:</p>

<pre><code class="language-bash"># Build for AMD64 (cluster architecture)
docker build --platform linux/amd64 \
  -f Dockerfile.mastodon-sentry \
  -t ${REGISTRY}/mastodon-sentry:${VERSION} \
  . --push
</code></pre>

<h2 id="deployment-results">Deployment Results</h2>

<p>After rebuilding with the correct architecture:</p>
<ul><li>✅ All pods running healthy (web, streaming, sidekiq)</li>
<li>✅ Elasticsearch cluster rolled out successfully</li>
<li>✅ PostgreSQL remained stable</li>
<li>✅ Zero data loss, minimal downtime</li>
<li>✅ All customizations preserved (LibreTranslate, Sentry, custom log levels)</li></ul>

<p><strong>Deployment Stats:</strong>
– Total time: ~2 hours (including troubleshooting)
– Downtime: Minimal (rolling update)</p>

<h2 id="lessons-learned">Lessons Learned</h2>
<ol><li><strong>Always specify target platform</strong> when building images for deployment, especially in cross-architecture development environments</li>
<li><strong>Build scripts should be architecture-aware</strong> to prevent silent failures</li>
<li><strong>Test deployments catch issues early</strong> – the error appeared immediately during pod startup</li>
<li><strong>Keep customizations isolated</strong> – Our values-river.yaml approach made the upgrade smooth</li></ol>

<h2 id="what-s-next">What&#39;s Next?</h2>

<p>We still need to reindex Elasticsearch for the new search features:</p>

<pre><code class="language-bash">kubectl exec -n mastodon deployment/river-mastodon-web -- \
  tootctl search deploy
</code></pre>

<p>This will update search indices for all accounts, statuses, and tags to take advantage of v4.5.0&#39;s improved search capabilities.</p>

<h2 id="key-takeaway">Key Takeaway</h2>

<p>Modern development often happens on ARM64 Macs while production runs on AMD64 servers. Docker&#39;s multi-platform build support makes this seamless—but only if you remember to use it! A simple <code>--platform</code> flag saved us from a much longer debugging session.</p>

<p>Happy federating! 🐘</p>

<hr>

<p><strong>Resources:</strong>
– <a href="https://github.com/mastodon/mastodon/releases/tag/v4.5.0" rel="nofollow">Mastodon v4.5.0 Release Notes</a>
– <a href="https://docs.docker.com/build/building/multi-platform/" rel="nofollow">Docker Multi-Platform Builds</a>
– <a href="https://github.com/mastodon/chart" rel="nofollow">Mastodon Helm Chart</a></p>

<hr>

<p><em>Our instance runs on Kubernetes with custom Sentry monitoring, LibreTranslate integration, and an alternative Redis implementation. All chart templates remain identical to upstream, with customizations isolated in our values file.</em></p>

<p>Comment in the Fediverse <a href="https://avys.group.lt/@/saint@river.group.lt" class="u-url mention" rel="nofollow">@<span>saint@river.group.lt</span></a></p>
]]></content:encoded>
      <guid>https://avys.group.lt/saint/upgrading-river-mastodon-to-v4-5-0-a-journey-through-architecture-mismatches</guid>
      <pubDate>Sat, 08 Nov 2025 23:35:26 +0000</pubDate>
    </item>
    <item>
      <title>Monitoring best practices</title>
      <link>https://avys.group.lt/saint/monitoring-best-practices</link>
      <description>&lt;![CDATA[Monitoring best practices&#xA;&#xA;There are things that really irks my day and monitoring alerts that are not actionable (i.e. - informational) are in that list, so writing this blog post to improve the signal. &#xA;&#xA;Any alert you receive from monitoring system should be actionable and that action must not be snoosable or something similar.&#xA;&#xA;You get alert - you work bitch. &#xA;&#xA;Comment in the Fediverse @saint@river.group.lt]]&gt;</description>
      <content:encoded><![CDATA[<h2 id="monitoring-best-practices">Monitoring best practices</h2>

<p>There are things that really irks my day and monitoring alerts that are not actionable (i.e. – informational) are in that list, so writing this blog post to improve the signal.</p>
<ul><li>Any alert you receive from monitoring system should be actionable and that action must not be snoosable or something similar.</li></ul>

<p>You get alert – you work bitch.</p>

<p>Comment in the Fediverse <a href="https://avys.group.lt/@/saint@river.group.lt" class="u-url mention" rel="nofollow">@<span>saint@river.group.lt</span></a></p>
]]></content:encoded>
      <guid>https://avys.group.lt/saint/monitoring-best-practices</guid>
      <pubDate>Thu, 16 Nov 2023 15:23:18 +0000</pubDate>
    </item>
    <item>
      <title>How to use Borgmatic to backup PostgreSQL in Kubernetes</title>
      <link>https://avys.group.lt/saint/how-to-use-borgmatic-to-backup-postgresql-in-kubernetes</link>
      <description>&lt;![CDATA[How to use Borgmatic to backup PostgreSQL in Kubernetes&#xA;&#xA;There are many goodies in the internets, but not much good documentation so that usage of them would be frictionless. Here is a short writeup on backuping up Mastodon instance database, running on Kubernetes with Borgmatic, but it could be used for any generic database and/or file path, that is supported by Borg backup and Borgmatic. &#xA;&#xA;For the destination/target repository I am using Borg Base, but it should work with any Borg compatible ssh repo.&#xA;&#xA;There are some issues that I might solve in the future, namely - storing sensitive information in safer way, but for the moment I just wanted to make backups work. If you will do it - please let me know and I will update my setup. &#xA;&#xA;First things first, we need:&#xA;Kubernetes&#xA;Mastodon deployment in its own namespace&#xA;Setup SSH keys&#xA;Setup Healtchecks&#xA;Setup Borgbase&#xA;Install Borgmatic via Helm Chart, using our values&#xA;&#xA;Kubernetes&#xA;You should be runnning something already&#xA;&#xA;Mastodon deployment&#xA;You should have deployed Mastodon already in its own namespace. Instructions should work for any generic deployment that uses PostgreSQL or any other supported database.&#xA;&#xA;Setup SSH keys&#xA;You need to generate ssh key and save both parts - private and public. Private will go to our Borgmatic setup and public - to Borgbase.&#xA;&#xA;ssh-keygen -t ed25519 -f /tmp/ided25519&#xA;&#xA;This can be done on any computer that has ssh-keygen utility. &#xA;Setup Healthchecks&#xA;This is optional, but do it if you do not use Borgbase - get https://healthchecks.io/ account - it is free for small numbers of checks. Borgbase also has the same functionality, so you might skip it if you chose to use Borgbase.&#xA;&#xA;Setup Borgbase &#xA;Again - you can use whatever repository server that supports Borg, but I found Borgbase having all the features I require for the cheap price. Add public ssh key part to keys and make sure that repository is tied to this key. Save the repository address.&#xA;&#xA;Install Borgmatic via Helm Chart, using our values&#xA;I have used this Chart - https://charts.gabe565.com/charts/borgmatic/ - it is great stuff, just had some issues figuring out how it works. I am kinda slow learner - I make a lot of assumptions that result in being me wrong most of the time. The trick was to find good values for values.yaml:&#xA;&#xA;IMPORTANT NOTE&#xA;&#xA;This chart inherits from our common library chart. You can check the default values/options here:&#xA;https://github.com/bjw-s/helm-charts/blob/main/charts/library/common/values.yaml&#xA;&#xA;image:&#xA;  # -- image repository&#xA;  repository: ghcr.io/borgmatic-collective/borgmatic&#xA;  # -- image pull policy&#xA;  pullPolicy: IfNotPresent&#xA;  # -- image tag&#xA;  tag: 1.7.14&#xA;&#xA;controller:&#xA;  # -- Set the controller type. Valid options are deployment or cronjob.&#xA;  type: deployment&#xA;  cronjob:&#xA;    # -- Only used when controller.type: cronjob. Sets the backup CronJob time.&#xA;    schedule: 0    &#xA;    # -- Only used when controller.type: cronjob. Sets the CronJob backoffLimit.&#xA;    backoffLimit: 0&#xA;&#xA;-- environment variables. [ref]&#xA;@default -- See values.yaml&#xA;env:&#xA;  # -- Borg host ID used in archive names&#xA;  # @default -- Deployment namespace&#xA;  BORGHOSTID: &#34;&#34;&#xA;  BORGPASSPHRASE: ---GENERATE THIS WITH pwgen OR SIMILAR TOOL---&#xA;  PGPASSWORD: ---PostgresSQL db password---&#xA;  # MYSQLPWD:&#xA;  # MONGODBPASSWORD:&#xA;&#xA;persistence:&#xA;  # -- Configure persistence settings for the chart under this key.&#xA;  # @default -- See values.yaml&#xA;  data:&#xA;    enabled: false&#xA;    retain: true&#xA;    # storageClass: &#34;&#34;&#xA;    # accessMode: ReadWriteOnce&#xA;    # size: 1Gi&#xA;    subPath:&#xA;      path: borg-repository&#xA;        mountPath: /mnt/borg-repository&#xA;      path: config&#xA;        mountPath: /root/.config/borg&#xA;      path: cache&#xA;        mountPath: /root/.cache/borg&#xA;  # -- Configure SSH credentials for the chart under this key.&#xA;  # @default -- See values.yaml&#xA;  ssh:&#xA;    name: borgmatic-ssh &#xA;    enabled: true&#xA;    type: configMap&#xA;    mountPath: /root/.ssh/&#xA;    readOnly: false&#xA;    defaultMode: 0600&#xA;&#xA;configMaps:&#xA;  # -- Configure Borgmatic container under this key.&#xA;  # @default -- See values.yaml&#xA;  ssh :&#xA;    enabled: true&#xA;    data:&#xA;      ided25519: |&#xA;        -----BEGIN OPENSSH PRIVATE KEY-----&#xA;        --- PASTE YOUR PRIVATE KEY HERE---&#xA;        -----END OPENSSH PRIVATE KEY-----&#xA;      knownhosts: |&#xA;        --- paste the output of ssh-keyscan borg-repository-address ---&#xA;      &#xA;  config:&#xA;    enabled: true&#xA;    data:&#xA;      # -- Crontab&#xA;      crontab.txt: |-&#xA;        0 1   * PATH=$PATH:/usr/bin /usr/local/bin/borgmatic --stats -v 0 2  &amp;1&#xA;      # -- Borgmatic config. [ref]&#xA;      # @default -- See values.yaml&#xA;      config.yaml: |&#xA;        location:&#xA;          # List of source directories to backup.&#xA;          sourcedirectories:&#xA;            /etc/ &lt;- any directory you want as we are concerned only with db backup&#xA;&#xA;          # Paths of local or remote repositories to backup to.&#xA;          repositories:&#xA;            ---BORG REPOSITORY URL---&#xA;&#xA;        retention:&#xA;          # Retention policy for how many backups to keep.&#xA;          keepdaily: 7&#xA;          keepweekly: 4&#xA;          keepmonthly: 6&#xA;&#xA;        consistency:&#xA;          # List of checks to run to validate your backups.&#xA;          checks:&#xA;            name: repository&#xA;            name: archives&#xA;              frequency: 2 weeks&#xA;&#xA;        hooks:&#xA;&#xA;          # Databases to dump and include in backups.&#xA;          postgresqldatabases:&#xA;            name: mastodonproduction&#xA;              hostname: hostname-of-mastodon-postgresql-db&#xA;              username: mastodon&#xA;&#xA;          # Third-party services to notify you if backups aren&#39;t happening.&#xA;          healthchecks: --- healtcheck url ---&#xA;&#xA;helm install borgmatic gabe565/borgmatic -f values.yaml -n mastodon&#xA;kubectl rollout status deployment.apps/borgmatic -n mastodon&#xA;kubectl exec -i deployment.apps/borgmatic -n mastodon -- borgmatic init --encryption repokey-blake2&#xA;kubectl exec -it deployment.apps/borgmatic -n mastodon -- borgmatic create --stats&#xA;All of these commands should be completed without errors&#xA;&#xA; &#xA;&#xA;Comment in the Fediverse @saint@river.group.lt]]&gt;</description>
      <content:encoded><![CDATA[<h2 id="how-to-use-borgmatic-to-backup-postgresql-in-kubernetes">How to use Borgmatic to backup PostgreSQL in Kubernetes</h2>

<p>There are many goodies in the internets, but not much good documentation so that usage of them would be frictionless. Here is a short writeup on backuping up Mastodon instance database, running on Kubernetes with Borgmatic, but it could be used for any generic database and/or file path, that is supported by Borg backup and Borgmatic.</p>

<p>For the destination/target repository I am using Borg Base, but it should work with any Borg compatible ssh repo.</p>

<p>There are some issues that I might solve in the future, namely – storing sensitive information in safer way, but for the moment I just wanted to make backups work. If you will do it – please let me know and I will update my setup.</p>

<p>First things first, we need:
– Kubernetes
– Mastodon deployment in its own namespace
– Setup SSH keys
– Setup Healtchecks
– Setup Borgbase
– Install Borgmatic via Helm Chart, using our values</p>

<h3 id="kubernetes">Kubernetes</h3>

<p>You should be runnning something already</p>

<h3 id="mastodon-deployment">Mastodon deployment</h3>

<p>You should have deployed Mastodon already in its own namespace. Instructions should work for any generic deployment that uses PostgreSQL or any other supported database.</p>

<h3 id="setup-ssh-keys">Setup SSH keys</h3>

<p>You need to generate ssh key and save both parts – private and public. Private will go to our Borgmatic setup and public – to Borgbase.</p>

<pre><code>ssh-keygen -t ed25519 -f /tmp/id_ed25519
</code></pre>

<p>This can be done on any computer that has ssh-keygen utility. <code>/tmp/id_ed25519</code>will contain the private part and <code>/tmp/id_ed25519.pub</code> – the public. You don&#39;t need the files themselves, just contents.</p>

<h3 id="setup-healthchecks">Setup Healthchecks</h3>

<p>This is optional, but do it if you do not use Borgbase – get <a href="https://healthchecks.io/" rel="nofollow">https://healthchecks.io/</a> account – it is free for small numbers of checks. Borgbase also has the same functionality, so you might skip it if you chose to use Borgbase.</p>

<h3 id="setup-borgbase">Setup Borgbase</h3>

<p>Again – you can use whatever repository server that supports Borg, but I found Borgbase having all the features I require for the cheap price. Add public ssh key part to keys and make sure that repository is tied to this key. Save the repository address.</p>

<h3 id="install-borgmatic-via-helm-chart-using-our-values">Install Borgmatic via Helm Chart, using our values</h3>

<p>I have used this Chart – <a href="https://charts.gabe565.com/charts/borgmatic/" rel="nofollow">https://charts.gabe565.com/charts/borgmatic/</a> – it is great stuff, just had some issues figuring out how it works. I am kinda slow learner – I make a lot of assumptions that result in being me wrong most of the time. The trick was to find good values for values.yaml:</p>

<pre><code>#
# IMPORTANT NOTE
#
# This chart inherits from our common library chart. You can check the default values/options here:
# https://github.com/bjw-s/helm-charts/blob/main/charts/library/common/values.yaml
#

image:
  # -- image repository
  repository: ghcr.io/borgmatic-collective/borgmatic
  # -- image pull policy
  pullPolicy: IfNotPresent
  # -- image tag
  tag: 1.7.14

controller:
  # -- Set the controller type. Valid options are `deployment` or `cronjob`.
  type: deployment
  cronjob:
    # -- Only used when `controller.type: cronjob`. Sets the backup CronJob time.
    schedule: 0 * * * *
    # -- Only used when `controller.type: cronjob`. Sets the CronJob backoffLimit.
    backoffLimit: 0

# -- environment variables. [[ref]](https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables)
# @default -- See [values.yaml](./values.yaml)
env:
  # -- Borg host ID used in archive names
  # @default -- Deployment namespace
  BORG_HOST_ID: &#34;&#34;
  BORG_PASSPHRASE: ---GENERATE THIS WITH pwgen OR SIMILAR TOOL---
  PGPASSWORD: ---PostgresSQL db password---
  # MYSQL_PWD:
  # MONGODB_PASSWORD:

persistence:
  # -- Configure persistence settings for the chart under this key.
  # @default -- See [values.yaml](./values.yaml)
  data:
    enabled: false
    retain: true
    # storageClass: &#34;&#34;
    # accessMode: ReadWriteOnce
    # size: 1Gi
    subPath:
      - path: borg-repository
        mountPath: /mnt/borg-repository
      - path: config
        mountPath: /root/.config/borg
      - path: cache
        mountPath: /root/.cache/borg
  # -- Configure SSH credentials for the chart under this key.
  # @default -- See [values.yaml](./values.yaml)
  ssh:
    name: borgmatic-ssh 
    enabled: true
    type: configMap
    mountPath: /root/.ssh/
    readOnly: false
    defaultMode: 0600

configMaps:
  # -- Configure Borgmatic container under this key.
  # @default -- See [values.yaml](./values.yaml)
  ssh :
    enabled: true
    data:
      id_ed25519: |
        -----BEGIN OPENSSH PRIVATE KEY-----
        --- PASTE YOUR PRIVATE KEY HERE---
        -----END OPENSSH PRIVATE KEY-----
      known_hosts: |
        --- paste the output of ssh-keyscan borg-repository-address ---
      
  config:
    enabled: true
    data:
      # -- Crontab
      crontab.txt: |-
        0 1 * * * PATH=$PATH:/usr/bin /usr/local/bin/borgmatic --stats -v 0 2&gt;&amp;1
      # -- Borgmatic config. [[ref]](https://torsion.org/borgmatic/docs/reference/configuration)
      # @default -- See [values.yaml](./values.yaml)
      config.yaml: |
        location:
          # List of source directories to backup.
          source_directories:
            - /etc/ &lt;- any directory you want as we are concerned only with db backup

          # Paths of local or remote repositories to backup to.
          repositories:
            - ---BORG REPOSITORY URL---

        retention:
          # Retention policy for how many backups to keep.
          keep_daily: 7
          keep_weekly: 4
          keep_monthly: 6

        consistency:
          # List of checks to run to validate your backups.
          checks:
            - name: repository
            - name: archives
              frequency: 2 weeks

        hooks:


          # Databases to dump and include in backups.
          postgresql_databases:
            - name: mastodon_production
              hostname: hostname-of-mastodon-postgresql-db
              username: mastodon

          # Third-party services to notify you if backups aren&#39;t happening.
          healthchecks: --- healtcheck url ---
</code></pre>

<pre><code>helm install borgmatic gabe565/borgmatic -f values.yaml -n mastodon
kubectl rollout status deployment.apps/borgmatic -n mastodon
kubectl exec -i deployment.apps/borgmatic -n mastodon -- borgmatic init --encryption repokey-blake2
kubectl exec -it deployment.apps/borgmatic -n mastodon -- borgmatic create --stats
</code></pre>

<p>All of these commands should be completed without errors</p>

<p>Comment in the Fediverse <a href="https://avys.group.lt/@/saint@river.group.lt" class="u-url mention" rel="nofollow">@<span>saint@river.group.lt</span></a></p>
]]></content:encoded>
      <guid>https://avys.group.lt/saint/how-to-use-borgmatic-to-backup-postgresql-in-kubernetes</guid>
      <pubDate>Sat, 17 Jun 2023 15:49:25 +0000</pubDate>
    </item>
    <item>
      <title>Caddyfile for running Lemmy</title>
      <link>https://avys.group.lt/saint/caddyfile-for-running-lemmy</link>
      <description>&lt;![CDATA[Caddyfile for running Lemmy&#xA;&#xA;How to follow Lemmy community from  Mastodon&#xA;&#xA;Spent a couple of hours.. wanted to follow a Lemmy community from group.lt instance on Mastodon. Here is a working config for Caddy (Caddyfile):&#xA;&#xA;group.lt {&#xA;&#x9;reverseproxy&#x9;http://lemmylemmy-ui1:1234&#xA;        tls saint@ghost.lt {&#xA;}&#xA;&#xA;@lemmy {&#xA;        path    /api/&#xA;        path    /pictrs/&#xA;        path    /feeds/&#xA;        path    /nodeinfo/&#xA;        path    /.well-known/&#xA;}&#xA;&#xA;@lemmy-hdr {&#xA;&#x9;header Accept application/&#xA;}&#xA;&#xA;@lemmy-post {&#xA;&#x9;method POST&#xA;}&#xA;&#xA;handle @lemmy {&#xA;        reverseproxy   http://lemmylemmy1:8536&#xA;}&#xA;&#xA;handle @lemmy-hdr {&#xA;        reverseproxy   http://lemmylemmy1:8536&#xA;}&#xA;&#xA;handle @lemmy-post {&#xA;        reverseproxy   http://lemmylemmy1:8536&#xA;}&#xA;&#xA;The key point here was &#xA;&#xA;@lemmy-hdr {&#xA;&#x9;header Accept application/*&#xA;}&#xA;&#xA;I have taken a hint from lemmy.coupou.fr&#xA;&#xA;and from some nginx conf for lemmy&#xA;&#xA;Comment in the Fediverse @saint@river.group.lt]]&gt;</description>
      <content:encoded><![CDATA[<h2 id="caddyfile-for-running-lemmy">Caddyfile for running Lemmy</h2>

<h3 id="how-to-follow-lemmy-community-from-mastodon">How to follow Lemmy community from  Mastodon</h3>

<p>Spent a couple of hours.. wanted to follow a Lemmy community from <a href="https://group.lt" rel="nofollow">group.lt</a> instance on Mastodon. Here is a working config for Caddy (Caddyfile):</p>

<pre><code>group.lt {
	reverse_proxy	http://lemmy_lemmy-ui_1:1234
        tls saint@ghost.lt {
}

@lemmy {
        path    /api/*
        path    /pictrs/*
        path    /feeds/*
        path    /nodeinfo/*
        path    /.well-known/*
}

@lemmy-hdr {
	header Accept application/*
}

@lemmy-post {
	method POST
}

handle @lemmy {
        reverse_proxy   http://lemmy_lemmy_1:8536
}

handle @lemmy-hdr {
        reverse_proxy   http://lemmy_lemmy_1:8536
}

handle @lemmy-post {
        reverse_proxy   http://lemmy_lemmy_1:8536
}
</code></pre>

<p>The key point here was</p>

<pre><code>@lemmy-hdr {
	header Accept application/*
}
</code></pre>

<p>I have taken a hint from <a href="https://lemmy.coupou.fr/post/11068/comment/5544" rel="nofollow">lemmy.coupou.fr</a></p>

<p>and from <a href="https://github.com/LemmyNet/lemmy-ansible/blob/main/templates/nginx.conf" rel="nofollow">some nginx conf for lemmy</a></p>

<p>Comment in the Fediverse <a href="https://avys.group.lt/@/saint@river.group.lt" class="u-url mention" rel="nofollow">@<span>saint@river.group.lt</span></a></p>
]]></content:encoded>
      <guid>https://avys.group.lt/saint/caddyfile-for-running-lemmy</guid>
      <pubDate>Wed, 21 Dec 2022 12:46:51 +0000</pubDate>
    </item>
    <item>
      <title>Reclaiming space in synapse postgresql database</title>
      <link>https://avys.group.lt/saint/reclaiming-space-in-synapse-postgresql-database</link>
      <description>&lt;![CDATA[Reclaiming space in synapse postgresql database&#xA;&#xA;Follow the fat elephant&#xA;&#xA;I have received an alert from Grafana - that my synapse directory is almost full, which was kinda strange as I have given 100GB partition to it just a couple of weeks ago.. So I have put a hat, picked up some cider and something to smoke and went to the adventure. &#xA;&#xA;From the old times I knew that postgresql database size can be reduced using vacuumdb. Entered the container and boom - after 15 or so minutes it has finished and reclaimed 100MB of space.. Hmmm... Interesting - which table eats the space. Google, link&#xA;&#xA;SELECT&#xA;    relname AS &#34;relation&#34;,&#xA;    pgsizepretty (&#xA;        pgtotalrelationsize (C .oid)&#xA;    ) AS &#34;totalsize&#34;&#xA;FROM&#xA;    pgclass C&#xA;LEFT JOIN pgnamespace N ON (N.oid = C .relnamespace)&#xA;WHERE&#xA;    nspname NOT IN (&#xA;        &#39;pgcatalog&#39;,&#xA;        &#39;informationschema&#39;&#xA;    )&#xA;AND C .relkind  &#39;i&#39;&#xA;AND nspname !~ &#39;^pgtoast&#39;&#xA;ORDER BY&#xA;    pgtotalrelationsize (C .oid) DESC&#xA;LIMIT 5;&#xA; relation      | totalsize&#xA;--------------------+------------&#xA; stategroupsstate | 65 GB&#xA; eventjson         | 1197 MB&#xA; eventedges        | 619 MB&#xA; events             | 595 MB&#xA; eventauth         | 528 MB&#xA;Alright!!! Google: stategroupsstate, link and found a compression tool. &#xA;&#xA;git clone, crap a short docker-compose.yml and build the tool.&#xA;&#xA;root@instance-20211112-2005:/opt/synapse-compress-state# cat docker-compose.yaml&#xA;---&#xA;version: &#34;3.5&#34;&#xA;services:&#xA;  synapse-compress:&#xA;      build:&#xA;        context: rust-synapse-compress-state/&#xA;      command: synapseauto_compressor -p postgresql://user:pass@dbhost/dbname -c 500 -n 100&#xA;      networks:&#xA;          synapse&#xA;&#xA;networks:&#xA;        synapse:&#xA;                name: synapse&#xA;&#xA;let&#39;s crap some more:&#xA;&#xA;root@instance-20211112-2005:/opt/synapse# cat /opt/synapse-compress-state/run.sh&#xA;!/bin/bash&#xA;&#xA;cd /opt/synapse-compress-state/&#xA;&#xA;docker-compose up&#xA;&#xA;put it into crontab:&#xA;@daily /opt/synapse-compress-state/run.sh   /dev/null&#xA;&#xA;later googled more and found some smarter people than me: shrink synapse database and that really helped, especially reindexing. &#x9;&#xA;&#xA;Comment in the Fediverse @saint@river.group.lt]]&gt;</description>
      <content:encoded><![CDATA[<h2 id="reclaiming-space-in-synapse-postgresql-database">Reclaiming space in synapse postgresql database</h2>

<h3 id="follow-the-fat-elephant">Follow the fat elephant</h3>

<p>I have received an alert from Grafana – that my synapse directory is almost full, which was kinda strange as I have given 100GB partition to it just a couple of weeks ago.. So I have put a hat, picked up some cider and something to smoke and went to the adventure.</p>

<p>From the old times I knew that postgresql database size can be reduced using vacuumdb. Entered the container and boom – after 15 or so minutes it has finished and reclaimed 100MB of space.. Hmmm... Interesting – which table eats the space. Google, <a href="https://www.postgresqltutorial.com/postgresql-administration/postgresql-database-indexes-table-size/" rel="nofollow">link</a></p>

<pre><code>SELECT
    relname AS &#34;relation&#34;,
    pg_size_pretty (
        pg_total_relation_size (C .oid)
    ) AS &#34;total_size&#34;
FROM
    pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C .relnamespace)
WHERE
    nspname NOT IN (
        &#39;pg_catalog&#39;,
        &#39;information_schema&#39;
    )
AND C .relkind &lt;&gt; &#39;i&#39;
AND nspname !~ &#39;^pg_toast&#39;
ORDER BY
    pg_total_relation_size (C .oid) DESC
LIMIT 5;
</code></pre>

<pre><code> relation      | total_size
--------------------+------------
 state_groups_state | 65 GB
 event_json         | 1197 MB
 event_edges        | 619 MB
 events             | 595 MB
 event_auth         | 528 MB
</code></pre>

<p>Alright!!! Google: state<em>groups</em>state, <a href="https://matrix-org.github.io/synapse/latest/usage/administration/state_groups.html" rel="nofollow">link</a> and found a compression tool.</p>

<p>git clone, crap a short docker-compose.yml and build the tool.</p>

<pre><code>root@instance-20211112-2005:/opt/synapse-compress-state# cat docker-compose.yaml
---
version: &#34;3.5&#34;
services:
  synapse-compress:
      build:
        context: rust-synapse-compress-state/
      command: synapse_auto_compressor -p postgresql://user:pass@dbhost/dbname -c 500 -n 100
      networks:
          - synapse

networks:
        synapse:
                name: synapse
</code></pre>

<p>let&#39;s crap some more:</p>

<pre><code>root@instance-20211112-2005:/opt/synapse# cat /opt/synapse-compress-state/run.sh
#!/bin/bash

cd /opt/synapse-compress-state/

docker-compose up
</code></pre>

<p>put it into crontab:</p>

<pre><code>@daily /opt/synapse-compress-state/run.sh &gt; /dev/null
</code></pre>

<p>later googled more and found some smarter people than me: <a href="https://levans.fr/shrink-synapse-database.html" rel="nofollow">shrink synapse database</a> and that really helped, especially reindexing.</p>

<p>Comment in the Fediverse <a href="https://avys.group.lt/@/saint@river.group.lt" class="u-url mention" rel="nofollow">@<span>saint@river.group.lt</span></a></p>
]]></content:encoded>
      <guid>https://avys.group.lt/saint/reclaiming-space-in-synapse-postgresql-database</guid>
      <pubDate>Wed, 21 Dec 2022 12:46:26 +0000</pubDate>
    </item>
    <item>
      <title>How to send mail using php mail() function in docker way</title>
      <link>https://avys.group.lt/saint/how-to-send-mail-using-php-mail-function-in-docker-way</link>
      <description>&lt;![CDATA[How to send mail using php mail() function in docker way&#xA;&#xA;Using ssmtp to send email to the relay container&#xA;&#xA;Sometimes we want to run dockerized old php site that we do not want to work with, or a programmer is gone  and nobody cares to make changes to use email relay host, such as mailgun or gmail or anything else. In the Linux VM or bare metal server it is quite easy task - you run web server and mail server two in one and mail server takes care of mail routing. &#xA;&#xA;In the dockerized environment usually you want to run the least amount of services possible in the container, so sending mail using PHP&#39;s mail() function becomes a tricky.&#xA;&#xA;Let&#39;s create a docker-compose.yml file, containing all required containers:&#xA;&#xA;caddy - web server&#xA;&#xA;php - php server for the app - the trick here to use msmtp as a sendmail to have mail sent to remote server (our mail container)&#xA;&#xA;mail - smtp relay server, we will use postfix&#xA;&#xA;the source code is here: docker-php-mail-example&#xA;&#xA;the main thing is to use ssmtp on the php container and send data to mail container&#xA;&#xA;enjoy!&#xA;&#xA;Comment in the Fediverse @saint@river.group.lt]]&gt;</description>
      <content:encoded><![CDATA[<h2 id="how-to-send-mail-using-php-mail-function-in-docker-way">How to send mail using php mail() function in docker way</h2>

<h3 id="using-ssmtp-to-send-email-to-the-relay-container">Using ssmtp to send email to the relay container</h3>

<p>Sometimes we want to run dockerized old php site that we do not want to work with, or a programmer is gone  and nobody cares to make changes to use email relay host, such as mailgun or gmail or anything else. In the Linux VM or bare metal server it is quite easy task – you run web server and mail server two in one and mail server takes care of mail routing.</p>

<p>In the dockerized environment usually you want to run the least amount of services possible in the container, so sending mail using PHP&#39;s mail() function becomes a tricky.</p>

<p>Let&#39;s create a docker-compose.yml file, containing all required containers:</p>

<p><em>caddy</em> – web server</p>

<p><em>php</em> – php server for the app – the trick here to use <em>msmtp</em> as a sendmail to have mail sent to remote server (our mail container)</p>

<p><em>mail</em> – smtp relay server, we will use postfix</p>

<p>the source code is here: <a href="https://github.com/nycterent/docker-php-mail-example" rel="nofollow">docker-php-mail-example</a></p>

<p>the main thing is to use ssmtp on the php container and send data to mail container</p>

<p>enjoy!</p>

<p>Comment in the Fediverse <a href="https://avys.group.lt/@/saint@river.group.lt" class="u-url mention" rel="nofollow">@<span>saint@river.group.lt</span></a></p>
]]></content:encoded>
      <guid>https://avys.group.lt/saint/how-to-send-mail-using-php-mail-function-in-docker-way</guid>
      <pubDate>Wed, 21 Dec 2022 12:45:51 +0000</pubDate>
    </item>
  </channel>
</rss>