<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Kubernetes on alpaca-lab.blog</title><link>https://alpaca-lab.blog/en/tags/kubernetes/</link><description>Recent content in Kubernetes on alpaca-lab.blog</description><generator>Hugo -- 0.156.0</generator><language>en</language><lastBuildDate>Thu, 21 Dec 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://alpaca-lab.blog/en/tags/kubernetes/index.xml" rel="self" type="application/rss+xml"/><item><title>The Startup Sequence When a Pod Has Multiple Containers</title><link>https://alpaca-lab.blog/en/posts/kubernetes-startup-sequence-of-pods/</link><pubDate>Thu, 21 Dec 2023 00:00:00 +0000</pubDate><guid>https://alpaca-lab.blog/en/posts/kubernetes-startup-sequence-of-pods/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;I wrote a Kubernetes book called &amp;ldquo;Kubernetesマイクロサービス開発の実践&amp;rdquo; (Practical Kubernetes Microservices Development), and it&amp;rsquo;s now out! Please go buy it!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;ldquo;&lt;a href="https://www.amazon.co.jp/dp/4295018147/"&gt;Kubernetesマイクロサービス開発の実践&lt;/a&gt;&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Chapter 7 of the book covers the process from when a Pod object is created on the API Server to when the Pod actually starts running — but for various reasons, there&amp;rsquo;s one particularly nitty-gritty piece of behavior we couldn&amp;rsquo;t fit in the book: what happens when a Pod has multiple containers, and one or more of them uses a postStart lifecycle hook. This post writes up how such a Pod behaves when it starts.&lt;/p&gt;</description></item><item><title>Digging into the kubelet API</title><link>https://alpaca-lab.blog/en/posts/getting-started-with-kubelet-api/</link><pubDate>Mon, 19 Dec 2022 00:00:00 +0000</pubDate><guid>https://alpaca-lab.blog/en/posts/getting-started-with-kubelet-api/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;I found myself wanting to build something using the kubelet API, so I did some research to figure out how, and I&amp;rsquo;d like to share what I learned.&lt;/p&gt;
&lt;p&gt;Up until now I&amp;rsquo;d never really had a reason to touch it directly — I knew it was used for collecting container metrics, and every so often I&amp;rsquo;d think &amp;ldquo;ah, the kubelet API is out there working hard today too,&amp;rdquo; and that was about the extent of my relationship with it. I suspect a lot of Kubernetes engineers feel roughly the same way.&lt;/p&gt;</description></item><item><title>Triggering Reconcile from Arbitrary Events with a Custom Controller</title><link>https://alpaca-lab.blog/en/posts/custom-controller-for-out-of-cluster-events/</link><pubDate>Thu, 02 Dec 2021 00:00:00 +0000</pubDate><guid>https://alpaca-lab.blog/en/posts/custom-controller-for-out-of-cluster-events/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;I looked into how to write a custom controller that triggers Reconcile based on events happening outside the Kubernetes cluster, and this post writes up what I found.
Once you can do this, you can build controllers that use Kubernetes custom resources to manage systems that live outside the cluster. Neat!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;📘【note】
This post is day 3 of &lt;a href="https://qiita.com/advent-calendar/2021/kubernetes"&gt;Kubernetes Advent Calendar 2021&lt;/a&gt;.
Yesterday&amp;rsquo;s post was @makocchi&amp;rsquo;s &lt;a href="https://makocchi.medium.com/how-to-use-advanced-statefulset-ja-779ca00e2dda"&gt;Advanced StatefulSet を使ってみよう (Let&amp;rsquo;s try Advanced StatefulSet)&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Safe Pod Termination — Even an Alpaca Can Understand It (Experiment Edition)</title><link>https://alpaca-lab.blog/en/posts/kubernetes-graceful-shutdown-experiment/</link><pubDate>Thu, 17 Dec 2020 00:00:00 +0000</pubDate><guid>https://alpaca-lab.blog/en/posts/kubernetes-graceful-shutdown-experiment/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;This post is a follow-up to &lt;a href="https://zenn.dev/hhiroshell/articles/kubernetes-graceful-shutdown"&gt;Safe Pod Termination — Even an Alpaca Can Understand It&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Last time, we walked through what happens when a Pod terminates, based on how the various Kubernetes components work. A Deployment rolling update involves restarting Pods, and we found that the following two countermeasures are effective for handling requests without loss during that process:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sleeping in the preStop hook&lt;/li&gt;
&lt;li&gt;Implementing graceful shutdown in the application&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this post, we&amp;rsquo;ll actually perform a Deployment rolling update while live traffic is flowing, and check whether those countermeasures really work.&lt;/p&gt;</description></item><item><title>Safe Pod Termination — Even an Alpaca Can Understand It</title><link>https://alpaca-lab.blog/en/posts/kubernetes-graceful-shutdown/</link><pubDate>Fri, 18 Sep 2020 00:00:00 +0000</pubDate><guid>https://alpaca-lab.blog/en/posts/kubernetes-graceful-shutdown/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;This post organizes what actually happens from the moment a Pod starts terminating in Kubernetes until it&amp;rsquo;s gone. Building on that, it looks at how to terminate Pods safely — that is, with minimal loss of in-flight requests.&lt;/p&gt;
&lt;p&gt;The application model assumed here is a typical web application that receives HTTP requests and returns responses.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;📘【note】
This post is based on &lt;a href="https://qiita.com/superbrothers/items/3ac78daba3560ea406b2"&gt;@superbrothers&amp;rsquo;s &amp;ldquo;詳解 Pods の終了&amp;rdquo; (A Detailed Look at Pod Termination)&lt;/a&gt; and the &lt;a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination"&gt;official documentation&lt;/a&gt; — please check those out too. This post re-verifies the content against the latest Kubernetes as of 2020/09/23, and adds diagrams and extra explanation.&lt;/p&gt;</description></item></channel></rss>