<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on Szymon Kocur</title><link>https://szymonkocur.com/posts/</link><description>Recent content in Posts on Szymon Kocur</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 02 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://szymonkocur.com/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>Why Your Kubernetes Pods Get 502s During Deployments (and How preStop Hooks Fix It)</title><link>https://szymonkocur.com/posts/kubernetes-prestop-hooks-zero-downtime/</link><pubDate>Thu, 02 Apr 2026 00:00:00 +0000</pubDate><guid>https://szymonkocur.com/posts/kubernetes-prestop-hooks-zero-downtime/</guid><description>&lt;p&gt;If you&amp;rsquo;ve ever deployed to Kubernetes and seen users briefly hit a blank page or a &lt;code&gt;502 Bad Gateway&lt;/code&gt; error, you&amp;rsquo;re not alone. I ran into this exact issue on a production GKE cluster running a web frontend with multiple replicas behind a Google Cloud Load Balancer.&lt;/p&gt;
&lt;p&gt;The symptom: during a rolling update, for a few seconds, some users would see a black screen with a &amp;ldquo;failed upstream&amp;rdquo; message. Then it would resolve on its own. Annoying, intermittent, and hard to reproduce locally.&lt;/p&gt;</description></item><item><title>Three HPA Pitfalls I Hit on GKE with Flux and Linkerd</title><link>https://szymonkocur.com/posts/three-hpa-pitfalls-gke-flux-linkerd/</link><pubDate>Sun, 29 Mar 2026 00:00:00 +0000</pubDate><guid>https://szymonkocur.com/posts/three-hpa-pitfalls-gke-flux-linkerd/</guid><description>&lt;p&gt;I added Horizontal Pod Autoscalers to a production GKE cluster running &lt;a href="https://fluxcd.io/" class="external-link" target="_blank" rel="noopener"&gt;Flux CD&lt;/a&gt; for GitOps and &lt;a href="https://linkerd.io/" class="external-link" target="_blank" rel="noopener"&gt;Linkerd&lt;/a&gt; as a service mesh. The HPA configuration itself was straightforward — the problems came from how these three systems interact.&lt;/p&gt;
&lt;p&gt;Here are three pitfalls I hit, each requiring a separate fix.&lt;/p&gt;
&lt;h2 id="1-flux-keeps-resetting-the-replica-count"&gt;
 1. Flux keeps resetting the replica count
 &lt;a class="heading-link" href="#1-flux-keeps-resetting-the-replica-count"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;The first HPA I deployed looked like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#7ee787"&gt;apiVersion&lt;/span&gt;:&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#a5d6ff"&gt;autoscaling/v2&lt;/span&gt;&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#7ee787"&gt;kind&lt;/span&gt;:&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#a5d6ff"&gt;HorizontalPodAutoscaler&lt;/span&gt;&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#7ee787"&gt;metadata&lt;/span&gt;:&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#7ee787"&gt;name&lt;/span&gt;:&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#a5d6ff"&gt;frontend&lt;/span&gt;&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#7ee787"&gt;spec&lt;/span&gt;:&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#7ee787"&gt;scaleTargetRef&lt;/span&gt;:&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#7ee787"&gt;apiVersion&lt;/span&gt;:&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#a5d6ff"&gt;apps/v1&lt;/span&gt;&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#7ee787"&gt;kind&lt;/span&gt;:&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#a5d6ff"&gt;Deployment&lt;/span&gt;&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#7ee787"&gt;name&lt;/span&gt;:&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#a5d6ff"&gt;frontend&lt;/span&gt;&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#7ee787"&gt;minReplicas&lt;/span&gt;:&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#a5d6ff"&gt;5&lt;/span&gt;&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#7ee787"&gt;maxReplicas&lt;/span&gt;:&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#a5d6ff"&gt;10&lt;/span&gt;&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#7ee787"&gt;metrics&lt;/span&gt;:&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;- &lt;span style="color:#7ee787"&gt;type&lt;/span&gt;:&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#a5d6ff"&gt;Resource&lt;/span&gt;&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#7ee787"&gt;resource&lt;/span&gt;:&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#7ee787"&gt;name&lt;/span&gt;:&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#a5d6ff"&gt;cpu&lt;/span&gt;&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#7ee787"&gt;target&lt;/span&gt;:&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#7ee787"&gt;type&lt;/span&gt;:&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#a5d6ff"&gt;Utilization&lt;/span&gt;&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#7ee787"&gt;averageUtilization&lt;/span&gt;:&lt;span style="color:#6e7681"&gt; &lt;/span&gt;&lt;span style="color:#a5d6ff"&gt;70&lt;/span&gt;&lt;span style="color:#6e7681"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Within minutes, the HPA scaled the frontend from 5 to 7 replicas based on CPU load. Then Flux ran its next reconciliation cycle, saw that the Deployment manifest in Git said &lt;code&gt;replicas: 5&lt;/code&gt;, and reset it back. The HPA immediately scaled up again. Flux reset it again. A tug-of-war.&lt;/p&gt;</description></item><item><title>Flux vs HPA: Stop GitOps From Fighting Your Replica Count</title><link>https://szymonkocur.com/posts/flux-ignore-differences-hpa-replica-count/</link><pubDate>Sat, 28 Mar 2026 00:00:00 +0000</pubDate><guid>https://szymonkocur.com/posts/flux-ignore-differences-hpa-replica-count/</guid><description>&lt;p&gt;I added a Horizontal Pod Autoscaler to a Flux-managed Deployment and watched the replica count bounce between what the HPA wanted and what Git said. Every few minutes, Flux would reconcile, see that &lt;code&gt;spec.replicas&lt;/code&gt; had drifted from the Git state, and reset it. The HPA would immediately scale it back. Repeat forever.&lt;/p&gt;
&lt;p&gt;This is a fundamental tension in GitOps: Flux&amp;rsquo;s job is to make the cluster match Git. The HPA&amp;rsquo;s job is to set the replica count based on metrics. They both write to the same field, and they disagree.&lt;/p&gt;</description></item><item><title>Google Photos Takeout: Fixing the Metadata Mess</title><link>https://szymonkocur.com/posts/google-photos-takeout-mess/</link><pubDate>Sat, 15 Nov 2025 17:00:00 +0100</pubDate><guid>https://szymonkocur.com/posts/google-photos-takeout-mess/</guid><description>&lt;p&gt;Have you ever needed to degoogle part of your life? I have. I tried exporting my Google Photos to move them elsewhere and&amp;hellip; oh boi.&lt;/p&gt;
&lt;p&gt;Google Photos &lt;a href="https://takeout.google.com/" class="external-link" target="_blank" rel="noopener"&gt;Takeout&lt;/a&gt; is great until you actually try to use the export. You get split folders like &lt;code&gt;Takeout&lt;/code&gt;, &lt;code&gt;Takeout 2&lt;/code&gt;, &lt;code&gt;Takeout 3…&lt;/code&gt;, a JSON file per asset and images/videos that lost their original timestamps. Albums are there, but the metadata that makes your library useful is fragmented.&lt;/p&gt;</description></item><item><title>When Hibernate Shouts at Me</title><link>https://szymonkocur.com/posts/hibernate-in-memory-pagination/</link><pubDate>Wed, 12 Nov 2025 19:31:31 +0100</pubDate><guid>https://szymonkocur.com/posts/hibernate-in-memory-pagination/</guid><description>&lt;p&gt;Seriously, not only humans can shout at you — sometimes your code does too!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When&lt;/strong&gt;? You may ask.&lt;/p&gt;
&lt;h3 id="the-problem"&gt;
 The Problem
 &lt;a class="heading-link" href="#the-problem"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;It happens when you do something so bad in code that even the logs beg you to look at them. When I first saw the log &lt;code&gt;firstResult/maxResults specified with collection fetch; applying in memory!&lt;/code&gt;, I ignored it — many times, I must admit. Now I feel bad about it. But what is this log even about?&lt;/p&gt;</description></item><item><title>What is the A2A (Agent-To-Agent) Protocol? Explained Simply</title><link>https://szymonkocur.com/posts/a2a-protocol/</link><pubDate>Sun, 29 Jun 2025 00:00:00 +0000</pubDate><guid>https://szymonkocur.com/posts/a2a-protocol/</guid><description>&lt;h1 id="what-is-the-a2a-agent-to-agent-protocol"&gt;
 What is the A2A (Agent-To-Agent) Protocol?
 &lt;a class="heading-link" href="#what-is-the-a2a-agent-to-agent-protocol"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h1&gt;
&lt;p&gt;In short, &lt;a href="https://a2aproject.github.io/A2A/latest/specification/" class="external-link" target="_blank" rel="noopener"&gt;A2A&lt;/a&gt; is a protocol that enables communication between autonomous agents in a decentralized and secure way.
It can be used to delegate tasks, exchange information, or facilitate collaboration between systems powered by &lt;a href="https://en.wikipedia.org/wiki/Large_language_model" class="external-link" target="_blank" rel="noopener"&gt;large
language models (LLMs)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To better understand this, let’s first consider how things work in the human world. In society, each person has their
role, a unique set of skills and knowledge that makes them more suited to perform certain tasks than others. When we
receive a task, we start by analyzing it, take responsibility for it, and try to achieve a specific outcome. If there&amp;rsquo;s
a part we can’t handle ourselves, we may look for someone who can help — and once we find that person, we delegate that
part of the task to them.&lt;/p&gt;</description></item></channel></rss>