<?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>DEV Community: Florian Cartron</title>
    <description>The latest articles on DEV Community by Florian Cartron (@florian_cartron_99c9a9c4a).</description>
    <link>https://dev.to/florian_cartron_99c9a9c4a</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%2F2351325%2F9db8ba8b-859b-437c-879e-fb2c06e46c58.jpg</url>
      <title>DEV Community: Florian Cartron</title>
      <link>https://dev.to/florian_cartron_99c9a9c4a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/florian_cartron_99c9a9c4a"/>
    <language>en</language>
    <item>
      <title>How to simulate a Worker Node failure in your Kubernetes Cluster without direct access</title>
      <dc:creator>Florian Cartron</dc:creator>
      <pubDate>Fri, 02 May 2025 09:19:45 +0000</pubDate>
      <link>https://dev.to/florian_cartron_99c9a9c4a/how-to-simulate-a-worker-node-failure-in-your-kubernetes-cluster-without-direct-acces-54f6</link>
      <guid>https://dev.to/florian_cartron_99c9a9c4a/how-to-simulate-a-worker-node-failure-in-your-kubernetes-cluster-without-direct-acces-54f6</guid>
      <description>&lt;p&gt;I pondered: How can I simulate a node outage due to misconfiguration using only kubectl? This approach can be valuable for preparing training sessions or technical interviews.&lt;/p&gt;

&lt;p&gt;Suppose I aim to alter the kubelet service configuration to prevent it from starting.&lt;/p&gt;

&lt;p&gt;First, I need a method to access the node and modify the kubelet service configuration. I can utilize the &lt;a href="https://kubernetes.io/docs/reference/kubectl/generated/kubectl_debug/" rel="noopener noreferrer"&gt;kubectl debug&lt;/a&gt; command to create an ephemeral container that shares its Linux namespaces with the node. While this feature is commonly used for debugging distroless containers, it can also be employed for node debugging.&lt;/p&gt;

&lt;p&gt;I also would like to be able to use commands like &lt;code&gt;systemctl&lt;/code&gt; as if i were directly on the node.&lt;br&gt;
Let's try with the &lt;a href="https://github.com/kubernetes/enhancements/blob/master/keps/sig-cli/1441-kubectl-debug/README.md#profile-general" rel="noopener noreferrer"&gt;general profile&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl debug node/node01 &lt;span class="nt"&gt;--profile&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;general &lt;span class="nt"&gt;--image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;busybox &lt;span class="nt"&gt;-it&lt;/span&gt;
&lt;span class="c"&gt;# Creating debugging pod node-debugger-node01-2zpm8 with container debugger on node node01.&lt;/span&gt;
&lt;span class="c"&gt;# If you don't see a command prompt, try pressing enter.&lt;/span&gt;

/ &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;span class="c"&gt;# Filesystem                Size      Used Available Use% Mounted on&lt;/span&gt;
&lt;span class="c"&gt;# overlay                  18.3G      5.9G     12.4G  32% /&lt;/span&gt;
&lt;span class="c"&gt;# tmpfs                    64.0M         0     64.0M   0% /dev&lt;/span&gt;
&lt;span class="c"&gt;# /dev/vda1                18.3G      5.9G     12.4G  32% /host&lt;/span&gt;
&lt;span class="c"&gt;# ...&lt;/span&gt;

/ &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /host/etc/os-release | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-n1&lt;/span&gt;
&lt;span class="c"&gt;# PRETTY_NAME="Ubuntu 24.04.1 LTS"&lt;/span&gt;

/ &lt;span class="nv"&gt;$ &lt;/span&gt;ps aux | &lt;span class="nb"&gt;grep &lt;/span&gt;kubelet
&lt;span class="c"&gt;# 736 root      0:42 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/# bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/# lib/kubelet/config.yaml --container-runtime-endpoint=unix:///var/run/containerd/# containerd.sock --pod-infra-container-image=registry.k8s.io/pause:3.10 # --container-runtime-endpoint unix:///run/containerd/containerd.sock # --cgroup-driver=systemd --eviction-hard imagefs.available&amp;lt;5%,memory.# available&amp;lt;100Mi,nodefs.available&amp;lt;5% --fail-swap-on=false&lt;/span&gt;
&lt;span class="c"&gt;# 18233 root      0:00 grep kubelet&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yeah ! I can access the host filesystem and view its processes, but I still can't use &lt;code&gt;systemctl&lt;/code&gt; commands. Let's chroot into the host filesystem and intentionally disrupt the kubelet service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/ &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;chroot&lt;/span&gt; /host
node01:/ &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s1"&gt;'s/config\.yaml/conf1g.yaml/g'&lt;/span&gt; /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf
node01:/&lt;span class="nv"&gt;$ &lt;/span&gt;systemctl daemon-reload
node01:/&lt;span class="nv"&gt;$ &lt;/span&gt;systemctl restart kubelet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I was immediately ejected from the node, and after a few seconds—the duration of the controller manager's grace period—the node was marked as NotReady.&lt;/p&gt;

&lt;p&gt;Let's encapsulate this process into a concise one-liner to simulate a failure on a random node in the cluster:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;kubectl debug &lt;span class="si"&gt;$(&lt;/span&gt;kubectl get nodes &lt;span class="nt"&gt;-l&lt;/span&gt; &lt;span class="s1"&gt;'!node-role.kubernetes.io/control-plane'&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; name | &lt;span class="nb"&gt;shuf&lt;/span&gt; &lt;span class="nt"&gt;-n1&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--profile&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;general &lt;span class="nt"&gt;--image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;busybox &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nb"&gt;chroot&lt;/span&gt; /host sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"sed -i 's/config&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;.yaml/conf1g.yaml/g' /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf &amp;amp;&amp;amp; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
  systemctl daemon-reload &amp;amp;&amp;amp; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
  systemctl restart kubelet"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key takeaway from this test is the critical importance of exercising caution when assigning the &lt;code&gt;pods/ephemeralcontainers&lt;/code&gt; permission to users. Granting this permission allows users to inject ephemeral containers into existing pods/nodes, which can bypass standard admission controls and security policies such as Pod Security Admission, OPA Gatekeeper, or Kyverno. This capability poses a significant security risk, as it enables the creation of privileged containers without undergoing the usual validation processes, potentially compromising the cluster's security posture.&lt;/p&gt;

</description>
      <category>kubernetes</category>
    </item>
    <item>
      <title>kuberc: an exciting new feature for kubectl</title>
      <dc:creator>Florian Cartron</dc:creator>
      <pubDate>Tue, 08 Apr 2025 14:28:51 +0000</pubDate>
      <link>https://dev.to/florian_cartron_99c9a9c4a/kuberc-an-exciting-new-feature-for-kubectl-56oj</link>
      <guid>https://dev.to/florian_cartron_99c9a9c4a/kuberc-an-exciting-new-feature-for-kubectl-56oj</guid>
      <description>&lt;p&gt;Kubernetes 1.33, scheduled for late April, introduces &lt;strong&gt;kuberc&lt;/strong&gt;, a new feature that allows you to customize &lt;strong&gt;kubectl&lt;/strong&gt;. This feature, described in &lt;a href="https://github.com/kubernetes/enhancements/tree/master/keps/sig-cli/3104-introduce-kuberc" rel="noopener noreferrer"&gt;KEP-3104&lt;/a&gt;, enables you to create aliases and enforce options for kubectl subcommands.&lt;/p&gt;

&lt;p&gt;This customization is possible through a &lt;code&gt;.kube/kuberc&lt;/code&gt; file in your home directory (the path can be modified with the &lt;code&gt;--kuberc&lt;/code&gt; flag).&lt;/p&gt;

&lt;p&gt;The example below demonstrates how to create an alias for creating a namespace with a predefined name, and how to force the interactive behavior of the &lt;code&gt;kubectl delete&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kubectl.config.k8s.io/v1alpha1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Preference&lt;/span&gt;
&lt;span class="c1"&gt;# alias "kubectl crns" for "kubectl create namespace test-kuberc-ns"&lt;/span&gt;
&lt;span class="na"&gt;aliases&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;crns&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;create namespace&lt;/span&gt;
    &lt;span class="na"&gt;appendArgs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;test-kuberc-ns&lt;/span&gt;
&lt;span class="c1"&gt;# Force the --interactive=true flag for kubectl delete&lt;/span&gt;
&lt;span class="na"&gt;overrides&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;delete&lt;/span&gt;
    &lt;span class="na"&gt;flags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;interactive&lt;/span&gt;
        &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;true"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh846hch913o9ccyoo2rc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh846hch913o9ccyoo2rc.png" alt="kuberc in action" width="800" height="210"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s take the example of the &lt;code&gt;kubectl delete&lt;/code&gt; command. Kubernetes maintainers cannot enable confirmation before deletion by default, as it would disrupt many CI/CD processes. However, with kuberc’s customization options, you can enable this feature when needed, without affecting other users.&lt;/p&gt;

&lt;p&gt;This feature will be available in alpha with Kubernetes 1.33 and can be activated using the environment variable &lt;code&gt;KUBECTL_KUBERC=true&lt;/code&gt;. Note that, for now, kubectl’s auto-completion does not work with aliases defined by kuberc.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>cli</category>
    </item>
    <item>
      <title>Cloud Run Revision Tags: Secure Routing and Automation</title>
      <dc:creator>Florian Cartron</dc:creator>
      <pubDate>Tue, 11 Mar 2025 11:06:15 +0000</pubDate>
      <link>https://dev.to/florian_cartron_99c9a9c4a/cloud-run-revision-tags-secure-routing-and-automation-2h78</link>
      <guid>https://dev.to/florian_cartron_99c9a9c4a/cloud-run-revision-tags-secure-routing-and-automation-2h78</guid>
      <description>&lt;p&gt;Cloud Run is a fully managed service by Google Cloud that allows you to run containerized applications in a scalable environment without the need to manage the underlying infrastructure. It combines the simplicity of serverless with the flexibility of containers, enabling rapid deployments, precise pay-as-you-go billing, and automatic scaling based on demand. Ideal for web applications, APIs, or background processing tasks, Cloud Run streamlines development and deployment while ensuring a seamless user experience.&lt;/p&gt;

&lt;p&gt;Cloud Run enables you to run multiple revisions of your application in parallel and intelligently split traffic between them. Revision tags allow you to access specific versions in preview mode for testing or demonstration purposes.&lt;/p&gt;

&lt;p&gt;However, it's important to note that anyone who knows or can predict the URL of a Cloud Run service can access it, as these URLs are publicly accessible by default. This is especially critical for revision tag URLs, which are often used for previewing specific versions and are not meant to be publicly accessible. To address this, it is common practice to place the Cloud Run service behind a load balancer. This setup not only centralizes traffic management but also enables the use of Identity-Aware Proxy (IAP) to secure access. With IAP, you can enforce authentication and authorization, ensuring that only authorized users or systems can access the revision tag URLs, adding an essential layer of security to your deployment.&lt;/p&gt;

&lt;p&gt;Placing a Cloud Run service behind a load balancer, while providing enhanced security, can introduce additional complexity—particularly when dealing with revision tags. Configuring the URL map to correctly route traffic to specific revision tags requires careful setup and maintenance. Each tag URL needs to be explicitly mapped, which can become cumbersome as the number of revisions and tags grows or changes. This complexity can also impact the flexibility and speed of deployment, making it important to weigh the trade-offs between security and operational simplicity when adopting this approach.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are URL masks?
&lt;/h2&gt;

&lt;p&gt;Serverless Network Endpoint Groups (NEGs) in Cloud Run provide &lt;a href="https://cloud.google.com/load-balancing/docs/negs/serverless-neg-concepts#url_masks" rel="noopener noreferrer"&gt;URL masks&lt;/a&gt;, which enable you to configure custom routing for incoming requests. URL masks enable you to define specific paths that &lt;a href="https://cloud.google.com/load-balancing/docs/https/setting-up-https-serverless#cloud-run" rel="noopener noreferrer"&gt;route traffic to distinct Cloud Run revisions or services&lt;/a&gt;, providing flexibility in managing traffic distribution. This feature is especially useful when using load balancers, as it helps manage traffic across different versions of an application without having to update the url map.&lt;br&gt;
URL masks let you use placeholders to dynamically route requests to the right service/revision tag, with this kind of syntax:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftrdmuk5qmd23a1zti2sn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftrdmuk5qmd23a1zti2sn.png" alt="URL masks syntax" width="800" height="214"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Let’s demonstrate the power of URL Masks
&lt;/h2&gt;

&lt;p&gt;Scenario: we have two services, named Hello and Hola, and both of them have two tagged revisions, but traffic is sent to only one, as the other tag is a preview version only accessible with access restrained by IAP(IAP configuration will not be a part of this demonstration):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foxlx86sfo6dndq74lscv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foxlx86sfo6dndq74lscv.png" alt="Demonstration diagram" width="800" height="608"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will deploy this infrastructure with &lt;code&gt;gcloud&lt;/code&gt; cli, but you can use terraform as well.&lt;/p&gt;
&lt;h3&gt;
  
  
  Deploying Cloud Run Services with Tagged Revisions
&lt;/h3&gt;

&lt;p&gt;Let's start with the &lt;code&gt;hello&lt;/code&gt; service with 2 revisions respectively named/tagged &lt;code&gt;green&lt;/code&gt; and &lt;code&gt;blue&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;PROJECT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"your-project-id"&lt;/span&gt;
&lt;span class="nv"&gt;REGION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"any-googlecloud-region"&lt;/span&gt;

gcloud config &lt;span class="nb"&gt;set &lt;/span&gt;project &lt;span class="nv"&gt;$PROJECT&lt;/span&gt;

&lt;span class="c"&gt;# Deploy the "hello" Cloud Run service&lt;/span&gt;
gcloud run deploy hello &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="nv"&gt;$REGION&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--image&lt;/span&gt; us-docker.pkg.dev/cloudrun/container/hello &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--revision-suffix&lt;/span&gt; green &lt;span class="nt"&gt;--tag&lt;/span&gt; green &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--set-env-vars&lt;/span&gt; &lt;span class="nv"&gt;COLOR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;green &lt;span class="nt"&gt;--allow-unauthenticated&lt;/span&gt;

&lt;span class="c"&gt;# Create "blue" revision without traffic&lt;/span&gt;
gcloud run deploy hello &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="nv"&gt;$REGION&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--image&lt;/span&gt; us-docker.pkg.dev/cloudrun/container/hello &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--revision-suffix&lt;/span&gt; blue &lt;span class="nt"&gt;--tag&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--no-traffic&lt;/span&gt; &lt;span class="nt"&gt;--set-env-vars&lt;/span&gt; &lt;span class="nv"&gt;COLOR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;blue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This service should be accessible directly from the public url(&lt;code&gt;green&lt;/code&gt; will be served) and both revisions can be accessed through their revision tag url:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F03wcywr0fiqn3t0eh8uu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F03wcywr0fiqn3t0eh8uu.png" alt="Revision Tags" width="800" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We want our services to be deployed behind a load balancer, and not directly accessed from the internet, so we will disable external access:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Disable external access&lt;/span&gt;
gcloud run services update hello &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="nv"&gt;$REGION&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--ingress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;internal-and-cloud-load-balancing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now, the &lt;code&gt;hola&lt;/code&gt; service and its 2 revisions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Deploy the "hola" Cloud Run service&lt;/span&gt;
gcloud run deploy hola &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="nv"&gt;$REGION&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--image&lt;/span&gt; us-docker.pkg.dev/cloudrun/container/hello &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--revision-suffix&lt;/span&gt; red &lt;span class="nt"&gt;--tag&lt;/span&gt; red &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--set-env-vars&lt;/span&gt; &lt;span class="nv"&gt;COLOR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;red &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--allow-unauthenticated&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--ingress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;internal-and-cloud-load-balancing

&lt;span class="c"&gt;# Create "yellow" revision without traffic&lt;/span&gt;
gcloud run deploy hola &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="nv"&gt;$REGION&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--image&lt;/span&gt; us-docker.pkg.dev/cloudrun/container/hello &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--revision-suffix&lt;/span&gt; yellow &lt;span class="nt"&gt;--tag&lt;/span&gt; yellow &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--no-traffic&lt;/span&gt; &lt;span class="nt"&gt;--set-env-vars&lt;/span&gt; &lt;span class="nv"&gt;COLOR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;yellow
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Managing our domain name
&lt;/h3&gt;

&lt;p&gt;By combining URL masks with a DNS wildcard, you can fully automate your URL mapping process. This setup allows you to dynamically route traffic to various revision tags without manual intervention, streamlining deployment and minimizing errors. With this combination, you can efficiently manage large-scale applications with multiple revisions, ensuring both security and scalability while reducing operational complexity.&lt;/p&gt;

&lt;p&gt;We reserve an IP address so we can know it and use &lt;a href="https://sslip.io/" rel="noopener noreferrer"&gt;sslip.io&lt;/a&gt; to get a domain with a wildcard DNS based on our IP, and then create the self-signed SSL certificate that our load balancer will use later:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Reserve a regional IP for the load balancer&lt;/span&gt;
gcloud compute addresses create hello-ip &lt;span class="nt"&gt;--global&lt;/span&gt;
&lt;span class="nv"&gt;IP_ADDRESS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;gcloud compute addresses describe hello-ip &lt;span class="nt"&gt;--global&lt;/span&gt; &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"get(address)"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;DOMAIN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IP_ADDRESS&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.sslip.io"&lt;/span&gt;

&lt;span class="c"&gt;# Generate self-signed SSL certificate&lt;/span&gt;
openssl genrsa &lt;span class="nt"&gt;-out&lt;/span&gt; wildcard.key 2048
openssl req &lt;span class="nt"&gt;-new&lt;/span&gt; &lt;span class="nt"&gt;-key&lt;/span&gt; wildcard.key &lt;span class="nt"&gt;-out&lt;/span&gt; wildcard.csr &lt;span class="nt"&gt;-subj&lt;/span&gt; &lt;span class="s2"&gt;"/CN=*.&lt;/span&gt;&lt;span class="nv"&gt;$DOMAIN&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
openssl x509 &lt;span class="nt"&gt;-req&lt;/span&gt; &lt;span class="nt"&gt;-days&lt;/span&gt; 365 &lt;span class="nt"&gt;-in&lt;/span&gt; wildcard.csr &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-signkey&lt;/span&gt; wildcard.key &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-out&lt;/span&gt; wildcard.crt &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;-extfile&lt;/span&gt; &amp;lt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s2"&gt;"subjectAltName=DNS:*.&lt;/span&gt;&lt;span class="nv"&gt;$DOMAIN&lt;/span&gt;&lt;span class="s2"&gt;,DNS:&lt;/span&gt;&lt;span class="nv"&gt;$DOMAIN&lt;/span&gt;&lt;span class="s2"&gt;,DNS:*.preview.&lt;/span&gt;&lt;span class="nv"&gt;$DOMAIN&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# Create SSL certificate in Google Cloud&lt;/span&gt;
gcloud compute ssl-certificates create hello-certificate &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--certificate&lt;/span&gt; wildcard.crt &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--private-key&lt;/span&gt; wildcard.key &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--global&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Configuring Serverless NEGs for URL Masks
&lt;/h3&gt;

&lt;p&gt;Now that we know our base domain name, we can create our serveless network endpoint groups with the url masks, as defined in the diagram, as well as the backend services that will be used by the load balancer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create a serverless NEG for tagged revisions&lt;/span&gt;
gcloud compute network-endpoint-groups create preview-neg &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--region&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$REGION&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--network-endpoint-type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;SERVERLESS &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--cloud-run-url-mask&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;tag&amp;gt;-&amp;lt;service&amp;gt;.preview.&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;DOMAIN&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="c"&gt;# Create backend service and attach NEG&lt;/span&gt;
gcloud compute backend-services create preview-backend &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--global&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--load-balancing-scheme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;EXTERNAL_MANAGED
gcloud compute backend-services add-backend preview-backend &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--global&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--network-endpoint-group&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;preview-neg &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--network-endpoint-group-region&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$REGION&lt;/span&gt;

&lt;span class="c"&gt;# Create a serverless neg for services&lt;/span&gt;
gcloud compute network-endpoint-groups create service-neg &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--region&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$REGION&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--network-endpoint-type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;SERVERLESS &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--cloud-run-url-mask&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;service&amp;gt;.&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;DOMAIN&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
gcloud compute backend-services create service-backend &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--global&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--load-balancing-scheme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;EXTERNAL_MANAGED
gcloud compute backend-services add-backend service-backend &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--global&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--network-endpoint-group&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;service-neg &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--network-endpoint-group-region&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$REGION&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Setting Up Load Balancing for Secure Routing
&lt;/h3&gt;

&lt;p&gt;Finally, we create a load balancer to expose securely our dynamic URLs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create the url map with the "service" access as default&lt;/span&gt;
gcloud compute url-maps create hello-urlmap &lt;span class="nt"&gt;--default-service&lt;/span&gt; service-backend &lt;span class="nt"&gt;--global&lt;/span&gt;
&lt;span class="c"&gt;# Add a path matcher for preview urls&lt;/span&gt;
gcloud compute url-maps add-path-matcher hello-urlmap &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--path-matcher-name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;preview-matcher &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--default-service&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;preview-backend &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--new-hosts&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"*.preview.&lt;/span&gt;&lt;span class="nv"&gt;$DOMAIN&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="c"&gt;# Create the target proxy&lt;/span&gt;
gcloud compute target-https-proxies create hello-target-proxy &lt;span class="nt"&gt;--url-map&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;hello-urlmap &lt;span class="nt"&gt;--ssl-certificates&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;hello-certificate &lt;span class="nt"&gt;--global&lt;/span&gt;

&lt;span class="c"&gt;# Create the forwarding rule&lt;/span&gt;
gcloud compute forwarding-rules create hello-forwarding-rule &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--address&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$IP_ADDRESS&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--global-address&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--ip-protocol&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;TCP &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--load-balancing-scheme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;EXTERNAL_MANAGED &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--ports&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;443 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--target-https-proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;hello-target-proxy &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--global-target-https-proxy&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--global&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After a few minutes, the services will be accessible through these URLs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;https://hello.&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IP_ADDRESS&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;.sslip.io/ &lt;span class="c"&gt;# green&lt;/span&gt;
https://green-hello.preview.&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IP_ADDRESS&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;.sslip.io/
https://blue-hello.preview.&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IP_ADDRESS&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;.sslip.io/

https://hola.&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IP_ADDRESS&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;.sslip.io/ &lt;span class="c"&gt;# red&lt;/span&gt;
https://red-hola.preview.&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IP_ADDRESS&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;.sslip.io/
https://yellow-hola.preview.&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IP_ADDRESS&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;.sslip.io/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Demo scripts are available:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/floriancartron/c793c7bfe33078d115169fdd60fe59be" rel="noopener noreferrer"&gt;deploy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/floriancartron/2f7240aa97e81678eaf590d0d3032135" rel="noopener noreferrer"&gt;cleanup&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Going Further: Securing and Optimizing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Protecting the Backend Service with IAP
&lt;/h3&gt;

&lt;p&gt;To enhance the security of your Cloud Run deployment, you can use Identity-Aware Proxy (IAP) to protect your backend services. IAP acts as a gatekeeper, ensuring that only authenticated and authorized users or systems can access your Cloud Run services. By enabling IAP, you can restrict access to specific revision tags or service versions, providing an additional layer of security for your application. This is particularly useful when you want to prevent unauthorized access to your preview environments.&lt;br&gt;
It's important to note that the same IAP configuration applies to all services accessed via your URL map/URL mask combination. Since IAP is enforced at the backend service level, any service or revision mapped through this configuration will inherit the same access controls, ensuring a consistent and secure authentication policy across all your deployed versions.&lt;br&gt;
Additionally, to use IAP, your services must be accessed over HTTPS, meaning you need a valid SSL/TLS certificate. If you've used a DNS wildcard for your load balancer configuration, a wildcard certificate is essential for securing all your subdomains. This ensures secure communication while maintaining the flexibility to manage multiple services and revision tags under the same domain.&lt;/p&gt;

&lt;h3&gt;
  
  
  Managing Costs with Tagged Revisions
&lt;/h3&gt;

&lt;p&gt;While revision tags offer significant advantages in managing versions and traffic, it’s important to keep an eye on the associated costs, especially when using features like min instances &amp;gt; 0. Setting a minimum number of instances ensures that a certain number of instances are always running, even when traffic is low, which avoids cold starts but can lead to increased costs. This is especially important when working with revision tags, as each tagged revision will incur charges based on the minimum instance settings, even if no traffic is routed to it. If you're using revision tags in a staging or preview environment, be mindful of these settings to avoid unexpected costs. Carefully managing the number of active instances for each revision tag can help optimize costs while maintaining the required service levels.&lt;/p&gt;

&lt;h3&gt;
  
  
  Viewing Revision Tag URLs
&lt;/h3&gt;

&lt;p&gt;With the URL mask pattern, it can be difficult to predict and construct dynamically generated URLs, as it won't appear with a simple link in the Google Cloud console. I have developed a simple tool to visualize the available URLs: &lt;a href="https://github.com/floriancartron/cloudrun-revision-tag-urlviewer" rel="noopener noreferrer"&gt;Cloud Run Revision Tag URL Viewer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>googlecloud</category>
      <category>cloud</category>
    </item>
    <item>
      <title>🧑‍🚀 Road to be a Kubestronaut, C'est parti ! 🚀</title>
      <dc:creator>Florian Cartron</dc:creator>
      <pubDate>Fri, 22 Nov 2024 16:01:46 +0000</pubDate>
      <link>https://dev.to/zenika/road-to-be-a-kubestronaut-here-we-go-29d4</link>
      <guid>https://dev.to/zenika/road-to-be-a-kubestronaut-here-we-go-29d4</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv125n1pczg5k8etsvkto.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv125n1pczg5k8etsvkto.png" alt="Kubestronaut logo" width="381" height="132"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Par &lt;a href="https://www.linkedin.com/in/hugues-connan" rel="noopener noreferrer"&gt;Hugues Connan&lt;/a&gt; et &lt;a href="https://www.linkedin.com/in/florian-cartron/" rel="noopener noreferrer"&gt;Florian Cartron&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Réussir la &lt;strong&gt;certification Certified Kubernetes Security Specialist (CKS)&lt;/strong&gt; peut sembler être une consécration dans le parcours des certifications Kubernetes tant elle est réputée la plus difficile de toutes et vue comme le niveau ultime en matière d’administration et sécurité. Cependant, la &lt;strong&gt;Cloud Native Computing Foundation (CNCF)&lt;/strong&gt; a ajouté un nouveau défi avec le lancement du programme &lt;strong&gt;Kubestronaut&lt;/strong&gt; lors de la dernière &lt;a href="https://blog.zenika.com/2024/05/21/%F0%9F%8E%89-retour-sur-la-kubecon-2024/" rel="noopener noreferrer"&gt;&lt;strong&gt;KubeCon Europe 2024&lt;/strong&gt;&lt;/a&gt; à Paris, définissant ainsi ce qu'il signifie d'être un expert Kubernetes complet.&lt;/p&gt;

&lt;p&gt;Comment devient-on un "Kubestronaut" et qu’est-ce que cela peut vous apporter ? Dans cet article, nous vous partageons notre parcours, les conseils pratiques et les étapes nécessaires pour atteindre ce titre honorifique (et non, on ne finit pas réellement dans l’espace !) et être reconnus comme experts certifiés Kubernetes.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Le programme Kubestronaut, c’est quoi ?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Le &lt;a href="https://www.cncf.io/training/kubestronaut/" rel="noopener noreferrer"&gt;programme Kubestronaut&lt;/a&gt; a été créé par la CNCF pour encourager les professionnels Kubernetes à démontrer leur expertise à travers un ensemble complet de certifications. &lt;strong&gt;Kubestronaut&lt;/strong&gt; est un titre accordé à ceux qui réussissent les cinq certifications majeures : &lt;strong&gt;KCNA&lt;/strong&gt; (Kubernetes and Cloud Native Associate), &lt;strong&gt;KCSA&lt;/strong&gt; (Kubernetes Cloud Security Associate), &lt;strong&gt;CKAD&lt;/strong&gt; (Certified Kubernetes Application Developer), &lt;strong&gt;CKA&lt;/strong&gt; (Certified Kubernetes Administrator), et &lt;strong&gt;CKS&lt;/strong&gt; (Certified Kubernetes Security Specialist).&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Les avantages&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;En devenant Kubestronaut, on n’obtient pas qu’un titre honorifique, cela apporte une validation en matière de maîtrise de Kubernetes. Aussi, ce parcours permet d’approfondir certains concepts de l’orchestrateur même s’il ne remplace pas pour autant l’expérience en production. Le programme offre aussi des réductions sur des certifications CNCF, l’accès à des événements comme la KubeCon à des tarifs préférentiels, des coupons (partageables, ou pas !) pour toutes les certifications proposées par la CNCF, et même une veste permettant d’arborer fièrement le logo Kubestronaut.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Comment sommes-nous devenus Kubestronaut ?&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Les 5 certifications Kubernetes&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F55yqjf02hqlryxndz7kj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F55yqjf02hqlryxndz7kj.png" alt="all kubernetes certifications" width="800" height="418"&gt;&lt;/a&gt;&lt;br&gt;
Le programme demande de réussir cinq certifications différentes, chacune abordant des aspects spécifiques de Kubernetes et de l’écosystème Cloud Native. Il se découpe en 2 grandes familles, tout d’abord, tout d’abord les 2 certifications QCM de niveau pré-professionnel (KC*):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;KCNA&lt;/strong&gt; : Introduction à Kubernetes et au Cloud Native
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;KCSA&lt;/strong&gt; : Notions de sécurité Cloud Native appliquées à Kubernetes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Puis Les 3 certifications pratiques de niveau professionnel (CK*) :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;CKAD&lt;/strong&gt; : Développement d’applications Kubernetes
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CKA&lt;/strong&gt; : Administration de clusters Kubernetes
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CKS&lt;/strong&gt; : Sécurité avancée dans Kubernetes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Pour être Kubestronaut, il faut avoir ces 5 certifications en cours de validité, elles ont toutes une durée de validité de 2 ans.&lt;/p&gt;

&lt;p&gt;Les certifications Kubernetes sont disponibles à l'achat sur le site &lt;a href="https://training.linuxfoundation.org/resources/kubestronaut-program/" rel="noopener noreferrer"&gt;training.linuxfoundation.org&lt;/a&gt;, où l'on peut retrouver l'ensemble des certifications requises pour le programme Kubestronaut. Divers bundles permettent de réduire les coûts, et il y a souvent de bonnes offres pendant les événements comme la KubeCon et le Cyber Monday. Les promotions régulières sont également répertoriées dans ce &lt;a href="https://github.com/techiescamp/linux-foundation-coupon" rel="noopener noreferrer"&gt;repository GitHub&lt;/a&gt;. Il est également possible d’acheter un bundle contenant le cours (autoformation en ligne) correspondant à la certification.&lt;/p&gt;

&lt;p&gt;Chacune des certifications peut être planifiée pendant 1 an à compter de la date d’achat. Vous avez aussi le droit à une nouvelle tentative gratuite en cas d’échec. Afin de pouvoir en profiter dans de bonnes conditions, nous vous conseillons de vous fixer une date afin d’avoir un objectif établi. Cela vous permettra également d’éviter la procrastination, vous pourrez toujours déplacer votre créneau d’examen si tout ne se passe pas comme prévu.&lt;/p&gt;

&lt;p&gt;La liste des domaines de compétences évalués est disponible sur la page de chacune des certifications.&lt;/p&gt;

&lt;p&gt;Il existe une &lt;a href="https://docs.linuxfoundation.org/tc-docs/certification" rel="noopener noreferrer"&gt;page&lt;/a&gt; recensant les FAQ et les instructions importantes pour se préparer au mieux au format de l’examen.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Choisir son parcours de certification&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Le parcours idéal varie selon le niveau de départ en Kubernetes :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Débutants&lt;/strong&gt; : KCNA &amp;gt; KCSA &amp;gt; CKAD &amp;gt; CKA &amp;gt; CKS. Ainsi vous aurez un vernis théorique global avant de vous attaquer à la pratique.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Utilisateurs expérimentés&lt;/strong&gt; : KCNA &amp;gt; CKAD &amp;gt; CKA &amp;gt; KCSA &amp;gt; CKS. Ce parcours permet d’aller de plus en plus en profondeur sur les axes administration et sécurité, en commençant par la théorie, puis la pratique.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Axé sur la pratique&lt;/strong&gt; : CKAD &amp;gt; CKA &amp;gt; KCNA &amp;gt; CKS &amp;gt; KCSA. Comme pour le parcours précédent, d’abord les certifications générales, puis celles portant sur la sécurité. Par contre, l’idée ici est de commencer par la pratique, puis d’enchainer avec la certification KC* associée, le périmètre y étant certes plus théorique, mais aussi et surtout plus large.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ces suggestions permettent d’adapter le parcours selon la connaissance initiale de Kubernetes et les objectifs et contextes personnels. Vous pouvez toutefois les passer dans l’ordre que vous souhaitez, le seul prérequis est qu’il faut être certifié CKA pour pouvoir passer la CKS.&lt;/p&gt;

&lt;h5&gt;
  
  
  Nos parcours
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hugues Connan&lt;/strong&gt; : Je suis passé de 0 à 5 certifications en un peu moins de 2 ans. J’avais une première expérience dans l’administration de Kubernetes mais je souhaitais valider mes compétences à travers la CKA, première certification passée. Puis, j’ai enchaîné avec la CKAD, puis la CKS. A ce moment-là, je pensais que les certifications Kubernetes étaient terminées pour moi. Puis, il y a eu le parcours Kubestronaut qui m’a amené à passer la KCNA puis la KCSA.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Florian Cartron&lt;/strong&gt; : Je suis passé de 0 à 5 certifications en 1 mois, avec un peu d’expérience sur Kubernetes, en filigrane sur les 5 dernières années et beaucoup de temps investi : environ 10h par certification QCM et 30h par certification pratique. J’ai choisi le parcours axé sur la pratique, cela correspond à ma méthode d’apprentissage, et la plupart des connaissances acquises sont utiles pour les questionnaires QCM, il faut simplement approfondir les sujets Cloud Native hors Kubernetes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Comment préparer les certifications ?&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Examens en ligne avec PSI&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Tous les examens ont lieu à distance via le “Bridge Secure Browser” fourni par l’organisme certifiant PSI. Le binaire est à télécharger au début de chaque examen sur votre espace &lt;a href="https://trainingportal.linuxfoundation.org/learn/" rel="noopener noreferrer"&gt;Training portal de la Linux Foundation&lt;/a&gt;. Vous pouvez donc les passer depuis chez vous, ou bien au bureau tant que vous respectez quelques contraintes non exhaustives :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;être dans une pièce fermée sans mur vitré
&lt;/li&gt;
&lt;li&gt;avoir un bureau sur lequel il n’y a que votre ordinateur et de l’eau dans un contenant transparent
&lt;/li&gt;
&lt;li&gt;impossible d’avoir un écran externe
&lt;/li&gt;
&lt;li&gt;pas de poubelle au pied
&lt;/li&gt;
&lt;li&gt;ne pas avoir un chat qui sait ouvrir les portes et qui vient dire coucou à l’examinateur (true story).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bref, vous pourrez retrouver toutes les règles &lt;a href="https://docs.linuxfoundation.org/tc-docs/certification/lf-handbook2/exam-rules-and-policies" rel="noopener noreferrer"&gt;ici&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Dans le processus, il y a l’étape de vérification de votre environnement de test et de votre identité. Une fois cette étape validée, vous avez un écran vous demandant d’attendre que votre examen commence. En théorie, vous devez normalement  avoir accès à l’interface d’examen au bout de 5 min maximum. Si vous sentez que l’attente est trop longue à votre goût, n’hésitez pas à contacter le support via le chat intégré. Un simple redémarrage du navigateur suffit parfois à débloquer la situation. Si vous le relancez, vous retomber sur l’examen en cours.&lt;/p&gt;

&lt;p&gt;Il est possible de lancer l’examen, étapes de vérification comprises, jusqu'à 30 minutes avant l’heure programmée.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Les certifications QCM&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;KCNA&lt;/strong&gt; et &lt;strong&gt;KCSA&lt;/strong&gt; sont 2 certifications assez généralistes sous forme de Questionnaire à Choix Multiples. Ce QCM comprend 60 questions à réponses uniques pour 1h30 d’examen. Sur le papier, elles sont destinées à être des certifications pré-professionnelles qu’on peut aussi qualifiées “d’entrée”. A la différence des CK*, celles-ci ne testent pas uniquement vos connaissances sur Kubernetes. Bien sûr, quasiment une question sur 2 concerne directement Kubernetes, ce qui a donc un poids important dans la note finale. Pour autant, elles vont aussi vérifier vos connaissances sur l’écosystème du Cloud Native et de la sécurité appliqué à Kubernetes.&lt;/p&gt;

&lt;p&gt;Pour réussir, il faut avoir bien répondu à au moins 75% des questions.&lt;/p&gt;

&lt;p&gt;Comme dans beaucoup de certifications de cette forme, le meilleur conseil est de bien lire les questions. Cela peut paraître évident mais certaines questions ont des indices dans leur énoncé. N’hésitez pas non plus à mettre un petit drapeau sur les questions où vous avez un doute car vous pourrez revenir dessus par la suite. Et enfin, nous vous conseillons aussi, si vous avez le temps, de parcourir à nouveau toutes les questions, certaines questions peuvent vous aider à répondre à celles où vous aviez un doute.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Les certifications pratiques&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;La CKAD, CKA et CKS sont 3 examens qui comportent entre 15 et 20 questions à résoudre en 2h, via le terminal du bureau à distance d’une machine virtuelle Linux. Vous aurez le droit d’accéder à la documentation officielle de Kubernetes (via le navigateur dans le bureau à distance, dans le navigateur sécurisé PSI). Pour réussir, il faut avoir bien répondu à au moins 66% des questions.&lt;/p&gt;

&lt;p&gt;Ici, il va falloir manipuler entre autres le client &lt;a href="https://kubernetes.io/fr/docs/reference/kubectl/overview/" rel="noopener noreferrer"&gt;kubectl&lt;/a&gt; pour répondre aux questions, les compétences et l’expérience pratiques sont donc ici essentielles. Un bon moyen de se tester est d’utiliser une plateforme d’entraînement telle que &lt;a href="https://killercoda.com/" rel="noopener noreferrer"&gt;killercoda.com&lt;/a&gt;  pour des mises en situation concrètes proches des examens, la liste des scénarios y est plutôt exhaustive. &lt;/p&gt;

&lt;p&gt;Avec chacune de ces certifications sont fournies 2 sessions identiques d’un examen blanc sur &lt;a href="http://killer.sh" rel="noopener noreferrer"&gt;killer.sh&lt;/a&gt; : c’est exactement le même environnement que pour l’examen réel, profitez en pour vous familiariser avec. Nous vous conseillons de garder la seconde session d’examen blanc pour préparer votre nouvelle tentative d’examen en cas d’échec. Attention : les examens blancs comportent plus de questions, et les questions sont plus complexes. Pas grave, tout ne s’arrête pas à la fin du décompte de 2h, vous pouvez y revenir autant que vous voulez pour corriger vos erreurs et traiter toutes les questions pendant 36h. Les questions sont très exhaustives et couvrent tout ce sur quoi vous pourrez tomber lors de l’examen.&lt;/p&gt;

&lt;p&gt;Pour vous préparer au mieux, Zenika propose également des sessions de préparation sur une journée pour les examens &lt;a href="https://training.zenika.com/fr-fr/training/prepa-ckad/description" rel="noopener noreferrer"&gt;CKAD&lt;/a&gt; et &lt;a href="https://training.zenika.com/fr-fr/training/prepa-cka/description" rel="noopener noreferrer"&gt;CKA&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Dans ces certifications, le temps est précieux. Voici quelques conseils pour vous permettre d’avoir toutes les chances de réussir :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;kubectl&lt;/strong&gt; : Familiarisez-vous avec les commandes impératives pour accélérer la création de configurations, et exploitez au maximum l’aide des commandes (&lt;em&gt;--help&lt;/em&gt;), qui comporte de nombreux exemples d’utilisation très pratiques. Utilisez l'option “&lt;em&gt;--dry-run=client -o yaml”&lt;/em&gt; pour générer rapidement des configurations en YAML, ce qui vous fera gagner un temps précieux.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Édition avec Vim&lt;/strong&gt; : Devenez rapide et efficace avec Vim pour pouvoir éditer des fichiers en toute agilité pendant l'examen. Savoir se déplacer dans le fichier, indenter, copier, coller, supprimer des mots ou des lignes. Il y a plusieurs manières de faire ces actions, le tout est d’être à l’aise avec quelques raccourcis. Si vous préférez Nano, les mêmes conseils doivent s’appliquer, mais nous ne serons pas capables de le confirmer !
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Aide de la documentation&lt;/strong&gt; : Pendant l'examen, la documentation officielle de Kubernetes est accessible. C'est un atout majeur : entraînez-vous à repérer rapidement les sections importantes pour trouver les informations essentielles en un clin d'œil grâce à la recherche, notamment pour copier les descripteurs de ressources qu’il n’est pas possible de générer avec kubectl.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ne pas rester bloqué&lt;/strong&gt; : Si vous ne voyez pas du tout comment résoudre une question, mettez un drapeau pour y revenir plus tard. Idem si vous avez tenté une solution qui ne fonctionne pas et que vous ne comprenez pas pourquoi.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A noter qu’en plus d’être plus pointue techniquement, la certification CKS est bien plus longue, 2h ne seront pas de trop !&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Devenir un &lt;strong&gt;Kubestronaut&lt;/strong&gt; est un parcours exigeant, mais stimulant et très enrichissant pour tout professionnel souhaitant maîtriser Kubernetes et l'écosystème Cloud Native. Grâce à des étapes de certification progressives et un entraînement régulier, nous avons pu acquérir une expertise complète et reconnaître notre engagement dans ce domaine en pleine expansion.&lt;/p&gt;

&lt;p&gt;Pour celles et ceux qui se lancent dans cette aventure, préparez-vous bien, investissez le temps nécessaire pour chaque certification, et n'hésitez pas à chercher les bonnes ressources pour vous permettre de préparer individuellement chaque certification : One step at a time!&lt;/p&gt;

&lt;p&gt;Bon courage, futurs Kubestronauts !&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>certification</category>
    </item>
  </channel>
</rss>
