<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: krzwiatrzyk</title>
    <description>The latest articles on Forem by krzwiatrzyk (@krzwiatrzyk).</description>
    <link>https://forem.com/krzwiatrzyk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F638757%2Ff08783d7-8710-41d3-98b7-f39d7bdf5e46.png</url>
      <title>Forem: krzwiatrzyk</title>
      <link>https://forem.com/krzwiatrzyk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/krzwiatrzyk"/>
    <language>en</language>
    <item>
      <title>Kargo - promote your application changes in a controlled (GitOps) way!</title>
      <dc:creator>krzwiatrzyk</dc:creator>
      <pubDate>Sat, 28 Sep 2024 07:14:31 +0000</pubDate>
      <link>https://forem.com/krzwiatrzyk/kargo-promote-your-application-changes-in-a-controlled-gitops-way-31ib</link>
      <guid>https://forem.com/krzwiatrzyk/kargo-promote-your-application-changes-in-a-controlled-gitops-way-31ib</guid>
      <description>&lt;p&gt;Simply told, Kargo will bump up your image tag reference in the git whenever new version is released.&lt;/p&gt;

&lt;p&gt;Not simply told, Kargo is a release management tool with environment as a pipeline delivery solution (few hard to understand phrases and voule'a!)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5j2ju3kpdbenuto9ev7g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5j2ju3kpdbenuto9ev7g.png" alt="Image description" width="800" height="709"&gt;&lt;/a&gt;&lt;br&gt;
Source: &lt;a href="https://akuity.io/blog/why-continuous-promotion/" rel="noopener noreferrer"&gt;https://akuity.io/blog/why-continuous-promotion/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To continue reading, visit: &lt;a href="https://blog.windkube.com/kargo-application/" rel="noopener noreferrer"&gt;https://blog.windkube.com/kargo-application/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>gitops</category>
      <category>devops</category>
      <category>cicd</category>
    </item>
    <item>
      <title>Patch your servers! It's time of regreSSHion</title>
      <dc:creator>krzwiatrzyk</dc:creator>
      <pubDate>Wed, 03 Jul 2024 06:39:52 +0000</pubDate>
      <link>https://forem.com/krzwiatrzyk/patch-your-servers-its-time-of-regresshion-1f5</link>
      <guid>https://forem.com/krzwiatrzyk/patch-your-servers-its-time-of-regresshion-1f5</guid>
      <description>&lt;p&gt;OpenSSH CVE-2024-6387 vulnerability allows to perform an unauthenticated RCE that grants root access to the host machine.&lt;/p&gt;

&lt;p&gt;Read more: &lt;a href="https://blog.windkube.com/patch-your-servers-its-time-of-regresshion/"&gt;https://blog.windkube.com/patch-your-servers-its-time-of-regresshion/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>vulnerability</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Template Kubernetes manifests with dynamic data using Gomplate functions</title>
      <dc:creator>krzwiatrzyk</dc:creator>
      <pubDate>Tue, 28 May 2024 06:39:44 +0000</pubDate>
      <link>https://forem.com/krzwiatrzyk/template-kubernetes-manifests-with-dynamic-data-using-gomplate-functions-4egn</link>
      <guid>https://forem.com/krzwiatrzyk/template-kubernetes-manifests-with-dynamic-data-using-gomplate-functions-4egn</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TargetGroupBinding AWS Load Balancer Controler custom resource requires TargetGroup ARN to be specified&lt;/li&gt;
&lt;li&gt;TargetGroup ARN includes a random ID at the end of ARN to uniquely identify a target group — like:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;arn:aws:elasticloadbalancing:eu-west-1:&amp;lt;account-id&amp;gt;:targetgroup/&amp;lt;target-group-name&amp;gt;/ba7a3694de41e946
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;To deploy multiple TargetGroupBindings user is forced to copy &amp;amp; paste TargetGroupARNs from AWS&lt;/li&gt;
&lt;li&gt;Gomplate functions can use TargetGroupName to TargetGroupARN mapping from AWS and template Kubernetes resources in git&lt;/li&gt;
&lt;li&gt;GitHub Actions can be used to automatically prepare a PR if new manifests are supplied or TargetGroup will be recreated on AWS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;To learn how to implement that, read the full story:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.windkube.com/template-kubernetes-manifests-with-dynamic-data-using-gomplate-functions/"&gt;https://blog.windkube.com/template-kubernetes-manifests-with-dynamic-data-using-gomplate-functions/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>gitops</category>
      <category>aws</category>
    </item>
    <item>
      <title>Kubernetes Headless Service</title>
      <dc:creator>krzwiatrzyk</dc:creator>
      <pubDate>Sat, 02 Oct 2021 08:27:37 +0000</pubDate>
      <link>https://forem.com/krzwiatrzyk/kubernetes-headless-service-3odi</link>
      <guid>https://forem.com/krzwiatrzyk/kubernetes-headless-service-3odi</guid>
      <description>

&lt;h2&gt;
  
  
  What is a headless service?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IjXaAvn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/Screenshot_8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IjXaAvn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/Screenshot_8.png" alt="Kubernetes Headless Service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;headless service&lt;/strong&gt; is a Kubernetes Service without &lt;em&gt;ClusterIP.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the difference between headless service and normal service?
&lt;/h2&gt;

&lt;p&gt;First, let's see the differences between &lt;strong&gt;headless&lt;/strong&gt; and &lt;strong&gt;headful&lt;/strong&gt; service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m7CnwMs7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/image-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m7CnwMs7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/image-2.png" alt="Kubernetes Headless Service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;NOTE: Originally, there isn't something like "headful" service in Kubernetes nomenclature. It is used in this article to differentiate services.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After creating both services, it is visible that &lt;strong&gt;ClusterIP&lt;/strong&gt; was not set for &lt;strong&gt;headless&lt;/strong&gt; service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sb1_DcE2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/obraz_2021-10-02_103514.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sb1_DcE2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/obraz_2021-10-02_103514.png" alt="Kubernetes Headless Service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have 3 containers (called &lt;em&gt;test-*&lt;/em&gt;) that will be included in &lt;strong&gt;headless&lt;/strong&gt; and &lt;strong&gt;headful&lt;/strong&gt; services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I8CtY7EI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/image-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I8CtY7EI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/image-1.png" alt="Kubernetes Headless Service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, let's check (with usage of &lt;strong&gt;dnsutils&lt;/strong&gt; pod) what addresses will be returned from DNS for particular services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wHGRpW4e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/image-8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wHGRpW4e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/image-8.png" alt="Kubernetes Headless Service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Can you see the difference? If &lt;strong&gt;ClusterIP&lt;/strong&gt; is set, then only one IP address is returned in answer, thus load balancing is done by the cluster itself. However, if &lt;strong&gt;ClusterIP&lt;/strong&gt; is empty, addresses of all available endpoints are returned, allowing the application to know and decide which target instance to connect to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Another approach with StatefulSets
&lt;/h2&gt;

&lt;p&gt;With &lt;strong&gt;StatefulSets&lt;/strong&gt; you can achieve the same behavior as with &lt;strong&gt;headless&lt;/strong&gt; service by specifying &lt;em&gt;spec.serviceName&lt;/em&gt; field (headful or headless, doesn't matter).&lt;/p&gt;

&lt;p&gt;I have created a &lt;strong&gt;StatefulSet&lt;/strong&gt; with 3 pods (&lt;em&gt;test-*&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eXAzgDFL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/image-9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eXAzgDFL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/image-9.png" alt="Kubernetes Headless Service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And pointed a &lt;strong&gt;headful&lt;/strong&gt; service in the spec.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ktMHE0Nf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/image-10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ktMHE0Nf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/image-10.png" alt="Kubernetes Headless Service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, it is possible to resolve specific pods in this service (this is not normally possible).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O7n3fcMA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/image-14.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O7n3fcMA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/image-14.png" alt="Kubernetes Headless Service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's great, you can create an application that can connect to particular instances by name of the pod.&lt;/p&gt;

&lt;p&gt;Drawback? Somehow, your client must know how many instances of the target application are there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Headless service with StatefulSet
&lt;/h2&gt;

&lt;p&gt;If &lt;strong&gt;StatefulSet&lt;/strong&gt; has specified &lt;em&gt;spec.serviceName&lt;/em&gt; field and targeted a &lt;strong&gt;headless&lt;/strong&gt; service, then DNS discovery can be used for getting the number of instances available (i.e. 3) and then using the above solution to connect (i.e.: &lt;em&gt;test-0.headful, test-1.headful, test-3.headful&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;Where this is useful? One of the best examples is Kafka, where sometimes a particular topic's partition leader is on a different broker than the application connected to. Check the diagram below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8KMXWcC5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/Kafka-Topic-Partition.drawio--2-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8KMXWcC5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://krzwiatrzyk.eu/content/images/2021/10/Kafka-Topic-Partition.drawio--2-.png" alt="Kubernetes Headless Service"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetesadvanced</category>
    </item>
  </channel>
</rss>
