<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Infrastructure as Posts]]></title><description><![CDATA[Infrastructure, Security and Automation]]></description><link>https://www.infrastructureposts.com</link><image><url>https://substackcdn.com/image/fetch/$s_!vHv0!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff643ed50-a60f-4212-a80f-ba5f6b8498f6_1024x1024.png</url><title>Infrastructure as Posts</title><link>https://www.infrastructureposts.com</link></image><generator>Substack</generator><lastBuildDate>Wed, 29 Apr 2026 21:56:46 GMT</lastBuildDate><atom:link href="https://www.infrastructureposts.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Marius Kimmina]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[infrastructureposts@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[infrastructureposts@substack.com]]></itunes:email><itunes:name><![CDATA[Marius Kimmina]]></itunes:name></itunes:owner><itunes:author><![CDATA[Marius Kimmina]]></itunes:author><googleplay:owner><![CDATA[infrastructureposts@substack.com]]></googleplay:owner><googleplay:email><![CDATA[infrastructureposts@substack.com]]></googleplay:email><googleplay:author><![CDATA[Marius Kimmina]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Virtual Kubernetes Clusters on AWS EKS]]></title><description><![CDATA[Cheaper than real clusters and better isolated then namespaces virtual clusters on Kubernetes are a promising middle ground between the multi-cluster and multi-namespace approach]]></description><link>https://www.infrastructureposts.com/p/virtual-kubernetes-clusters-on-aws</link><guid isPermaLink="false">https://www.infrastructureposts.com/p/virtual-kubernetes-clusters-on-aws</guid><dc:creator><![CDATA[Marius Kimmina]]></dc:creator><pubDate>Thu, 18 Jan 2024 15:30:18 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/d1f2d8c8-535e-4deb-bf74-0acba1cdf2eb_282x188.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey folks, It&#8217;s been quiet on infrastructure as posts for a while now but we are so back!<br>In this year I&#8217;ll focus more on providing practical examples for all the things I&#8217;ll talk about in the form of Terraform repos for you to reproduce everything.</p><p>So the Code for this and all future setups can be found here:<br>https://github.com/infrastructure-as-posts</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Today I want to showcase virtual Kubernetes clusters to you, more specifically we will be exploring the tool <em>vcluster</em> and how to use to create virtual clusters inside of an EKS cluster on AWS.</p><p>Requirements to follow along with this article:</p><ul><li><p>Terraform &#8594; https://developer.hashicorp.com/terraform/install</p></li><li><p>Helm &#8594; https://helm.sh/docs/intro/install/</p></li><li><p>vcluster &#8594; https://www.vcluster.com/docs/getting-started/setup</p></li><li><p>AWS Account</p></li></ul><p>Note that <strong>this does exceed the AWS free-tier</strong> <strong>and can occur charges on your AWS Account</strong> depending on how long you keep this setup up and running. Remember to always clean up (terraform destroy) after you are done with your experiments.</p><p>Find the necessary code for this exact setup here: <br>https://github.com/infrastructure-as-posts/vcluster-on-eks<br><br>For readability sake the code snippets in the article have been kept short and may be missing some parts, which can be found in the repository linked above.</p><h2>Why virtual clusters?</h2><p>Virtual clusters create an appealing middle ground between spinning up multiple real clusters and simply using separate namespaces. They are only slightly more costly than namespaces but create strongly isolated environments.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!N_QR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb52083-62c0-49ab-acaf-9435e6b0a32f_800x405.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!N_QR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb52083-62c0-49ab-acaf-9435e6b0a32f_800x405.png 424w, https://substackcdn.com/image/fetch/$s_!N_QR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb52083-62c0-49ab-acaf-9435e6b0a32f_800x405.png 848w, https://substackcdn.com/image/fetch/$s_!N_QR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb52083-62c0-49ab-acaf-9435e6b0a32f_800x405.png 1272w, https://substackcdn.com/image/fetch/$s_!N_QR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb52083-62c0-49ab-acaf-9435e6b0a32f_800x405.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!N_QR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb52083-62c0-49ab-acaf-9435e6b0a32f_800x405.png" width="800" height="405" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cdb52083-62c0-49ab-acaf-9435e6b0a32f_800x405.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:405,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;vcluster Intro&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="vcluster Intro" title="vcluster Intro" srcset="https://substackcdn.com/image/fetch/$s_!N_QR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb52083-62c0-49ab-acaf-9435e6b0a32f_800x405.png 424w, https://substackcdn.com/image/fetch/$s_!N_QR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb52083-62c0-49ab-acaf-9435e6b0a32f_800x405.png 848w, https://substackcdn.com/image/fetch/$s_!N_QR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb52083-62c0-49ab-acaf-9435e6b0a32f_800x405.png 1272w, https://substackcdn.com/image/fetch/$s_!N_QR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdb52083-62c0-49ab-acaf-9435e6b0a32f_800x405.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">source: https://github.com/loft-sh/vcluster</figcaption></figure></div><p>Think for example about B2B SaaS companies that might currently be spinning up a new Kubernetes cluster for each of their enterprise customers, this comes at a cost and using virtual clusters instead could lead to significant savings for them.</p><p>I can also see this being utilized for test environments, where a company might spin up and down virtual Kubernetes clusters for test environments on-demand.</p><h2>How does it work?</h2><p>Virtual clusters essentially turn a namespace into a cluster of it&#8217;s own. vcluster replicates the components of a standard Kubernetes cluster, such as the API server, controller manager, and scheduler. However, these components interact with the physical cluster's resources in a way that is abstracted and isolated, allowing multiple virtual clusters to coexist on the same physical infrastructure without interference, each believing it's an independent Kubernetes cluster.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!q5Cn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe11c8fd-2601-4072-9e01-15415f7a92c8_1856x1372.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!q5Cn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe11c8fd-2601-4072-9e01-15415f7a92c8_1856x1372.png 424w, https://substackcdn.com/image/fetch/$s_!q5Cn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe11c8fd-2601-4072-9e01-15415f7a92c8_1856x1372.png 848w, https://substackcdn.com/image/fetch/$s_!q5Cn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe11c8fd-2601-4072-9e01-15415f7a92c8_1856x1372.png 1272w, https://substackcdn.com/image/fetch/$s_!q5Cn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe11c8fd-2601-4072-9e01-15415f7a92c8_1856x1372.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!q5Cn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe11c8fd-2601-4072-9e01-15415f7a92c8_1856x1372.png" width="1456" height="1076" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe11c8fd-2601-4072-9e01-15415f7a92c8_1856x1372.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1076,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:247538,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!q5Cn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe11c8fd-2601-4072-9e01-15415f7a92c8_1856x1372.png 424w, https://substackcdn.com/image/fetch/$s_!q5Cn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe11c8fd-2601-4072-9e01-15415f7a92c8_1856x1372.png 848w, https://substackcdn.com/image/fetch/$s_!q5Cn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe11c8fd-2601-4072-9e01-15415f7a92c8_1856x1372.png 1272w, https://substackcdn.com/image/fetch/$s_!q5Cn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe11c8fd-2601-4072-9e01-15415f7a92c8_1856x1372.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>As you can see, the pods exist on the Host cluster but everything else, such as </p><ul><li><p>deployments</p></li><li><p>statefulsets</p></li><li><p>secrets</p></li><li><p>configmaps</p></li><li><p>&#8230;</p></li></ul><p>Only exists in the virtual cluster and can&#8217;t be seen from the host cluster.</p><p>Now that you know what we are talking about, let&#8217;s setup a new virtual cluster on top of AWS EKS.</p><h2>Creating a new EKS Cluster</h2><p>The first thing we need for our setup is a Kubernetes cluster to act as the host cluster. We will be using the Elastic Kubernetes Services (EKS) by AWS. To setup an EKS cluster with Terraform there are two common approaches:</p><ol><li><p><a href="https://registry.terraform.io/modules/terraform-aws-modules/eks/aws/latest">eks module</a> provided by the community</p></li><li><p><a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_cluster">Official aws_eks_cluster resource</a></p></li></ol><p>At the time of writing this, the community module has over 1.2 Million downloads in the last month and is one of the most established and well maintained community modules. It makes the whole setup a lot easier and thus we will be using it here as well. If you need more fine grained control you can opt for the aws_eks_cluster resource instead.</p><p> The Terraform sample below shows that we will be creating a new VPC for the cluster and that we will have two node groups with one node in each, resulting in a cluster of two nodes in total.</p><pre><code>
locals {
  cluster_name = "vcluster-eks"
}

module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "5.0.0"

  name = "vcluster-vpc"

  cidr            = "10.0.0.0/16"
  azs             = ["eu-central-1a", "eu-central-1b"]
  private_subnets = ["10.0.1.0/24", "10.0.2.0/24"]
}

module "eks" {
  source  = "terraform-aws-modules/eks/aws"
  version = "19.15.3"

  cluster_name    = local.cluster_name
  cluster_version = "1.28"

  vpc_id                         = module.vpc.vpc_id
  subnet_ids                     = module.vpc.private_subnets
  cluster_endpoint_public_access = true

  eks_managed_node_groups = {
    one = {
      name = "node-group-1"

      instance_types = ["t3.small"]

      min_size     = 1
      max_size     = 1
      desired_size = 1
    }
    two = {
      name = "node-group-2"

      instance_types = ["t3.small"]

      min_size     = 1
      max_size     = 1
      desired_size = 1
    }
  }
}</code></pre><p>The following diagram should help in visualizing the different encapsulation layers. The EKS cluster only exists within the boarders of the VPC, it spawns across two availability zones (eu-central-1 and eu-central-1b) and each node of this cluster will be in it&#8217;s own subnet within one of the two AZs. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!w1C4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a764a3-86c8-40d3-b528-e3418370ca5b_1924x1256.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!w1C4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a764a3-86c8-40d3-b528-e3418370ca5b_1924x1256.png 424w, https://substackcdn.com/image/fetch/$s_!w1C4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a764a3-86c8-40d3-b528-e3418370ca5b_1924x1256.png 848w, https://substackcdn.com/image/fetch/$s_!w1C4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a764a3-86c8-40d3-b528-e3418370ca5b_1924x1256.png 1272w, https://substackcdn.com/image/fetch/$s_!w1C4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a764a3-86c8-40d3-b528-e3418370ca5b_1924x1256.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!w1C4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a764a3-86c8-40d3-b528-e3418370ca5b_1924x1256.png" width="1456" height="950" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c2a764a3-86c8-40d3-b528-e3418370ca5b_1924x1256.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:950,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:230628,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!w1C4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a764a3-86c8-40d3-b528-e3418370ca5b_1924x1256.png 424w, https://substackcdn.com/image/fetch/$s_!w1C4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a764a3-86c8-40d3-b528-e3418370ca5b_1924x1256.png 848w, https://substackcdn.com/image/fetch/$s_!w1C4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a764a3-86c8-40d3-b528-e3418370ca5b_1924x1256.png 1272w, https://substackcdn.com/image/fetch/$s_!w1C4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a764a3-86c8-40d3-b528-e3418370ca5b_1924x1256.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Note that it is not always a given that each node will have their own subnet, if you have many nodes then many of them will also end up in the same AZs and in the same subnet.</p><h2>Creating a virtual cluster inside EKS</h2><p>Now that we have an EKS cluster up and running, adding vcluster to it can easily be done via a Helm chart provided by <a href="https://loft.sh/">loft labs</a> (the company behind vcluster). </p><pre><code>resource "helm_release" "demo_vcluster" {
  name             = "demo-vcluster"
  namespace        = "vcluster"
  create_namespace = true
  repository       = "https://charts.loft.sh"
  chart            = "vcluster"
  version          = "0.18.1"
}</code></pre><p>Note that depending on the time you are trying to replicated this setup you might have to change the version number as development around vcluster is happening rapidly and 0.19.0 is already in alpha.</p><h2>Connecting to the virtual cluster</h2><p>Connecting to the vcluster is straight forward, let&#8217;s first look at the available virtual clusters:</p><pre><code>vcluster list</code></pre><p>You should see the &#8220;demo-vcluster&#8221; up and running. The output here is very similar to the one of e.g. &#8216;docker ps&#8217;.</p><p>Connecting to the vcluster once it has been created is also straightforward, all you need is the name of virtual cluster.</p><pre><code>vcluster connect demo-vcluster</code></pre><p>While you are connect, you kube-context has been modified and all &#8220;kubectl&#8221; commands you run from here on will be targeting the virtual cluster instead of the host cluster.</p><p>You can verify that your context has changed by running the command below</p><pre><code>$ kubectl config current-context
vcluster_demo-vcluster_vcluster_arn:aws:eks:eu-central-1:345411212130:cluster/vcluster-eks</code></pre><p>After connecting to the virtual cluster we can interact with it in the same way we would do with any other Kubernetes cluster. The fact that this is a virtual cluster is completely hidden from us.</p><p>Looking at the cluster in k9s we only see a single pod running CoreDNS</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Mxbn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfca5257-99c5-45ab-8e83-5d0a820b0628_1917x366.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Mxbn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfca5257-99c5-45ab-8e83-5d0a820b0628_1917x366.png 424w, https://substackcdn.com/image/fetch/$s_!Mxbn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfca5257-99c5-45ab-8e83-5d0a820b0628_1917x366.png 848w, https://substackcdn.com/image/fetch/$s_!Mxbn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfca5257-99c5-45ab-8e83-5d0a820b0628_1917x366.png 1272w, https://substackcdn.com/image/fetch/$s_!Mxbn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfca5257-99c5-45ab-8e83-5d0a820b0628_1917x366.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Mxbn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfca5257-99c5-45ab-8e83-5d0a820b0628_1917x366.png" width="1456" height="278" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cfca5257-99c5-45ab-8e83-5d0a820b0628_1917x366.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:278,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:64031,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Mxbn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfca5257-99c5-45ab-8e83-5d0a820b0628_1917x366.png 424w, https://substackcdn.com/image/fetch/$s_!Mxbn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfca5257-99c5-45ab-8e83-5d0a820b0628_1917x366.png 848w, https://substackcdn.com/image/fetch/$s_!Mxbn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfca5257-99c5-45ab-8e83-5d0a820b0628_1917x366.png 1272w, https://substackcdn.com/image/fetch/$s_!Mxbn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcfca5257-99c5-45ab-8e83-5d0a820b0628_1917x366.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2>Conclusion </h2><p>Currently virtual clusters seem like a promising technology to me and I could see it being heavily utilized for testing in the future, especially in the context of CI/CD pipelines. They allow for isolated testing environments that closely mimic production settings, enabling more accurate testing and faster deployment cycles. Furthermore, virtual Kubernetes clusters contribute to efficient resource utilization, reducing the cost associated with physical infrastructure.</p><h2>Closing words</h2><p>I hope you got some value out of this and consider leaving your email address so that you don&#8217;t miss out on any of my future posts. I am also just a human who makes mistakes, so if you think anything here is wrong, please let me know.<br>If you want to encourage me to keep doing this you can <a href="https://ko-fi.com/mariuskimmina">buy me a coffee</a>.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[E7: Thoughts on "Scaling up the Prime Video audio/video monitoring service and reducing costs by 90%"]]></title><description><![CDATA[I came across this article the other day when it was all over reddit.]]></description><link>https://www.infrastructureposts.com/p/e7-thoughts-on-scaling-up-the-prime</link><guid isPermaLink="false">https://www.infrastructureposts.com/p/e7-thoughts-on-scaling-up-the-prime</guid><dc:creator><![CDATA[Marius Kimmina]]></dc:creator><pubDate>Sat, 06 May 2023 09:00:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24b28056-ec02-479b-9786-62be743c3bbb_1011x803.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I came across <a href="https://www.primevideotech.com/video-streaming/scaling-up-the-prime-video-audio-video-monitoring-service-and-reducing-costs-by-90">this article</a> the other day when it was all over reddit. I couldn&#8217;t help but notice that a lot of people seem to take this as &#8220;we should stop doing microservices all together and go back to building monoliths&#8221; and I want to elaborate on why I don&#8217;t think that was the point of the article at all and what we should take away instead.</p><p>Let&#8217;s first first clarify that this article isn&#8217;t talking about all of prime video but only about one tool, that one team at Prime Video uses.</p><blockquote><p>Our Video Quality Analysis (VQA) team at Prime Video already owned a tool for audio/video quality inspection, but we never intended nor designed it to run at high scale</p></blockquote><p>One can assume that the entirety of Prime Video still consists of a microservice architecture, evidence for which can be found in <a href="https://www.primevideotech.com/cloud-and-scale/how-prime-video-troubleshoots-quickly-and-cost-effectively-at-scale">one of their other blog posts</a>, and the article above never suggested otherwise.<br>One <a href="https://www.reddit.com/r/sysadmin/comments/137ior7/comment/jiu3utf/?utm_source=share&amp;utm_medium=web2x&amp;context=3">fellow redditor</a> has said it best:</p><blockquote><p>You can make a wall out of bricks, and it can be better using 200 bricks vs 5 big blocks, but not using 400,000 bricks.</p></blockquote><p>Emphasizing that they are still using a microservice architecture for prime video, but for this particular service they had split it up too much and found a bigger service to be more beneficial.</p><p>So, let&#8217;s take a closer look at why the split into multiple microservices wasn&#8217;t the right approach in this case. The following image shows their initial microservice based architecture.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0KNs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24b28056-ec02-479b-9786-62be743c3bbb_1011x803.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0KNs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24b28056-ec02-479b-9786-62be743c3bbb_1011x803.png 424w, https://substackcdn.com/image/fetch/$s_!0KNs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24b28056-ec02-479b-9786-62be743c3bbb_1011x803.png 848w, https://substackcdn.com/image/fetch/$s_!0KNs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24b28056-ec02-479b-9786-62be743c3bbb_1011x803.png 1272w, https://substackcdn.com/image/fetch/$s_!0KNs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24b28056-ec02-479b-9786-62be743c3bbb_1011x803.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0KNs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24b28056-ec02-479b-9786-62be743c3bbb_1011x803.png" width="1011" height="803" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/24b28056-ec02-479b-9786-62be743c3bbb_1011x803.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:803,&quot;width&quot;:1011,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The diagram shows a control plane and data plan in the initial architecture. The customer's request is handled by a lambda function that is then forwarded to relevant step functions that execute detectors. At the same time, Media Conversion service starts processing the input stream, providing artifacts to detectors through an S3 bucket. Once the analysis is completed, the aggregated result is being stored in an S3 bucket.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The diagram shows a control plane and data plan in the initial architecture. The customer's request is handled by a lambda function that is then forwarded to relevant step functions that execute detectors. At the same time, Media Conversion service starts processing the input stream, providing artifacts to detectors through an S3 bucket. Once the analysis is completed, the aggregated result is being stored in an S3 bucket." title="The diagram shows a control plane and data plan in the initial architecture. The customer's request is handled by a lambda function that is then forwarded to relevant step functions that execute detectors. At the same time, Media Conversion service starts processing the input stream, providing artifacts to detectors through an S3 bucket. Once the analysis is completed, the aggregated result is being stored in an S3 bucket." srcset="https://substackcdn.com/image/fetch/$s_!0KNs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24b28056-ec02-479b-9786-62be743c3bbb_1011x803.png 424w, https://substackcdn.com/image/fetch/$s_!0KNs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24b28056-ec02-479b-9786-62be743c3bbb_1011x803.png 848w, https://substackcdn.com/image/fetch/$s_!0KNs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24b28056-ec02-479b-9786-62be743c3bbb_1011x803.png 1272w, https://substackcdn.com/image/fetch/$s_!0KNs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24b28056-ec02-479b-9786-62be743c3bbb_1011x803.png 1456w" sizes="100vw" loading="lazy" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The initial architecture </figcaption></figure></div><p>Quoting from the article:</p><blockquote><p>The two most expensive operations in terms of cost were the orchestration workflow and when data passed between distributed components</p></blockquote><p>Now, looking at the diagram above, a high cost for data flow is not all that surprising with the media conversion service uploading everything to an S3 bucket first which is then to be accessed by the detectors running on the step functions.</p><p>But another factor that played a huge role in this was the cost of the step functions. I am again quoting from the original article:</p><blockquote><p>Our service performed multiple state transitions for every second of the stream</p></blockquote><p>Currently, the <a href="https://aws.amazon.com/step-functions/pricing/">price for AWS step functions</a> sits at $0.025 per 1,000 state transitions. If we assume that by &#8220;multiple&#8221; they mean 3, which is probably a generous assumption, then streaming for one hour would result in</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;3600 * 3 * 0.025 / 1000 = 0.27&quot;,&quot;id&quot;:&quot;ZMSQQAALQQ&quot;}" data-component-name="LatexBlockToDOM"></div><p>0.27$ for one hour of streaming. This really shows that, while serverless options are often are great way to get started in developing new services and applications, they can get absurdly expensive under heavy workloads.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!czRJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ff1524d-8450-4f99-b098-da9c11657138_1258x786.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!czRJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ff1524d-8450-4f99-b098-da9c11657138_1258x786.png 424w, https://substackcdn.com/image/fetch/$s_!czRJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ff1524d-8450-4f99-b098-da9c11657138_1258x786.png 848w, https://substackcdn.com/image/fetch/$s_!czRJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ff1524d-8450-4f99-b098-da9c11657138_1258x786.png 1272w, https://substackcdn.com/image/fetch/$s_!czRJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ff1524d-8450-4f99-b098-da9c11657138_1258x786.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!czRJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ff1524d-8450-4f99-b098-da9c11657138_1258x786.png" width="1258" height="786" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4ff1524d-8450-4f99-b098-da9c11657138_1258x786.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:786,&quot;width&quot;:1258,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The diagram represents a control and data plan for the updated architecture. All the components run within a single ECS task, therefore the control doesn't go through the network. Data sharing is done through instance memory and only the final results are uploaded to an S3 bucket.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The diagram represents a control and data plan for the updated architecture. All the components run within a single ECS task, therefore the control doesn't go through the network. Data sharing is done through instance memory and only the final results are uploaded to an S3 bucket." title="The diagram represents a control and data plan for the updated architecture. All the components run within a single ECS task, therefore the control doesn't go through the network. Data sharing is done through instance memory and only the final results are uploaded to an S3 bucket." srcset="https://substackcdn.com/image/fetch/$s_!czRJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ff1524d-8450-4f99-b098-da9c11657138_1258x786.png 424w, https://substackcdn.com/image/fetch/$s_!czRJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ff1524d-8450-4f99-b098-da9c11657138_1258x786.png 848w, https://substackcdn.com/image/fetch/$s_!czRJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ff1524d-8450-4f99-b098-da9c11657138_1258x786.png 1272w, https://substackcdn.com/image/fetch/$s_!czRJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ff1524d-8450-4f99-b098-da9c11657138_1258x786.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The final architecture</figcaption></figure></div><p>With this new approach they did run into a problem tho, they got to a point where they couldn&#8217;t add any more detectors to the single EC2 instance - a classic problem when running a monolith. They solved this by creating multiple copies of the services with different detectors running on them and added an orchestration layer on top.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pVTu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5627434-27d6-4f7b-9b6a-503874b7ca53_725x805.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pVTu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5627434-27d6-4f7b-9b6a-503874b7ca53_725x805.png 424w, https://substackcdn.com/image/fetch/$s_!pVTu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5627434-27d6-4f7b-9b6a-503874b7ca53_725x805.png 848w, https://substackcdn.com/image/fetch/$s_!pVTu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5627434-27d6-4f7b-9b6a-503874b7ca53_725x805.png 1272w, https://substackcdn.com/image/fetch/$s_!pVTu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5627434-27d6-4f7b-9b6a-503874b7ca53_725x805.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pVTu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5627434-27d6-4f7b-9b6a-503874b7ca53_725x805.png" width="725" height="805" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e5627434-27d6-4f7b-9b6a-503874b7ca53_725x805.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:805,&quot;width&quot;:725,&quot;resizeWidth&quot;:725,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Customer's request is being forwarded by a lambda function to relevant ECS tasks. The result for each detector is stored in S3 bucket separately.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Customer's request is being forwarded by a lambda function to relevant ECS tasks. The result for each detector is stored in S3 bucket separately." title="Customer's request is being forwarded by a lambda function to relevant ECS tasks. The result for each detector is stored in S3 bucket separately." srcset="https://substackcdn.com/image/fetch/$s_!pVTu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5627434-27d6-4f7b-9b6a-503874b7ca53_725x805.png 424w, https://substackcdn.com/image/fetch/$s_!pVTu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5627434-27d6-4f7b-9b6a-503874b7ca53_725x805.png 848w, https://substackcdn.com/image/fetch/$s_!pVTu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5627434-27d6-4f7b-9b6a-503874b7ca53_725x805.png 1272w, https://substackcdn.com/image/fetch/$s_!pVTu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5627434-27d6-4f7b-9b6a-503874b7ca53_725x805.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">How they overcame the limits of EC2 instances</figcaption></figure></div><p>Now, looking at the end result, only two things have really changed. </p><ol><li><p>They are now using EC2 based ECS tasks for their computation instead of serverless step functions.</p></li><li><p>They integrated the media conversion directly into the detectors</p></li></ol><p>The first change is cheaper for them because step functions get ridiculously expensive at scale, as we saw in the example calculation. <br>The second change eliminates the intermediate S3 bucket which was frequently accessed, making it an expensive component as well.<br><br>Of course, all of this is easy for me to write now looking at their article with all the benefit of hindsight. Making the decision to re-architect something that is already running in production is never easy and making the call to use less of the prominent microservice based approach and instead couple things closer together must have been even harder. My respect to the engineers who made this decision and congratulations to their achievements. Please go and read <a href="https://www.primevideotech.com/video-streaming/scaling-up-the-prime-video-audio-video-monitoring-service-and-reducing-costs-by-90">their article</a>, it&#8217;s much better than this one.</p><h2>Closing Words</h2><p>I hope got value out of this and consider leaving your email address so that you don&#8217;t miss out on any of my future posts. I am also just a human who makes mistakes, so if you think anything here is wrong, please let me know.<br>If you want to encourage me to keep doing this you can <a href="https://ko-fi.com/mariuskimmina">buy me a coffee</a>.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[E6: SigNoz the open-source DataDog alternative]]></title><description><![CDATA[In this post I want to give some love to an open-source project that I have discovered just a few months ago: SigNoz.]]></description><link>https://www.infrastructureposts.com/p/signoz-the-open-source-datadog-alternative</link><guid isPermaLink="false">https://www.infrastructureposts.com/p/signoz-the-open-source-datadog-alternative</guid><dc:creator><![CDATA[Marius Kimmina]]></dc:creator><pubDate>Sat, 11 Mar 2023 10:31:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9680ee5c-188e-4f3b-abe3-19cd4d4a2ab4_3102x1085.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this post I want to give some love to an open-source project that I have discovered just a few months ago: <a href="https://github.com/SigNoz/signoz">SigNoz</a>. </p><p>There are a few commercial solutions that allow you to have metrics, logs and traces all in one place, such as DataDog or NewRelic. When you want to selfhost open-source solutions instead you were stuck with using multiple solutions and swichting between them. You might have been using <a href="https://prometheus.io/">Prometheus</a> for metrics, <a href="https://www.jaegertracing.io/">Jaegar</a> for Traces and <a href="https://www.elastic.co/what-is/elk-stack">Elasticsearch</a> for logs - as an example. </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>All of these tools are outstanding in their own right and are great at what they do but there are some nice benefits to having all three (logs, metrics, traces) in one place. </p><p>Coincidentally, while I was in the process of writing this article there was also a <a href="https://news.ycombinator.com/item?id=35067093">huge DataDog outage</a> which might make some people evaluate other options - including open-source ones.</p><p>So, let&#8217;s talk about</p><ul><li><p>Observability &amp; Monitoring</p></li><li><p>SigNoz &amp; OpenTelemetry</p></li><li><p>The Community</p></li></ul><p>And don&#8217;t forget to <a href="https://github.com/SigNoz/signoz">leave a star for them on Github</a>, they deserve it.</p><p>Disclaimer: Observability and Monitoring are huge topics that won&#8217;t ever fit into a single blog post, if you really want to get into it I highly recommend <a href="https://sre.google/sre-book/table-of-contents/">the SRE book</a>.</p><h2>Observability &amp; Monitoring</h2><p><strong>Observability</strong> is a property of a system, like functionality or testability. A system is considered &#8220;observable&#8221; if the current state can be estimated by only using information from outputs. These outputs are logs, metrics and traces, also known as the three pillars of observability. An application with great observability makes it easy for teams to analyze what is happening and enables them to quickly resolve the underlying issue.</p><p><strong>Monitoring</strong> on the other hand is the active act of observing the system.  In essence, monitoring technologies, such as&nbsp;application performance monitoring (APM), can tell you if a system is up or down or if there is a problem.</p><p>These two things usually go hand-in-hand as having better observability gives you more data to monitor and having great observability without any monitoring also means that you won&#8217;t ever know when something is wrong before the users complain.</p><p>If you search for these two terms online you will also find different definitions, for example some consider monitoring a subset of observability. As with many terms invented by our industry it&#8217;s hard to find a clear answer. In the end it will only matter that you know when something is wrong with your system and that you are able to resolve the issue.</p><p>When setting up monitoring for any system we generally want it to help us answer the questions: <em>what&#8217;s broken, and why?</em></p><p>Note that these two questions often have totally different answers, what&#8217;s broken might be an application serving error 500s to users while the why might the server our application is running on is out of space or that a database might be refusing to connect.</p><p>What information do we need to answer these two questions? While you can monitor virtually anything about a system and sometimes it has to be decided on a case by case basis what is relevant information for a given system, the industry has generally come to agree on four factors that we should always have a close eye on - <a href="https://sre.google/sre-book/monitoring-distributed-systems/">the four golden signals</a>:</p><ul><li><p>Latency</p></li><li><p>Traffic</p></li><li><p>Errors</p></li><li><p>Saturation</p><p></p></li></ul><p>If you measure all four golden signals and send out an alert when one of them is problematic, your service will have at least somewhat decent monitoring.</p><h2>How it works with SigNoz &amp; OpenTelemetry</h2><p>SigNoz relies on OpenTelemetry to gain insights into the performance of your applications. Once you have <a href="https://opentelemetry.io/docs/instrumentation/">instrumented your application with OpenTelemetry</a>, you send this data to the SigNoz Otel Collector, which will save it in a ClickHouse database. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9I64!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9680ee5c-188e-4f3b-abe3-19cd4d4a2ab4_3102x1085.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9I64!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9680ee5c-188e-4f3b-abe3-19cd4d4a2ab4_3102x1085.png 424w, https://substackcdn.com/image/fetch/$s_!9I64!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9680ee5c-188e-4f3b-abe3-19cd4d4a2ab4_3102x1085.png 848w, https://substackcdn.com/image/fetch/$s_!9I64!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9680ee5c-188e-4f3b-abe3-19cd4d4a2ab4_3102x1085.png 1272w, https://substackcdn.com/image/fetch/$s_!9I64!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9680ee5c-188e-4f3b-abe3-19cd4d4a2ab4_3102x1085.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9I64!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9680ee5c-188e-4f3b-abe3-19cd4d4a2ab4_3102x1085.png" width="1456" height="509" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9680ee5c-188e-4f3b-abe3-19cd4d4a2ab4_3102x1085.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:509,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:238104,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9I64!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9680ee5c-188e-4f3b-abe3-19cd4d4a2ab4_3102x1085.png 424w, https://substackcdn.com/image/fetch/$s_!9I64!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9680ee5c-188e-4f3b-abe3-19cd4d4a2ab4_3102x1085.png 848w, https://substackcdn.com/image/fetch/$s_!9I64!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9680ee5c-188e-4f3b-abe3-19cd4d4a2ab4_3102x1085.png 1272w, https://substackcdn.com/image/fetch/$s_!9I64!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9680ee5c-188e-4f3b-abe3-19cd4d4a2ab4_3102x1085.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is easy enough if you develop your application with OpenTelemetry right from the beginning and use it for all signals. When it comes to logging tho, most users will probably already be using a different library. </p><p>In those cases, it&#8217;s still easy to get your logs into SigNoz you can write your logs to a file and use the <a href="https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/filelogreceiver">OpenTelemetry Filelog Receiver</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4qn9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee640fd2-59aa-4892-87f2-537a20fa6f5f_2277x451.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4qn9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee640fd2-59aa-4892-87f2-537a20fa6f5f_2277x451.png 424w, https://substackcdn.com/image/fetch/$s_!4qn9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee640fd2-59aa-4892-87f2-537a20fa6f5f_2277x451.png 848w, https://substackcdn.com/image/fetch/$s_!4qn9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee640fd2-59aa-4892-87f2-537a20fa6f5f_2277x451.png 1272w, https://substackcdn.com/image/fetch/$s_!4qn9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee640fd2-59aa-4892-87f2-537a20fa6f5f_2277x451.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4qn9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee640fd2-59aa-4892-87f2-537a20fa6f5f_2277x451.png" width="1456" height="288" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ee640fd2-59aa-4892-87f2-537a20fa6f5f_2277x451.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:288,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:64133,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4qn9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee640fd2-59aa-4892-87f2-537a20fa6f5f_2277x451.png 424w, https://substackcdn.com/image/fetch/$s_!4qn9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee640fd2-59aa-4892-87f2-537a20fa6f5f_2277x451.png 848w, https://substackcdn.com/image/fetch/$s_!4qn9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee640fd2-59aa-4892-87f2-537a20fa6f5f_2277x451.png 1272w, https://substackcdn.com/image/fetch/$s_!4qn9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee640fd2-59aa-4892-87f2-537a20fa6f5f_2277x451.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>If advanced parsing and collecting capabilities are needed which are not present in OpenTelemetry or something like FluentBit or LogStash is already present then the agents can push the logs to the OpenTelemetry collector using protocols like FluentForward, TCP or UDP.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wTo0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498ce1d1-7dda-4c02-bf01-b47e7e921e9b_2972x456.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wTo0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498ce1d1-7dda-4c02-bf01-b47e7e921e9b_2972x456.png 424w, https://substackcdn.com/image/fetch/$s_!wTo0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498ce1d1-7dda-4c02-bf01-b47e7e921e9b_2972x456.png 848w, https://substackcdn.com/image/fetch/$s_!wTo0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498ce1d1-7dda-4c02-bf01-b47e7e921e9b_2972x456.png 1272w, https://substackcdn.com/image/fetch/$s_!wTo0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498ce1d1-7dda-4c02-bf01-b47e7e921e9b_2972x456.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wTo0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498ce1d1-7dda-4c02-bf01-b47e7e921e9b_2972x456.png" width="1456" height="223" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/498ce1d1-7dda-4c02-bf01-b47e7e921e9b_2972x456.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:223,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:85239,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wTo0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498ce1d1-7dda-4c02-bf01-b47e7e921e9b_2972x456.png 424w, https://substackcdn.com/image/fetch/$s_!wTo0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498ce1d1-7dda-4c02-bf01-b47e7e921e9b_2972x456.png 848w, https://substackcdn.com/image/fetch/$s_!wTo0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498ce1d1-7dda-4c02-bf01-b47e7e921e9b_2972x456.png 1272w, https://substackcdn.com/image/fetch/$s_!wTo0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F498ce1d1-7dda-4c02-bf01-b47e7e921e9b_2972x456.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>With the data in ClickHouse you can use the SigNoz web interface to gain insights into your applications state and performance.</p><p>I also love how sane their default configuration is. When we decided to deploy SigNoz into one of our test environments at work we simply added their helm chart to our Terraform repository and without setting any configuration options it just worked - see the code we used below.</p><pre><code>resource "helm_release" "signoz" {
  name             = "signoz"
  repository       = "https://charts.signoz.io"
  chart            = "signoz"
  create_namespace = true
  namespace        = var.namespace
}</code></pre><p>I was also amazed that I installed SigNoz in our k8s cluster and it was able to start ingesting k8s pod logs and metrics right away without requiring any further configuration.</p><p>The maintainers of SigNoz also provide guidance in how to setup OpenTelemetry and SigNoz for all kinds of different applications</p><ul><li><p><a href="https://signoz.io/opentelemetry/python/">Flask Python</a></p></li><li><p><a href="https://signoz.io/opentelemetry/nodejs/">NodeJS</a></p></li><li><p><a href="https://signoz.io/opentelemetry/tomcat/">Tomcat Java</a></p></li><li><p><a href="https://signoz.io/opentelemetry/go/">Gin Go</a><br></p></li></ul><p><a href="https://signoz.io/docs/instrumentation/">And more</a> - If you prefer videos over writing then they also have a series of on youtube on how to setup different their monitoring system for different applications, you can find it <a href="https://www.youtube.com/watch?v=4obQilMqU4E&amp;list=PL0N8FjJpzGl_VLU-PedUdnWXUybA90pcP">here</a>.</p><h2>The Community</h2><p>What really made me fall in love with this project is how they treat their community. When discovering a new open-source software that interests me I generally start on the &#8220;issues&#8221; tab - this gives me a good idea of what&#8217;s going on in the project, how active the developers are and how they&#8217;re dealing with bugs and feature requests. SigNoz has to be one of the most active projects I&#8217;ve discovered so far - turning on notifications means that I can&#8217;t open Github anymore without seeing new discussions or pull requests. </p><p>You can also see the number of commits to the repository over time - these guys are killing it.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_Dcc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7215fcc-7215-43a0-baef-3f17d5f1c15b_1689x262.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_Dcc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7215fcc-7215-43a0-baef-3f17d5f1c15b_1689x262.png 424w, https://substackcdn.com/image/fetch/$s_!_Dcc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7215fcc-7215-43a0-baef-3f17d5f1c15b_1689x262.png 848w, https://substackcdn.com/image/fetch/$s_!_Dcc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7215fcc-7215-43a0-baef-3f17d5f1c15b_1689x262.png 1272w, https://substackcdn.com/image/fetch/$s_!_Dcc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7215fcc-7215-43a0-baef-3f17d5f1c15b_1689x262.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_Dcc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7215fcc-7215-43a0-baef-3f17d5f1c15b_1689x262.png" width="1456" height="226" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d7215fcc-7215-43a0-baef-3f17d5f1c15b_1689x262.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:226,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19246,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_Dcc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7215fcc-7215-43a0-baef-3f17d5f1c15b_1689x262.png 424w, https://substackcdn.com/image/fetch/$s_!_Dcc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7215fcc-7215-43a0-baef-3f17d5f1c15b_1689x262.png 848w, https://substackcdn.com/image/fetch/$s_!_Dcc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7215fcc-7215-43a0-baef-3f17d5f1c15b_1689x262.png 1272w, https://substackcdn.com/image/fetch/$s_!_Dcc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7215fcc-7215-43a0-baef-3f17d5f1c15b_1689x262.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>I&#8217;ve also Made a few small contributions myself (<a href="https://github.com/SigNoz/signoz/pull/1904">here</a>, <a href="https://github.com/SigNoz/signoz/pull/2002">here</a> and <a href="https://github.com/SigNoz/signoz/pull/2003">here</a>) and felt very welcomed by the developers - looking forward to contribute more in the future.</p><p>If you&#8217;ve always wanted to contribute to open-source there are a lot of open issues with the <a href="https://github.com/SigNoz/signoz/labels/good%20first%20issue">&#8220;good first issue&#8221; label</a> that you could pick up - if anything is unclear just ask and I&#8217;m sure they&#8217;ll be more than happy to help.</p><p>In addition to their activity on Github they are also happy to help anyone troublehsoot problems and discuss ideas on their <a href="https://signoz.io/slack">slack channel</a>.</p><h2>Conclusion</h2><p>So, why should you give SigNoz a chance?</p><ul><li><p>Open-source</p></li><li><p>Awesome default settings</p></li><li><p>Very easy to setup and get started</p></li><li><p>Tries to do lot&#8217;s of common things - such as calculating p99 - automatically for you</p></li><li><p>Active community and developers who are willing to help you troubleshoot and fix things</p></li></ul><p>All that being said, don&#8217;t exepect it to be as mature as DataDog just yet. They are still at an early stage with very active development so expect things to change / break when updating.</p><p>I am looking forward to see them develop this further and believe that they can give many of the commercial tools a run for their money.</p><h2>Closing Words</h2><p>I hope got value out of this and consider leaving your email address so that you don&#8217;t miss out on any of my future posts.</p><p>This newsletter is free but if you want to encourage me to keep doing this you can <a href="https://ko-fi.com/mariuskimmina">buy me a coffee</a>.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[E5: Building Better CI/CD Pipelines]]></title><description><![CDATA[I&#8217;m personally in some kind of hate/love relationship with pipelines.]]></description><link>https://www.infrastructureposts.com/p/e5-building-better-cicd-pipelines</link><guid isPermaLink="false">https://www.infrastructureposts.com/p/e5-building-better-cicd-pipelines</guid><dc:creator><![CDATA[Marius Kimmina]]></dc:creator><pubDate>Sat, 18 Feb 2023 10:00:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa807ce7e-cf53-4d8b-9294-72a904fed717_1735x1061.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I&#8217;m personally in some kind of hate/love relationship with pipelines. I love them for all the work they do for me and could never imagine going back to a world without them. </p><p>I also hate it whenever I have to wait for a pipeline to finish. Eagerly wanting to know if my change is good and the pipeline passes or if there are problems I need to fix first. Depending on your pipeline this can take anywhere from 1 to 60 minutes. 1 Minute is a pipeline that just runs your unit tests and reports back if they pass or fail. A pipeline that is closer to 60 minutes is doing a whole lot more (at least I would hope so), static code analysis, unit tests, integration tests, linting, deployments to test environments, end to end tests - you can add a lot to your pipeline if you so choose.</p><p>However long your pipeline currently takes, you would probably prefer it to be faster and conveniently today I want to talk about a few things that may help you get there.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>I have mostly been using Gitlab pipelines in my own career and I will be using Gitlab for all examples in this Post. That being said, most principles you find here can also be implemented in other CI/CD platforms like CircleCI or Github Actions.</p><p>Before we begin I want to at least establish some common vocabulary. </p><ul><li><p>Runner &#8594; Maschine that executes the pipeline</p></li><li><p>CICD Platform &#8594; Where we define pipeline instructions, e. g. Gitlab</p></li><li><p>Job &#8594; A group of instructions that is executed by the runner</p></li><li><p>Stage &#8594;A group of one or more jobs, common stages are: build, test, deploy</p></li></ul><p>The things I will be talking about here are:</p><ul><li><p>When to run pipelines</p></li><li><p>Caching</p></li><li><p>Docker in Docker</p></li></ul><p>All I say here stems from personal experience and your mileage may warry.</p><h1>When to run pipelines</h1><p>Using one repository for multiple applications seems to have become a popular approach in recent years, at least I have stumbled upon it on multiple occasions. I first hard about <a href="https://research.google/pubs/pub45424/">Google doing it</a> and later discovered that there is even a word for it, <a href="https://monorepo.tools/">Monorepo</a>. </p><p>I have also seen some strange patterns emerge when following the monorepo approach, such as running all tests for all services whenever a change has been made to any service.</p><p>Always testing all applications in a repo with potentially 10s, 100s or even 1000s of them can be unfathomably time consuming. If you are using cloud provider to run your Pipelines, you might also have to pay more for the heavier load.</p><p>Just because all your applications and services are now living in one repository doesn&#8217;t mean that you should treat them like one single entity. In the world of microservices such an approach would be called a <a href="https://torvo.com.au/articles/6-symptoms-of-a-distributed-monolith#:~:text=Distributed%20monoliths%20occur%20when%20the,the%20risk%20of%20any%20changes.">distributed monolith</a>. </p><p>Many CI/CD platforms offer a way to check for changes to certain files or directories before running a pipeline. In Gitlab you can do it as follows:</p><pre><code><code>only:
  changes:
    - dir-a/*
    - dir-b/**/*
    - file-c</code></code></pre><p>This defines a pipeline that is only executed when</p><p>a) a file in <em>dir-a</em> has been changed<br>b) a file in <em>dir-b</em> or any subdirectory of <em>dir-b</em> has been changed<br>c) <em>file-c</em> has been changed.</p><p>In a monorepo this can be used to run the tests for a service only when files for this service change.</p><p>Builds and deployments should generally be handled similarly. They are all different services that just happen to have their code in the same repository, treat them as different entities.</p><div class="pullquote"><p>What follows now is some rambling about Gitlab specific things that have annoyed me in the past, if you are not using Gitlab you can safely skip ahead to the next chapter about Caching.</p></div><p>Be aware that `changes` in Gitlab is always considered true when the pipeline is triggered via the web UI instead of by pushing code. </p><p>Another case I come across frequently is to manually trigger only certain parts of the pipeline and all CI/CD platforms should allow for this in one way or another. In Gitlab you can define custom variables before triggering a Pipeline manually and then check these variables for running certain jobs.</p><p>For example, if I have two separate test jobs defined, <em>TestA</em> and <em>TestB</em> then I can define that <em>TestA</em> may only run if the variable <code>TEST_A</code> is set to <code>yes</code></p><pre><code><code>only:
  variables: 
    - $TEST_A == "yes"</code></code></pre><p>When you define many rules around when to run your pipelines, things can get a bit confusing, for example consider the following `only` definition. This Pipeline will run when either <code>TEST_A</code> or <code>TEST_C</code> is yes. </p><pre><code><code>only:
  variables: 
    - $TEST_A == "yes"
    - $TEST_C == "yes"</code></code></pre><p>But what about the following? </p><pre><code><code>only:
  variables: 
    - $TEST_A == "yes"
    - $TEST_C == "yes"
  changes:
    - dir-a/*
    - dir-b/**/*
    - file-c</code></code></pre><p>Well this will also run when the Pipeline is triggered manually and either <code>TEST_A</code> or <code>TEST_C</code> is set to <code>yes</code>. It will never run on any code push tho, because both the <code>variables</code> and the <code>changes</code> section have to evaluate to <code>true</code>. When you trigger the Pipeline manually, <code>changes</code> are always true, so in that case it works, but if you push code changes you never have custom variables defined thus your pipeline will never run.<br><br>More recently, Gitlab has introduced a new alternative to <code>only </code>in the form of <code>rules</code>. With rules I was able to get the behavior I actually desired, the Pipeline can be run manually by setting either <code>TEST_A</code> or <code>TEST_B</code> and the Pipeline will also automatically run all tests on a push that contains changes to the code.</p><pre><code><code>rules:
  - if: '$TEST_A == "yes" || $TEST_ALL == "yes"'
  - if: '$TEST_B == "yes"
    when: never
  - changes:
      paths:
        - dir-a/**/*
        - dir-b/**/*</code></code></pre><h1><br>Caching</h1><p>Let&#8217;s say we have an application that is build using nodejs. Installing all dependencies for a big javascript application can take a while, so long in fact that the following has become one of the most wide spread memes among developers.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wHI2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1681e5a-4685-4176-a900-cb0b2fab3234_990x712.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wHI2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1681e5a-4685-4176-a900-cb0b2fab3234_990x712.png 424w, https://substackcdn.com/image/fetch/$s_!wHI2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1681e5a-4685-4176-a900-cb0b2fab3234_990x712.png 848w, https://substackcdn.com/image/fetch/$s_!wHI2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1681e5a-4685-4176-a900-cb0b2fab3234_990x712.png 1272w, https://substackcdn.com/image/fetch/$s_!wHI2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1681e5a-4685-4176-a900-cb0b2fab3234_990x712.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wHI2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1681e5a-4685-4176-a900-cb0b2fab3234_990x712.png" width="586" height="421.4464646464646" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d1681e5a-4685-4176-a900-cb0b2fab3234_990x712.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:712,&quot;width&quot;:990,&quot;resizeWidth&quot;:586,&quot;bytes&quot;:68307,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wHI2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1681e5a-4685-4176-a900-cb0b2fab3234_990x712.png 424w, https://substackcdn.com/image/fetch/$s_!wHI2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1681e5a-4685-4176-a900-cb0b2fab3234_990x712.png 848w, https://substackcdn.com/image/fetch/$s_!wHI2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1681e5a-4685-4176-a900-cb0b2fab3234_990x712.png 1272w, https://substackcdn.com/image/fetch/$s_!wHI2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1681e5a-4685-4176-a900-cb0b2fab3234_990x712.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Which leads us to the conclusion, that we want to avoid downloading dependencies whenever possible. </p><p>How can we determine when the node_modules should be downloaded again? Pause here for a moment and think about it, it&#8217;s a good mental exercise.<br><br>The answer is to take a hash of the package-lock.json file. When this hash changes, the dependencies have changed in some way and need to be downloaded again. As long as this hash stays the same, we keep using the present node_modules and skip the download step.</p><p>Gitlab will do this hashing step for us if we us package-lock.json as the cache-key.</p><pre><code>cache:  
  key:    
    files:      
      - package-lock.json  
  paths:    
    - node_modules/</code></pre><h3>Using distributed caching</h3><p>When you have one more than one runner for your pipeline, caching on the runner becomes less effective. You might have 6 jobs that run in parallel and that all need to be done before the next stage. If only one of these 6 jobs get picked up by a runner that doesn&#8217;t have his cache build up, this one becomes the bottleneck it almost doesn&#8217;t matter that we had a cache hit on the other 5.</p><p>In that case, it can make sense to store your cache in a remote storage such as S3 that all runners can access. Downloading your node_modules from S3 will of course be slower than having them cached locally but in my experience it is still a lot faster than running <code>npm install</code>. </p><h1>Docker in Docker</h1><blockquote><p>Do you really want Docker-in-Docker? Or do you just want to be able to run Docker (specifically: build, run, sometimes push containers and images) from your CI system, while this CI system itself is in a container?</p></blockquote><p>The above is a quote from this <a href="https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/">excellent article</a> by <a href="https://jpetazzo.github.io/">one of the developers of docker, who has also worked on docker in docker</a>. Since we are talking about pipelines here, we want the later. I strongly advise you to read their whole article but If you are short on time, you should mount the docker.sock of your runner into the container that executes the pipeline. </p><p>With this, when you use a docker command inside the docker runner, the command will be executed by the host docker engine. Meaning that instead of running docker containers inside docker containers you instead get the host to create a second container.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OtlW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa807ce7e-cf53-4d8b-9294-72a904fed717_1735x1061.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OtlW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa807ce7e-cf53-4d8b-9294-72a904fed717_1735x1061.png 424w, https://substackcdn.com/image/fetch/$s_!OtlW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa807ce7e-cf53-4d8b-9294-72a904fed717_1735x1061.png 848w, https://substackcdn.com/image/fetch/$s_!OtlW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa807ce7e-cf53-4d8b-9294-72a904fed717_1735x1061.png 1272w, https://substackcdn.com/image/fetch/$s_!OtlW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa807ce7e-cf53-4d8b-9294-72a904fed717_1735x1061.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OtlW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa807ce7e-cf53-4d8b-9294-72a904fed717_1735x1061.png" width="1456" height="890" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a807ce7e-cf53-4d8b-9294-72a904fed717_1735x1061.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:890,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:140492,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OtlW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa807ce7e-cf53-4d8b-9294-72a904fed717_1735x1061.png 424w, https://substackcdn.com/image/fetch/$s_!OtlW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa807ce7e-cf53-4d8b-9294-72a904fed717_1735x1061.png 848w, https://substackcdn.com/image/fetch/$s_!OtlW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa807ce7e-cf53-4d8b-9294-72a904fed717_1735x1061.png 1272w, https://substackcdn.com/image/fetch/$s_!OtlW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa807ce7e-cf53-4d8b-9294-72a904fed717_1735x1061.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In Gitlab, you would do this by modifying the runner configuration as seen below.</p><pre><code>[[runners]]
  url = "https://gitlab.com/"
  token = RUNNER_TOKEN
  executor = "docker"
  [runners.docker]
    image = "docker:20.10.16"
    privileged = false
    volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]</code></pre><h2>Lessons learned</h2><p>The most important take aways here are</p><ul><li><p>Only test / build / deploy what has changed</p></li><li><p>Make use of caching mechanisms</p></li><li><p>Docker in Docker is often not necessary for CI purposes</p></li></ul><h2>Closing Words</h2><p>I hope got value out of this and consider leaving your email address so that you don&#8217;t miss out on any of my future posts.</p><p>Also, we are hiring - so if you are you are in Germany (Hamburg) or willing to move here and you would like to join me, we are looking for DevOps folks as well as Go developers. Get in touch with me on <a href="https://www.linkedin.com/in/marius-kimmina/">LinkedIn</a> if you wana know more.</p><p>This newsletter is free but if you want to encourage me to keep doing this you can <a href="https://ko-fi.com/mariuskimmina">buy me a coffee</a>.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[E4: AWS Load Balancer Controller as an Ingress Controller]]></title><description><![CDATA[In this episode, I want to discuss how the AWS Load Balancer Controller behaves when acting as an Ingress Controller.]]></description><link>https://www.infrastructureposts.com/p/e4-aws-load-balancer-controller-as</link><guid isPermaLink="false">https://www.infrastructureposts.com/p/e4-aws-load-balancer-controller-as</guid><dc:creator><![CDATA[Marius Kimmina]]></dc:creator><pubDate>Sun, 05 Feb 2023 12:48:17 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdee50b6a-ed0b-4f14-8d23-8a7210ebc730_721x553.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this episode, I want to discuss how the AWS Load Balancer Controller behaves when acting as an <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/">Ingress Controller</a>. </p><p>When people think about ingresses on Kubernetes, they are commonly imagining them as the entrypoint into the cluster that also lives inside the cluster. Often represented in diagramms such as the one below.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jmyl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7615e2cf-e3b9-4154-9e67-40a492df3470_2754x1456.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jmyl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7615e2cf-e3b9-4154-9e67-40a492df3470_2754x1456.png 424w, https://substackcdn.com/image/fetch/$s_!jmyl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7615e2cf-e3b9-4154-9e67-40a492df3470_2754x1456.png 848w, https://substackcdn.com/image/fetch/$s_!jmyl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7615e2cf-e3b9-4154-9e67-40a492df3470_2754x1456.png 1272w, https://substackcdn.com/image/fetch/$s_!jmyl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7615e2cf-e3b9-4154-9e67-40a492df3470_2754x1456.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jmyl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7615e2cf-e3b9-4154-9e67-40a492df3470_2754x1456.png" width="1456" height="770" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7615e2cf-e3b9-4154-9e67-40a492df3470_2754x1456.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:770,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:205004,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jmyl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7615e2cf-e3b9-4154-9e67-40a492df3470_2754x1456.png 424w, https://substackcdn.com/image/fetch/$s_!jmyl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7615e2cf-e3b9-4154-9e67-40a492df3470_2754x1456.png 848w, https://substackcdn.com/image/fetch/$s_!jmyl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7615e2cf-e3b9-4154-9e67-40a492df3470_2754x1456.png 1272w, https://substackcdn.com/image/fetch/$s_!jmyl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7615e2cf-e3b9-4154-9e67-40a492df3470_2754x1456.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Here the traffic arrvies in our cluster, the ingress forwards it to a service of type ClusterIP which then hands it of to the pods. The service can be of type ClusterIP since it doesn&#8217;t have to be accessible from outside the cluster, it&#8217;s only accessed via an Ingress that lives inside the cluster.</p><p>I also always thought of them like this, which stems from <a href="https://youtu.be/T4Z7visMM4E?t=1142">a youtube video</a> I watched early on when I started learning about kubernetes. </p><p>This is not necessarily wrong but as it is often the case with diagramms, they don&#8217;t tell you the whole story.<br><br>An ingress is really just a set of rules to pass to a controller that is listening for them. An <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/">Ingress Controller</a>. You can deploy a bunch of ingress rules, but nothing will happen unless you have a controller that can process them.</p><p>When you set up the <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/">AWS Load Balancer Controller</a> as an Ingress Controller, they tell you that the service must be of type NodePort or LoadBalancer. At least when using their <em>instance mode.</em></p><blockquote><p>service must be of type "NodePort" or "LoadBalancer" to use <code>instance</code> mode</p></blockquote><p>I don&#8217;t wanna go into the details about the two different modes or tell you which one you should choose, at least not in this article. </p><p>I was wondering why these services would have to be of type "NodePort" or "LoadBalancer". Setting them up as such makes them reachable from outside the cluster - but when we have an ingress in front, why would this be necessary?</p><p>I finally understood when looking at an <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/how-it-works/">architecture diagramm of the AWS Load Balancer Controller</a>. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qt_h!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdee50b6a-ed0b-4f14-8d23-8a7210ebc730_721x553.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qt_h!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdee50b6a-ed0b-4f14-8d23-8a7210ebc730_721x553.png 424w, https://substackcdn.com/image/fetch/$s_!qt_h!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdee50b6a-ed0b-4f14-8d23-8a7210ebc730_721x553.png 848w, https://substackcdn.com/image/fetch/$s_!qt_h!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdee50b6a-ed0b-4f14-8d23-8a7210ebc730_721x553.png 1272w, https://substackcdn.com/image/fetch/$s_!qt_h!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdee50b6a-ed0b-4f14-8d23-8a7210ebc730_721x553.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qt_h!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdee50b6a-ed0b-4f14-8d23-8a7210ebc730_721x553.png" width="721" height="553" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dee50b6a-ed0b-4f14-8d23-8a7210ebc730_721x553.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:553,&quot;width&quot;:721,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;controller-design&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="controller-design" title="controller-design" srcset="https://substackcdn.com/image/fetch/$s_!qt_h!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdee50b6a-ed0b-4f14-8d23-8a7210ebc730_721x553.png 424w, https://substackcdn.com/image/fetch/$s_!qt_h!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdee50b6a-ed0b-4f14-8d23-8a7210ebc730_721x553.png 848w, https://substackcdn.com/image/fetch/$s_!qt_h!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdee50b6a-ed0b-4f14-8d23-8a7210ebc730_721x553.png 1272w, https://substackcdn.com/image/fetch/$s_!qt_h!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdee50b6a-ed0b-4f14-8d23-8a7210ebc730_721x553.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When you are using AWS Load Balancer Controller as your ingress controller, the ingress rules are fulllfilled by target groups in AWS, outside of your cluster.</p><p>The diagram from the beginning of the post would have to look more like the one below.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Q-x9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa147319e-cc90-40a2-a831-caf3146819ab_3238x1462.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Q-x9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa147319e-cc90-40a2-a831-caf3146819ab_3238x1462.png 424w, https://substackcdn.com/image/fetch/$s_!Q-x9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa147319e-cc90-40a2-a831-caf3146819ab_3238x1462.png 848w, https://substackcdn.com/image/fetch/$s_!Q-x9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa147319e-cc90-40a2-a831-caf3146819ab_3238x1462.png 1272w, https://substackcdn.com/image/fetch/$s_!Q-x9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa147319e-cc90-40a2-a831-caf3146819ab_3238x1462.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Q-x9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa147319e-cc90-40a2-a831-caf3146819ab_3238x1462.png" width="1456" height="657" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a147319e-cc90-40a2-a831-caf3146819ab_3238x1462.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:657,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:232037,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Q-x9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa147319e-cc90-40a2-a831-caf3146819ab_3238x1462.png 424w, https://substackcdn.com/image/fetch/$s_!Q-x9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa147319e-cc90-40a2-a831-caf3146819ab_3238x1462.png 848w, https://substackcdn.com/image/fetch/$s_!Q-x9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa147319e-cc90-40a2-a831-caf3146819ab_3238x1462.png 1272w, https://substackcdn.com/image/fetch/$s_!Q-x9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa147319e-cc90-40a2-a831-caf3146819ab_3238x1462.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Here you can see that the service has to be reachable from outside the cluster, which means that we can&#8217;t use type ClusterIP but we have to use NodePort or LoadBalancer.</p><h2>Lessons learned</h2><p>An Ingress is just a set of rules and it&#8217;s up to the ingress controller to enforce these rules. In most cases, the first diagramm we saw will probably be correct and your ingress will be part of your cluster but it doesn&#8217;t have to be that way. <br>The AWS Load Balancer Controller is using AWS Target Groups to enforce the ingress rules before traffic enters your kubernetes cluster.</p><h2>Closing Words</h2><p>I hope got value out of this and consider leaving your email address so that you don&#8217;t miss out on any of my future posts.</p><p>This newsletter is free but if you want to encourage me to keep doing this you can <a href="https://ko-fi.com/mariuskimmina">buy me a coffee</a> or <a href="https://www.buymeacoffee.com/mariuskimmina">buy me a coffee</a>.<br></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[E3: AWS Load Balancer Controller VS Strimzi Kafka Operator ]]></title><description><![CDATA[This is a deep dive into how different components in a Kubernetes cluster can sometimes end up fighting against each other, leading to strange and hard to understand behaviour.]]></description><link>https://www.infrastructureposts.com/p/e3-aws-load-balancer-controller-vs</link><guid isPermaLink="false">https://www.infrastructureposts.com/p/e3-aws-load-balancer-controller-vs</guid><dc:creator><![CDATA[Marius Kimmina]]></dc:creator><pubDate>Sat, 28 Jan 2023 10:00:12 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aad48ca-7a58-4966-bc59-68d2bc9b7386_1179x735.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>While in <a href="https://www.infrastructureposts.com/p/e2-about-kubernetes-load-balancers">last weeks episode</a> I briefly touched on how finalizers in kubernetes work. This week I want to take you on a tour into a special case where we did end up with dangling load balancers on AWS when deleting a service of type LoadBalancer in Kubernetes. that I once came across that, for a moment, made my feel like I was losing my sanity.</p><p>Let me start by giving you some background knowledge on the two components that were involved in this case, <a href="https://github.com/strimzi/strimzi-kafka-operator">Strimzi Kafka Operator</a> and <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/">AWS Load Balancer Controller</a>.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>Kafka on Kubernetes</h2><p>We are using <a href="https://kafka.apache.org/">kafka</a> at work, deployed on kubernetes using the <a href="https://github.com/strimzi/strimzi-kafka-operator">Strimzi kafka operator</a>. <br>Furthermore, we are exposing kafka using load balancers, as has been <a href="https://strimzi.io/blog/2019/05/13/accessing-kafka-part-4/">showcased on the Strimzi blog</a>.</p><p>To give clients access to the individual brokers, the operator creates a separate service of type LoadBalancer for each broker. As a result, each broker will get also have a separate load balancer in the cloud.</p><p>This leads to a slightly odd architecture, as shown in the diagramm below, assuming you have 3 brokers in your kafka cluster.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!imdJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf4de58-54f6-4c21-b454-07be4c6f9adb_1582x1263.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!imdJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf4de58-54f6-4c21-b454-07be4c6f9adb_1582x1263.png 424w, https://substackcdn.com/image/fetch/$s_!imdJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf4de58-54f6-4c21-b454-07be4c6f9adb_1582x1263.png 848w, https://substackcdn.com/image/fetch/$s_!imdJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf4de58-54f6-4c21-b454-07be4c6f9adb_1582x1263.png 1272w, https://substackcdn.com/image/fetch/$s_!imdJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf4de58-54f6-4c21-b454-07be4c6f9adb_1582x1263.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!imdJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf4de58-54f6-4c21-b454-07be4c6f9adb_1582x1263.png" width="1456" height="1162" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6cf4de58-54f6-4c21-b454-07be4c6f9adb_1582x1263.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1162,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:221587,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!imdJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf4de58-54f6-4c21-b454-07be4c6f9adb_1582x1263.png 424w, https://substackcdn.com/image/fetch/$s_!imdJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf4de58-54f6-4c21-b454-07be4c6f9adb_1582x1263.png 848w, https://substackcdn.com/image/fetch/$s_!imdJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf4de58-54f6-4c21-b454-07be4c6f9adb_1582x1263.png 1272w, https://substackcdn.com/image/fetch/$s_!imdJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf4de58-54f6-4c21-b454-07be4c6f9adb_1582x1263.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>None of these load balancers are actually balancing any load, they just serve as entrypoints for each individual kafka broker.</p><p>It is also worth mentioning that these load balancers on AWS are <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html">Network Load Balancer (NLB)</a>. Network load balancers act on layer 4, this enables them to serve traffic with a lower latency and at less cost than the layer <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html">Application Load Balancer (ALB)</a> but they also don&#8217;t offer features such as authentication, sticky sessions or request based routing.</p><p>We can find a simple answer as to why they went with NLBs over ALBs on <a href="https://strimzi.io/blog/2019/05/13/accessing-kafka-part-4/">the strimzi blog</a></p><blockquote><p>Since none of the common load balancing services supports the Kafka protocol, Strimzi always uses the Layer 4 load balancing.</p></blockquote><h2>AWS Load Balancer Controller</h2><p>As you saw in the last image, for each broker we need a service of type LoadBalancer. We are running our entire infrastructure on AWS, so for us each of these services maps to an external load balancer in the cloud, an <a href="https://aws.amazon.com/elasticloadbalancing/">ELB</a>.</p><p>These load balancers on AWS are automatically created for us by the <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/">AWS Load Balancer Controller</a>. This is generally great as we don&#8217;t have to worry about managing these load balancers, we just create a service of type LoadBalancer in Kubernetes and the controller takes care of creating and managing the ELB automatically.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9yzC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F820ec044-c7c2-4565-915a-075738720655_1241x755.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9yzC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F820ec044-c7c2-4565-915a-075738720655_1241x755.png 424w, https://substackcdn.com/image/fetch/$s_!9yzC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F820ec044-c7c2-4565-915a-075738720655_1241x755.png 848w, https://substackcdn.com/image/fetch/$s_!9yzC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F820ec044-c7c2-4565-915a-075738720655_1241x755.png 1272w, https://substackcdn.com/image/fetch/$s_!9yzC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F820ec044-c7c2-4565-915a-075738720655_1241x755.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9yzC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F820ec044-c7c2-4565-915a-075738720655_1241x755.png" width="1241" height="755" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/820ec044-c7c2-4565-915a-075738720655_1241x755.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:755,&quot;width&quot;:1241,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:124891,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9yzC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F820ec044-c7c2-4565-915a-075738720655_1241x755.png 424w, https://substackcdn.com/image/fetch/$s_!9yzC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F820ec044-c7c2-4565-915a-075738720655_1241x755.png 848w, https://substackcdn.com/image/fetch/$s_!9yzC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F820ec044-c7c2-4565-915a-075738720655_1241x755.png 1272w, https://substackcdn.com/image/fetch/$s_!9yzC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F820ec044-c7c2-4565-915a-075738720655_1241x755.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It also takes care of deleting the load balancer on AWS once we delete the service in our cluster. To achieve this it adds a finalizer to the definition of all services (and ingresses) that it created a cloud resource for.</p><p>For an explanation of how finalizers work have a look at <a href="https://www.infrastructureposts.com/i/97552921/finalizers-for-load-balancers">last weeks episode</a> or the <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/">finalizers documentation</a>.</p><h2>Mistery of a missing finalizer</h2><p>We noticed that when removing the LoadBalancer services that connect to Kafka in our cluster, the ELBs on the side of AWS are still there even tho they don&#8217;t serve a purpose anymore.</p><p>First I checked the current yaml definition of our load balancers, created by the strimzi operator. There were no finalizers, which is clearly why the load balancers in AWS didn&#8217;t get deleted. Which leaves only one question to be answered, why are the finalizers missing?<br><br>During research I found <a href="https://github.com/strimzi/strimzi-kafka-operator/issues/4500">this issue in the strimzi operator repo</a> according to which support for finalizers should have been added around march 2021. Furthermore a <a href="https://github.com/strimzi/strimzi-kafka-operator/issues/3974">second issue in the same repository</a> suggest adding the following. </p><pre><code><code>finalizers:
- service.kubernetes.io/load-balancer-cleanup</code></code></pre><p>I had to look up what this is supposedly doing and found a straight forward explanation.</p><blockquote><p>Specifically, if a Service has type LoadBalancer, the service controller will attach a finalizer named <code>service.kubernetes.io/load-balancer-cleanup</code>. The finalizer will only be removed after the load balancer resource is cleaned up. This prevents dangling load balancer resources even in corner cases such as the service controller crashing.</p></blockquote><p>Now, in hindsight, I should have paused here for a moment and ask myself why the service controller, who is supposed to add this finalizer, apparently didn&#8217;t do it. That&#8217;s not what I did tho, instead I rushed towards my editor and added this finalizer myself.</p><pre><code>apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
  name: {{ .Values.cluster_name }}
  namespace: {{ .Values.namespace }}
spec:
  kafka:
    version: {{ .Values.kafka_version }}
    replicas: {{ .Values.kafka_replicas }}
    authorization:
      type: simple
      superUsers:
        - admin
    listeners:
      - name: plain
        port: 9095
        type: internal
        tls: false
        authentication:
          type: scram-sha-512
        configuration:
          useServiceDnsDomain: true
      - name: external
        port: {{ .Values.kafka_port }}
        type: loadbalancer
        tls: true
        authentication:
          type: scram-sha-512
        configuration:
          finalizers:
            - service.kubernetes.io/load-balancer-cleanup
        ...</code></pre><p>With this change deployed in one of our test environments I used <a href="https://k9scli.io/">k9s</a> to confirm the presence of this finalizer.</p><p>What I saw really suprised me tho, there are suddenly not just one but two finalizers present.</p><ul><li><p>service.kubernetes.io/load-balancer-cleanup</p></li><li><p>service.k8s.aws/resources</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o-8Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe222f592-e2aa-475b-b4a8-67377a77ae73_1193x980.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o-8Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe222f592-e2aa-475b-b4a8-67377a77ae73_1193x980.png 424w, https://substackcdn.com/image/fetch/$s_!o-8Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe222f592-e2aa-475b-b4a8-67377a77ae73_1193x980.png 848w, https://substackcdn.com/image/fetch/$s_!o-8Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe222f592-e2aa-475b-b4a8-67377a77ae73_1193x980.png 1272w, https://substackcdn.com/image/fetch/$s_!o-8Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe222f592-e2aa-475b-b4a8-67377a77ae73_1193x980.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o-8Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe222f592-e2aa-475b-b4a8-67377a77ae73_1193x980.png" width="1193" height="980" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e222f592-e2aa-475b-b4a8-67377a77ae73_1193x980.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:980,&quot;width&quot;:1193,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:172611,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!o-8Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe222f592-e2aa-475b-b4a8-67377a77ae73_1193x980.png 424w, https://substackcdn.com/image/fetch/$s_!o-8Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe222f592-e2aa-475b-b4a8-67377a77ae73_1193x980.png 848w, https://substackcdn.com/image/fetch/$s_!o-8Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe222f592-e2aa-475b-b4a8-67377a77ae73_1193x980.png 1272w, https://substackcdn.com/image/fetch/$s_!o-8Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe222f592-e2aa-475b-b4a8-67377a77ae73_1193x980.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>At that time I didn&#8217;t know where this second finalizer came from and felt super confused.</p><p>Things got worse when I tried to delete this service and saw it being removed instantly. Normally when a finalizer is present, this should take a few seconds for the controller to remove the cloud resource.</p><p>I went over to the AWS console and, of course, the load balancer is still there. The controller did not remove it even tho the service of type LoadBalancer was deleted. The added finalizer did not work.</p><p>I had no idea what was going on at this point but this other finalizer that had appeared, service.k8s.aws/resources, seemed to be worth investigating.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!twGO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061f0736-4c3e-486d-9a48-d9d80e81b22c_1479x548.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!twGO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061f0736-4c3e-486d-9a48-d9d80e81b22c_1479x548.png 424w, https://substackcdn.com/image/fetch/$s_!twGO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061f0736-4c3e-486d-9a48-d9d80e81b22c_1479x548.png 848w, https://substackcdn.com/image/fetch/$s_!twGO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061f0736-4c3e-486d-9a48-d9d80e81b22c_1479x548.png 1272w, https://substackcdn.com/image/fetch/$s_!twGO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061f0736-4c3e-486d-9a48-d9d80e81b22c_1479x548.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!twGO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061f0736-4c3e-486d-9a48-d9d80e81b22c_1479x548.png" width="1456" height="539" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/061f0736-4c3e-486d-9a48-d9d80e81b22c_1479x548.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:539,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:103345,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!twGO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061f0736-4c3e-486d-9a48-d9d80e81b22c_1479x548.png 424w, https://substackcdn.com/image/fetch/$s_!twGO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061f0736-4c3e-486d-9a48-d9d80e81b22c_1479x548.png 848w, https://substackcdn.com/image/fetch/$s_!twGO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061f0736-4c3e-486d-9a48-d9d80e81b22c_1479x548.png 1272w, https://substackcdn.com/image/fetch/$s_!twGO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F061f0736-4c3e-486d-9a48-d9d80e81b22c_1479x548.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Great, the first hit is a code reference on Github, I already thought this would be a deep rabbithole to go down. Then I noticed the name of the rep <em>aws-load-balancer-controller </em>- so this other finalizer had to be related to it.</p><p>Then it dawned on me, the operator first creates the service of type LoadBalancer, then the load balancer controller adds the finalizer (service.k8s.aws/resources) to it and so far everthing is good but then the operator removes the finalizer in his <a href="https://developers.redhat.com/articles/2021/06/22/kubernetes-operators-101-part-2-how-operators-work#how_operators_reconcile_kubernetes_cluster_states">reconciliation loop</a>.</p><p>When I saw both finalizers being present, the operator must have removed the service.k8s.aws/resources just before I could delete the service.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HA2D!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aad48ca-7a58-4966-bc59-68d2bc9b7386_1179x735.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HA2D!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aad48ca-7a58-4966-bc59-68d2bc9b7386_1179x735.png 424w, https://substackcdn.com/image/fetch/$s_!HA2D!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aad48ca-7a58-4966-bc59-68d2bc9b7386_1179x735.png 848w, https://substackcdn.com/image/fetch/$s_!HA2D!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aad48ca-7a58-4966-bc59-68d2bc9b7386_1179x735.png 1272w, https://substackcdn.com/image/fetch/$s_!HA2D!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aad48ca-7a58-4966-bc59-68d2bc9b7386_1179x735.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HA2D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aad48ca-7a58-4966-bc59-68d2bc9b7386_1179x735.png" width="1179" height="735" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0aad48ca-7a58-4966-bc59-68d2bc9b7386_1179x735.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:735,&quot;width&quot;:1179,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:123448,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HA2D!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aad48ca-7a58-4966-bc59-68d2bc9b7386_1179x735.png 424w, https://substackcdn.com/image/fetch/$s_!HA2D!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aad48ca-7a58-4966-bc59-68d2bc9b7386_1179x735.png 848w, https://substackcdn.com/image/fetch/$s_!HA2D!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aad48ca-7a58-4966-bc59-68d2bc9b7386_1179x735.png 1272w, https://substackcdn.com/image/fetch/$s_!HA2D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aad48ca-7a58-4966-bc59-68d2bc9b7386_1179x735.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In this case  when we remove the service type LoadBalancer, the ELB we will not be deleted. Without the finalizer the service gets deleted immediately and the AWS Load Balancer Controller has no idea that it has to get rid of the cloud load balancer.</p><p>When we now go back to the defintion file and replace <em>service.kubernetes.io/load-balancer-cleanup</em> with <em>service.k8s.aws/resources </em>then the whole things works as intended.</p><pre><code>apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
  name: {{ .Values.cluster_name }}
  namespace: {{ .Values.namespace }}
spec:
  kafka:
    version: {{ .Values.kafka_version }}
    replicas: {{ .Values.kafka_replicas }}
    authorization:
      type: simple
      superUsers:
        - admin
    listeners:
      - name: plain
        port: 9095
        type: internal
        tls: false
        authentication:
          type: scram-sha-512
        configuration:
          useServiceDnsDomain: true
      - name: external
        port: {{ .Values.kafka_port }}
        type: loadbalancer
        tls: true
        authentication:
          type: scram-sha-512
        configuration:
          finalizers:
            - service.k8s.aws/resources</code></pre><p>Now there is only one finalizer present and it&#8217;s the one that the AWS Load Balancer Controller understands.</p><p>Deleting the service again will take a few seconds, as it should, and leaves no cloud load balancer behind.</p><h2>Lessions learned</h2><ol><li><p>Finalizers are just a string that your controller understands. Adding the finalizer <code>service.kubernetes.io/load-balancer-cleanup</code> didn&#8217;t help because it&#8217;s not what the AWS Load Balancer Controller was expecting. </p></li><li><p>When something is missing from or unexpectedly added to a service defintion and the service is handled by an operator, there is a good chance that the operator is to blame. Keep the reconciliation loop in mind when troubleshooting such cases.</p></li></ol><h2>Closing Words</h2><p>In this post I tried to share the whole process of fixing this issue, including all the gaps in my knowledge that I had and how I closed them. </p><p>I hope you enjoyed this little story and that you will be better equiped should you ever face a similar situation. If you got value out of this then consider leaving your email address so that you don&#8217;t miss out on any of my future posts.</p><p>This newsletter is free but if you want to encourage me to keep doing this you can <a href="https://ko-fi.com/mariuskimmina">buy me a coffee</a> or <a href="https://www.buymeacoffee.com/mariuskimmina">buy me a coffee</a>.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[E2: About Kubernetes Load Balancers]]></title><description><![CDATA[Todays episode is about accessing applications running on Kubernetes. While there are multiple ways to go about this, such as port forwarding and Nodeports, we will look at how the Kubernetes services of type LoadBalancer work]]></description><link>https://www.infrastructureposts.com/p/e2-about-kubernetes-load-balancers</link><guid isPermaLink="false">https://www.infrastructureposts.com/p/e2-about-kubernetes-load-balancers</guid><dc:creator><![CDATA[Marius Kimmina]]></dc:creator><pubDate>Sat, 21 Jan 2023 10:00:59 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd82fe9-9be4-47bb-bd6a-e024a077510d_1241x755.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Todays episode is about accessing applications running on Kubernetes. We will look at how the Kubernetes services of type <em>LoadBalancer</em> work , when we should use them and how they integrate with load balancers of cloud providers. We also explain  what an <em>Ingress</em> is and how it compares to services of type <em>LoadBalancer</em>.</p><p>We will also look take a brief look at the concept of <em>finalizers</em> and see how they help us avoid leaving unwanted cloud resources activ when deleting load balancers in Kubernetes. </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>Services in Kubernetes</h2><p>Each Pod in Kubernetes has it&#8217;s own IP address. When a Pod is destroyed and recreated by Kubernetes, it&#8217;s IP changes. This is obviously a problem if we want to access an application running on a Pod. Services solve this problem for us by giving us a static IP through which we can access an application running on a Pod.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!u5Iw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aea9562-7871-4e0b-b58f-5986bf529f57_1226x1090.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!u5Iw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aea9562-7871-4e0b-b58f-5986bf529f57_1226x1090.png 424w, https://substackcdn.com/image/fetch/$s_!u5Iw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aea9562-7871-4e0b-b58f-5986bf529f57_1226x1090.png 848w, https://substackcdn.com/image/fetch/$s_!u5Iw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aea9562-7871-4e0b-b58f-5986bf529f57_1226x1090.png 1272w, https://substackcdn.com/image/fetch/$s_!u5Iw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aea9562-7871-4e0b-b58f-5986bf529f57_1226x1090.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!u5Iw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aea9562-7871-4e0b-b58f-5986bf529f57_1226x1090.png" width="1226" height="1090" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6aea9562-7871-4e0b-b58f-5986bf529f57_1226x1090.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1090,&quot;width&quot;:1226,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:146282,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!u5Iw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aea9562-7871-4e0b-b58f-5986bf529f57_1226x1090.png 424w, https://substackcdn.com/image/fetch/$s_!u5Iw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aea9562-7871-4e0b-b58f-5986bf529f57_1226x1090.png 848w, https://substackcdn.com/image/fetch/$s_!u5Iw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aea9562-7871-4e0b-b58f-5986bf529f57_1226x1090.png 1272w, https://substackcdn.com/image/fetch/$s_!u5Iw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6aea9562-7871-4e0b-b58f-5986bf529f57_1226x1090.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The default service type is <code>ClusterIP</code>. This type of service can only be accessed from inside the cluster. Services of type <code>NodePort</code> or <code>LoadBalancer</code> are accessible from outside the cluster.</p><h2>Service type LoadBalancer vs Ingress</h2><p>Kubernetes services of type LoadBalancer and Ingresses can at first glance seem like they are doing the same thing. So let&#8217;s take a closer look.</p><h3>Service type LoadBalancer</h3><p>A kubernetes LoadBalancer service is a service that can be accessed through external load balancers that are <strong>NOT</strong> in your kubernetes cluster, but exist elsewhere. They can work with your pods, assuming that your pods are externally routable. Google and AWS provide this capability natively. In terms of Amazon, this service maps directly with <a href="https://aws.amazon.com/elasticloadbalancing/">ELB</a>. Kubernetes when running in AWS (EKS) can automatically provision and configure an ELB instance for each LoadBalancer service deployed.</p><p>The following shows how users can access pods and the applications running on them, on kubernetes when using a service type LoadBalancer with AWS.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aDU9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F264ee7eb-181f-47f8-ba54-8a5a2a4e427d_1411x1934.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aDU9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F264ee7eb-181f-47f8-ba54-8a5a2a4e427d_1411x1934.png 424w, https://substackcdn.com/image/fetch/$s_!aDU9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F264ee7eb-181f-47f8-ba54-8a5a2a4e427d_1411x1934.png 848w, https://substackcdn.com/image/fetch/$s_!aDU9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F264ee7eb-181f-47f8-ba54-8a5a2a4e427d_1411x1934.png 1272w, https://substackcdn.com/image/fetch/$s_!aDU9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F264ee7eb-181f-47f8-ba54-8a5a2a4e427d_1411x1934.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aDU9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F264ee7eb-181f-47f8-ba54-8a5a2a4e427d_1411x1934.png" width="1411" height="1934" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/264ee7eb-181f-47f8-ba54-8a5a2a4e427d_1411x1934.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1934,&quot;width&quot;:1411,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:267251,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aDU9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F264ee7eb-181f-47f8-ba54-8a5a2a4e427d_1411x1934.png 424w, https://substackcdn.com/image/fetch/$s_!aDU9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F264ee7eb-181f-47f8-ba54-8a5a2a4e427d_1411x1934.png 848w, https://substackcdn.com/image/fetch/$s_!aDU9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F264ee7eb-181f-47f8-ba54-8a5a2a4e427d_1411x1934.png 1272w, https://substackcdn.com/image/fetch/$s_!aDU9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F264ee7eb-181f-47f8-ba54-8a5a2a4e427d_1411x1934.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When you are running kubernetes on premise you might not want to depend on a cloud provider for load balancing. In that case there are also alternatives such as <a href="https://metallb.universe.tf/">metallb</a>.</p><h3>Ingress</h3><p>An ingress is really just a set of rules to pass to a controller that is listening for them. An <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/">Ingress Controller</a>. You can deploy a bunch of ingress rules, but nothing will happen unless you have a controller that can process them. A LoadBalancer service could listen for ingress rules, if it is configured to do so.</p><p>Let\s look at an example ingress ressource</p><pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-example
spec:
  rules:
  - host: "foo.bar.com"
    http:
      paths:
      - pathType: Prefix
        path: "/bar"
        backend:
          service:
            name: service1
            port:
              number: 80
  - host: "bar.foo.com"
    http:
      paths:
      - pathType: Prefix
        path: "/foo"
        backend:
          service:
            name: service2
            port:
              number: 80</code></pre><p>Each ingress rule consists of the following:</p><ul><li><p>Host</p></li><li><p>Paths</p></li><li><p>Backend</p><p></p></li></ul><p>The <em>host</em> is optional, in this example, the host is specified for both ingress rules, so the rule applies to inbound HTTP traffic where the host header is either foo.bar.com or bar.foo.com.</p><p>The <em>paths</em> section contains a list of paths, in the example above each ingress rule has one path in it&#8217;s list of paths. Each path is associated with a <em>backend</em></p><p>The <em>backend</em> defines a service to which the traffic should be send. HTTP(S) requests that match the host and path of the rule are sent to the listed backend.</p><p>Let&#8217;s consider a second ingress resource and a visual representation of it.<br>This time our ingress consists of a total of three rules, all applying to the same host <em>example.com</em>. They differ by path, meaning that an Incoming request which has the host header set to <code>example.com</code> and a path of <code>s1 </code>will be forwarded to service1.</p><pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-example
spec:
  rules:
  - host: "example.com"
    http:
      paths:
      - pathType: Prefix
        path: "/s1"
        backend:
          service:
            name: service1
            port:
              number: 80
  - host: "example.com"
    http:
      paths:
      - pathType: Prefix
        path: "/s2"
        backend:
          service:
            name: service2
            port:
              number: 80
  - host: "example.com"
    http:
      paths:
      - pathType: Prefix
        path: "/s3"
        backend:
          service:
            name: service3
            port:
              number: 80</code></pre><p>The following diagramm is a visual representation of the above ingress.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vA_0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65c68d43-fa40-4154-8334-632c68ab7f95_2367x2175.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vA_0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65c68d43-fa40-4154-8334-632c68ab7f95_2367x2175.png 424w, https://substackcdn.com/image/fetch/$s_!vA_0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65c68d43-fa40-4154-8334-632c68ab7f95_2367x2175.png 848w, https://substackcdn.com/image/fetch/$s_!vA_0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65c68d43-fa40-4154-8334-632c68ab7f95_2367x2175.png 1272w, https://substackcdn.com/image/fetch/$s_!vA_0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65c68d43-fa40-4154-8334-632c68ab7f95_2367x2175.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vA_0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65c68d43-fa40-4154-8334-632c68ab7f95_2367x2175.png" width="1456" height="1338" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/65c68d43-fa40-4154-8334-632c68ab7f95_2367x2175.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1338,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:426213,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vA_0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65c68d43-fa40-4154-8334-632c68ab7f95_2367x2175.png 424w, https://substackcdn.com/image/fetch/$s_!vA_0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65c68d43-fa40-4154-8334-632c68ab7f95_2367x2175.png 848w, https://substackcdn.com/image/fetch/$s_!vA_0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65c68d43-fa40-4154-8334-632c68ab7f95_2367x2175.png 1272w, https://substackcdn.com/image/fetch/$s_!vA_0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65c68d43-fa40-4154-8334-632c68ab7f95_2367x2175.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Service1-3 in the above example are typically of type ClusterIP since they are accessed from inside the cluster.</p><p>As you can see, the ingress rules define which service the incoming traffic should go to. It&#8217;s important to once more emphasize that ingress rules alone have no effect, you need a <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/">controller</a> that executes them.</p><p>While a service of type LoadBalancer or Nodeport may be used with any portocol or port, an Ingress does not expose arbitrary ports or protocols. Exposing services other than HTTP and HTTPS to the internet typically uses a service of type NodePort or LoadBalancer.</p><h3>When to use what?</h3><p>If you want to directly expose a service, <strong>service type LoadBalancer</strong> is the default method. All traffic on the port you specify will be forwarded to the service. There is no filtering, no routing, etc. This means you can send almost any kind of traffic to it, like HTTP, TCP, UDP, Websockets, gRPC, or whatever.</p><p>The big downside is that each service you expose with a LoadBalancer will get its own IP address, and you have to pay for a LoadBalancer per exposed service, which can get expensive!</p><p><strong>Ingress</strong> is probably the most powerful way to expose your services, but can also be the most complicated. There are many types of Ingress controllers, from the Google Cloud Load Balancer, Nginx, Contour, Istio, and more. There are also plugins for Ingress controllers, like the cert-manager, that can automatically provision SSL certificates for your services.</p><p>Ingress is the most useful if you want to expose multiple services under the same IP address, and these services all use the same L7 protocol (typically HTTP). You only pay for one load balancer if you are using the native GCP integration, and because Ingress is &#8220;smart&#8221; you can get a lot of features out of the box (like SSL, Auth, Routing, etc)</p><h2>AWS Load Balancer Controller</h2><p>Now, as we have seen before, the service type LoadBalance needs an external load balancer to function. In most cases these will be load balancers created on a cloud provider.</p><p>The exact setup of this  varies depending on the cloud provider you use, assuming AWS you will need the <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.4/">AWS Load Balancer Controller</a>.</p><p>This controller coordinates the creation of an ELB on AWS whenever you create a service of type LoadBalancer in your kubernetes cluster.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hjEE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd82fe9-9be4-47bb-bd6a-e024a077510d_1241x755.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hjEE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd82fe9-9be4-47bb-bd6a-e024a077510d_1241x755.png 424w, https://substackcdn.com/image/fetch/$s_!hjEE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd82fe9-9be4-47bb-bd6a-e024a077510d_1241x755.png 848w, https://substackcdn.com/image/fetch/$s_!hjEE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd82fe9-9be4-47bb-bd6a-e024a077510d_1241x755.png 1272w, https://substackcdn.com/image/fetch/$s_!hjEE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd82fe9-9be4-47bb-bd6a-e024a077510d_1241x755.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hjEE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd82fe9-9be4-47bb-bd6a-e024a077510d_1241x755.png" width="1241" height="755" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9fd82fe9-9be4-47bb-bd6a-e024a077510d_1241x755.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:755,&quot;width&quot;:1241,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:124987,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hjEE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd82fe9-9be4-47bb-bd6a-e024a077510d_1241x755.png 424w, https://substackcdn.com/image/fetch/$s_!hjEE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd82fe9-9be4-47bb-bd6a-e024a077510d_1241x755.png 848w, https://substackcdn.com/image/fetch/$s_!hjEE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd82fe9-9be4-47bb-bd6a-e024a077510d_1241x755.png 1272w, https://substackcdn.com/image/fetch/$s_!hjEE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd82fe9-9be4-47bb-bd6a-e024a077510d_1241x755.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When you create a service of type LoadBalancer the AWS Load Balancer Controller will communicate with AWS to ensure that the corelating ELB is created there.</p><h2>Finalizers for load balancers</h2><p>Now, what happens when we delete the serivce type LoadBalancer? Ideally we want the actual load balancer in the cloud to be gone as well since it&#8217;s serves no purpose without the service. </p><p>Good news: that&#8217;s exactly what happens. when you have the AWS Load Balancer Controller deployed on your kubernetes cluster, you might notice that all your services of type LoadBalancer have a section added to their metadata that looks like this:</p><pre><code>finalizer:
  - service.k8s.aws/resources</code></pre><p>Similarly, all ingresses in your cluster also have a finalizer section</p><pre><code>finalizer:
  - ingress.k8s.aws/resources</code></pre><p>These finalizers will prevent the resource from being deleted until the AWS Load Balancer Controller is done cleaning up all related cloud resources.</p><p>The name of the finalizer, e.g. `service.k8s.aws/resources` really has no special meaning to it in kubernetes, it&#8217;s just a string that the load balancer controller understands.</p><p>If you put a finalizer such as </p><pre><code>finalizer:
  - this.is.just.a.random.string/doesnotexist</code></pre><p>Then the deletion of the resource will be prevented indefinetly, since there is no controller that understands this strings and knows what to do with it. The only way you can delete the service in this case to manually remove the finalizer from the service definition.</p><h2>Closing Words</h2><p>Next Weeks episode will feature a story about how AWS Load Balancer Controller and Strimzi Kafka Operator can be working against each other, troubleshooting an edge case that almost had me lose my sanity. Consider leaving your email if you want to hear the story.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[E1: Moving from Lens to k9s for Kubernetes visibility]]></title><description><![CDATA[TLDR: k9s is provides all the features I used in Openlens previous to their downgrade in 6.3.0 Give it a shot.]]></description><link>https://www.infrastructureposts.com/p/moving-from-lens-to-k9s-for-kubernetes</link><guid isPermaLink="false">https://www.infrastructureposts.com/p/moving-from-lens-to-k9s-for-kubernetes</guid><dc:creator><![CDATA[Marius Kimmina]]></dc:creator><pubDate>Sat, 14 Jan 2023 10:17:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeec955-3d58-41b2-bb55-ce33d2609a32_3806x1994.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>TLDR: <a href="https://github.com/derailed/k9s">k9s</a> is provides all the features I used in Openlens previous to their <a href="https://github.com/lensapp/lens/issues/6823">downgrade in 6.3.0</a> and it will likely stay this way since there is no commercial version of k9s and no company behind it. Give it a shot.</p><div><hr></div><p>Openlens and k9s offer visibility into your Kubernetes cluster. Running a kubectl command everytime you need any information about your cluster can be cumbersome. The obvious solution to this is to have some kind of UI that shows you all the resources in your cluster. </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>As many people felt the need to have a UI for their Kubernetes clusters, many different solutions have emerged. The most prominent one are:</p><ul><li><p>kube-dashboard</p></li><li><p>Lens</p></li><li><p>k9s</p></li><li><p>kubenav (mobile)</p></li></ul><p>And there are even more than just these 4.</p><p><a href="https://k8slens.dev/">Lens</a> is an electron app with both a commerical version (called Lens) and a free and open source version (called Openlens). I have been a long time user of openlens, mostly because it's what my company was already using when I joined. The free version has been working just fine for me and had everything I could ask for, until it didn't. Recently, the lens developers have decided to <a href="https://github.com/lensapp/lens/issues/6823">downgrade Openlens</a> in order to get more people to use their commerical version. </p><p>Many users where caught by suprise when they updated Openlens to version 6.3.0 and discovered that the buttons for accessing logs and getting a shell on a pod where gone. In a discussion on a Github issue, opened by one such surprised user, they proclaimed to have made these changes for &#8220;<a href="https://github.com/lensapp/lens/issues/6823#issuecomment-1363736366">more secure and faster booting</a>&#8221; while at the same time pointing out that these buttons are still available in the commercial version. <br><br>Not sure when the last time was that I saw this many downvotes on Github.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!d9YT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F064422df-cdb7-46d8-a040-4a652944770a_1705x541.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!d9YT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F064422df-cdb7-46d8-a040-4a652944770a_1705x541.png 424w, https://substackcdn.com/image/fetch/$s_!d9YT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F064422df-cdb7-46d8-a040-4a652944770a_1705x541.png 848w, https://substackcdn.com/image/fetch/$s_!d9YT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F064422df-cdb7-46d8-a040-4a652944770a_1705x541.png 1272w, https://substackcdn.com/image/fetch/$s_!d9YT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F064422df-cdb7-46d8-a040-4a652944770a_1705x541.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!d9YT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F064422df-cdb7-46d8-a040-4a652944770a_1705x541.png" width="1456" height="462" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/064422df-cdb7-46d8-a040-4a652944770a_1705x541.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:462,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:107618,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!d9YT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F064422df-cdb7-46d8-a040-4a652944770a_1705x541.png 424w, https://substackcdn.com/image/fetch/$s_!d9YT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F064422df-cdb7-46d8-a040-4a652944770a_1705x541.png 848w, https://substackcdn.com/image/fetch/$s_!d9YT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F064422df-cdb7-46d8-a040-4a652944770a_1705x541.png 1272w, https://substackcdn.com/image/fetch/$s_!d9YT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F064422df-cdb7-46d8-a040-4a652944770a_1705x541.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>They surely got a lot of negative feedback, people are especially furious about the fact that they tried to sell this as "for security reasons". People don't like it when you lie to their face, who would have thought.</p><p>I liked Oenlens but now, the free version is not up to the task anymore and I don't want to support a company that downgrades an open source product and lies to their uses by calling it a security patch. </p><p>Anyway, there were many people talking (complaining) about this change on both <a href="https://www.reddit.com/r/kubernetes/comments/zw3a2e/mirantis_is_up_to_more_shenanigans_with_lens/">Reddit</a> and <a href="https://mobile.twitter.com/kverma_twt/status/1608048255790878725">Twitter</a>. The most recommended alternative in all of these discussion was <a href="https://github.com/derailed/k9s">k9s</a> which I first tried about two weeks ago and so far I have been loving it. </p><p>There is a clear downside to it tho, it&#8217;s a terminal UI. This means no more clicking around, you will need to know keyboard shortcuts to get things done.<br><br>The screenshot below show k9s having me choose between the clusters configured in my <code>~/.kube/config</code> file</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MJ35!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d62ccc0-e2e5-4553-8ece-af95259253c0_3827x2087.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MJ35!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d62ccc0-e2e5-4553-8ece-af95259253c0_3827x2087.png 424w, https://substackcdn.com/image/fetch/$s_!MJ35!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d62ccc0-e2e5-4553-8ece-af95259253c0_3827x2087.png 848w, https://substackcdn.com/image/fetch/$s_!MJ35!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d62ccc0-e2e5-4553-8ece-af95259253c0_3827x2087.png 1272w, https://substackcdn.com/image/fetch/$s_!MJ35!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d62ccc0-e2e5-4553-8ece-af95259253c0_3827x2087.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MJ35!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d62ccc0-e2e5-4553-8ece-af95259253c0_3827x2087.png" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1d62ccc0-e2e5-4553-8ece-af95259253c0_3827x2087.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:98173,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MJ35!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d62ccc0-e2e5-4553-8ece-af95259253c0_3827x2087.png 424w, https://substackcdn.com/image/fetch/$s_!MJ35!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d62ccc0-e2e5-4553-8ece-af95259253c0_3827x2087.png 848w, https://substackcdn.com/image/fetch/$s_!MJ35!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d62ccc0-e2e5-4553-8ece-af95259253c0_3827x2087.png 1272w, https://substackcdn.com/image/fetch/$s_!MJ35!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d62ccc0-e2e5-4553-8ece-af95259253c0_3827x2087.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Once you get used to to this way of navigating your cluster, it's just so much faster. Even if the Lens developers rolled back their changes and added the buttons back in, I wouldn't return. </p><p>Anyone who likes to stay in the terminal during development (I mean you, vim users), will love this. </p><h2>Working with k9s</h2><p>Follow the instructions <a href="https://k9scli.io/topics/install/">here</a> to install k9s. </p><p>Once you have it installed, the command k9s will bring up the terminal UI.</p><p>If you have multiple clusters in you <em>kubeconfig</em>, the first screen will generally prompt you to choose a cluster, as seen in the previous screenshot.</p><p>You navigate up and down this list with j and k, which you might be familar with from the editor vim</p><p>Pressing : will bring up a prompt for you to enter commands. Some of the most common comands are</p><ul><li><p>ctx &#8594; brings up the screen to choose a cluster again</p></li><li><p>ctx SANDBOX &#8594; will directly bring you to the cluster called SANDBOX</p></li><li><p>ns &#8594; brings up a screen where you switch between namespaces</p></li><li><p>pod &#8594; will you show you all pods in the current namespace, the same goes for the name of all other k8s ressources, e.g. service will bring up all services</p></li></ul><p>Some other good to know shortcuts</p><ul><li><p>s while hovering over a pod will give you a shell (ctrl d will let you leave the shell again and return to k9s)</p></li><li><p>l while hovering over a pod will give you logs (esc to go back, this goes for everything except the shell)</p></li><li><p>ctrl-k will kill a pod</p></li><li><p>ctrl-d will delete a pod</p></li><li><p>y will give you the yaml definition of a pod</p></li><li><p>shift-f (F) to setup port forwarding</p></li></ul><p>Many useful shortcuts are also displayed on the top of the UI. There you can also always see which cluster you are operating in.</p><p>Namespaces you visit will also get assigned to numbers. In the screenshot below I`ve been visiting <a href="https://github.com/SigNoz/signoz">signoz</a> and <em>all</em> namespaces and can now quickly switch between them by pressing 0 for all or 1 for signoz</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!99jQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeec955-3d58-41b2-bb55-ce33d2609a32_3806x1994.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!99jQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeec955-3d58-41b2-bb55-ce33d2609a32_3806x1994.png 424w, https://substackcdn.com/image/fetch/$s_!99jQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeec955-3d58-41b2-bb55-ce33d2609a32_3806x1994.png 848w, https://substackcdn.com/image/fetch/$s_!99jQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeec955-3d58-41b2-bb55-ce33d2609a32_3806x1994.png 1272w, https://substackcdn.com/image/fetch/$s_!99jQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeec955-3d58-41b2-bb55-ce33d2609a32_3806x1994.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!99jQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeec955-3d58-41b2-bb55-ce33d2609a32_3806x1994.png" width="1456" height="763" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fdeec955-3d58-41b2-bb55-ce33d2609a32_3806x1994.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:763,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:271680,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!99jQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeec955-3d58-41b2-bb55-ce33d2609a32_3806x1994.png 424w, https://substackcdn.com/image/fetch/$s_!99jQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeec955-3d58-41b2-bb55-ce33d2609a32_3806x1994.png 848w, https://substackcdn.com/image/fetch/$s_!99jQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeec955-3d58-41b2-bb55-ce33d2609a32_3806x1994.png 1272w, https://substackcdn.com/image/fetch/$s_!99jQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdeec955-3d58-41b2-bb55-ce33d2609a32_3806x1994.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Typing ? anywhere will bring up the help menu which shows you all shortcuts available</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!i2TN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fcd8cfc-74d1-4f9d-8a1c-01bada923062_3813x1994.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i2TN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fcd8cfc-74d1-4f9d-8a1c-01bada923062_3813x1994.png 424w, https://substackcdn.com/image/fetch/$s_!i2TN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fcd8cfc-74d1-4f9d-8a1c-01bada923062_3813x1994.png 848w, https://substackcdn.com/image/fetch/$s_!i2TN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fcd8cfc-74d1-4f9d-8a1c-01bada923062_3813x1994.png 1272w, https://substackcdn.com/image/fetch/$s_!i2TN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fcd8cfc-74d1-4f9d-8a1c-01bada923062_3813x1994.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i2TN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fcd8cfc-74d1-4f9d-8a1c-01bada923062_3813x1994.png" width="1456" height="761" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0fcd8cfc-74d1-4f9d-8a1c-01bada923062_3813x1994.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:761,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:328348,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!i2TN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fcd8cfc-74d1-4f9d-8a1c-01bada923062_3813x1994.png 424w, https://substackcdn.com/image/fetch/$s_!i2TN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fcd8cfc-74d1-4f9d-8a1c-01bada923062_3813x1994.png 848w, https://substackcdn.com/image/fetch/$s_!i2TN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fcd8cfc-74d1-4f9d-8a1c-01bada923062_3813x1994.png 1272w, https://substackcdn.com/image/fetch/$s_!i2TN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fcd8cfc-74d1-4f9d-8a1c-01bada923062_3813x1994.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Conclusion</h2><p>After 6.3.0 openlens can no longer really be considered a good option for visibility into your Kubernetes clusters. For companys that don&#8217;t mind paying for the commercial version of lens, it&#8217;s still a good opiton. That being said, k9s offers all the features of you need to operate your clusters effectively and will most likely stay free forever. When you work with it regularly and get used to the shortcuts, there is a good chance you will find yourself being faster then you could ever be with lens.</p><p></p><div><hr></div><p>This newsletter is free but if you want to you can <a href="https://ko-fi.com/mariuskimmina">buy me a coffee</a> / <a href="https://www.buymeacoffee.com/mariuskimmina">buy me a coffee</a>.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.infrastructureposts.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Infrastructure as Posts! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>