<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ansil H on Medium]]></title>
        <description><![CDATA[Stories by Ansil H on Medium]]></description>
        <link>https://medium.com/@ansilh?source=rss-b2f31c191304------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*t11Orijbe6lOZPkZ2M3_XA.jpeg</url>
            <title>Stories by Ansil H on Medium</title>
            <link>https://medium.com/@ansilh?source=rss-b2f31c191304------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 10:47:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ansilh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Mastering Automated Certificate Management with Gateway API and cert-manager]]></title>
            <link>https://medium.com/@ansilh/mastering-automated-certificate-management-with-gateway-api-and-cert-manager-8c17c0ef76e4?source=rss-b2f31c191304------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c17c0ef76e4</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Ansil H]]></dc:creator>
            <pubDate>Tue, 24 Jun 2025 16:25:13 GMT</pubDate>
            <atom:updated>2025-06-24T16:25:13.619Z</atom:updated>
            <content:encoded><![CDATA[<p>Building upon our setup from <a href="https://medium.com/techbeatly/revolutionizing-kubernetes-traffic-management-the-gateway-to-the-future-b1b23d175b88">Part 1</a> where we installed <a href="https://kgateway.dev/">kgateway</a> as our Gateway API, we now dive into the next phase: automating SSL certificate management.</p><p>This advanced configuration transforms your gateway from a basic traffic router into a production-ready, security-focused infrastructure component that handles certificate lifecycle management seamlessly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*DGEOsSZcdHWSHmE7.gif" /><figcaption>Kgateway + Cert-Manger + ACME</figcaption></figure><h3>Prerequisites</h3><p>Before proceeding with this guide, ensure you have completed the initial Gateway API setup from our previous article <a href="https://medium.com/techbeatly/revolutionizing-kubernetes-traffic-management-the-gateway-to-the-future-b1b23d175b88">Part 1</a>. Additionally, if you’re working within an internal network environment, you’ll need access to an ACME server. For setting up an internal ACME server, refer to this comprehensive guide on <a href="https://medium.com/@ansilh/setting-up-your-own-acme-server-with-step-ca-a-complete-guide-73919de86382">setting up your own ACME server with Step CA</a>.</p><h3>Installing cert-manager with Gateway API Support</h3><p>The cornerstone of automated certificate management in Kubernetes is cert-manager. However, to leverage its capabilities with Gateway API, we must enable the appropriate flags during installation. You can follow below helm command to perform the installation.</p><pre>helm repo add jetstack https://charts.jetstack.io<br><br>helm install \<br>  cert-manager jetstack/cert-manager \<br>  --namespace cert-manager \<br>  --create-namespace \<br>  --version v1.18.0 \<br>  --set crds.enabled=true \<br>  --set config.enableGatewayAPI=true</pre><p><strong>Note</strong>: The --set config.enableGatewayAPI=true flag is essential for cert-manager to interact with Gateway resources.</p><p>Verify the successful deployment by checking pod status:</p><pre>kubectl get pods -n cert-manager<br><br>NAME                                       READY   STATUS    RESTARTS   AGE<br>cert-manager-65d9f9468d-bqt99              1/1     Running   0          100s<br>cert-manager-cainjector-5f6f659459-xd4n7   1/1     Running   0          100s<br>cert-manager-webhook-75d4c8db8b-cxbzp      1/1     Running   0          100s</pre><h3>Configuring Certificate Issuers</h3><h4>Public Internet Scenarios: Let’s Encrypt Integration</h4><p>For externally accessible Gateway APIs, Let’s Encrypt provides a robust, free certificate authority. The configuration process is well-documented in the <a href="https://cert-manager.io/docs/tutorials/acme/nginx-ingress/#step-6---configure-a-lets-encrypt-issuer">official cert-manager tutorial</a>.</p><h4>Internal Network Scenarios: Private ACME Server Setup</h4><p>For internal environments where external certificate authorities aren’t accessible or desired, a private ACME server becomes necessary. This is where our StepCA setup becomes invaluable.(Refer <a href="https://medium.com/@ansilh/setting-up-your-own-acme-server-with-step-ca-a-complete-guide-73919de86382">setting up your own ACME server with Step CA</a>)</p><p>First, generate the certificate authority bundle that cert-manager will use to trust your private ACME server:</p><pre>sudo cat /opt/step-ca/.step/certs/intermediate_ca.crt /opt/step-ca/conf/root_ca.pem | base64 -w0 &amp;&amp; echo</pre><p>Create the <em>ClusterIssuer</em> resource with your private ACME server configuration:</p><pre>kubectl create -f - &lt;&lt;EOF<br>apiVersion: cert-manager.io/v1<br>kind: ClusterIssuer<br>metadata:<br>  name: stepca<br>spec:<br>  acme:<br>    email: ansil@ansil-lab.io<br>    privateKeySecretRef:<br>      name: stepca-issuer-account-key<br>    server: https://ca.ansil-lab.io:8443/acme/acme/directory<br>    caBundle: xxxxxxxxxxxxxxx # Replace with your generated caBundle<br>    solvers:<br>    - http01:<br>        gatewayHTTPRoute:<br>          parentRefs:<br>          - kind: Gateway<br>            name: kgateway<br>            namespace: kgateway-system<br>EOF</pre><p>Verify the <em>ClusterIssuer</em> registration:</p><pre>kubectl describe clusterissuer stepca</pre><p>Look for the ACMEAccountRegistered status in the output:</p><pre>Status:<br>  Acme:<br>    Last Private Key Hash:  xxxxx<br>    Last Registered Email:  ansil@ansil-lab.io<br>    Uri:                    https://ca.ansil-lab.io:8443/acme/acme/account/xxxxxx<br>  Conditions:<br>    Last Transition Time:  2025-06-18T23:29:01Z<br>    Message:               The ACME account was registered with the ACME server<br>    Observed Generation:   1<br>    Reason:                ACMEAccountRegistered &lt;&lt;-------<br>    Status:                True<br>    Type:                  Ready</pre><h3>Enhancing Your Gateway Configuration</h3><p>Now we’ll modify the Gateway resource created in <a href="https://medium.com/techbeatly/revolutionizing-kubernetes-traffic-management-the-gateway-to-the-future-b1b23d175b88">Part 1</a> to support automated SSL certificate management. <strong>The key additions include the cert-manager annotation and HTTPS listener configuration.</strong></p><pre>kubectl edit gateway httpbin -n kgateway-system</pre><p>Update your Gateway specification:</p><pre>apiVersion: gateway.networking.k8s.io/v1<br>kind: Gateway<br>metadata:<br>  annotations:<br>    cert-manager.io/cluster-issuer: stepca  #&lt;&lt;--- Links to our ClusterIssuer<br>  name: httpbin<br>  namespace: kgateway-system<br>spec:<br>  gatewayClassName: kgateway<br>  infrastructure:<br>    parametersRef:<br>      group: gateway.kgateway.dev<br>      kind: GatewayParameters<br>      name: httpbin-kgateway-parameters<br>  listeners:<br>  - allowedRoutes:<br>      namespaces:<br>        from: All<br>    name: http<br>    port: 80<br>    protocol: HTTP<br>  - allowedRoutes:      #&lt;--- New HTTPS listener<br>      namespaces:<br>        from: All<br>    hostname: httpbin.ansil-lab.io<br>    name: https<br>    port: 443<br>    protocol: HTTPS<br>    tls:<br>      certificateRefs:<br>      - group: &quot;&quot;<br>        kind: Secret<br>        name: httpbin-ansil-lab-io-tls<br>      mode: Terminate #&lt;--- We are terminating SSL on gateway</pre><h3>Understanding the Automation Process</h3><p>Upon saving the Gateway configuration, cert-manager initiates the ACME challenge process automatically. During HTTP-01 validation, you’ll observe a temporary <em>HTTPRoute</em> resource appear in your cluster. This route handles the ACME challenge verification and disappears once the process completes successfully.</p><p>The certificate and private key are stored in the specified Kubernetes Secret (httpbin-ansil-lab-io-tls in our example), making them immediately available to your Gateway for SSL termination.</p><p>The kgateway controller will pickup the certificate from the secret and reprograms the gateway pod.</p><p>Kgateway uses envoy, so you would be able to see the config with below steps.</p><pre>kubectl port-forward pod/http-76686b4d99-g66t9 -n kgateway-system 19000 &amp;</pre><p>You will be able to quickly identify some of the relevant configs based on the Gateway spec we have.</p><pre>...<br>...<br>                {<br>                  &quot;filter_chain_match&quot;: {<br>                    &quot;server_names&quot;: [<br>                      &quot;httpbin.ansil-lab.io&quot; &lt;&lt;&lt;---- hostname<br>                    ]<br>                  },<br>                  &quot;filters&quot;: [<br>...<br>                  &quot;transport_socket&quot;: {<br>                    &quot;name&quot;: &quot;envoy.transport_sockets.tls&quot;,<br>                    &quot;typed_config&quot;: {<br>                      &quot;@type&quot;: &quot;type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext&quot;,<br>                      &quot;common_tls_context&quot;: {<br>                        &quot;tls_params&quot;: {},<br>                        &quot;tls_certificates&quot;: [ &lt;&lt;&lt;---- cert and key from secrets (from cert-manager)<br>                          {<br>                            &quot;certificate_chain&quot;: {<br>                              &quot;inline_bytes&quot;: &quot;&lt;base64 encoded certs&gt;<br>...<br>...</pre><h3>Verification and Testing</h3><p>Once the certificate provisioning completes, verify HTTPS connectivity to your application. You can also inspect the certificate details using OpenSSL:</p><pre>openssl s_client -showcerts -connect httpbin.ansil-lab.io:443 -verify_return_error 2&gt;/dev/null | openssl x509 -noout -text | grep DNS:</pre><p>Expected output:</p><pre>DNS:httpbin.ansil-lab.io</pre><h3>Advanced Configuration: Multiple Host names</h3><p>The Gateway API’s flexibility shines when managing multiple host names. Adding additional HTTPS listeners automatically triggers certificate provisioning for each unique host name:</p><pre>- allowedRoutes:<br>    namespaces:<br>      from: All<br>  hostname: httpbin-2.ansil-lab.io<br>  name: https-2<br>  port: 443<br>  protocol: HTTPS<br>  tls:<br>    certificateRefs:<br>    - group: &quot;&quot;<br>      kind: Secret<br>      name: httpbin-2-ansil-lab-io-tls<br>    mode: Terminate</pre><p>Each host name receives its own certificate, stored in a dedicated Kubernetes Secret, providing granular security management.</p><p>You can verify that using below command:</p><pre>openssl s_client -showcerts -connect httpbin-2.ansil-lab.io:443 -verify_return_error 2&gt;/dev/null | openssl x509 -noout -text | grep DNS:</pre><pre>DNS:httpbin-2.ansil-lab.io</pre><h3>Complete Gateway Configuration</h3><p>Here’s the final Gateway specification supporting multiple host names with automated certificate management:</p><pre>apiVersion: gateway.networking.k8s.io/v1<br>kind: Gateway<br>metadata:<br>  annotations:<br>    cert-manager.io/cluster-issuer: stepca<br>  name: httpbin<br>  namespace: kgateway-system<br>spec:<br>  gatewayClassName: kgateway<br>  infrastructure:<br>    parametersRef:<br>      group: gateway.kgateway.dev<br>      kind: GatewayParameters<br>      name: httpbin-kgateway-parameters<br>  listeners:<br>  - allowedRoutes:<br>      namespaces:<br>        from: All<br>    name: http<br>    port: 80<br>    protocol: HTTP<br>  - allowedRoutes:<br>      namespaces:<br>        from: All<br>    hostname: httpbin.ansil-lab.io<br>    name: https<br>    port: 443<br>    protocol: HTTPS<br>    tls:<br>      certificateRefs:<br>      - group: &quot;&quot;<br>        kind: Secret<br>        name: httpbin-ansil-lab-io-tls<br>      mode: Terminate<br>  - allowedRoutes:<br>      namespaces:<br>        from: All<br>    hostname: httpbin-2.ansil-lab.io<br>    name: https-2<br>    port: 443<br>    protocol: HTTPS<br>    tls:<br>      certificateRefs:<br>      - group: &quot;&quot;<br>        kind: Secret<br>        name: httpbin-2-ansil-lab-io-tls<br>      mode: Terminate</pre><h3>Conclusion</h3><p>By integrating cert-manager with Gateway API, we’ve transformed a basic traffic management setup into a production-ready infrastructure that handles SSL certificates seamlessly. This automation eliminates manual certificate management overhead while ensuring consistent security posture across your Kubernetes applications.</p><p>The combination of Gateway API’s modern traffic management capabilities with cert-manager’s robust certificate automation creates a powerful foundation for secure, scalable Kubernetes ingress networking.</p><p><em>This article is part of the series on Kubernetes Gateway API. For the complete setup , start with </em><a href="https://medium.com/techbeatly/revolutionizing-kubernetes-traffic-management-the-gateway-to-the-future-b1b23d175b88"><em>Part 1: Gateway API Installation and Configuration</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c17c0ef76e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up Your Own ACME Server with Step-CA: A Complete Guide]]></title>
            <link>https://medium.com/@ansilh/setting-up-your-own-acme-server-with-step-ca-a-complete-guide-73919de86382?source=rss-b2f31c191304------2</link>
            <guid isPermaLink="false">https://medium.com/p/73919de86382</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[ingress]]></category>
            <category><![CDATA[ssl]]></category>
            <dc:creator><![CDATA[Ansil H]]></dc:creator>
            <pubDate>Fri, 20 Jun 2025 22:05:34 GMT</pubDate>
            <atom:updated>2025-07-10T07:33:41.194Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s security-conscious world, managing certificates for your internal services can be challenging. The Automated Certificate Management Environment (ACME) protocol has remodeled the certificate management by automating the issuance and renewal processes. While Let’s Encrypt is the most well-known ACME service provider, running your own private ACME server gives you greater control over your certificates and eliminates the limitations of public Certificate Authorities (CAs).</p><p>This guide will walk you through setting up Step-CA, an open-source certificate authority that supports the ACME protocol, allowing you to create an internal PKI system for your local network. By the end, you’ll have a fully functional ACME server capable of issuing certificates for your internal services without relying on external providers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*sfQ6g1WKVwQNOWeQ-_S0LQ.gif" /><figcaption>ACME client / server interaction</figcaption></figure><h3>Why Run Your Own ACME Server?</h3><p>Running your own ACME server with Step-CA offers several advantages:</p><ul><li><strong>Complete control over certificate issuance lifetimes.</strong></li><li><strong>Ability to issue certificates for internal hosts that public CAs won’t/can’t validate.</strong></li><li><strong>No rate limits or restrictions imposed by public CAs.</strong></li><li><strong>Automated certificate management for your internal infrastructure.</strong></li></ul><h3>Prerequisites</h3><p>Before we begin, ensure you have:</p><ul><li>A Linux server with root access</li><li>Basic understanding of PKI concepts</li><li>Internet connectivity for downloading required packages</li></ul><h3>Step-by-Step Installation Guide</h3><h3>1. Create Directory Structure.</h3><p>First, let’s create the necessary directories for our Step-CA installation:</p><pre>mkdir -p /opt/step-ca/{bin,conf}</pre><h3>2. Set Up Certificate Tools.</h3><p>Navigate to the configuration directory and download the CFSSL tools, which we’ll use to create our initial root CA certificates:</p><pre>cd /opt/step-ca/conf</pre><pre>curl -L --fail --remote-name-all https://github.com/cloudflare/cfssl/releases/download/v1.6.5/{cfssl_1.6.5_linux_amd64,cfssljson_1.6.5_linux_amd64,cfssl_1.6.5_checksums.txt}<br>sha256sum -c --ignore-missing cfssl_1.6.5_checksums.txt &amp;&amp; rm cfssl_1.6.5_checksums.txt</pre><p>Make the downloaded binaries executable and move them to a location in your PATH:</p><pre>chmod +x cfssl_1.6.5_linux_amd64 cfssljson_1.6.5_linux_amd64<br>sudo mv cfssl_1.6.5_linux_amd64 /usr/local/bin/cfssl<br>sudo mv cfssljson_1.6.5_linux_amd64 /usr/local/bin/cfssljson</pre><p>Verify the installation:</p><pre>cfssl version</pre><h3>3. Create Certificate Authority Configuration.</h3><p>Generate default configuration files for our root CA:</p><pre>cfssl print-defaults config &gt; root_ca-config.json<br>cfssl print-defaults csr &gt; root_ca-csr.json</pre><p>You can customize these configuration files according to your requirements before proceeding. Once ready, initialize the CA:</p><pre>cfssl gencert -initca root_ca-csr.json | cfssljson -bare root_ca</pre><h3>4. Create Password File.</h3><p>Generate a random password for the Step-CA <em>systemd</em> service:</p><pre>head /dev/urandom | tr -dc A-Za-z0-9 | head -c10 &gt; password.txt</pre><h3>5. Download StepCA Binaries.</h3><p>Download and extract the Step CLI and Step-CA server binaries:</p><pre>curl -L --fail --remote-name-all https://dl.smallstep.com/gh-release/cli/gh-release-header/v0.28.6/{step_linux_0.28.6_amd64.tar.gz,checksums.txt}<br>sha256sum -c --ignore-missing checksums.txt &amp;&amp; rm checksums.txt</pre><pre>tar -xvf step_linux_0.28.6_amd64.tar.gz -C ../bin step_0.28.6/bin/step --strip-components=2 &amp;&amp; rm step_linux_0.28.6_amd64.tar.gz</pre><pre>curl -L --fail --remote-name-all https://dl.smallstep.com/gh-release/certificates/gh-release-header/v0.28.3/{step-ca_linux_0.28.3_amd64.tar.gz,checksums.txt}<br>sha256sum -c --ignore-missing checksums.txt &amp;&amp; rm checksums.txt</pre><pre>tar -xvf step-ca_linux_0.28.3_amd64.tar.gz -C ../bin step-ca &amp;&amp; rm step-ca_linux_0.28.3_amd64.tar.gz</pre><p>Verify the extracted binaries:</p><pre>ls -l ../bin/</pre><p>Expected output:</p><pre>total 90640<br>-rwxr-xr-x 1 1001 118 41771056 Mar 18 02:33 step<br>-rwxr-xr-x 1 1001 118 51037125 Mar 18 16:02 step-ca</pre><h3>6. Initialize StepCA.</h3><p>Set up the Step-CA environment and initialize it with our root CA:</p><blockquote>Adjust the flags for your setup</blockquote><pre>export STEPPATH=/opt/step-ca/.step<br>../bin/step path<br>/opt/step-ca/bin/step ca init \<br>    --root=/opt/step-ca/conf/root_ca.pem \<br>    --key=/opt/step-ca/conf/root_ca-key.pem \<br>    --deployment-type=standalone \<br>    --name=AnsilsLab \<br>    --dns=ca.ansil-lab.io \<br>    --address=:8443 \<br>    --provisioner=jwk \<br>    --password-file=/opt/step-ca/conf/password.txt \<br>    --acme</pre><p>The initialization process will output details about your new CA setup, including paths to certificates and configuration files.</p><p>The output should look similar to:</p><pre>Copying root certificate... done!<br>Generating intermediate certificate... done!<br><br>✔ Root certificate: /opt/step-ca/.step/certs/root_ca.crt<br>✔ Root private key: /opt/step-ca/.step/secrets/root_ca_key<br>✔ Root fingerprint: 7259684937b23ca2bf0d8b2beb28c7fc6bc1306bdb30fe772b5d32304560a19b<br>✔ Intermediate certificate: /opt/step-ca/.step/certs/intermediate_ca.crt<br>✔ Intermediate private key: /opt/step-ca/.step/secrets/intermediate_ca_key<br>✔ Database folder: /opt/step-ca/.step/db<br>✔ Default configuration: /opt/step-ca/.step/config/defaults.json<br>✔ Certificate Authority configuration: /opt/step-ca/.step/config/ca.json<br><br>Your PKI is ready to go. To generate certificates for individual services see &#39;step help ca&#39;.<br><br>FEEDBACK 😍 🍻<br>  The step utility is not instrumented for usage statistics. It does not phone<br>  home. But your feedback is extremely valuable. Any information you can provide<br>  regarding how you’re using `step` helps. Please send us a sentence or two,<br>  good or bad at feedback@smallstep.com or join GitHub Discussions<br>  https://github.com/smallstep/certificates/discussions and our Discord <br>  https://u.step.sm/discord.</pre><h3>7. Create Systemd Unit File.</h3><p>Create a <em>systemd</em> unit file to manage the Step-CA service:</p><pre>cat &gt;/etc/systemd/system/step-ca.service &lt;&lt;&#39;EOF&#39;<br>[Unit]<br>Description=step-ca service<br>Documentation=https://smallstep.com/docs/step-ca<br>Documentation=https://smallstep.com/docs/step-ca/certificate-authority-server-production<br>After=network-online.target<br>Wants=network-online.target<br>StartLimitIntervalSec=30<br>StartLimitBurst=3<br>ConditionFileNotEmpty=/opt/step-ca/.step/config/ca.json<br>ConditionFileNotEmpty=/opt/step-ca/conf/password.txt<br><br>[Service]<br>Type=simple<br>Environment=STEPPATH=/opt/step-ca<br>WorkingDirectory=/opt/step-ca<br>ExecStart=/opt/step-ca/bin/step-ca .step/config/ca.json --password-file conf/password.txt<br>ExecReload=/bin/kill --signal HUP $MAINPID<br>Restart=on-failure<br>RestartSec=5<br>TimeoutStopSec=30<br>StartLimitInterval=30<br>StartLimitBurst=3<br><br>; Process capabilities &amp; privileges<br>AmbientCapabilities=CAP_NET_BIND_SERVICE<br>CapabilityBoundingSet=CAP_NET_BIND_SERVICE<br>SecureBits=keep-caps<br>NoNewPrivileges=yes<br><br>; Sandboxing<br>ProtectSystem=full<br>ProtectHome=true<br>RestrictNamespaces=true<br>RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6<br>PrivateTmp=true<br>PrivateDevices=true<br>ProtectClock=true<br>ProtectControlGroups=true<br>ProtectKernelTunables=true<br>ProtectKernelLogs=true<br>ProtectKernelModules=true<br>LockPersonality=true<br>RestrictSUIDSGID=true<br>RemoveIPC=true<br>RestrictRealtime=true<br>SystemCallFilter=@system-service<br>SystemCallArchitectures=native<br>MemoryDenyWriteExecute=true<br>ReadWriteDirectories=/opt/step-ca/.step/db<br><br>[Install]<br>WantedBy=multi-user.target<br>EOF</pre><p>This <em>systemd</em> unit file is adjusted to run in an internal, non-critical environment. Consider to use the file from <a href="https://github.com/smallstep/certificates/blob/master/systemd/step-ca.service">https://github.com/smallstep/certificates/blob/master/systemd/step-ca.service</a> if you want more security and isolation.</p><h3>8. Start and Enable the Service</h3><p>Reload systemd, enable the service to start at boot, and check its status:</p><pre>systemctl daemon-reload<br>systemctl enable step-ca<br>systemctl status step-ca</pre><p>You should see output indicating that the service is running:</p><pre>● step-ca.service - step-ca service<br>   Loaded: loaded (/etc/systemd/system/step-ca.service; enabled; preset: enabled)<br>   Active: active (running) since Wed 2025-06-18 22:26:30 UTC; 25s ago<br>     Docs: https://smallstep.com/docs/step-ca<br>       https://smallstep.com/docs/step-ca/certificate-authority-server-production<br>   Main PID: 8998 (step-ca)<br>    Tasks: 9 (limit: 4654)<br>   Memory: 13.1M (peak: 13.6M)<br>    CPU: 135ms<br>   CGroup: /system.slice/step-ca.service<br>       └─8998 /opt/step-ca/bin/step-ca .step/config/ca.json --password-file conf/password.txt<br><br>Jun 18 22:26:30 k8s-master step-ca[^8998]: badger 2025/06/18 22:26:30 INFO: All 0 tables opened in 0s<br>Jun 18 22:26:30 k8s-master step-ca[^8998]: 2025/06/18 22:26:30 Building new tls configuration using step-ca x509 Signer Interface<br>Jun 18 22:26:30 k8s-master step-ca[^8998]: 2025/06/18 22:26:30 Starting Smallstep CA/0.28.3 (linux/amd64)<br>Jun 18 22:26:30 k8s-master step-ca[^8998]: 2025/06/18 22:26:30 Documentation: https://u.step.sm/docs/ca<br>Jun 18 22:26:30 k8s-master step-ca[^8998]: 2025/06/18 22:26:30 Community Discord: https://u.step.sm/discord<br>Jun 18 22:26:30 k8s-master step-ca[^8998]: 2025/06/18 22:26:30 Config file: .step/config/ca.json<br>Jun 18 22:26:30 k8s-master step-ca[^8998]: 2025/06/18 22:26:30 The primary server URL is https://ca.ansil-lab.io:8443<br>Jun 18 22:26:30 k8s-master step-ca[^8998]: 2025/06/18 22:26:30 Root certificates are available at https://ca.ansil-lab.io:8443/roots.pem<br>Jun 18 22:26:30 k8s-master step-ca[^8998]: 2025/06/18 22:26:30 X.509 Root Fingerprint: 7259684937b23ca2bf0d8b2beb28c7fc6bc1306bdb30fe772b5d32304560a19b<br>Jun 18 22:26:30 k8s-master step-ca[^8998]: 2025/06/18 22:26:30 Serving HTTPS on :8443 ...</pre><h3>Using Your ACME Server</h3><p>Now that your Step-CA server is running, you can use it with any ACME client to request certificates.</p><p>To configure an ACME client to use your Step-CA server:</p><ol><li>Point the client to your ACME directory URL: <a href="https://ca.ansil-lab.io:8443/acme/acme/directory">https://ca.ansil-lab.io:8443/acme/acme/directory</a></li><li>Configure the client to trust your root certificate.</li></ol><p>You can read the <a href="https://medium.com/@ansilh/mastering-automated-certificate-management-with-gateway-api-and-cert-manager-8c17c0ef76e4">next article</a> that covers ACME setup for Kubernetes Gateway API. If you want a refresher for Gateway API, please read the <a href="https://medium.com/techbeatly/revolutionizing-kubernetes-traffic-management-the-gateway-to-the-future-b1b23d175b88">previous articl</a>e.</p><h3>Limitations and Considerations</h3><p>While the open-source version of Step-CA provides powerful certificate management capabilities, it’s important to note some limitations:</p><ul><li>The open-source version does not support External Account Binding (EAB), which is used by some commercial CAs to link ACME accounts with external accounts</li><li>It uses a two-tier PKI with one root CA and one intermediate CA.</li><li>For high-availability deployments, you may need to consider additional configuration</li></ul><p>For enterprise environments with more complex requirements, SmallStep offers a commercial version with additional features like multiple CAs, active revocation, and ACME External Account Binding.</p><h3>Conclusion</h3><p>You’ve successfully set up your own private ACME server using Step-CA, giving you complete control over certificate issuance for your internal network. This setup allows you to automate certificate management for your services without relying on external providers.</p><p>By running your own CA, you can issue certificates with custom lifetimes, support internal hosts, and integrate certificate management into your existing workflows. The ACME protocol’s standardization means you can use a wide variety of clients with your Step-CA server, making certificate automation accessible across your infrastructure.</p><p>Remember to secure access to your CA server and properly manage your root certificate, as it forms the foundation of trust for your entire PKI system.</p><p><strong>Disclosure: </strong><em>This article presents a technical implementation guide and does not constitute a sponsored content or formal product endorsement. The selection of Step-CA for this tutorial is based primarily on its open-source licensing model, which aligns with the educational objectives of this guide.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73919de86382" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Revolutionizing Kubernetes Traffic Management: The Gateway to the Future]]></title>
            <link>https://medium.com/techbeatly/revolutionizing-kubernetes-traffic-management-the-gateway-to-the-future-b1b23d175b88?source=rss-b2f31c191304------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1b23d175b88</guid>
            <category><![CDATA[future]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cncf]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Ansil H]]></dc:creator>
            <pubDate>Fri, 20 Jun 2025 03:17:03 GMT</pubDate>
            <atom:updated>2025-06-20T03:17:03.994Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you tired of wrestling with Ingress limitations and dreaming of a more powerful, flexible way to manage traffic in your Kubernetes cluster? Get ready for an exciting journey into the future of Kubernetes networking with Gateway API — the game-changing solution that’s about to transform how you think about traffic routing!</p><h3>Why Gateway API is the Kubernetes Networking Revolution You’ve Been Waiting For!</h3><p>The days of basic Ingress are numbered, and for good reason! Gateway API isn’t just an upgrade — it’s a complete paradigm shift that brings enterprise-grade capabilities directly into your Kubernetes cluster. Unlike traditional Ingress which only supports HTTP/HTTPS protocols, Gateway API opens the door to advanced traffic management with support for multiple protocols including TCP, UDP, and HTTP/2, making it the Swiss Army knife of Kubernetes traffic routing.</p><h3>The Power Trio: Role-Oriented Design That Actually Makes Sense.</h3><p>What makes Gateway API truly revolutionary is its thoughtful role-oriented architecture:</p><ul><li><strong>Infrastructure Providers</strong> can define gateway classes and policies</li><li><strong>Cluster Operators</strong> manage gateway instances and security</li><li><strong>Application Developers</strong> focus purely on routing rules</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*otorAlVRevVI7ShEiicK8Q.gif" /><figcaption>Gateway API Role and Personas</figcaption></figure><p>This separation of concerns eliminates the chaos of annotations and vendor-specific configurations that plague traditional Ingress implementations.</p><h3>Meet kgateway: The Envoy-Powered Gateway!</h3><p>Enter kgateway — a feature-rich, lightning-fast Kubernetes-native gateway api controller built on the rock-solid foundation of Envoy proxy. This isn’t just another gateway controller; it’s your ticket to enterprise-grade traffic management with the simplicity of Kubernetes-native resources.</p><h3>Setting Up Gateway API with kgateway: A Practical Guide</h3><p>Let’s walk through the process of implementing Gateway API using kgateway in a Kubernetes environment.</p><h3>Step 1: Installing the Foundation — Gateway API CRDs</h3><p>First, let’s lay the groundwork with the official Gateway API Custom Resource Definitions:</p><pre>kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.1/standard-install.yaml</pre><p>This single command installs the standardized Gateway API resources that work consistently across all implementations — no more vendor lock-in!</p><h3>Step 2: Deploying kgateway</h3><p>Now for the exciting part — installing kgateway using Helm:</p><p>Install kgateway CRDs</p><pre>helm upgrade -i --create-namespace --namespace kgateway-system --version v2.0.1 kgateway-crds oci://cr.kgateway.dev/kgateway-dev/charts/kgateway-crds</pre><p>Install kgateway controller</p><pre>helm upgrade -i --namespace kgateway-system --version v2.0.1 kgateway oci://cr.kgateway.dev/kgateway-dev/charts/kgateway</pre><p>Watch as kgateway springs to life, ready to handle your most demanding traffic scenarios!</p><h3>Step 3 (Optional): Configuring Cilium for LoadBalancer Services</h3><p>This step is applicable only when your cluster is running with Cilium CNI.</p><p>Here’s where things get really exciting — we’re going to enable LoadBalancer services using Cilium’s L2 announcements feature:</p><pre>helm upgrade cilium cilium/cilium --version 1.17.4 \<br>  --set hubble.relay.enabled=true \<br>  --set hubble.ui.enabled=true \<br>  --set l2announcements.enabled=true \<br>  --namespace kube-system</pre><p>This eliminates the need for external tools like MetalLB, giving you native LoadBalancer capabilities!</p><p><strong>Creating Your IP Pool</strong></p><p>Define an IP pool where Cilium will work its magic and make sure you select an IP range that is reserved for Load balancers.</p><pre>kubectl create -f - &lt;&lt;EOF<br>apiVersion: &quot;cilium.io/v2alpha1&quot;<br>kind: CiliumLoadBalancerIPPool<br>metadata:<br>  name: &quot;lb-pool&quot;<br>spec:<br>  blocks:<br>  - start: &quot;192.168.56.150&quot;<br>    stop: &quot;192.168.56.180&quot;<br>EOF</pre><p><strong>The L2 Announcement Policy — Making IPs Accessible</strong></p><p>Enable external access to your LoadBalancer IPs with this elegant policy:</p><pre>kubectl create -f - &lt;&lt;EOF <br>apiVersion: &quot;cilium.io/v2alpha1&quot;<br>kind: CiliumL2AnnouncementPolicy<br>metadata:<br>  name: default<br>spec:<br>  loadBalancerIPs: true<br>EOF</pre><p>This policy makes Cilium respond to ARP requests, seamlessly integrating your cluster with your local network!</p><h3>Gateway API in Action</h3><p>ime for the moment of truth — let’s deploy an application and see Gateway API work its magic!</p><h3>Deploying httpbin — Your Test Application</h3><pre>kubectl apply -f https://raw.githubusercontent.com/kgateway-dev/kgateway/refs/heads/v2.0.x/examples/httpbin.yaml</pre><h3>Creating Your Gateway — The Traffic Entry Point</h3><pre>kubectl apply -f- &lt;&lt;EOF<br>kind: Gateway<br>apiVersion: gateway.networking.k8s.io/v1<br>metadata:<br>  name: httpbin<br>  namespace: kgateway-system<br>spec:<br>  gatewayClassName: kgateway<br>  listeners:<br>  - protocol: HTTP<br>    port: 8080<br>    name: http<br>    allowedRoutes:<br>      namespaces:<br>        from: All<br>EOF</pre><p><strong>Watching Everything Come Together</strong></p><p>After applying the Gateway spec, you will immediately see a new pod coming up inside kgateway-system namespace. At the same time a new LoadBalancer service also comes up. Remember, the EXTERNAL-IP will be populated only when your infra support Load balancer services.</p><pre>kubectl get pods -n kgateway-system<br><br># NAME                        READY   STATUS    RESTARTS      AGE<br># httpbin-797c4f4884-lvcct       1/1     Running   0             96s</pre><pre>kubectl get svc -n kgateway-system<br><br># NAME       TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)          AGE<br># httpbin       LoadBalancer   10.106.255.243   192.168.56.150   8080:31968/TCP   23s</pre><p><strong>Bonus</strong></p><p>You might be wondering about HA of this pod that is going to handle your application’s traffic. The initial replicas can be set using the GatewayParameters spec. Then you can configure HPA to handle load dynamically.</p><pre>apiVersion: gateway.kgateway.dev/v1alpha1<br>kind: GatewayParameters<br>metadata:<br>  name: httpbin-kgateway-parameters<br>  namespace: kgateway-system<br>spec:<br>  kube:<br>    deployment:<br>      replicas: 3</pre><p>You can refer this infra specific GatewayParameters spec inside your Gateway!</p><pre>kind: Gateway<br>metadata:<br>  name: my-gateway<br>  namespace: kgateway-system<br>spec:<br>  gatewayClassName: kgateway<br>  infrastructure:  #&lt;---- The spec used for creating deployment will refer the gatewayparameters.spec.kube.deployment.replicas <br>    parametersRef:<br>      group: gateway.kgateway.dev/v1alpha1<br>      kind: GatewayParameters<br>      name: httpbin-kgateway-parameters</pre><p>If you apply this changes then you will see 3 replicas of the gateway pod. Please note that the Gateway API controller replica count is by a helm parameter <em>controller.replicaCount</em> in kgateway.</p><pre>kubectl get pods -n kgateway-system<br><br>NAME                        READY   STATUS    RESTARTS   AGE<br>http-c8d7d796d-666fn        1/1     Running   0          58s<br>http-c8d7d796d-8f27g        1/1     Running   0          58s<br>http-c8d7d796d-lcls2        1/1     Running   0          8h</pre><h3>Creating the HTTPRoute — Where Routing Gets Intelligent</h3><pre>kubectl apply -f- &lt;&lt;EOF<br>apiVersion: gateway.networking.k8s.io/v1<br>kind: HTTPRoute<br>metadata:<br>  name: httpbin<br>  namespace: httpbin<br>  labels:<br>    route: httpbin-route<br>spec:<br>  parentRefs:<br>  - name: httpbin<br>    namespace: kgateway-system<br>  hostnames:<br>  - &quot;httpbin.ansil-lab.io&quot;<br>  rules:<br>  - backendRefs:<br>    - name: httpbin<br>      port: 8000<br>EOF</pre><p>This <em>HTTPRoute</em> demonstrates the expressive power of Gateway API — clean, declarative routing rules that are both human-readable and incredibly powerful!</p><h3>The Victory Lap — Testing Your Gateway API Setup</h3><p>Add a DNS entry to resolve the FQDN. In my case I’ve added a DNS entry for httpbin.ansil-lab.io pointing to 192.168.56.150, before executing the curl command;</p><pre>curl http://httpbin.ansil-lab.io/headers</pre><p><strong>The result:</strong></p><pre>{<br>  &quot;headers&quot;: {<br>    &quot;Accept&quot;: [&quot;*/*&quot;],<br>    &quot;Host&quot;: [&quot;httpbin.ansil-lab.io&quot;],<br>    &quot;User-Agent&quot;: [&quot;curl/8.5.0&quot;],<br>    &quot;X-Envoy-Expected-Rq-Timeout-Ms&quot;: [&quot;15000&quot;],<br>    &quot;X-Envoy-External-Address&quot;: [&quot;10.0.1.208&quot;],<br>    &quot;X-Forwarded-For&quot;: [&quot;10.0.1.208&quot;],<br>    &quot;X-Forwarded-Proto&quot;: [&quot;http&quot;],<br>    &quot;X-Request-Id&quot;: [&quot;d9e8aefe-a6d7-49d6-99d0-c7a59fae8cee&quot;]<br>  }<br>}</pre><p>Look at those Envoy headers!</p><h3>Developer Experience Improvements</h3><p>The Gateway API reduces reliance on vendor-specific annotations and custom configurations. Your routing rules become more declarative, easier to understand, and more portable between different implementations.</p><h3>Conclusion: A Practical Step Forward</h3><p>Gateway API represents a meaningful advancement in Kubernetes traffic routing. While it requires learning new concepts and resources, the investment pays off with more maintainable, powerful, and standardized traffic management capabilities.</p><p>Whether you’re managing a single cluster or working across multiple environments, this approach provides a solid foundation for handling traffic in modern Kubernetes deployments. As the Gateway API continues to mature, it’s worth considering as part of your Kubernetes networking strategy.</p><p>I’ll be sharing more about Gateway API and especially kgateway, like how to configure TLS in Gateway API.</p><p>Stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1b23d175b88" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techbeatly/revolutionizing-kubernetes-traffic-management-the-gateway-to-the-future-b1b23d175b88">Revolutionizing Kubernetes Traffic Management: The Gateway to the Future</a> was originally published in <a href="https://medium.com/techbeatly">techbeatly</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forge Your Ultimate K8S Playground: Pre-bake Kubeadm and Cilium CNI in Ubuntu Cloud Image.]]></title>
            <link>https://medium.com/@ansilh/forge-your-ultimate-k8s-playground-pre-bake-kubeadm-and-cilium-cni-in-ubuntu-cloud-image-2f83af55dd0a?source=rss-b2f31c191304------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f83af55dd0a</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[cilium]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[kubeadm]]></category>
            <dc:creator><![CDATA[Ansil H]]></dc:creator>
            <pubDate>Sun, 15 Jun 2025 17:10:05 GMT</pubDate>
            <atom:updated>2025-06-15T18:26:05.736Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XmNw2QBNz_aMxq42.png" /></figure><p>Tired of waiting for container images to download every time you launch a new Kubernetes cluster?</p><p>Setting up environments repeatedly can be a drag, slowing down your development and testing cycles.</p><p>What if you could create a “golden” Ubuntu image, perfectly tailored for Kubernetes and pre-loaded with all the essentials including Cilium CNI?</p><p>This guide will show you how to customize an official Ubuntu Cloud Image to include containerd, kubeadm, kubectl, and even the necessary images for the Cilium CNI. By pre-baking these components into your image, you can spin up kubeadm-based Kubernetes nodes in a fraction of the usual time.</p><p>This tutorial is for you if you want a faster, more automated way to set up clusters for testing, development, or learning. We’ll be using standard Linux tools like qemu-img and chroot to perform open-heart surgery on an Ubuntu image, transforming it into a lean, mean, Kubernetes-launching machine.</p><p><strong>What You’ll Need</strong></p><p>Before we begin, make sure you’re on a Linux system (preferably Ubuntu) with the following tools installed:</p><ul><li>curl for downloading files.</li><li>qemu-utils which provides the qemu-img tool.</li><li>Basic command-line familiarity.</li></ul><p>You should also have a machine with at least 2 CPUs and 2 GB of RAM to later run a Kubernetes node using the image we create.</p><h3>Step 1: Obtain and Prepare the Base Image</h3><p>First, we need a base to build upon. We’ll grab the latest Ubuntu 24.04 (Noble Numbat) server cloud image. These images are lightweight and designed for virtualized environments.</p><p>The cloud image comes in qcow2 format, which is efficient for storage. However, for direct manipulation of the filesystem, the raw format is easier to work with. We’ll convert it and also add 7GB of extra space to accommodate our Kubernetes tools and container images.</p><pre># Download the latest Ubuntu Noble cloud image<br>curl -LO https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img<br><br># Convert from qcow2 to raw format<br>qemu-img convert -p -f qcow2 -O raw noble-server-cloudimg-amd64.img noble-server-cloudimg-amd64.raw<br><br># Add 7GB of space to the raw image file<br>qemu-img resize noble-server-cloudimg-amd64.raw +7G</pre><h3>Step 2: Mount the Image and Grow the Filesystem</h3><p>Now we have a raw disk image, but the filesystem within it is still the original size. We need to mount this image as a loop device to interact with its partitions.</p><p>A loop device makes a file appear as a block device (like a hard drive), allowing us to mount and modify its contents.</p><pre># Set up a loop device for our raw image<br>sudo losetup -Pf noble-server-cloudimg-amd64.raw<br><br># Find the name of your new loop device (e.g., /dev/loop9)<br>sudo losetup --list | grep raw</pre><p>With the device mapped (we’ll use /dev/loop4 as an example for the rest of the guide, but <strong>be sure to use the one from your output</strong>), we can tell the partition table and the filesystem to recognize and use the extra 7GB of space we added.</p><pre># Use parted to fix the GPT table after resizing<br># Note: parted might warn that not all space is used. Type &quot;Fix&quot;.<br>sudo parted /dev/loop4<br># (parted) p     &lt;- prints the partition table<br># (parted) Fix   &lt;- fixes the table<br># (parted) quit &lt;- quits parted<br><br># Check the filesystem for errors before resizing<br>sudo e2fsck -f /dev/loop4p1<br><br># Tell the partition to grow and fill the available space<br>sudo growpart /dev/loop4 1<br><br># Resize the filesystem<br>sudo resize2fs /dev/loop4p1<br><br># Check the filesystem to confirm the integrity after resize<br>sudo e2fsck -f /dev/loop4p1</pre><h3>Step 3: Enter the Chroot Environment</h3><p>This is where the real magic happens. We will use chroot (change root) to enter the filesystem of our image as if it were the root directory of our current system. This powerful technique allows us to run commands like apt-get and modify system files inside the image without booting it in a VM.</p><pre># Mount the image&#39;s primary partition<br>sudo mount /dev/loop4p1 /mnt/raw<br><br># Enter the chroot environment<br>sudo chroot /mnt/raw/<br><br># Inside the chroot, mount necessary virtual filesystems<br>mount -t proc proc /proc<br>mount -t devpts devpts /dev/pts<br><br># Temporarily set up DNS for package installation<br>unlink /etc/resolv.conf<br>echo &quot;nameserver 1.1.1.1&quot; &gt; /etc/resolv.conf</pre><h3>Step 4: Install Kubernetes Components</h3><p>Now that we are “inside” the image, we can install everything needed for a Kubernetes node.</p><p><strong>Install Containerd</strong></p><p>First, we’ll set up containerd, a lightweight and robust container runtime. We’ll configure it to use SystemdCgroup, which is the recommended cgroup driver for Kubernetes to ensure resource management stability.</p><pre># Update package lists<br>apt-get update<br><br># Add Docker&#39;s GPG key and repository to install containerd<br>curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc<br>echo \<br>&quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \<br>$(. /etc/os-release &amp;&amp; echo &quot;${UBUNTU_CODENAME:-$VERSION_CODENAME}&quot;) stable&quot; | \<br>tee /etc/apt/sources.list.d/docker.list &gt; /dev/null<br><br># Install containerd<br>apt-get update<br>apt-get install -y containerd.io apt-transport-https<br><br># Generate default config and set SystemdCgroup to true<br>containerd config default | tee /etc/containerd/config.toml<br>sed -i &#39;s/SystemdCgroup = false/SystemdCgroup = true/&#39; /etc/containerd/config.toml</pre><p><strong>Install Kubeadm, Kubelet, and Kubectl</strong></p><p>Next, we add the official Kubernetes repository and install the holy trinity of Kubernetes tooling: kubeadm, kubelet, and kubectl. We also use apt-mark hold to prevent them from being accidentally upgraded.</p><pre># Enable IP forwarding, a requirement for Kubernetes networking<br>echo &quot;net.ipv4.ip_forward = 1&quot; &gt;/etc/sysctl.d/10-k8s.conf<br><br># Add the Kubernetes package repository<br>curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg<br>echo &#39;deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.32/deb/ /&#39; | tee /etc/apt/sources.list.d/kubernetes.list &gt; /dev/null<br><br># Install and hold the packages<br>apt-get update<br>apt-get install -y kubelet kubeadm kubectl<br>apt-mark hold kubelet kubeadm kubectl<br><br># Enable the kubelet service to start on boot<br>systemctl enable kubelet</pre><h3>Step 5: The Secret Sauce — Pre-pulling Images</h3><p>This step is the key to our lightning-fast cluster deployments. We will pre-pull all the necessary container images for the Kubernetes control plane and the Cilium CNI. When you later run kubeadm init, it will find the images already present on the disk and skip the download phase entirely.</p><pre># Start containerd in the background to pull images<br>containerd &amp;<br><br># Pre-pull all required kubeadm images<br>for image in $(kubeadm config images list); do  <br>  ctr image pull $image <br>done<br># OR kubeadm config images pull<br><br># Install Helm to help us find Cilium&#39;s images<br>curl -LO https://get.helm.sh/helm-v3.18.2-linux-amd64.tar.gz<br>tar -xvf helm-v3.18.2-linux-amd64.tar.gz -C /usr/local/bin linux-amd64/helm --strip-components=1 <br>rm helm-v3.18.2-linux-amd64.tar.gz <br>helm repo add cilium https://helm.cilium.io/<br><br># Magically find and pull all Cilium images using Helm values<br>for image in $(helm show values cilium/cilium --version 1.17.4 | grep repository: -A 1 --no-group-separator | awk -F&#39;&quot;&#39; &#39;<br>/repository:/ { repo=$2 }<br>/tag:/ { print repo &quot;:&quot; $2 }<br>&#39;); do<br>    ctr image pull $image<br>done<br><br># Bring the containerd process to the foreground and stop it<br>fg<br># Press Ctrl+C</pre><h3>Step 6: Finalize and Package the Image</h3><p>Our work inside the image is done. It’s time to clean up, exit the chroot, and convert our modified raw image back into the efficient qcow2 format, ready for use in any modern hypervisor like KVM or VirtualBox.</p><pre># --- Still inside chroot ---<br># Restore the original resolv.conf symlink<br>cd /etc/<br>rm resolv.conf<br>ln -s ../run/systemd/resolve/stub-resolv.conf resolv.conf<br><br># Unmount virtual filesystems and exit chroot<br>umount /dev/pts<br>umount /proc<br>exit<br><br># --- Back on your host system ---<br># Unmount the image partition and detach the loop device<br>sudo umount /mnt/raw <br>sudo losetup --detach /dev/loop4<br><br># Convert the final raw image back to qcow2 format<br>qemu-img convert -f raw -O qcow2 noble-server-cloudimg-amd64.raw noble-server-cloudimg-amd64-kubeadm-1.31-cilium.img</pre><p>If you are wondering about setting password during first-boot of VM, please refer the <a href="https://documentation.ubuntu.com/public-images/public-images-how-to/use-local-cloud-init-ds/">Ubuntu doc that explains how to use cloud-init seed ISO.</a></p><h3>Conclusion</h3><p>Congratulations! You have successfully forged a custom, reusable Ubuntu image that is primed for Kubernetes. By embedding containerd, kubeadm, and all the necessary container images directly, you’ve eliminated the most time-consuming steps of cluster creation. You can now use this qcow2 file as the base for your virtual machines. When you boot a node from this image and run kubeadm init or kubeadm join, the process will be astonishingly fast.</p><p>Go forth and build your clusters with unprecedented speed!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f83af55dd0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>