<?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: ZC</title>
    <description>The latest articles on DEV Community by ZC (@0x2633).</description>
    <link>https://dev.to/0x2633</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%2F372861%2F064bb717-7a0e-4b06-ae97-f087bd405d97.png</url>
      <title>DEV Community: ZC</title>
      <link>https://dev.to/0x2633</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/0x2633"/>
    <language>en</language>
    <item>
      <title>How to Enable Duo MFA on GCP Windows VMs for Compliance in 10 Minutes</title>
      <dc:creator>ZC</dc:creator>
      <pubDate>Wed, 28 Jan 2026 07:09:50 +0000</pubDate>
      <link>https://dev.to/0x2633/how-to-enable-duo-mfa-on-gcp-windows-vms-for-compliance-in-10-minutes-3d7k</link>
      <guid>https://dev.to/0x2633/how-to-enable-duo-mfa-on-gcp-windows-vms-for-compliance-in-10-minutes-3d7k</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Problem:&lt;/strong&gt; For the compliance, you might be asking to implement the MFA for running VM in GCP, it is easy when it comes to Linux, but how about Windows?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Solution:&lt;/strong&gt; There are not only one solution to achieve the goal, but this time we choose &lt;a href="https://duo.com/" rel="noopener noreferrer"&gt;Cisco Duo&lt;/a&gt; as the MFA infrastructure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Goal:&lt;/strong&gt; "By the end of this guide, you will have a secure Windows VM that prompts for MFA upon every RDP login."&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architecture Overview
&lt;/h2&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%2Flglnbe4l0nyfmygz7zbp.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%2Flglnbe4l0nyfmygz7zbp.png" alt="Duo flow for Windows" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A running &lt;strong&gt;Windows Server VM&lt;/strong&gt; on GCP.&lt;/li&gt;
&lt;li&gt;Admin access to the VM (RDP).&lt;/li&gt;
&lt;li&gt;A valid &lt;strong&gt;Cisco Duo&lt;/strong&gt; account (Free trial or Admin access).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Critical Network Check:&lt;/strong&gt; Ensure the VM allows outbound traffic on TCP port 443 to &lt;code&gt;api-*.duosecurity.com&lt;/code&gt;.(It will be used by the installation of Duo Authentication for Windows )&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Configure Duo Admin Panel
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Action:&lt;/strong&gt; Create a "&lt;a href="https://admin-524ebc1b.duosecurity.com/applications/protect/types" rel="noopener noreferrer"&gt;Protect an Application&lt;/a&gt;" entry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Selection:&lt;/strong&gt; Choose "Microsoft RDP".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Data:&lt;/strong&gt; Note down the &lt;strong&gt;Integration Key (IKEY)&lt;/strong&gt;, &lt;strong&gt;Secret Key (SKEY)&lt;/strong&gt;, and &lt;strong&gt;API Hostname&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&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%2Fixxhty26f0dtx9b3efnf.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%2Fixxhty26f0dtx9b3efnf.png" alt="Credential" width="643" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Installation on GCP Windows VM
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Download:&lt;/strong&gt; Link to the official &lt;a href="https://dl.duosecurity.com/duo-win-login-latest.exe" rel="noopener noreferrer"&gt;Duo Authentication for Windows Logon installer&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Install:&lt;/strong&gt; Walk through the wizard.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configuration:&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Enter the IKEY, SKEY, and Hostname. (Refers to last step in Step 1)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Verification &amp;amp; Troubleshooting
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Test:&lt;/strong&gt; After the above steps, try to log into Windows and you will see the MFA requirement like below screenshot.&lt;/li&gt;
&lt;/ul&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%2Fy471pqm0eylpn1gjdz7j.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%2Fy471pqm0eylpn1gjdz7j.png" alt="MFA Prompt" width="800" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Troubleshooting:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Problem:&lt;/em&gt; "I locked myself out!"&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Solution:&lt;/em&gt; Use GCP Serial Console or a startup script to uninstall/bypass Duo in an emergency.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;If you accidentally locked yourself out, you could use GCP Serial Console(Windows should choose &lt;strong&gt;#2&lt;/strong&gt;) to get into &lt;a href="https://docs.cloud.google.com/compute/docs/instances/connecting-to-sac" rel="noopener noreferrer"&gt;SAC&lt;/a&gt; to &lt;a href="https://help.duo.com/s/article/1088?language=en_US" rel="noopener noreferrer"&gt;stop the service or uninstall the service&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By implementing Cisco Duo on your GCP Windows VM, you have successfully added a critical layer of defense against credential theft and brute-force attacks. Not only does this secure your infrastructure, but it also helps you check the box for compliance standards like SOC2 or PCI-DSS that mandate MFA for remote access.&lt;/p&gt;

</description>
      <category>google</category>
      <category>microsoft</category>
      <category>security</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How To Add The Whitelist for Your Ingress-Nginx Controller of K8S?</title>
      <dc:creator>ZC</dc:creator>
      <pubDate>Fri, 13 Dec 2024 06:03:14 +0000</pubDate>
      <link>https://dev.to/0x2633/how-to-add-the-whitelist-for-your-ingress-nginx-controller-of-k8s-1a02</link>
      <guid>https://dev.to/0x2633/how-to-add-the-whitelist-for-your-ingress-nginx-controller-of-k8s-1a02</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Access control is a critical aspect of securing your Kubernetes applications. One way to enhance security is by implementing a whitelist to allow only specific IP addresses to access your services. In this post, I’ll show you how to configure IP whitelisting for your Ingress-Nginx Controller in Kubernetes.&lt;/p&gt;

&lt;p&gt;This guide is for anyone using Kubernetes and managing external or internal traffic to their services, such as DevOps engineers and Kubernetes enthusiasts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we start, ensure you have the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A working Kubernetes cluster.&lt;/li&gt;
&lt;li&gt;kubectl installed and configured.&lt;/li&gt;
&lt;li&gt;Ingress-Nginx Controller already installed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Understanding Whitelisting in Ingress-Nginx
&lt;/h2&gt;

&lt;p&gt;Whitelisting allows you to restrict access to your application based on IP addresses or CIDR ranges. This is particularly useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Securing internal applications that only certain teams or locations should access.&lt;/li&gt;
&lt;li&gt;Protecting sensitive data by limiting external access.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ingress-Nginx supports whitelisting via annotations, making it straightforward to set up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to Add a Whitelist
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Verify Ingress-Nginx Installation
&lt;/h3&gt;

&lt;p&gt;First, check that the Ingress-Nginx Controller is running in your cluster. Use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; ingress-nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for a pod with a name like ingress-nginx-controller. If it’s not running, install it using Ingress-Nginx installation guides.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Identify the IPs to Whitelist
&lt;/h3&gt;

&lt;p&gt;Determine the IP addresses or CIDR ranges you want to allow access. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Internal IPs: &lt;u&gt;192.168.1.0/24&lt;/u&gt;
&lt;/li&gt;
&lt;li&gt;External static IP: &lt;u&gt;203.0.113.0/24&lt;/u&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Configure the Ingress Nginx Controller(&lt;strong&gt;&lt;u&gt;!IMPORTANT&lt;/u&gt;&lt;/strong&gt;)
&lt;/h3&gt;

&lt;p&gt;Before we add the whitelist into the ingress resource, we &lt;strong&gt;&lt;u&gt;HAVE TO&lt;/u&gt;&lt;/strong&gt; change the &lt;code&gt;externalTrafficPolicy&lt;/code&gt; field to &lt;strong&gt;&lt;u&gt;Local&lt;/u&gt;&lt;/strong&gt; like below example or the whitelist will not be applied correctly.&lt;/p&gt;

&lt;p&gt;The comparison between Local and Cluster for &lt;code&gt;externalTrafficPolicy&lt;/code&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attribute/Behavior&lt;/th&gt;
&lt;th&gt;Local&lt;/th&gt;
&lt;th&gt;Cluster&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Traffic Routing&lt;/td&gt;
&lt;td&gt;Routes only to Pods on the node receiving traffic&lt;/td&gt;
&lt;td&gt;Distributes traffic to any Pod in the cluster&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Client Original IP&lt;/td&gt;
&lt;td&gt;Preserved&lt;/td&gt;
&lt;td&gt;Replaced by the node’s IP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Traffic Balancing&lt;/td&gt;
&lt;td&gt;Requires Load Balancer to balance external traffic&lt;/td&gt;
&lt;td&gt;Handled internally by Kubernetes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Network Hops&lt;/td&gt;
&lt;td&gt;Few (direct to the target Pod)&lt;/td&gt;
&lt;td&gt;More (may forward to other nodes)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;May be slightly higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fault Tolerance&lt;/td&gt;
&lt;td&gt;Requires Pods to be evenly distributed across nodes&lt;/td&gt;
&lt;td&gt;High, as traffic can reach any available Pod&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Use Case&lt;/td&gt;
&lt;td&gt;When client IP is needed (e.g., for logging or IP-based access control)&lt;/td&gt;
&lt;td&gt;For high availability and balanced distribution without needing client IP&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;...&lt;/span&gt;

&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;allocateLoadBalancerNodePorts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;clusterIP&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10.109.177.97&lt;/span&gt;
  &lt;span class="na"&gt;clusterIPs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;10.109.177.97&lt;/span&gt;
  &lt;span class="na"&gt;externalTrafficPolicy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Local&lt;/span&gt; &lt;span class="c1"&gt;# &amp;lt;--- Change it to Local, default is Cluster&lt;/span&gt;
  &lt;span class="na"&gt;healthCheckNodePort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;32459&lt;/span&gt;
  &lt;span class="na"&gt;internalTrafficPolicy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Cluster&lt;/span&gt;

&lt;span class="nn"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Configure the Ingress Resource
&lt;/h3&gt;

&lt;p&gt;To implement the whitelist, add the annotation nginx.ingress.kubernetes.io/whitelist-source-range to your Ingress resource. Below is a sample YAML configuration:&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;networking.k8s.io/v1&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;Ingress&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;example-ingress&lt;/span&gt;
  &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;nginx.ingress.kubernetes.io/whitelist-source-range&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;192.168.1.0/24,203.0.113.0/24"&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;example.com&lt;/span&gt;
    &lt;span class="na"&gt;http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt;
        &lt;span class="na"&gt;pathType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Prefix&lt;/span&gt;
        &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;service&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;example-service&lt;/span&gt;
            &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save this configuration as ingress.yaml.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Apply the Configuration
&lt;/h3&gt;

&lt;p&gt;Apply the YAML configuration using kubectl:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; ingress.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl describe ingress example-ingress
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check for the annotation and ensure it’s applied correctly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: Testing the Whitelist
&lt;/h3&gt;

&lt;p&gt;To confirm the whitelist works as expected, test access from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whitelisted IPs: Access the service using a browser or curl:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Host: example.com"&lt;/span&gt; http://&amp;lt;INGRESS_IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Non-Whitelisted IPs: Try accessing from an unlisted IP. You should receive a 403 Forbidden response.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Common Issues and Troubleshooting&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Access Denied Despite Proper Configuration:

&lt;ul&gt;
&lt;li&gt;Double-check the IP ranges in the annotation.&lt;/li&gt;
&lt;li&gt;Ensure you’re testing from the correct source IP.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Misconfigured CIDR Ranges:

&lt;ul&gt;
&lt;li&gt;Validate your CIDR format using online tools like CIDR Calculator.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Ingress Logs:

&lt;ul&gt;
&lt;li&gt;Check the logs of your Ingress-Nginx Controller for clues:
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs &lt;span class="nt"&gt;-n&lt;/span&gt; ingress-nginx &amp;lt;ingress-nginx-controller-pod&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Best Practices&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Combine whitelisting with HTTPS to encrypt traffic.&lt;/li&gt;
&lt;li&gt;Use ConfigMaps or Secrets to store sensitive configurations.&lt;/li&gt;
&lt;li&gt;Regularly review and update the whitelist as network requirements evolve.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;Adding a whitelist to your Ingress-Nginx Controller is a simple yet effective way to secure your Kubernetes applications. By restricting access to trusted IPs, you reduce the risk of unauthorized access. Give it a try, and feel free to share your feedback or challenges in the comments below!&lt;/p&gt;

&lt;p&gt;References and Further Reading&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/" rel="noopener noreferrer"&gt;Ingress-Nginx Official Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kubernetes.io/docs/concepts/services-networking/" rel="noopener noreferrer"&gt;Kubernetes Networking Concepts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ipaddressguide.com/cidr" rel="noopener noreferrer"&gt;CIDR Notation Explained&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>kubernetes</category>
    </item>
    <item>
      <title>How To Fix "java.io.IOException: Problem reading font data." When Load Customized TTF In Java.</title>
      <dc:creator>ZC</dc:creator>
      <pubDate>Wed, 31 Jul 2024 06:59:48 +0000</pubDate>
      <link>https://dev.to/0x2633/how-to-fix-javaioioexception-problem-reading-font-data-when-load-customized-ttf-in-java-4hmh</link>
      <guid>https://dev.to/0x2633/how-to-fix-javaioioexception-problem-reading-font-data-when-load-customized-ttf-in-java-4hmh</guid>
      <description>&lt;p&gt;Yesterday, my colleague said the service had a problem loading the customized font -- &lt;strong&gt;&lt;u&gt;NotoSerif-Regular.ttf&lt;/u&gt;&lt;/strong&gt; on our SIT, but it worked on local, the error was as follows:&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%2Fmr8iw4mruz9s1ofrhbtp.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%2Fmr8iw4mruz9s1ofrhbtp.png" alt=" " width="800" height="888"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After trying several methods, although it was resolved, I still have many questions.&lt;/p&gt;

&lt;p&gt;Our containerized service uses the base container image – &lt;strong&gt;&lt;u&gt;amazoncorretto:19-alpine&lt;/u&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Below is the solution and it seems that the &lt;strong&gt;&lt;a href="https://pkgs.alpinelinux.org/package/edge/community/x86/font-noto" rel="noopener noreferrer"&gt;font-noto&lt;/a&gt;&lt;/strong&gt; package must be installed first, or the problem will exist again.&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%2Fjnvavqbst6vxfkh08e7a.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%2Fjnvavqbst6vxfkh08e7a.png" alt=" " width="395" height="131"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, I can only treat it as a workaround but not a good solution.&lt;/p&gt;

&lt;p&gt;Because the package I installed contained the TTF file of font covered in the source code developed by our software engineer.&lt;/p&gt;

&lt;p&gt;Although I am still looking for the answer, I hope someone encountering this issue can fix the problem quickly.&lt;/p&gt;

&lt;p&gt;If someone has known the answer, please casually leave a comment to share your knowledge with us, big thanks!&lt;/p&gt;

</description>
      <category>java</category>
      <category>docker</category>
    </item>
    <item>
      <title>How Many Ingress Controllers We Need in K8S?</title>
      <dc:creator>ZC</dc:creator>
      <pubDate>Mon, 17 Jun 2024 08:17:27 +0000</pubDate>
      <link>https://dev.to/0x2633/how-many-ingress-controllers-we-need-in-k8s-12c7</link>
      <guid>https://dev.to/0x2633/how-many-ingress-controllers-we-need-in-k8s-12c7</guid>
      <description>&lt;p&gt;Generally speaking, using separate namespaces and &lt;code&gt;ingress-nginx&lt;/code&gt; controllers for different environments like SIT (System Integration Testing) and UAT (User Acceptance Testing) is a common and effective approach. This design provides isolation between environments, allowing you to configure and manage them independently. However, depending on your specific requirements and infrastructure, there might be alternative or complementary approaches to consider.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages of Separate Namespaces and Ingress Controllers
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Isolation&lt;/strong&gt;: Each environment (SIT and UAT) is isolated, preventing potential conflicts and allowing independent configurations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource Management&lt;/strong&gt;: Resources can be allocated and managed separately for each environment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt;: Fine-grained access control can be applied to each namespace.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Environments can be scaled independently based on their specific needs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment-Specific Configurations&lt;/strong&gt;: Different configurations, such as DNS, SSL certificates, and ingress rules, can be applied to each environment.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Alternative and Complementary Approaches
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cluster-per-Environment&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Description&lt;/strong&gt;: Deploy separate Kubernetes clusters for SIT and UAT.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;: Complete isolation at the cluster level, allowing for different Kubernetes versions and configurations. Enhanced security and resource isolation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cons&lt;/strong&gt;: Higher operational overhead and costs due to managing multiple clusters.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Namespace-per-Environment with Single Ingress Controller&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Description&lt;/strong&gt;: Use a single &lt;code&gt;ingress-nginx&lt;/code&gt; controller with multiple namespaces for SIT and UAT.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;: Simplified management with a single ingress controller. Reduced resource usage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cons&lt;/strong&gt;: Potential for configuration conflicts and reduced isolation compared to separate controllers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Use of Network Policies&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Description&lt;/strong&gt;: Implement Kubernetes Network Policies to enforce network isolation between namespaces.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;: Enhanced security and isolation without needing multiple ingress controllers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cons&lt;/strong&gt;: Requires careful planning and configuration of network policies.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Service Mesh&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Description&lt;/strong&gt;: Use a service mesh like Istio or Linkerd to manage traffic within and between environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;: Advanced traffic management, security, and observability. Can manage traffic routing, retries, and failures more effectively.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cons&lt;/strong&gt;: Additional complexity and resource overhead.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Multi-Tenant Ingress Controller&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Description&lt;/strong&gt;: Configure a single ingress controller to handle multiple environments by using annotations and custom configurations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;: Centralized management and reduced overhead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cons&lt;/strong&gt;: Complexity in configuring and managing different rules for each environment.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Example: Using a Single Cluster with Namespaces and Network Policies
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Namespaces&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl create namespace sit
kubectl create namespace uat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Ingress Controller&lt;/strong&gt;: Deploy a single &lt;code&gt;ingress-nginx&lt;/code&gt; controller, or use separate controllers as needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Network Policies&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define network policies to control traffic between namespaces and to/from the internet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;sit-network-policy.yaml&lt;/strong&gt;:&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;networking.k8s.io/v1&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;NetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;allow-sit-ingress&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sit&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{}&lt;/span&gt;
  &lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;namespaceSelector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;matchLabels&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;sit&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ingress-nginx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;uat-network-policy.yaml&lt;/strong&gt;:&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;networking.k8s.io/v1&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;NetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;allow-uat-ingress&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;uat&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{}&lt;/span&gt;
  &lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;namespaceSelector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;matchLabels&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;uat&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ingress-nginx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Ingress Resources&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define separate ingress resources for each environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;sit-ingress.yaml&lt;/strong&gt;:&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;networking.k8s.io/v1&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;Ingress&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;sit-ingress&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sit&lt;/span&gt;
  &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;nginx.ingress.kubernetes.io/rewrite-target&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sit.example.com&lt;/span&gt;
    &lt;span class="na"&gt;http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt;
        &lt;span class="na"&gt;pathType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Prefix&lt;/span&gt;
        &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;service&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;sit-service&lt;/span&gt;
            &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;uat-ingress.yaml&lt;/strong&gt;:&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;networking.k8s.io/v1&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;Ingress&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;uat-ingress&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;uat&lt;/span&gt;
  &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;nginx.ingress.kubernetes.io/rewrite-target&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;uat.example.com&lt;/span&gt;
    &lt;span class="na"&gt;http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt;
        &lt;span class="na"&gt;pathType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Prefix&lt;/span&gt;
        &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;service&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;uat-service&lt;/span&gt;
            &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;Using separate namespaces and &lt;code&gt;ingress-nginx&lt;/code&gt; controllers for SIT and UAT is a good practice for isolating environments and managing resources independently. Depending on your needs, you might also consider alternatives like separate clusters, network policies, or a service mesh for more advanced traffic management and security features.&lt;/p&gt;

&lt;p&gt;Choose the approach that best fits your organization's infrastructure, resource management capabilities, and operational overhead considerations.&lt;/p&gt;

</description>
      <category>kubernetes</category>
    </item>
    <item>
      <title>What are SLI, SLO and SLA, and Why are they important in SRE?</title>
      <dc:creator>ZC</dc:creator>
      <pubDate>Wed, 05 Jun 2024 03:10:29 +0000</pubDate>
      <link>https://dev.to/0x2633/what-are-sli-slo-and-sla-and-why-are-they-important-in-sre-1h1o</link>
      <guid>https://dev.to/0x2633/what-are-sli-slo-and-sla-and-why-are-they-important-in-sre-1h1o</guid>
      <description>&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Aspect&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Service Level Indicator (SLI)&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Service Level Objective (SLO)&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Service Level Agreement (SLA)&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Definition&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A metric that measures the performance of a service. Examples include latency, error rate, throughput, and availability.&lt;/td&gt;
&lt;td&gt;A target value or range of values for a particular SLI over a specified time period. It represents the goal for the service's performance.&lt;/td&gt;
&lt;td&gt;A formalized contract between a service provider and a customer outlining expected performance standards (often defined by SLOs) and the consequences of not meeting those standards.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;To provide a quantifiable measure of some aspect of the service's performance.&lt;/td&gt;
&lt;td&gt;To set specific, measurable goals for service performance based on SLIs.&lt;/td&gt;
&lt;td&gt;To establish clear expectations and responsibilities between the service provider and the customer, including penalties or compensations for not meeting the agreed performance levels.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;- Latency (e.g., 95th percentile response time)&lt;br&gt;- Error rate (e.g., percentage of failed requests)&lt;br&gt;- Availability (e.g., uptime percentage)&lt;br&gt;- Throughput&lt;/td&gt;
&lt;td&gt;- 95th percentile latency should be less than 100ms over the last 30 days&lt;br&gt;- Error rate should be less than 0.1% over the last 7 days&lt;br&gt;- Availability should be 99.9% over the last month&lt;/td&gt;
&lt;td&gt;- The service will maintain 99.9% availability each month. If availability drops below this threshold, the service provider will credit the customer 10% of their monthly fee for each 0.1% drop below the threshold, up to 50%.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Who Defines It&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Engineers and service owners who monitor and manage the service.&lt;/td&gt;
&lt;td&gt;Engineers and service owners in collaboration with business stakeholders to ensure the objectives meet business needs and are achievable.&lt;/td&gt;
&lt;td&gt;Business leaders, legal teams, and sometimes customers, often with input from engineers and service owners to ensure technical feasibility.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scope&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Specific aspects of service performance, typically focused on technical metrics.&lt;/td&gt;
&lt;td&gt;Broader than SLIs, encompassing goals for multiple SLIs, often with business impact considerations.&lt;/td&gt;
&lt;td&gt;Broad and formal, encompassing agreed-upon performance standards, legal obligations, and financial implications.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Timeframe&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Continuous, providing real-time or near-real-time data on service performance.&lt;/td&gt;
&lt;td&gt;Specific periods (e.g., weekly, monthly) over which the service's performance is evaluated against the objective.&lt;/td&gt;
&lt;td&gt;Defined contract period, typically monthly or annually, with regular reviews and updates as needed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Consequences of Not Meeting&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Not meeting SLIs typically triggers alerts for engineers to investigate and resolve issues.&lt;/td&gt;
&lt;td&gt;Not meeting SLOs may lead to internal reviews and action plans to improve service performance.&lt;/td&gt;
&lt;td&gt;Not meeting SLAs typically results in penalties, such as service credits or refunds to the customer, and can damage the service provider's reputation and customer trust.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Visibility&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Primarily internal, used by the service provider's engineering teams.&lt;/td&gt;
&lt;td&gt;Internal, with visibility to both engineering teams and business stakeholders.&lt;/td&gt;
&lt;td&gt;External, visible to both the service provider and the customer, often documented in legal contracts.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Example Metrics&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;- Average response time&lt;br&gt;- Number of errors&lt;br&gt;- System uptime&lt;br&gt;- Request per second&lt;/td&gt;
&lt;td&gt;- 99.9% of requests should have response times under 200ms&lt;br&gt;- Error rate should not exceed 0.1% over a month&lt;br&gt;- 99.99% uptime&lt;/td&gt;
&lt;td&gt;- 99.9% availability per month&lt;br&gt;- 99% of support requests answered within 24 hours&lt;br&gt;- 95% of incidents resolved within 4 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SLI&lt;/strong&gt;: Measures specific aspects of service performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SLO&lt;/strong&gt;: Sets target performance levels for SLIs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SLA&lt;/strong&gt;: Formal agreement that includes SLOs and outlines the consequences of not meeting them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Therefore, service providers can effectively manage and communicate their service performance, ensuring alignment with customer expectations and business objectives.&lt;/p&gt;

</description>
      <category>sre</category>
    </item>
    <item>
      <title>The flow of creating digital signatures and verification in Python</title>
      <dc:creator>ZC</dc:creator>
      <pubDate>Mon, 03 Jun 2024 01:27:46 +0000</pubDate>
      <link>https://dev.to/0x2633/the-flow-of-creating-digital-signature-and-verification-in-python-37ng</link>
      <guid>https://dev.to/0x2633/the-flow-of-creating-digital-signature-and-verification-in-python-37ng</guid>
      <description>&lt;p&gt;This flow demonstrates how to create and verify a digital signature using the &lt;code&gt;cryptography&lt;/code&gt; library in Python. This process ensures the authenticity and integrity of the message, confirming that it was signed by the holder of the private key and has not been altered.&lt;br&gt;
There are main 3 steps.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Generate Key Pair:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Private Key&lt;/strong&gt;: Created using RSA, with a public exponent of 65537 and a key size of 2048 bits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public Key&lt;/strong&gt;: Derived from the private key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage&lt;/strong&gt;: Both keys are saved to files in PEM format.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Sign the Message:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Message&lt;/strong&gt;: The data to be signed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hash Function&lt;/strong&gt;: SHA-256 is used to hash the message.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Padding&lt;/strong&gt;: PSS (Probabilistic Signature Scheme) with MGF1 (Mask Generation Function) and a maximum salt length is used for padding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Signature&lt;/strong&gt;: The message is signed using the private key, and the signature is saved to a file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Verify the Signature:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Public Key&lt;/strong&gt;: Loaded from the PEM file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Signature&lt;/strong&gt;: Loaded from the file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Message&lt;/strong&gt;: The original message that was signed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verification&lt;/strong&gt;: The public key, along with the message and the signature, is used to verify the authenticity of the signature. If the signature is valid, it means the message was signed by the corresponding private key.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Step 1: Install the Required Library
&lt;/h3&gt;

&lt;p&gt;First, ensure you have the &lt;code&gt;cryptography&lt;/code&gt; library installed. You can install it using pip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;cryptography
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Generate a Key Pair
&lt;/h3&gt;

&lt;p&gt;A key pair consists of a private key (used for signing) and a public key (used for verification).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;cryptography.hazmat.primitives.asymmetric&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;rsa&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;cryptography.hazmat.primitives&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;serialization&lt;/span&gt;

&lt;span class="c1"&gt;# Generate private key
&lt;/span&gt;&lt;span class="n"&gt;private_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rsa&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate_private_key&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;public_exponent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;65537&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;key_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2048&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Generate public key from the private key
&lt;/span&gt;&lt;span class="n"&gt;public_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;private_key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;public_key&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Save the private key to a file
&lt;/span&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;private_key.pem&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;wb&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;private_key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;private_bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;serialization&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Encoding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PEM&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;serialization&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PrivateFormat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PKCS8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;encryption_algorithm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;serialization&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NoEncryption&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# Save the public key to a file
&lt;/span&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;public_key.pem&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;wb&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;public_key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;public_bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;serialization&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Encoding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PEM&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;serialization&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PublicFormat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SubjectPublicKeyInfo&lt;/span&gt;
    &lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Sign a Message
&lt;/h3&gt;

&lt;p&gt;To create a digital signature, you'll use the private key to sign a message.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;cryptography.hazmat.primitives&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;hashes&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;cryptography.hazmat.primitives.asymmetric&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;padding&lt;/span&gt;

&lt;span class="c1"&gt;# Message to be signed
&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, this is a secret message!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="c1"&gt;# Sign the message
&lt;/span&gt;&lt;span class="n"&gt;signature&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;private_key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PSS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;mgf&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;MGF1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hashes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SHA256&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
        &lt;span class="n"&gt;salt_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PSS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MAX_LENGTH&lt;/span&gt;
    &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;hashes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SHA256&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Save the signature to a file
&lt;/span&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;signature.bin&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;wb&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Verify the Signature
&lt;/h3&gt;

&lt;p&gt;To verify the signature, use the public key to check if it matches the message.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Load the public key
&lt;/span&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;public_key.pem&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;rb&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;public_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;serialization&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load_pem_public_key&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;

&lt;span class="c1"&gt;# Load the signature
&lt;/span&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;signature.bin&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;rb&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;signature&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Message to be verified
&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, this is a secret message!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="c1"&gt;# Verify the signature
&lt;/span&gt;&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;public_key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;verify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PSS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;mgf&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;MGF1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hashes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SHA256&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
            &lt;span class="n"&gt;salt_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PSS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MAX_LENGTH&lt;/span&gt;
        &lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="n"&gt;hashes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SHA256&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;The signature is valid.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;The signature is invalid.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>certification</category>
    </item>
    <item>
      <title>How To Apply The GCP Service Account Into On-premise K8S Step By Step</title>
      <dc:creator>ZC</dc:creator>
      <pubDate>Thu, 30 May 2024 03:31:07 +0000</pubDate>
      <link>https://dev.to/0x2633/how-to-apply-the-gcp-service-account-into-on-premise-k8s-step-by-step-4oc8</link>
      <guid>https://dev.to/0x2633/how-to-apply-the-gcp-service-account-into-on-premise-k8s-step-by-step-4oc8</guid>
      <description>&lt;p&gt;Applying a GCP service account to a local Kubernetes cluster involves a few steps to ensure that your Kubernetes pods can authenticate to GCP services using the service account. Here's a detailed guide to achieve this:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step-by-Step Guide
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Create a GCP Service Account
&lt;/h4&gt;

&lt;p&gt;First, create a service account in your GCP project and download the JSON key file.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create the Service Account&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud iam service-accounts create my-service-account &lt;span class="nt"&gt;--display-name&lt;/span&gt; &lt;span class="s2"&gt;"My Service Account"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Assign Roles to the Service Account&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud projects add-iam-policy-binding &amp;lt;YOUR-PROJECT-ID&amp;gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--member&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"serviceAccount:my-service-account@&amp;lt;YOUR-PROJECT-ID&amp;gt;.iam.gserviceaccount.com"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"roles/YOUR-ROLE"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Replace &lt;code&gt;&amp;lt;YOUR-PROJECT-ID&amp;gt;&lt;/code&gt; with your GCP project ID and &lt;code&gt;roles/YOUR-ROLE&lt;/code&gt; with the appropriate roles you need for your service account.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create and Download the Key File&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud iam service-accounts keys create key.json &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--iam-account&lt;/span&gt; my-service-account@&amp;lt;YOUR-PROJECT-ID&amp;gt;.iam.gserviceaccount.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  2. Create a Kubernetes Secret with the Service Account Key
&lt;/h4&gt;

&lt;p&gt;Next, create a Kubernetes secret that contains the service account key file.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create the Secret&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl create secret generic gcp-service-account &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--from-file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;key.json&lt;span class="o"&gt;=&lt;/span&gt;path/to/key.json
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Replace &lt;code&gt;path/to/key.json&lt;/code&gt; with the actual path to your downloaded service account key file.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  3. Configure Your Pods to Use the Service Account
&lt;/h4&gt;

&lt;p&gt;Modify your Kubernetes deployment or pod specification to mount the service account key as a volume and set the &lt;code&gt;GOOGLE_APPLICATION_CREDENTIALS&lt;/code&gt; environment variable.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Update Deployment YAML&lt;/strong&gt;:&lt;br&gt;
&lt;/p&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;apps/v1&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;Deployment&lt;/span&gt;
&lt;span class="na"&gt;metadata&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;my-app&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-app&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-app&lt;/span&gt;
    &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;containers&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;my-app&lt;/span&gt;
        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gcr.io/&amp;lt;YOUR-PROJECT-ID&amp;gt;/my-app:latest&lt;/span&gt;
&lt;span class="c1"&gt;### Keypoint Start&lt;/span&gt;
        &lt;span class="na"&gt;env&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;GOOGLE_APPLICATION_CREDENTIALS&lt;/span&gt;
          &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/secrets/google/key.json&lt;/span&gt;
        &lt;span class="na"&gt;volumeMounts&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;gcp-service-account&lt;/span&gt;
          &lt;span class="na"&gt;mountPath&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/secrets/google&lt;/span&gt;
          &lt;span class="na"&gt;readOnly&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
      &lt;span class="na"&gt;volumes&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;gcp-service-account&lt;/span&gt;
        &lt;span class="na"&gt;secret&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;secretName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gcp-service-account&lt;/span&gt;
&lt;span class="c1"&gt;### Keypoint End&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;In this example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Replace &lt;code&gt;gcr.io/&amp;lt;YOUR-PROJECT-ID&amp;gt;/my-app:latest&lt;/code&gt; with the image you are using.&lt;/li&gt;
&lt;li&gt;The environment variable &lt;code&gt;GOOGLE_APPLICATION_CREDENTIALS&lt;/code&gt; is set to the path where the key file will be mounted.&lt;/li&gt;
&lt;li&gt;The secret named &lt;code&gt;gcp-service-account&lt;/code&gt; is mounted as a volume at &lt;code&gt;/var/secrets/google&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Apply the Updated Deployment&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; deployment.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;By following these steps, you can configure your local Kubernetes cluster to use a GCP service account. This setup involves creating a GCP service account, generating and downloading a key file, creating a Kubernetes secret with the key file, and configuring your pods to use the service account by mounting the secret and setting the appropriate environment variable. This allows your applications running in Kubernetes to authenticate with GCP services securely.&lt;/p&gt;

</description>
      <category>kubernetes</category>
    </item>
    <item>
      <title>How To Pull The Images on GCP Artifact Registry From On-premise K8S</title>
      <dc:creator>ZC</dc:creator>
      <pubDate>Thu, 30 May 2024 03:25:41 +0000</pubDate>
      <link>https://dev.to/0x2633/how-to-pull-the-images-on-gcp-artifact-registry-from-on-premise-k8s-6o4</link>
      <guid>https://dev.to/0x2633/how-to-pull-the-images-on-gcp-artifact-registry-from-on-premise-k8s-6o4</guid>
      <description>&lt;p&gt;To access Google Cloud Platform (GCP) Artifact Registry from a local Kubernetes cluster using a service account key file, you need to follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Create a GCP Service Account and Key File&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create a Kubernetes Secret with the Service Account Key&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configure Your Kubernetes Deployment to Use the Secret&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pull Images from Artifact Registry&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step-by-Step Guide
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Create a GCP Service Account and Key File
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Create the Service Account&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   gcloud iam service-accounts create my-service-account &lt;span class="nt"&gt;--display-name&lt;/span&gt; &lt;span class="s2"&gt;"My Service Account"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Grant the Necessary Roles to the Service Account&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   gcloud projects add-iam-policy-binding &amp;lt;YOUR-PROJECT-ID&amp;gt; &lt;span class="se"&gt;\&lt;/span&gt;
       &lt;span class="nt"&gt;--member&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"serviceAccount:my-service-account@&amp;lt;YOUR-PROJECT-ID&amp;gt;.iam.gserviceaccount.com"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
       &lt;span class="nt"&gt;--role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"roles/artifactregistry.reader"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;&amp;lt;YOUR-PROJECT-ID&amp;gt;&lt;/code&gt; with your GCP project ID.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Create and Download the Key File&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   gcloud iam service-accounts keys create key.json &lt;span class="se"&gt;\&lt;/span&gt;
       &lt;span class="nt"&gt;--iam-account&lt;/span&gt; my-service-account@&amp;lt;YOUR-PROJECT-ID&amp;gt;.iam.gserviceaccount.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Create a Kubernetes Secret with the Service Account Key
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Create the Secret&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   kubectl create secret docker-registry gcp-artifact-registry &lt;span class="se"&gt;\&lt;/span&gt;
       &lt;span class="nt"&gt;--docker-server&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;LOCATION-docker.pkg.dev &lt;span class="se"&gt;\&lt;/span&gt;
       &lt;span class="nt"&gt;--docker-username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;_json_key &lt;span class="se"&gt;\&lt;/span&gt;
       &lt;span class="nt"&gt;--docker-password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;key.json&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
       &lt;span class="nt"&gt;--docker-email&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your-email@example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;LOCATION&lt;/code&gt; with the location of your Artifact Registry (e.g., &lt;code&gt;us-central1&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;your-email@example.com&lt;/code&gt; with your email.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. Configure Your Kubernetes Deployment to Use the Secret
&lt;/h4&gt;

&lt;p&gt;Update your Kubernetes deployment YAML to reference the secret for pulling images.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Update Deployment YAML&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&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;apps/v1&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;Deployment&lt;/span&gt;
   &lt;span class="na"&gt;metadata&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;my-app&lt;/span&gt;
   &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
     &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
     &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
       &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
         &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-app&lt;/span&gt;
     &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
       &lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
         &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
           &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-app&lt;/span&gt;
       &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
         &lt;span class="na"&gt;containers&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;my-app&lt;/span&gt;
           &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY/IMAGE:TAG&lt;/span&gt;
           &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
           &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;containerPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8080&lt;/span&gt;
         &lt;span class="na"&gt;imagePullSecrets&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;gcp-artifact-registry&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the placeholders:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;LOCATION&lt;/code&gt; with your Artifact Registry location (e.g., &lt;code&gt;us-central1&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PROJECT-ID&lt;/code&gt; with your GCP project ID.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;REPOSITORY&lt;/code&gt; with the name of your repository.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;IMAGE:TAG&lt;/code&gt; with the specific image and tag you want to use.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Apply the Deployment&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; deployment.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  4. Verify the Setup
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check the Deployment Status&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   kubectl get pods
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Describe a Pod to Verify Image Pull&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   kubectl describe pod &amp;lt;POD-NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for the events section to see if the image was pulled successfully.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;By following these steps, you configure your local Kubernetes cluster to authenticate with GCP Artifact Registry using a service account key file. This involves creating a service account and key, storing the key as a Kubernetes secret, and updating your deployments to use the secret for image pulls. This setup ensures secure and efficient access to your container images stored in GCP Artifact Registry.&lt;/p&gt;

&lt;h2&gt;
  
  
  Refs
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/artifact-registry/docs/docker/pushing-and-pulling#key" rel="noopener noreferrer"&gt;https://cloud.google.com/artifact-registry/docs/docker/pushing-and-pulling#key&lt;/a&gt;&lt;br&gt;
&lt;a href="https://cloud.google.com/artifact-registry/docs/docker/authentication#json-key" rel="noopener noreferrer"&gt;https://cloud.google.com/artifact-registry/docs/docker/authentication#json-key&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Why Use "kubectl proxy" and What Is The Disadvantage?</title>
      <dc:creator>ZC</dc:creator>
      <pubDate>Fri, 26 Apr 2024 06:37:23 +0000</pubDate>
      <link>https://dev.to/0x2633/why-use-kubectl-proxy-and-what-is-the-disadvantage-ll4</link>
      <guid>https://dev.to/0x2633/why-use-kubectl-proxy-and-what-is-the-disadvantage-ll4</guid>
      <description>&lt;p&gt;The &lt;code&gt;kubectl proxy&lt;/code&gt; command creates a proxy server or API proxy on your local machine that provides an API gateway to the Kubernetes API server. This proxy server provides an intermediate link between your local setup and the Kubernetes API, handling the authentication process to allow you to interact with the cluster without needing to explicitly manage credentials for each request.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Use &lt;code&gt;kubectl proxy&lt;/code&gt;?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Simplified Access&lt;/strong&gt;: It simplifies access to the Kubernetes API without needing to manage authentication tokens directly in your client code. &lt;code&gt;kubectl proxy&lt;/code&gt; handles authentication to the Kubernetes API for you, making it easier to interact with the cluster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Development and Testing&lt;/strong&gt;: It's particularly useful in development environments when you need to frequently interact with the Kubernetes API. You can easily query the API, inspect different parts of the cluster, or debug your applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Security&lt;/strong&gt;: Using &lt;code&gt;kubectl proxy&lt;/code&gt; can improve security because it restricts API access to the services that are accessible from the local machine. It provides a more secure way to access the cluster internals without exposing them to the outside network.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;API Exploration&lt;/strong&gt;: If you're developing applications that interact with Kubernetes, or if you're just learning the Kubernetes API, &lt;code&gt;kubectl proxy&lt;/code&gt; provides a quick and secure way to explore the API. It allows you to browse the REST API of Kubernetes via a web browser or use standard tools like &lt;code&gt;curl&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  When to Use &lt;code&gt;kubectl proxy&lt;/code&gt;?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Development and Debugging&lt;/strong&gt;: When developing or debugging applications that interact with Kubernetes, using &lt;code&gt;kubectl proxy&lt;/code&gt; can provide easy and secure access to the cluster API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Accessing the Kubernetes Dashboard&lt;/strong&gt;: If you're using the Kubernetes Web UI (Dashboard), &lt;code&gt;kubectl proxy&lt;/code&gt; can provide access to the dashboard without exposing it to the public internet. You can run the proxy and then navigate to the dashboard URL provided by the proxy in your browser.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Quick API Access for Scripts and Local Testing&lt;/strong&gt;: For scripts or local testing scenarios where you might need to interact with the Kubernetes API, &lt;code&gt;kubectl proxy&lt;/code&gt; can facilitate this interaction without complex configuration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Educational Purposes&lt;/strong&gt;: When learning how Kubernetes works and how to interact with its API, running &lt;code&gt;kubectl proxy&lt;/code&gt; allows you to explore API endpoints directly from your browser or command line.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How to Use &lt;code&gt;kubectl proxy&lt;/code&gt;?
&lt;/h3&gt;

&lt;p&gt;Here is a basic example of how to start &lt;code&gt;kubectl proxy&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;kubectl proxy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command starts the proxy at &lt;code&gt;localhost:8001&lt;/code&gt;. Once the proxy is running, you can access the API at &lt;code&gt;http://localhost:8001/api/&lt;/code&gt;. For example, to get details about the Kubernetes nodes via the API, you could use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl http://localhost:8001/api/v1/nodes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or simply use your web browser to navigate to &lt;code&gt;http://localhost:8001/api/v1/nodes&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the disadvantage of it?
&lt;/h2&gt;

&lt;p&gt;While &lt;code&gt;kubectl proxy&lt;/code&gt; is a helpful tool for interfacing with the Kubernetes API in various scenarios, it does have some limitations and disadvantages that might affect its suitability for certain uses:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Limited to Local Access&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;kubectl proxy&lt;/code&gt; runs on the local machine and does not natively support remote access. This makes it less suitable for environments where access from different network locations is required unless additional network configurations (like VPNs or port forwarding) are set up.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Not Suitable for Production Use&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Due to its nature as a development tool, &lt;code&gt;kubectl proxy&lt;/code&gt; is not designed for production use. It lacks the robustness, scalability, and security features needed for safe production environments.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;Performance Overhead&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Running &lt;code&gt;kubectl proxy&lt;/code&gt; can introduce an additional layer of overhead because it acts as an intermediate proxy server. This might not be significant for small-scale or development environments but can become noticeable with extensive API interactions or large-scale operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Security Implications&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;While &lt;code&gt;kubectl proxy&lt;/code&gt; provides a secure way to access the Kubernetes API by handling authentication locally, it also means that any application running on your local machine could potentially access the Kubernetes API through the proxy. This could pose a security risk if the local environment is compromised.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. &lt;strong&gt;Simplicity with Limitations&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;kubectl proxy&lt;/code&gt; simplifies access by handling authentication, but it also means that more complex authentication scenarios (e.g., using different credentials for different parts of the API) are harder to manage directly through the proxy.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. &lt;strong&gt;No Built-in Load Balancing&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;kubectl proxy&lt;/code&gt; provides a straightforward connection to the Kubernetes API but does not handle load balancing or failover for the Kubernetes API servers. This means it is less resilient to API server failures compared to more sophisticated proxy or API gateway solutions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  7. &lt;strong&gt;Dependency on kubectl&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The proxy's availability and functionality are tied to the &lt;code&gt;kubectl&lt;/code&gt; command line tool, which may not always be ideal or convenient, especially in automated scripts or environments where minimal dependencies are preferred.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  8. &lt;strong&gt;Limited Customization&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;kubectl proxy&lt;/code&gt; offers limited options for customization. Unlike full-featured API gateways or custom proxy servers, you cannot configure things like custom headers, caching policies, or detailed logging.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  When to Consider Alternatives:
&lt;/h3&gt;

&lt;p&gt;Given these limitations, for scenarios that require high availability, secure remote access, or are intended for production environments, it's advisable to look into more robust solutions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dedicated API gateways (e.g., Kong, Tyk)&lt;/li&gt;
&lt;li&gt;Cloud provider-specific solutions (e.g., AWS API Gateway, Azure API Management)&lt;/li&gt;
&lt;li&gt;Advanced ingress controllers in Kubernetes (e.g., NGINX Ingress, Traefik) that offer more control, scalability, and security features.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In summary, while &lt;code&gt;kubectl proxy&lt;/code&gt; is excellent for development, testing, and learning purposes, it is not suitable for production environments or situations requiring advanced configuration and robust access management.&lt;/p&gt;

&lt;p&gt;In summary, &lt;code&gt;kubectl proxy&lt;/code&gt; is a useful tool for safely interacting with the Kubernetes API, especially during development, debugging, and learning phases. It offers a straightforward way to communicate with your cluster without complex authentication management.&lt;/p&gt;

</description>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Why does"etcd" Matter In Kubernetes?</title>
      <dc:creator>ZC</dc:creator>
      <pubDate>Fri, 26 Apr 2024 05:51:49 +0000</pubDate>
      <link>https://dev.to/0x2633/why-etcd-is-matter-in-kubernetes-48cn</link>
      <guid>https://dev.to/0x2633/why-etcd-is-matter-in-kubernetes-48cn</guid>
      <description>&lt;p&gt;&lt;code&gt;etcd&lt;/code&gt; is a critical component primarily used in distributed systems, providing consistent and highly available key-value storage. Below are several key reasons and the importance of using &lt;code&gt;etcd&lt;/code&gt;:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Coordination and State Management in Distributed Systems&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;etcd&lt;/strong&gt; offers a reliable way to store and synchronize crucial data in distributed systems. This is vital for managing cluster states, configuration information, and coordinating distributed deployments.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Consistency Guarantees&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;etcd&lt;/strong&gt; is designed based on the Raft consensus algorithm, which maintains strong data consistency across cluster nodes. Even in the case of network partitions or node failures involving multiple nodes, &lt;code&gt;etcd&lt;/code&gt; ensures that data is not lost and automatically restores data consistency when the cluster resumes normal operation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;Backing Store for Kubernetes&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;In Kubernetes clusters, &lt;code&gt;etcd&lt;/code&gt; serves as the backing store for all cluster data. This includes the states of pods, services, secrets, and configuration data. The reliability of this information directly affects the stability and operability of the Kubernetes cluster.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Service Discovery and Configuration Management&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;etcd&lt;/code&gt; can be used for service discovery and configuration management. Due to its high availability and consistency characteristics, many distributed applications and services use &lt;code&gt;etcd&lt;/code&gt; to store configuration information and service location details for quick and reliable querying.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. &lt;strong&gt;Locks and Leader Election&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;etcd&lt;/code&gt; provides distributed locks and leader election mechanisms. These are crucial for handling distributed computations and ensuring that operations across multiple processing nodes are serialized, ensuring process order and consistency.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. &lt;strong&gt;Easy Integration and Language Agnosticism&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;etcd&lt;/code&gt; provides an HTTP/JSON API, which allows for easy integration with various programming languages and environments. Its openness and extensibility enable developers to use &lt;code&gt;etcd&lt;/code&gt; flexibly according to their needs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In summary, &lt;code&gt;etcd&lt;/code&gt; is an indispensable component in distributed systems, especially in environments that require &lt;strong&gt;high consistency&lt;/strong&gt; and &lt;strong&gt;reliability&lt;/strong&gt;. Its design philosophy is to address critical issues in distributed environments, such as &lt;strong&gt;data consistency&lt;/strong&gt;, &lt;strong&gt;service discovery&lt;/strong&gt;, &lt;strong&gt;state management&lt;/strong&gt;, and &lt;strong&gt;multi-node synchronization&lt;/strong&gt;. In Kubernetes and other systems that require strong consistency guarantees, the role of &lt;code&gt;etcd&lt;/code&gt; is particularly important.&lt;/p&gt;

</description>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Install K8S On Rocky Linux by A Shell Script</title>
      <dc:creator>ZC</dc:creator>
      <pubDate>Tue, 09 Apr 2024 03:23:58 +0000</pubDate>
      <link>https://dev.to/0x2633/install-k8s-on-rocky-linux-by-a-shell-script-oe9</link>
      <guid>https://dev.to/0x2633/install-k8s-on-rocky-linux-by-a-shell-script-oe9</guid>
      <description>&lt;p&gt;I recently had to install &lt;a href="https://kubernetes.io/" rel="noopener noreferrer"&gt;Kubernetes&lt;/a&gt; on our on-premise servers. Sure, there were a lot of instructions on the internet that people shared. However, I am a lazy guy. I like to do anything as simple as possible so that I create a shell script depending on the &lt;a href="https://phoenixnap.com/kb/install-kubernetes-on-rocky-linux" rel="noopener noreferrer"&gt;website&lt;/a&gt;.&lt;br&gt;
I have pushed it into my &lt;a href="https://github.com/u2633/rocky-linux-k8s-installer" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt;. Be lazy...&lt;/p&gt;

</description>
      <category>linux</category>
      <category>kubernetes</category>
      <category>lazy</category>
    </item>
  </channel>
</rss>
