<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog on Paolo Carta</title><link>https://paolocarta.com/blog/</link><description>Recent content in Blog on Paolo Carta</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 29 Mar 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://paolocarta.com/blog/index.xml" rel="self" type="application/rss+xml"/><item><title>Using ArgoCD ApplicationSet templating to conditionally apply SyncPolicies</title><link>https://paolocarta.com/blog/argocd-applicationset-templatepatch/</link><pubDate>Sat, 29 Mar 2025 00:00:00 +0000</pubDate><guid>https://paolocarta.com/blog/argocd-applicationset-templatepatch/</guid><description>&lt;p&gt;ApplicationSets can be really useful to generate several applications, for instance when using multiple environments. This can be achieved by using generators such as the list, git or cluster ones.&lt;/p&gt;
&lt;p&gt;Sometimes the application generated might be different from one environment to another. For instance, we might want automatic sync on &lt;code&gt;dev&lt;/code&gt; and &lt;code&gt;test&lt;/code&gt;, but manual sync in the &lt;code&gt;prod&lt;/code&gt; environment.&lt;/p&gt;
&lt;p&gt;This article shows how to use an ApplicationSet with &lt;code&gt;templatePatch&lt;/code&gt; to conditionally apply &lt;code&gt;syncPolicy&lt;/code&gt; based on the environment. This example assumes you&amp;rsquo;re using a List or Git generator that includes an &lt;code&gt;env&lt;/code&gt; field (e.g., &lt;code&gt;test&lt;/code&gt;, &lt;code&gt;prod&lt;/code&gt;) for each application.&lt;/p&gt;</description></item><item><title>ArgoCD GitOps Repository structure with multiple instances</title><link>https://paolocarta.com/blog/argocd-multi-gitops-repo-structure/</link><pubDate>Tue, 25 Mar 2025 00:00:00 +0000</pubDate><guid>https://paolocarta.com/blog/argocd-multi-gitops-repo-structure/</guid><description>&lt;p&gt;Many organizations running workloads in Kubernetes are embracing ArgoCD to deploy safely and ensure consistency and traceability.&lt;/p&gt;
&lt;p&gt;Unfortunately there are not many guidelines or best practices yet explaining how to structure the GitOps repository for simplicity and maintainability.&lt;/p&gt;
&lt;p&gt;In this article I would like to show my solution with a setup consisting of multiple ArgoCD instances. Basically each Kubernetes cluster will have its own instance, which will manage all resources belonging to it. ArgoCD will be bootstrapped externally, for instance at cluster provisioning with Terraform.&lt;/p&gt;</description></item><item><title>ArgoCD GitOps Repository Structure with a single management instance</title><link>https://paolocarta.com/blog/argocd-single-gitops-repo-structure/</link><pubDate>Sun, 23 Mar 2025 00:00:00 +0000</pubDate><guid>https://paolocarta.com/blog/argocd-single-gitops-repo-structure/</guid><description>&lt;p&gt;Many organizations running workloads in Kubernetes are embracing ArgoCD to deploy safely and ensure consistency and traceability.&lt;/p&gt;
&lt;p&gt;Unfortunately there are not many guidelines or best practices yet explaining how to structure the GitOps repository for simplicity and maintainability.&lt;/p&gt;
&lt;p&gt;In this article I would like to show my solution with a setup consisting of a single management ArgoCD instance. It allows a clear separation between applications, infrastructure and ArgoCD Apps and Projects. Moreover it supports multiple environments by leveraging Kustomize.&lt;/p&gt;</description></item><item><title>Validate your Kubernetes manifests with Kubeconform and Kustomize in CI/CD</title><link>https://paolocarta.com/blog/kubernetes-manifest-validation-kubeconform/</link><pubDate>Thu, 12 Dec 2024 00:00:00 +0000</pubDate><guid>https://paolocarta.com/blog/kubernetes-manifest-validation-kubeconform/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Kubernetes manifests define how your applications and resources should be configured and managed.&lt;/p&gt;
&lt;p&gt;To ensure that these manifests are valid and compliant with Kubernetes standards, it&amp;rsquo;s crucial to validate them before deploying to any cluster. One effective way to automate this process is by using Kubeconform in your CI pipeline. This blog post will walk you through the process of integrating Kubeconform into a CI pipeline to validate your Kubernetes manifests.&lt;/p&gt;</description></item><item><title>Kubernetes Error Notifications in Slack with Botkube</title><link>https://paolocarta.com/blog/botkube-kubernetes-notifications-slack/</link><pubDate>Thu, 05 Dec 2024 00:00:00 +0000</pubDate><guid>https://paolocarta.com/blog/botkube-kubernetes-notifications-slack/</guid><description>&lt;h2 id="prerequisites"&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;In order to use this guide, I assume you already have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A Kubernetes Cluster up and running&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.botkube.io/installation/slack/#install-botkube-in-kubernetes-cluster"&gt;Botkube&lt;/a&gt; installed on your cluster&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.botkube.io/installation/slack/#install-app-for-socket-slack-in-your-slack-workspace"&gt;Slack App&lt;/a&gt; for Botkube installed in your workspace&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In case you don&amp;rsquo;t fullfill all of them, please follow the links attached for the setup.&lt;/p&gt;
&lt;h2 id="notifications"&gt;Notifications&lt;/h2&gt;
&lt;p&gt;Imagine you&amp;rsquo;re managing a Kubernetes cluster and want to keep an eye on any errors occurring in your apps. With &lt;a href="https://botkube.io/"&gt;Botkube&lt;/a&gt;, we can get chat notifications about issues detected from Kubernetes events. This approach improves the platform team&amp;rsquo;s reaction time quite a bit.&lt;/p&gt;</description></item><item><title>Use Botkube Actions to get logs in Slack on app issues</title><link>https://paolocarta.com/blog/botkube-actions-slack-logs/</link><pubDate>Mon, 02 Dec 2024 00:00:00 +0000</pubDate><guid>https://paolocarta.com/blog/botkube-actions-slack-logs/</guid><description>&lt;h2 id="prerequisites"&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;In order to use this guide, I assume you already have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A Kubernetes Cluster up and running&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.botkube.io/installation/slack/#install-botkube-in-kubernetes-cluster"&gt;Botkube&lt;/a&gt; installed on your cluster&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.botkube.io/installation/slack/#install-app-for-socket-slack-in-your-slack-workspace"&gt;Slack App&lt;/a&gt; for Botkube installed in your workspace&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In case you don&amp;rsquo;t fullfill all of them, please follow the links attached for the setup.&lt;/p&gt;
&lt;h2 id="classic-notifications"&gt;Classic Notifications&lt;/h2&gt;
&lt;p&gt;Imagine you&amp;rsquo;re managing a Kubernetes cluster and want to keep an eye on any errors occurring in your apps. With &lt;a href="https://botkube.io/"&gt;Botkube&lt;/a&gt;, we can get chat notifications about issues detected from Kubernetes events. This approach improves the platform team&amp;rsquo;s reaction time quite a bit.&lt;/p&gt;</description></item><item><title>ArgoCD Server Side Apply for bulky CRDs</title><link>https://paolocarta.com/blog/argocd-server-side-apply/</link><pubDate>Thu, 28 Nov 2024 00:00:00 +0000</pubDate><guid>https://paolocarta.com/blog/argocd-server-side-apply/</guid><description>&lt;p&gt;In this post, I&amp;rsquo;ll explain the reason for the issue with ArgoCD on Kubernetes: &amp;ldquo;Too long: must have at most 262144 bytes&amp;rdquo;. After that we will see how to fix it.&lt;/p&gt;
&lt;p&gt;By default, ArgoCD performs a &lt;code&gt;kubectl apply&lt;/code&gt; operation to apply the configuration stored in Git. This is a client side operation that is using the &lt;code&gt;kubectl.kubernetes.io/last-applied-configuration&lt;/code&gt; annotation to store the previous resource state as JSON. This is used to compute the patch to apply to a resource.&lt;/p&gt;</description></item><item><title>Application Cleanup with the ArgoCD Deletion Finalizer</title><link>https://paolocarta.com/blog/argocd-app-deletion-finalizer/</link><pubDate>Wed, 27 Nov 2024 00:00:00 +0000</pubDate><guid>https://paolocarta.com/blog/argocd-app-deletion-finalizer/</guid><description>&lt;p&gt;In Kubernetes, finalizers prevent resource deletion before the cleanup has been successfully completed by the responsible controllers.&lt;/p&gt;
&lt;p&gt;ArgoCD supports its own &lt;a href="https://argo-cd.readthedocs.io/en/latest/user-guide/app_deletion/#about-the-deletion-finalizer"&gt;finalizer&lt;/a&gt; as well in order to perform cleanup operations when deleting an Application custom resource. You can add a finalizer annotation on any Argo CD application.&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;argoproj.io/v1alpha1&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;Application&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;finalizers&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:#8b949e;font-style:italic"&gt;# The default behavior is foreground cascading deletion&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:#a5d6ff"&gt;resources-finalizer.argocd.argoproj.io&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;When deleting an application with this finalizer, the ArgoCD application controller will perform a cascading delete of the application&amp;rsquo;s resources.&lt;/p&gt;</description></item><item><title>Configmaps and Secrets Reloader in Kubernetes</title><link>https://paolocarta.com/blog/configmaps-secret-reloader/</link><pubDate>Wed, 20 Nov 2024 00:00:00 +0000</pubDate><guid>https://paolocarta.com/blog/configmaps-secret-reloader/</guid><description>&lt;p&gt;After talking about change propagation in configmaps &lt;a href="https://paolocarta.com/blog/configmaps-behavior-kubernetes/"&gt;here&lt;/a&gt;, I would like to go deeper into the &lt;a href="https://github.com/stakater/Reloader"&gt;Reloader controller&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="what-is-configmap-reloader"&gt;What is ConfigMap Reloader?&lt;/h2&gt;
&lt;p&gt;ConfigMap Reloader is an open-source Kubernetes controller that automatically triggers rolling upgrades when ConfigMaps or Secrets are updated. It is useful in scenarios where your application relies on external configuration files.&lt;/p&gt;
&lt;p&gt;Without a tool like ConfigMap Reloader, you might need to manually delete or restart your pods to have your app using the new configuration, which can be cumbersome and prone to error, especially in larger deployments.&lt;/p&gt;</description></item><item><title>Behavior of ConfigMaps in Kubernetes When We Update Them</title><link>https://paolocarta.com/blog/configmaps-behavior-kubernetes/</link><pubDate>Wed, 13 Nov 2024 00:00:00 +0000</pubDate><guid>https://paolocarta.com/blog/configmaps-behavior-kubernetes/</guid><description>&lt;p&gt;Working with Kubernetes I noticed some confusion when talking about what happens when a ConfigMap gets updated.&lt;/p&gt;
&lt;p&gt;This article would like to explain my understanding about this behaviour.&lt;/p&gt;
&lt;h2 id="using-volume-mounts"&gt;Using Volume Mounts&lt;/h2&gt;
&lt;p&gt;When a ConfigMap is mounted as a volume, Kubernetes eventually will update the files in the volume if you are not using a subpath. However, the application needs to detect these changes and reload the configuration. Some apps for instance just load the config at startup and not dynamically.&lt;/p&gt;</description></item><item><title>A Kubernetes Production Readiness Checklist</title><link>https://paolocarta.com/blog/kubernetes-production-checklist/</link><pubDate>Sun, 15 Jan 2023 00:00:00 +0000</pubDate><guid>https://paolocarta.com/blog/kubernetes-production-checklist/</guid><description>&lt;p&gt;Declaring a cluster &amp;ldquo;production-ready&amp;rdquo; is often more of a vibe than a rigorous process. After running this exercise with a dozen or so clients, I&amp;rsquo;ve converged on a checklist that covers the things that actually bite people — not an exhaustive spec, but a focused set of high-signal checks.&lt;/p&gt;
&lt;h2 id="resource-requests-and-limits"&gt;Resource requests and limits&lt;/h2&gt;
&lt;p&gt;Every container should have CPU and memory &lt;strong&gt;requests&lt;/strong&gt; set. Limits are more nuanced — memory limits are important to prevent OOMKills cascading, but CPU limits can cause unnecessary throttling if set too low. At minimum: set requests on everything, set memory limits with some headroom, and measure actual usage before tuning CPU limits.&lt;/p&gt;</description></item></channel></rss>