<?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 Arun Kumar R on Medium]]></title>
        <description><![CDATA[Stories by Arun Kumar R on Medium]]></description>
        <link>https://medium.com/@rarun.unofficial?source=rss-4e90f1c3ad45------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8XN82AMfSp7KxsMr9P9QOA.jpeg</url>
            <title>Stories by Arun Kumar R on Medium</title>
            <link>https://medium.com/@rarun.unofficial?source=rss-4e90f1c3ad45------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 22:38:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rarun.unofficial/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[Exploring ISTIO Ambient Mode on Nutanix Kubernetes Platform(NKP)]]></title>
            <link>https://medium.com/@rarun.unofficial/exploring-istio-ambient-mode-on-nutanix-kubernetes-platform-nkp-599fd40af394?source=rss-4e90f1c3ad45------2</link>
            <guid isPermaLink="false">https://medium.com/p/599fd40af394</guid>
            <category><![CDATA[istio]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Arun Kumar R]]></dc:creator>
            <pubDate>Tue, 24 Feb 2026 05:25:46 GMT</pubDate>
            <atom:updated>2026-02-24T05:25:46.137Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine a small, cozy restaurant in your town. A small team runs the place seamlessly, the server takes your order, passes it to the cook, and brings the meal back to your table. Everyone knows each other, communication flows effortlessly, and the whole operation feels like one big family working in harmony.</p><p>Now, let’s fast forward a few months…</p><p>The food becomes the talk of the town. The restaurant starts scaling quickly, opening new branches in other cities and expanding the menu. Desserts are outsourced to a nearby bakery. Suddenly, things aren’t as simple anymore. There are more people involved, not everyone knows each other, and there’s a need to ensure that the desserts arrive fresh, from the correct vendor, and haven’t been tampered with along the way. Trust, verification, and secure communication have now become a challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aiu5PuL5vEb8RjUD7YTS9Q.png" /></figure><p>This scenario mirrors what happens in software when a monolithic application grows into a micro-services architecture. Your small restaurant under one roof is like a monolith, everything runs together on a single server. Micro-services breaks the application into separate services running on different hosts, which offers incredible advantages in scalability and availability. But just like your new branches and outsourced bakery, these services now need to communicate over a network, a channel vulnerable to attacks.</p><p>Now the challenge is clear, data must be encrypted, integrity verified, and only authorized services should talk to each other. Traditionally, developers would implement these checks themselves, adding complexity, inconsistency, and a lot of repetitive work across services.</p><h4><strong>This is exactly why ISTIO exists!</strong></h4><p>ISTIO is a service mesh that acts like your restaurant’s invisible supervisor. It handles mTLS and traffic encryption to keep communication secure, enforces policies so only authorized services can interact, manages traffic routing for smooth operations, monitors performance with observability, and even retries or redirects orders if something goes wrong.</p><p>The best part? ISTIO handles almost all of this automatically, no code changes, no messy manual configurations. All you have to do is drop your application into the mesh during deployment, and it just works.</p><h4>So how does <em>I</em>STIO actually work behind the scenes?</h4><p>Traditionally, service meshes uses a <strong>sidecar model</strong>, where a dedicated Envoy proxy is deployed alongside each service. When an application is deployed in a mesh-enabled environment, a sidecar container is automatically injected into every pod. This sidecar acts like a firewall, intercepting all incoming and outgoing traffic.</p><p>The ISTIO control plane<strong> </strong>manages these proxies, configuring them according to user-defined policies. However, this approach has some drawbacks. For example, if you have 100 pods, you will need 100 proxies, which can be resource-intensive. Additionally, enabling the mesh for an already deployed application typically requires restarting the application.</p><h4>Enter Ambient Mode!</h4><p>Ambient mode simplifies things, instead of running a sidecar proxy for every pod, it uses a shared per-node proxy called <strong>ztunnel (Zero Trust Tunnel)</strong> to handle secure traffic.Now, all applications running on the same node use the same proxy, with traffic interception happening at Layer 4 (L4). This reduces resource usage, allows existing applications to join the mesh without restarts, and simplifies policy management while still providing the same traffic control, security, and observability features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YQuI1XhAiHbs16vM0d_zyA.png" /><figcaption>Ambient mode traffic flow</figcaption></figure><blockquote>For a detailed comparison between sidecar and ambient mode, refer the <a href="https://istio.io/latest/docs/overview/dataplane-modes/">docs</a>.</blockquote><p>Now that we’ve covered the basics of Ambient Mode, let’s get hands-on using <strong>NKP 2.17</strong>, which brings support for ISTIO’s ambient mode. We’ll enable the service mesh, deploy a sample app, set up a gateway to safely bring traffic in, and visualize the whole setup using <strong>Kiali</strong>, so you can see Ambient mesh in action.</p><h3>Let’s get started</h3><h4>1. Deploy a NKP Cluster</h4><p>I deployed a Nutanix Kubernetes Platform (NKP) cluster, running on Nutanix infrastructure.</p><p><strong>NKP Version:</strong> 2.17</p><p>Refere <a href="https://portal.nutanix.com/page/documents/details?targetId=Nutanix-Kubernetes-Platform-v2_17:top-get-started-nkp-t.html">NKP guide</a> for detailed deployment steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l53_JI7nwHk50uGJ83SrDg.png" /><figcaption>NKP Dashboard</figcaption></figure><h4>2. Installing the Service mesh</h4><p>NKP makes it easy to install and manage platform applications that support a Kubernetes cluster. You just need to enable the required applications from the catalog, and they get deployed automatically in the background.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*riJit3zgCaVVVxVkOv_vPw.png" /><figcaption>NKP Application Catalog</figcaption></figure><p>For this lab, we’ll be installing the <strong>Istio</strong> Helm service and <strong>Kiali</strong>. Since we’ll be testing Istio in ambient mode, we’ll also add the following override configuration while enabling Istio.</p><p><strong>ISTIO Override config</strong></p><pre>cni:<br>   profile: ambient<br>   cni:<br>     ambient:<br>       enabled: true<br><br>istiod:<br>   profile: ambient<br>   pilot:<br>     env:<br>       PILOT_ENABLE_AMBIENT: true<br>       PILOT_ENABLE_AMBIENT_CONTROLLERS: true<br>       PILOT_ENABLE_HBONE: true<br>       CA_TRUSTED_NODE_ACCOUNTS: &quot;istio-helm-gateway-ns/ztunnel,kube-system/ztunnel&quot;<br><br>ztunnel:<br>   enabled: true<br>   env:<br>     CA_ADDRESS: &quot;istiod-istio-helm.istio-helm-system.svc:15012&quot;<br>     XDS_ADDRESS: &quot;istiod-istio-helm.istio-helm-system.svc:15012&quot;</pre><p>The override configuration needs to be pasted directly into the UI while enabling the Istio service, as shown in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zN34ABGYY1taOJfVVYbwzQ.png" /></figure><blockquote>NKP Doc for ref: <a href="https://portal.nutanix.com/page/documents/details?targetId=Nutanix-Kubernetes-Platform-v2_17:top-enable-istio-ambient-mode.html">Enabling ISTIO Ambient mode</a></blockquote><p>Now, let’s verify that the Istio and Kiali pods are running. This might take a few minutes. The screenshot below shows a fully healthy deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qze3lZ9ggEHqeRmNq784VA.png" /></figure><h4>3. Deploy a Test Application</h4><p>Now that we have our NKP cluster up and running with Istio installed in ambient mode, it’s time to test it using a sample application. For this lab, I’m using a simplified version of the Bookinfo application.</p><p>First, create a namespace called ambient-bookinfo.</p><p>Then, deploy the sample application by copying the contents below into a file and applying it to the ambient-bookinfo namespace.</p><pre># bookinfo.yaml<br><br>##################################################################################################<br># Reviews service<br>##################################################################################################<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: reviews<br>  labels:<br>    app: reviews<br>    service: reviews<br>spec:<br>  ports:<br>  - port: 9080<br>    name: http<br>  selector:<br>    app: reviews<br>---<br>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: bookinfo-reviews<br>  labels:<br>    account: reviews<br>---<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: reviews-v1<br>  labels:<br>    app: reviews<br>    version: v1<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: reviews<br>      version: v1<br>  template:<br>    metadata:<br>      labels:<br>        app: reviews<br>        version: v1<br>    spec:<br>      serviceAccountName: bookinfo-reviews<br>      containers:<br>      - name: reviews<br>        image: docker.io/istio/examples-bookinfo-reviews-v1:1.20.3<br>        imagePullPolicy: IfNotPresent<br>        env:<br>        - name: LOG_DIR<br>          value: &quot;/tmp/logs&quot;<br>        ports:<br>        - containerPort: 9080<br>        volumeMounts:<br>        - name: tmp<br>          mountPath: /tmp<br>        - name: wlp-output<br>          mountPath: /opt/ibm/wlp/output<br>      volumes:<br>      - name: wlp-output<br>        emptyDir: {}<br>      - name: tmp<br>        emptyDir: {}<br>---<br>##################################################################################################<br># Productpage service<br>##################################################################################################<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: productpage<br>  labels:<br>    app: productpage<br>    service: productpage<br>spec:<br>  ports:<br>  - port: 9080<br>    name: http<br>  selector:<br>    app: productpage<br>---<br>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: bookinfo-productpage<br>  labels:<br>    account: productpage<br>---<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: productpage-v1<br>  labels:<br>    app: productpage<br>    version: v1<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: productpage<br>      version: v1<br>  template:<br>    metadata:<br>      annotations:<br>        prometheus.io/scrape: &quot;true&quot;<br>        prometheus.io/port: &quot;9080&quot;<br>        prometheus.io/path: &quot;/metrics&quot;<br>      labels:<br>        app: productpage<br>        version: v1<br>    spec:<br>      serviceAccountName: bookinfo-productpage<br>      containers:<br>      - name: productpage<br>        image: docker.io/istio/examples-bookinfo-productpage-v1:1.20.3<br>        imagePullPolicy: IfNotPresent<br>        ports:<br>        - containerPort: 9080<br>        volumeMounts:<br>        - name: tmp<br>          mountPath: /tmp<br>      volumes:<br>      - name: tmp<br>        emptyDir: {}<br><br>##################################################################################################<br># Details service<br>##################################################################################################<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: details<br>  labels:<br>    app: details<br>    service: details<br>spec:<br>  ports:<br>  - port: 9080<br>    name: http<br>  selector:<br>    app: details<br>---<br>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: bookinfo-details<br>  labels:<br>    account: details<br>---<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: details-v1<br>  labels:<br>    app: details<br>    version: v1<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: details<br>      version: v1<br>  template:<br>    metadata:<br>      labels:<br>        app: details<br>        version: v1<br>    spec:<br>      serviceAccountName: bookinfo-details<br>      containers:<br>      - name: details<br>        image: docker.io/istio/examples-bookinfo-details-v1:1.20.3<br>        imagePullPolicy: IfNotPresent<br>        ports:<br>        - containerPort: 9080<br>---</pre><pre>kubectl apply -n ambient-bookinfo -f bookinfo.yaml</pre><p>Okay, lets verify if the application is deployed and running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o3iF8tA4dMEt8ipDhDPl5A.png" /></figure><blockquote><strong>Note:</strong> At this point we have not added our application into the service mesh.</blockquote><h4>4. Launch Kiali</h4><p>We can also verify this from the Kiali dashboard. Simply launch the dashboard from the NKP UI to see the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FgZ4oITRya1YygssEWhsMg.png" /><figcaption>NKP dashboard – cluster view</figcaption></figure><p>In Kiali, select the ambient-bookinfo namespace. You’ll notice that the namespace hasn’t been added to the mesh yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Yh-N97OkJ2J7X5LmPDvwQ.png" /><figcaption>Kiali dashboard (workloads view)</figcaption></figure><h4>5. Adding our application into mesh</h4><p>Now let’s add our workloads to the mesh, it’s pretty simple. We just need to label the namespace as shown below. Once that’s done, the change takes effect immediately, without restarting any applications.</p><pre>kubectl  label namespace ambient-bookinfo istio.io/dataplane-mode=ambient</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*dukqpbB2pcIFQNqE3VQ0hw.png" /></figure><p>Now, if we check again in Kiali, we can see that all the workloads in the ambient-bookinfo namespace have been added to the mesh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHCnA5zhtU9IpOJjXcIq4A.png" /><figcaption>Kiali dashboard (applications view)</figcaption></figure><p>Kiali is really useful for tracing traffic and visualizing it as a graph. So let’s generate some traffic.</p><h4>6. Generating traffic to application</h4><p>For this, we’ll use a netshoot container, an image that comes with basic network utilities pre-installed. We’ll deploy it in the same cluster and run a continuous curl request to the product page to generate traffic.</p><pre>kubectl run netshoot \<br> - image=nicolaka/netshoot \<br> - restart=Never \<br> - command - sleep infinity</pre><p>Grab the cluster IP of the productpage service and use it to create the curl request shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*vscgofKoxNm5TptTPeZ3lQ.png" /></figure><pre>while true; do<br>curl -vL http://10.108.78.32:9080/productpage?u=normal<br>sleep 1<br>done</pre><p>Now , shell into our netshoot container and run the above curl command.</p><pre>kubectl exec -it netshoot - bash</pre><p>This will run indefinitely and generate continuous traffic to the product page from the netshoot container. Let’s now visualize this in Kiali.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BrxnxOheDGzGclfnrL33UQ.png" /><figcaption>Kiali traffic graph (from netshoot)</figcaption></figure><p>We can now see the full traffic flow, how the netshoot pod communicates with the product page, and how the product page, in turn, talks to the details and reviews services.</p><p>The grey rectangular box represents the mesh. Since we’ve enabled the mesh only for the ambient-bookinfo namespace, the netshoot and Prometheus pods are outside the mesh.</p><p>You’ll also notice a lock icon between product page and the details/reviews services. This indicates that the traffic is encrypted and mTLS is enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/0*J7oNHYgnmqpIaG5j.png" /><figcaption>Kiali Traffic level details</figcaption></figure><h4>7. Exposing the application outside the cluster</h4><p>Right now, the product page is accessible only inside the cluster. Let’s expose it so users outside the cluster can securely access the application running within the mesh. We’ll do this using an Istio ingress gateway.</p><p>Create a Gateway using the Istio GatewayClass and configure it to expose the productpage application externally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*fqKBhuYjFVc-BjOyeyj9Lg.png" /><figcaption>List of Gateway Class available</figcaption></figure><pre>apiVersion: gateway.networking.k8s.io/v1<br>kind: Gateway<br>metadata:<br>  name: bookinfo-gateway<br>  namespace: istio-helm-gateway-ns<br>spec:<br>  gatewayClassName: istio<br>  listeners:<br>  - name: http<br>    port: 80<br>    protocol: HTTP<br>    allowedRoutes:<br>      namespaces:<br>        from: All<br>---<br>apiVersion: gateway.networking.k8s.io/v1<br>kind: HTTPRoute<br>metadata:<br>  name: bookinfo<br>  namespace: ambient-bookinfo<br>spec:<br>  parentRefs:<br>  - name: bookinfo-gateway<br>    namespace: istio-helm-gateway-ns<br>  rules:<br>  - matches:<br>    - path:<br>        type: Exact<br>        value: /productpage<br>    - path:<br>        type: PathPrefix<br>        value: /static<br>    - path:<br>        type: Exact<br>        value: /login<br>    - path:<br>        type: Exact<br>        value: /logout<br>    - path:<br>        type: PathPrefix<br>        value: /api/v1/products<br>    backendRefs:<br>    - name: productpage<br>      port: 9080</pre><p>Once the Gateway is created, you’ll notice that it gets assigned a LoadBalancer IP, which will be used to access the application from outside the cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o4BCXIKxJsdsevtGfj3HoQ.png" /></figure><p>Now from a browser, use the LoadBalancer IP assigned to the Gateway to access the application with the /productpage path prefix.</p><p>Example:<a href="http://10.38.86.124/productpage">http://10.38.86.124/productpage</a></p><p>Great! now our app is accessible from outside</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_54wZqt2FznDUbievRx8uQ.png" /></figure><p>Coming back to Kiali……lot of moving parts now!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qsqSv_FY4VmzBQbrqRoOxw.png" /></figure><h4>8. Blocking others (Auth Policy)</h4><p>Now it’s time to explore one of Istio’s powerful features.</p><p>What if we want the product page to be accessible only through the Gateway, and block all other traffic, whether it’s coming from another service or even from within the cluster?</p><p>To achieve this, we’ll create an AuthorizationPolicy that allows traffic only from the Istio Gateway. In this policy, we use the Gateway’s service account as the principal for validation.</p><pre>apiVersion: security.istio.io/v1<br>kind: AuthorizationPolicy<br>metadata:<br>  name: productpage-ztunnel<br>  namespace: ambient-bookinfo<br>spec:<br>  selector:<br>    matchLabels:<br>      app: productpage<br>  action: ALLOW<br>  rules:<br>  - from:<br>    - source:<br>        principals:<br>        - &quot;cluster.local/ns/istio-helm-gateway-ns/sa/bookinfo-gateway-istio&quot;</pre><p>Once the AuthorizationPolicy is applied, netshoot and Prometheus can no longer access the product page. Traffic is restricted strictly to requests originating from the Gateway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BcxG5dtmxJA9Jtnw12-5Zg.png" /><figcaption>Traffic graph after blocking others</figcaption></figure><p>Switching back to the netshoot terminal, you’ll notice that the request now results in a connection timeout.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eZz5nLq7miUXZZxeov3Bow.png" /><figcaption>netshoot container terminal</figcaption></figure><p><strong>9. Layer 7 in Ambient Mode</strong></p><p>In ambient mode, the node-level proxies (ztunnel) operate at Layer 4. This means they handle transport-level security and routing, but they don’t understand application-level protocols like HTTP. Because of this, they can’t perform Layer 7 filtering or advanced traffic control on their own.</p><p>To enable Layer 7 features, we need to deploy an additional Gateway called a Waypoint proxy. The Waypoint proxy handles application-aware traffic processing.</p><blockquote><strong>Note: </strong>In contrast, with the traditional sidecar model, Layer 7 capabilities were supported natively since each pod had its own Envoy proxy.</blockquote><h3>Final Thoughts</h3><p>That’s it for this walk through. The goal of this blog was just to give you a quick glimpse of ISTIO, what ambient mode is, and how you you can get started with it on NKP.</p><p>There’s a lot more that Istio supports, so I’d definitely recommend exploring the official <a href="https://istio.io/latest/docs/overview/">documentation</a> and experimenting further.</p><p>Thanks for reading, and happy learning! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=599fd40af394" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[eBPF made easy!]]></title>
            <link>https://medium.com/@rarun.unofficial/ebpf-made-easy-4240d195ce47?source=rss-4e90f1c3ad45------2</link>
            <guid isPermaLink="false">https://medium.com/p/4240d195ce47</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ebpf]]></category>
            <dc:creator><![CDATA[Arun Kumar R]]></dc:creator>
            <pubDate>Tue, 11 Nov 2025 11:57:47 GMT</pubDate>
            <atom:updated>2025-11-11T11:57:47.289Z</atom:updated>
            <content:encoded><![CDATA[<h4>If you’re into performance, security or observability, eBPF is your new best friend.</h4><h3>What to expect?</h3><p>To be honest, learning eBPF myself felt really confusing and even the beginner guides were way too technical for me. I’m just sharing the way I’d explain it to a friend.</p><p>If you’re hearing about eBPF for the first time or have no idea what it is, this blog is for you. I’ve tried to simplify it with some fun analogies, so you would never forget!</p><h3>Why Care About eBPF?</h3><p>Because everyone’s talking about it! 😄</p><p>eBPF isn’t new, but in recent years it has been gaining significant attention. Many companies are now integrating eBPF into their products, recognising the real power, efficiency and flexibility it brings to observability, security, and system optimisation.</p><h3>Imagine this….</h3><p>A patient with diabetes experiences daily fluctuations in blood sugar. The doctor recommended checking it every day with a blood test and if the levels get too high, a dose of insulin is given at the hospital to bring them back to a safe range.</p><h4><strong>Back in the day:</strong></h4><p>Every morning, the patient would drive to the hospital to give a blood sample and wait for the results. If his blood sugar was above the normal limit, he would take a dose of insulin at the hospital. But most days, his sugar levels were normal, so all those trips and waiting were for nothing.</p><h4><strong>The smart way:</strong></h4><p>Now, with a small glucose monitor attached to his body, the patient’s blood sugar is tracked continuously without any trips to the hospital. The readings show up live on a connected app and it even sends alerts if the sugar goes above the set limit. This way, he only needs to visit the hospital when there’s a real spike, to get the insulin dose, cutting out all the unnecessary daily travel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*XgJeLKQHyk7vwdj_.png" /></figure><p>This is the core idea behind eBPF and why it’s so efficient, keep this in back of your mind as we explore what is eBPF actually.</p><h3>From the eBPF world….</h3><p>At a high level, to understand this, lets take example of a packet filter application. Its simple job is to check incoming packets against a set of user-defined rules and then decide whether to accept or reject them. Let’s see how the flow works!</p><h4><strong>Without eBPF:</strong></h4><ol><li>A packet arrives at the physical network interface (NIC).</li><li>The <strong>kernel</strong> receives the packet.</li><li>The kernel copies <strong>all the packets</strong> to<strong> </strong>user space, where the packet filter application runs (this step uses cpu and memory)</li><li>The firewall application checks the packets, against the list of rules defined by the user and decides whether to accept or reject it.</li></ol><p>Don’t worry if you’re not familiar with user space and kernel, these are just two parts of the operating system. Applications run in <strong>user space</strong> and if they need to interact with hardware (like a network card), they go via the <strong>kernel</strong>.</p><p><strong>The Problem: </strong>In this approach, every packet is copied to user space, regardless of whether it will ultimately be allowed or rejected. This means that significant compute resources are wasted on copying packets that are just going to be discarded later.</p><h4>Using eBPF:</h4><p>eBPF makes packet processing much more efficient by letting filtering happen directly in the kernel,<strong> </strong>similar to how a glucose monitor continuously tracks a patient’s blood sugar without daily trips to the hospital. With eBPF, you can safely program and run packet filters right inside the kernel, handling data faster and more efficiently.</p><ol><li>A packet arrives at the physical network interface (NIC).</li><li>The <strong>kernel</strong> receives the packet.</li><li>An <strong>eBPF program running in the kernel</strong> evaluates the packet against user-defined rules and decides whether to accept or drop it.</li><li>Only the <strong>accepted packets</strong> are copied to user space for further processing by the application (this step uses cpu and memory).</li></ol><p>This greatly reduces CPU usage, memory copying and context/mode switches, making packet processing faster and more efficient. Packet filtering is just one classic use case of eBPF. By the way, eBPF stands for <strong>Extended Berkeley Packet Filter, </strong>though honestly, it’s grown way beyond just “packet filtering” now!</p><p>Today, eBPF powers observability, security, and networking in ways that traditional tools could only dream of.</p><h4><strong>Now, How do you run a packet filter program in the kernel?</strong></h4><p>The kernel is the heart of the operating system, one wrong move and the whole system could crash. That’s why Linux kernel developers are very cautious about adding new features. So, it would take years of time to get a feature added to the linux Kernel.</p><p>So, the question is, without modifying the kernel, how can you run your program inside it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*u8Fa06WMU8vM3LKC.png" /><figcaption>Scenario of adding a feature to the kernel traditionally (picture credits eBPF.io)</figcaption></figure><p>The answer is eBPF. It lets you run custom programs(like packet filter) safely inside the kernel, it also verifies your program before execution, to avoid system crash and runs it in an isolated environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*m3EzoEH3z8VtF8pl.png" /><figcaption>Scenario of adding a feature to the kernel using eBPF (picture credits eBPF.io)</figcaption></figure><h3>eBPF in Observability</h3><p>Observability is a crucial part of any system, it helps you trace issues, understand what’s really happening under the hood and even catch problems before they impact users. But figuring out which metrics to collect and how<em> </em>often to sample them isn’t always straightforward.</p><p>Coming back to our analogy, traditional hospital tests give you point-in-time readings, which are useful but they can’t tell you if your sugar levels spiked while you were asleep. A continuous glucose monitor, on the other hand, tracks your levels throughout the day, capturing trends and hidden fluctuations. This is similar to how eBPF makes the observability more effective and useful, compared to the traditional monitoring.</p><p><strong>Traditional Observability</strong> = Based on <strong>polling</strong> (a monitoring tool in user space, sends a poll to the kernel at fixed interval to collect the metrics)</p><p><strong>eBPF Observability </strong>= Based on <strong>events</strong> (monitoring happens within the kernel itself, whenever an event happens, making it more accurate)</p><p><strong>eBPF Map</strong> is a core component of eBPF that acts as a shared data structure between the kernel and user space. It provides a way for eBPF programs to store and retrieve data while executing inside the kernel. Once the data is collected or aggregated, a user-space application can read it from the map and convert it into a human-readable or consumable format (like metrics, logs, or traces).</p><h3>eBPF in Networking</h3><p>In the networking domain, eBPF mainly helps in the following use-cases,</p><ol><li>Load Balancing</li><li>Firewall</li><li>DDoS protection</li></ol><p>Cilium is a cloud-native networking solution that leverages eBPF to optimize and secure networking in Kubernetes environments. It uses XDP (eXpress Data Path), a high-performance in-kernel framework powered by eBPF, to handle packets at the earliest point in the networking stack. This enables low-latency, high-throughput and efficient load balancing, making Cilium far more scalable, compared to traditional options.</p><p>So, traffic routing decisions are handled right at the edge, as soon as the packet enters the NIC, instead of being processed later in the traditional TCP/IP stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*KjQpXFoGf1ZvyAqrpLAVDA.png" /><figcaption>Image Source: <a href="https://www.researchgate.net/publication/365930765_Extended_Berkeley_Packet_Filter_An_Application_Perspective">Extended Berkeley Packet Filter: An Application Perspective</a></figcaption></figure><p>Cilium can also act as a replacement for kube-proxy, which is responsible for managing Service IPs and load balancing in Kubernetes. By default, kube-proxy relies on native Linux IPtables to create routing rules for every Service and Pod. The problem is that IPtables process these rules linearly, meaning each routing decision requires scanning through a growing list of rules. As the number of Pods and Services increases, the routing cost rises exponentially, making kube-proxy inefficient and less suitable for large-scale or high-traffic environments.</p><p>Cilium, powered by eBPF, handles this efficiently within the kernel and avoids linear rule processing. Instead, it uses hash-based lookups to map incoming traffic directly to the appropriate Pod, enabling faster and more scalable packet routing.</p><h3>eBPF in Security</h3><p>Since this is just a basic blog for anyone getting started with eBPF, let’s not dive too deep into security. Instead, here’s a simple analogy to give a quick glimpse of how it works.</p><p>Imagine the security system of a building or an office premise.</p><h4>Traditional way</h4><p>Security guards are deployed to keep an eye on the building, walking around from room to room to spot anything suspicious. But since they can’t be everywhere at once, there’s always a chance they might miss something or catch it a bit late.</p><p>This is quite similar to how traditional security tools work, they’re agent-based, running scans across systems and checking specific logs to spot anything suspicious. But since they rely on periodic checks, there’s always some delay before they can detect and respond to a threat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nB_4c5Mzz5EH2_kBpxvkVw.png" /><figcaption>eBPF in Security (AI generated image)</figcaption></figure><h4>Now the eBPF way</h4><p>It’s like having CCTV cameras with motion sensors installed at every door and corner. The moment someone opens a door or makes a move, the system instantly detects it and sends an alert. Nothing slips by unnoticed and everything is monitored in real time.</p><p>Similarly, with eBPF, the monitoring happens right at the kernel level. So they have access to deeper insights and whenever an event occurs, eBPF can immediately track it and even block malicious activity right there at the source.</p><h3>Final Thoughts</h3><p>The goal of this blog was to make eBPF easy and fun to understand for anyone just starting out. Many people believe it’s one of the biggest changes to the Linux kernel, opening up lots of new possibilities. Even though it’s still pretty new, it’s already proving to be super efficient and powerful. Hope this helped you get a simple feel of what eBPF is all about!</p><h4>For Futher Reading…</h4><ul><li><a href="https://newrelic.com/blog/best-practices/what-is-ebpf">What is eBPF, and why does it matter for observability?</a></li><li><a href="https://docs.ebpf.io/">eBPF Docs</a></li><li><a href="https://isovalent.com/blog/post/why-replace-iptables-with-ebpf/">What is Kube-Proxy and why move from iptables to eBPF?</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4240d195ce47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VM in a Pod with Kubevirt, I Tried Migrating a Windows Domain Controller to Kubernetes]]></title>
            <link>https://medium.com/@rarun.unofficial/vm-in-a-pod-with-kubevirt-i-tried-migrating-a-windows-domain-controller-to-kubernetes-ca54373b4125?source=rss-4e90f1c3ad45------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca54373b4125</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[kubevirt]]></category>
            <dc:creator><![CDATA[Arun Kumar R]]></dc:creator>
            <pubDate>Wed, 20 Aug 2025 17:33:35 GMT</pubDate>
            <atom:updated>2025-08-20T17:33:35.517Z</atom:updated>
            <content:encoded><![CDATA[<p>Yes, you read that right, we’re going to run a Windows Server virtual machine inside a Kubernetes cluster. And no, this isn’t one of those K8s operators that just talk to a cloud provider API and translate YAML into VM instructions. The VM will actually run inside the Kubernetes cluster itself, as a POD.</p><p>In this Blog, I will explain, how I migrated an existing, windows server(domain controller) to Kubernetes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CeqPSg6thtUCOz2jtRsyvg.png" /></figure><h4>HOW?</h4><p>It’s easier than you think. KubeVirt is an open-source tool that lets you run virtual machines as pods inside Kubernetes. When you create a VM, KubeVirt launches a special pod that runs the VM using QEMU/KVM, managing its disks, network and lifecycle. This approach allows you to run both Linux and Windows VMs seamlessly inside your Kubernetes cluster, bringing traditional virtual machines into the cloud-native world.</p><h4>But WHY?</h4><p>Running a Windows Server with Active Directory inside a Kubernetes cluster is unconventional. This blog serves as an experimental demonstration to show that it’s possible, but it’s <strong>not recommended for production environments</strong>.</p><p>But here’s the real use case, while most applications are moving to Kubernetes, some legacy apps are hard to containerize. <strong>KubeVirt</strong> lets you run these apps as virtual machines on Kubernetes, giving you a consistent environment while developers continue working on containerizing them.</p><h4>Let’s get started!</h4><p>For this demo, I’ll be using a Nutanix cluster as my core infrastructure. However, you can achieve the same setup on your laptop using Oracle VirtualBox to create the Active Directory server, which we’ll later migrate to Kubernetes using KubeVirt.</p><h4>STEP-1 Creating the VM Disk Image:</h4><p>I’ve already pre-created my Windows Server VM and set up a domain with a few test users. To migrate our VM, the first step is to power it off, so we can export the VM disk image.</p><blockquote><strong>Note:</strong> It is recommended to have VirtIO drivers installed, on the windows machine, before creating the image. Refer this link for instructions:</blockquote><blockquote><a href="https://github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md">https://github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md</a></blockquote><p><strong>Exporting VM Image on Nutanix:</strong></p><ol><li>Log in to <strong>Prism Central</strong>.</li><li>Navigate to <strong>Menu → Compute → Images → Add Image</strong>.</li><li>Choose <strong>VM Disk</strong> and select the Active Directory VM you created for this demo.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ZPfJk83K3TrbpB24UX_PA.png" /><figcaption>Images page on Prim Central</figcaption></figure><p>4. To download the image, go to the <em>Images</em> page, select the image you just created, and choose <strong>Actions → Download Image</strong>. Save it locally in a separate folder, and make sure to add the .qcow2 extension at the end.</p><p><strong>For Oracle VirtualBox, see the link below:</strong></p><p>You might want to export the OVF and convert it to qcow2 format, please refer to the below link for instructions.</p><p><a href="https://linuxconfig.org/converting-virtualbox-ova-to-qcow2-for-qemu-kvm-deployment">https://linuxconfig.org/converting-virtualbox-ova-to-qcow2-for-qemu-kvm-deployment</a></p><p>After exporting, place the converted qcow2 image in a separate folder.</p><h4>STEP-2 Launch a quick HTTP file server:</h4><p>From the same directory containing the image, run the command below to start a local HTTP file server. We will use this server as a source, to import the VM image into a PVC on the K8s cluster.</p><pre>python3 -m http.server 8000</pre><p>Leave this terminal running in the background and open a new terminal to perform the remaining steps, as closing this would stop the file server.</p><blockquote><strong>Note: </strong>Ensure that Python3 is installed on your system for the above command to work.</blockquote><h4>STEP-3 Creating a K8s cluster:</h4><p>Now that the Windows VM image is ready, the next step is to set up a Kubernetes cluster, to host our Windows AD VM.</p><p>Since this is just for testing, I’ll spin up a Kind Kubernetes cluster on an Ubuntu virtual machine. You can either use your own laptop to run the Kind cluster or create a new Ubuntu VM on Oracle VirtualBox.</p><p>Depending on your operating system, follow the instructions in the link below to install <em>Kind</em> and start a local Kubernetes cluster.</p><p><a href="https://kind.sigs.k8s.io/docs/user/quick-start/#installation">https://kind.sigs.k8s.io/docs/user/quick-start/#installation</a></p><p><strong>For Linux OS (for other OS refer link above):</strong></p><pre># For AMD64 / x86_64<br>[ $(uname -m) = x86_64 ] &amp;&amp; curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.29.0/kind-linux-amd64<br># For ARM64<br>[ $(uname -m) = aarch64 ] &amp;&amp; curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.29.0/kind-linux-arm64<br>chmod +x ./kind<br>sudo mv ./kind /usr/local/bin/kind</pre><p><strong>To create the KIND cluster:</strong></p><p>Before creating the Kind K8s cluster, create an empty directory on the local host, which will be mounted to the Kind node. This directory will be used for a PVC to store the VM disk image, make sure to update the path in the YAML configuration accordingly.</p><pre># Kind-config.yaml<br><br>kind: Cluster<br>apiVersion: kind.x-k8s.io/v1alpha4<br>nodes:<br>- role: control-plane<br>  extraMounts:<br>    - hostPath: &lt;UPDATE LOCAL PATH HERE (/root/images)&gt;<br>      containerPath: /mnt/images<br>      readOnly: false<br>      selinuxRelabel: false<br>      propagation: None</pre><p>Now to create the cluster, run the below command and your k8s cluster should be ready, within few seconds.</p><pre>kind create cluster --name kubevirt --config kind-config.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*IIzhrDvk-h9KZR-w7x5Ytw.png" /><figcaption>Listing Nodes on Kind Cluster</figcaption></figure><h4>STEP-4 Deploying KubeVirt on K8s:</h4><p>KubeVirt runs as a deployment on the same Kubernetes cluster, so installing it is straightforward. Simply run the commands below and the required components will be created, using kubectl.</p><pre>export VERSION=$(curl -s https://storage.googleapis.com/kubevirt-prow/release/kubevirt/kubevirt/stable.txt)<br>echo $VERSION<br>kubectl create -f &quot;https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/kubevirt-operator.yaml&quot;</pre><p>To deploy the KubeVirt Custom resources(CRD):</p><pre>kubectl create -f &quot;https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/kubevirt-cr.yaml&quot;</pre><p>Verify that the deployment was successful, the PHASE should be shown as Deployed.</p><pre>kubectl get all -n kubevirt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7AA0Uw9_JKlj-TQkDeOaEA.png" /><figcaption>successful deployment looks like this</figcaption></figure><p>If you’re running your KIND cluster inside a VM, take a look at the note below on nested virtualisation.</p><p><strong>Nested Virtualization</strong> is a technology that allows you to run a VM inside another VM, with hardware acceleration. The method to enable it depends on your underlying hypervisor or cloud provider, so be sure to check the vendor-specific documentation to enable nested virtualization or CPU passthrough for your VM.</p><p><strong>For Nutanix AHV, to enable CPU passthrough:</strong></p><pre># get the VM UUID<br>acli vm.list | grep &lt;vm_name&gt;</pre><pre># Update the VM<br>acli vm.update &lt;vm_uuid&gt; cpu_passthrough=&quot;true&quot;</pre><p>If you’re unsure or just experimenting, no worries, you can run the command below to enable hardware emulation. However, this is not recommended for production, as performance will noticeably drop compared to CPU passthrough.</p><pre>kubectl -n kubevirt patch kubevirt kubevirt --type=merge --patch &#39;{&quot;spec&quot;:{&quot;configuration&quot;:{&quot;developerConfiguration&quot;:{&quot;useEmulation&quot;:true}}}}&#39;</pre><h4>STEP-5 Install VirtCtl:</h4><p>virtctl is a command-line tool for interacting with KubeVirt virtual machines, similar to kubectl but designed specifically for VMs. It allows you to start, stop and access the console of a running VM.</p><pre>VERSION=$(kubectl get kubevirt.kubevirt.io/kubevirt -n kubevirt -o=jsonpath=&quot;{.status.observedKubeVirtVersion}&quot;)<br>ARCH=$(uname -s | tr A-Z a-z)-$(uname -m | sed &#39;s/x86_64/amd64/&#39;) || windows-amd64.exe<br>echo ${ARCH}<br>curl -L -o virtctl https://github.com/kubevirt/kubevirt/releases/download/${VERSION}/virtctl-${VERSION}-${ARCH}<br>chmod +x virtctl<br>sudo install virtctl /usr/local/bin</pre><h4>STEP-6 Put the VM Disk Image into a PVC:</h4><p>To store the VM disk image in a PVC, we use a tool called <strong>Containerized Data Importer (CDI)</strong>. CDI acts like a downloader, it fetches a file from an external source and saves it into a PVC, allowing pods to attach and access the data later. In our case, we already have an HTTP file server hosting the VM image. Using CDI, we will create a <strong>DataVolume</strong> and import the image into our Kubernetes cluster.</p><p><strong>First to Install CDI:</strong></p><p>CDI is just another deployment in the same K8s cluster, you can create the application components by running the below commands.</p><pre>export TAG=$(curl -s -w %{redirect_url} https://github.com/kubevirt/containerized-data-importer/releases/latest)<br>export VERSION=$(echo ${TAG##*/})<br>kubectl create -f https://github.com/kubevirt/containerized-data-importer/releases/download/$VERSION/cdi-operator.yaml<br>kubectl create -f https://github.com/kubevirt/containerized-data-importer/releases/download/$VERSION/cdi-cr.yaml</pre><p><strong>Create a Persistent Volume:</strong></p><p>First, apply the PersistentVolume (PV) manifest below to create a PV in your cluster, pointing to the hostPath.</p><pre># Persistent Volume <br><br>apiVersion: v1<br>kind: PersistentVolume<br>metadata:<br>  name: winad-pv<br>spec:<br>  capacity:<br>    storage: 32Gi # UPDATE THE STORAGE AS PER THE SIZE OF YOUR QCOW2 IMAGE<br>  accessModes:<br>    - ReadWriteOnce<br>  hostPath:<br>    path: /mnt/images</pre><p>Next, we will create a DataVolume. The DataVolume will automatically create a PersistentVolumeClaim (PVC) that requests storage from the cluster and it will bind to the PV we just created. This ensures that your VM disk has a dedicated storage volume ready for use.</p><pre># DataVolume.yaml<br><br>apiVersion: cdi.kubevirt.io/v1beta1<br>kind: DataVolume<br>metadata:<br>  name: windows-ad<br>spec:<br>  source:<br>    http:<br>      url: &quot;http://192.168.5.4:8000/winad.qcow2&quot; <br>  storage:<br>    accessModes:<br>      - ReadWriteOnce<br>    resources:<br>      requests:<br>        storage: 32Gi<br>    storageClassName: &quot;&quot;</pre><blockquote><strong>Note:</strong> In the above DataVolume.yaml manifest, update the correct path for the http source url, pointing to the windows qcow2</blockquote><p>Now the CDI should create a pvc, spin up a importer pod and then start the download process. You can monitor the progress using the below command.</p><pre>watch kubectl get dv</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3LyP3ntT69oerBDiJeCD-w.png" /><figcaption>Completed Datavolume</figcaption></figure><p>Once the DataVolume phase changes to Succeeded, the Windows VM QCOW2 image has been successfully imported into the PVC. The only remaining task is to create a VM and attach it to this PVC.</p><h4>STEP-7 Create the VM on K8s:</h4><p>We’ve completed the hard part! The VM is now just another custom resource in KubeVirt and can be created by applying the manifest below.</p><pre># virtualmachine.yaml<br><br>apiVersion: kubevirt.io/v1<br>kind: VirtualMachine<br>metadata:<br>  generation: 1<br>  labels:<br>    kubevirt.io/os: windows<br>  name: windows-ad<br>spec:<br>  running: true<br>  template:<br>    metadata:<br>      creationTimestamp: null<br>      labels:<br>        kubevirt.io/domain: windows-ad<br>    spec:<br>      domain:<br>        cpu:<br>          cores: 2<br>        resources:<br>          requests:<br>            memory: 4096M<br>        firmware:<br>          bootloader:<br>            efi:<br>              secureBoot: false<br>        devices:<br>          disks:<br>          - disk:<br>              bus: sata<br>            name: pvcdisk<br>        machine:<br>          type: q35<br>      volumes:<br>        - name: pvcdisk<br>          persistentVolumeClaim:<br>            claimName: windows-ad</pre><p>Wait until the VM’s status changes to Running.</p><pre>kubectl get vm</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*adjGpddRJ0mr5Pg9BJD2bw.png" /></figure><h4>STEP-8 Take console of the VM:</h4><p>To view the VM’s graphical console, you’ll need a VNC viewer client. There are several clients available, but for this lab, we’ll use TigerVNC. Refer to the link below to download the latest version for your operating system.</p><p><a href="https://github.com/TigerVNC/tigervnc/releases">Releases · TigerVNC/tigervnc</a></p><p>Let’s start the vnc session for our windows-ad VM, using virtctl.</p><pre>virtctl vnc windows-ad --proxy-only --address 0.0.0.0</pre><p>Make a note of the port shown in the output, as we will use it to connect to this vnc session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FQKY2YQglQzOioTnTbAJ5g.png" /></figure><p>To connect, open <strong>TigerVNC Viewer</strong> and enter the IP address of the machine where you ran the virtctl command, followed by the port number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*PVVSHdEQrdbbhZBtP3YANg.png" /><figcaption>TigerVNC connection details</figcaption></figure><p>Once you click <strong>Connect</strong>, the magic happens, you’ll see a fully running Windows server VM right inside your Kind Kubernetes cluster, ready to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*654u8V4v24vs8ZcO_KLWdQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XMuFXIaiJyojnO2yMe9_JA.png" /><figcaption>Active directory console</figcaption></figure><p>We’ve successfully migrated a Domain Controller VM to a Kind Kubernetes cluster. As mentioned earlier, running a domain controller on Kubernetes is not recommended, this was more of a fun experiment. The real power of KubeVirt lies in running legacy applications alongside containerized workloads, enabling a unified platform for all your apps. It’s also useful for testing, development or gradually modernising monolithic systems without a full re-architecture.</p><p>Hope you enjoyed the blog! I’d love to hear your thoughts or questions, feel free to share them in the comments so we can start a discussion.</p><h4>Further Reading &amp; Resources:</h4><p><strong>KubeVirt:</strong> <a href="https://kubevirt.io/quickstart_kind/">https://kubevirt.io/quickstart_kind/</a></p><p><strong>Containerized Data Importer(CDI): </strong><a href="https://kubevirt.io/user-guide/storage/containerized_data_importer/">https://kubevirt.io/user-guide/storage/containerized_data_importer/</a></p><p><strong>Accessing a VM:</strong> <a href="https://kubevirt.io/user-guide/user_workloads/accessing_virtual_machines/">https://kubevirt.io/user-guide/user_workloads/accessing_virtual_machines/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca54373b4125" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bring Cloud-Like Database Management to Kubernetes with the Nutanix NDB Operator]]></title>
            <link>https://medium.com/@rarun.unofficial/bring-cloud-like-database-management-to-kubernetes-with-the-nutanix-ndb-operator-742fbd4c40d3?source=rss-4e90f1c3ad45------2</link>
            <guid isPermaLink="false">https://medium.com/p/742fbd4c40d3</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[nutanix]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-native]]></category>
            <dc:creator><![CDATA[Arun Kumar R]]></dc:creator>
            <pubDate>Thu, 19 Jun 2025 04:40:38 GMT</pubDate>
            <atom:updated>2025-06-19T04:40:38.489Z</atom:updated>
            <content:encoded><![CDATA[<p>These days, almost every app, whether it’s a shopping site, a mobile game, or a banking platform, relies heavily on databases. While building and managing apps has gotten way simple, thanks to containers and cloud-native tools, but handling databases are still a tricky part.</p><p>Setting up, managing, and scaling databases is often a big headache, especially when different types of databases are involved. DBAs spend a lot of time just keeping databases running smoothly, installing patches, handling backups, managing access, and making sure everything stays reliable. Meanwhile, developers are stuck waiting for the databases they need to get their work done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AlJqGouF4TA54AtVTI6Ppg.png" /></figure><p>With <strong>Nutanix Database Service (NDB)</strong>, that headache just goes away. You get a cloud-like experience for your database management, without all the usual drama. It handles everything for you, from setting up your database, patching, snapshots, making clones. And the best part? It all runs on Nutanix hybrid multi-cloud platform, so you get all the advanced storage saving capabilities, performance and reliability.</p><p>Some standout features include:</p><ul><li><strong>Storage efficiency</strong> with thin clones and snapshots</li><li><strong>One-click bulk patching</strong> for easy maintenance</li><li><strong>Fast replication and recovery</strong> in just minutes</li><li>Increased I/O performance</li></ul><p>NDB supports all the major players like Oracle, SQL Server, MySQL, MariaDB, PostgreSQL and MongoDB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gFDCMB_Ho_w747ja" /><figcaption>NDB Architecture (Image credits: Nutanix)</figcaption></figure><h4><strong>But What really makes the developers smile?</strong></h4><p>It’s the <strong>NDB Operator</strong> for Kubernetes, which brings database management right into your Kubernetes workflow, just like the rest of your app. With a few lines of YAML, you can provision, clone, restore, or clean up a production-grade database. No tickets. No waiting. just ready-to-roll databases in minutes.</p><h3><strong>Time to See It in Action:</strong></h3><p>Let’s bring it all together with a real-world example. We’ll provision a database directly from Kubernetes using the NDB Operator and connect it to a WordPress application, all with just a few lines of YAML. But that’s not all. We’ll also explore some of the coolest features of NDB, like Time Machine and instant cloning.</p><h4><strong>What You’ll Need:</strong></h4><ol><li><strong>A Nutanix cluster </strong>— running on AHV or ESXi, either on-premises or in NC2 (cloud).</li><li><strong>Nutanix Database Service (NDB) </strong>installed<strong>—</strong>NDB runs as a virtual appliance in the target nutanix cluster and supports multiple HA models. For details, see the link below. For this demo, we’re using a simple standalone instance.</li></ol><blockquote><strong>NDB Installation: </strong><a href="https://portal.nutanix.com/page/documents/details?targetId=Nutanix-NDB-User-Guide-v2_8:top-installation-c.html">https://portal.nutanix.com/page/documents/details?targetId=Nutanix-NDB-User-Guide-v2_8:top-installation-c.html</a></blockquote><p>3. A <strong>Kubernetes cluster</strong> with network access to the NDB server and <strong>cert-manager </strong>installed. For this demo, I’m using Nutanix Kubernetes Platform (NKP).</p><blockquote><strong>Nutanix Kubernetes Platform(NKP):</strong> <a href="https://www.nutanix.com/products/kubernetes-management-platform">https://www.nutanix.com/products/kubernetes-management-platform</a></blockquote><p>4. <strong>NDB Operator</strong> installed, on the kubernetes cluster:</p><pre># Add the Nutanix helm repo<br>helm repo add nutanix https://nutanix.github.io/helm/<br><br># Install the NDB operator using helm<br>helm install ndb-operator nutanix/ndb-operator -n ndb-operator --create-namespace</pre><p>Verify the pods are in running state:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aafi-kyQLqQfMjdjgCNKjA.png" /></figure><h4>Let’s Begin:</h4><p><strong>STEP I : Connecting the K8s cluster to the NDB server</strong></p><p>Create the below secret and NDBServer resource:</p><pre># ndb-secret.yaml - contains the credentials to access NDB server<br><br>apiVersion: v1<br>kind: Secret<br>metadata:<br>  name: ndb-secret<br>type: Opaque<br>stringData:<br>  username: username-for-ndb-server<br>  password: password-for-ndb-server<br>  ca_certificate: |<br>    -----BEGIN CERTIFICATE-----<br>    CA CERTIFICATE (ca_certificate is optional)<br>    -----END CERTIFICATE-----</pre><pre># ndbserver.yaml - contains the connection details for NDB server<br> <br>apiVersion: ndb.nutanix.com/v1alpha1<br> kind: NDBServer<br> metadata:<br>   labels:<br>     app.kubernetes.io/name: ndbserver<br>     app.kubernetes.io/instance: ndbserver<br>     app.kubernetes.io/part-of: ndb-operator<br>     app.kubernetes.io/managed-by: kustomize<br>     app.kubernetes.io/created-by: ndb-operator<br>   name: ndb<br> spec:<br>     # Name of the secret that holds the credentials for NDB: username, password and ca_certificate created earlier<br>     credentialSecret: ndb-secret<br>     # NDB Server&#39;s API URL<br>     server: https://[NDB IP]:8443/era/v0.9<br>     # Set to true to skip SSL certificate validation, should be false if ca_certificate is provided in the credential secret.<br>    skipCertificateVerification: true</pre><p>Now apply the resources to the cluster,</p><pre>kubectl apply -f ndb-secret.yaml<br>kubectl apply -f ndbserver.yaml</pre><p>Verify the status of the NDB server, if it says “<strong>OK</strong>” then we are good!</p><pre>kubectl get ndbserver</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0uX1OX4a9DXlWSSnyHpwMg.png" /><figcaption>sample output — ndbserver</figcaption></figure><p><strong>STEP II : Defining the database secret</strong></p><p>In this step, we will be creating a secret containing the database password and SSH key. NDB uses this to configure new databases.</p><pre># db-secret.yaml - contains the password and SSH key for the NDB database to be created<br><br>apiVersion: v1<br>kind: Secret<br>metadata:<br>  name: db-instance-secret<br>type: Opaque<br>stringData:<br>  password: password-for-the-database-instance<br>  ssh_public_key: SSH-PUBLIC-KEY</pre><p>Now, create the secret.</p><pre>kubectl apply -f db-sercret.yaml</pre><h4>⏱️ Before We Move On: Let’s Talk TimeMachines</h4><p><strong>TimeMachine</strong> is a built-in feature of NDB, which captures and maintains snapshots and transaction logs of your source database and every database created in NDB gets a TimeMachine automatically attached.</p><p>Snapshots are available locally in the cluster, so it only takes a few seconds to restore a snapshot.</p><p><strong>SLA</strong> — Controls the retention for snapshots, you can create one or use a default SLA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mzLIvlTFxhULX11--nzutA.png" /><figcaption>Default SLAs for TimeMachine</figcaption></figure><p><strong>Data Access Management(DAB)</strong> — In a multi-cluster setup, you can also configure to replicate data across clusters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jdCR4tOXGWwzmaPK2gebTA.png" /><figcaption>DataAccessManagement Policy</figcaption></figure><p><strong>STEP III : Provisioning the database</strong></p><p>For, this example since we are going to use wordpress application, we will be provisioning a MySQL database using NDB, for which we’ll use a custom resource called Database.</p><blockquote><strong>Note: </strong>NDB comes out-of-the box with default software profiles, that allows you to provision different database engines, without any pre-configuration or image setup. But for production use-cases, it is always recommended to create your own profile.</blockquote><pre># ndb-mysql.yaml - to provision a mysql database instance on NDB.<br><br>apiVersion: ndb.nutanix.com/v1alpha1<br>kind: Database<br>metadata:<br>  # This name that will be used within the kubernetes cluster<br>  name: ndb-mysql-01<br>spec:<br>  # Name of the NDBServer resource created earlier<br>  ndbRef: ndb<br>  isClone: false<br>  # Database instance specific details (that is to be provisioned)<br>  databaseInstance:<br>    # Cluster id of the cluster where the Database has to be provisioned<br>    # Can be fetched from the GET /clusters endpoint<br>    clusterId: &quot;b7cef632-2362-4a02-b839-d9d188a0d531&quot;<br>    # The database instance name on NDB<br>    name: &quot;mysql-db&quot;<br>    # The description of the database instance<br>    description: database created from NDB operator for wordpress<br>    # Names of the databases on that instance<br>    databaseNames:<br>      - wordpress_db<br>    # Credentials secret name for NDB installation<br>    credentialSecret: db-instance-secret<br>    size: 40<br>    timezone: &quot;UTC&quot;<br>    type: mysql<br>    timeMachine:                        # Optional block, if removed the SLA defaults to NONE<br>      sla : &quot;DEFAULT_OOB_GOLD_SLA&quot;<br>      dailySnapshotTime:   &quot;20:00:00&quot;   # Time for daily snapshot in hh:mm:ss format<br>      snapshotsPerDay:     2            # Number of snapshots per day<br>      logCatchUpFrequency: 90           # Frequency (in minutes)<br>      weeklySnapshotDay:   &quot;SATURDAY&quot;  # Day of the week for weekly snapshot<br>      monthlySnapshotDay:  25           # Day of the month for monthly snapshot<br>      quarterlySnapshotMonth: &quot;Jan&quot;     # Start month of the quarterly snapshot</pre><p>Now to trigger the database provisioning, create the resource on the K8s cluster.</p><pre>kubeclt apply -f ndb-mysql.yaml</pre><p>Just sit back and watch the magic happen, you can track the progress from both Kubernetes and the NDB dashboard.</p><p><strong>From K8s:</strong></p><pre>kubectl get database</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*JDsxRmtLe1duXxPH2E2K9Q.png" /></figure><p><strong>NDB dashboard, </strong>gives you a detailed view of all the tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oVGg5mP-2M9qZ_66-icjiA.png" /><figcaption>NDB dashboard — Operations</figcaption></figure><p>Once the deployment is successful, the database status will change to “READY” and also on NDB dashboard, you can get the summary and also view the TimeMachine details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nuPMfOsCK_LlvEKmwvZwKA.png" /><figcaption>Database Summary</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YRzDA-olNEt-cT_RDGxFDg.png" /><figcaption>TimeMachine Summary</figcaption></figure><p><strong>IMPORTANT: </strong>When you provision a database with NDB, a Kubernetes ClusterIP service is automatically created, using the same name as the database resource. This service acts as the internal access point, allowing your Kubernetes applications to seamlessly connect to the database without any extra configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*5NZfY7MEwXsB_Qd0Or1JVQ.png" /><figcaption>Database service created by NDB</figcaption></figure><p><strong>STEP IV : Deploying the wordpress application</strong></p><p>Now, we’ll deploy the WordPress application and connect it to the MySQL database we provisioned earlier using NDB.</p><blockquote><strong>Note:</strong> Ideally, you wouldn’t need to provision the database and application in separate steps. Instead, you can configure the application with an init-container that waits for the database to become healthy before starting the main container (as shown in below example). This approach fully automates the deployment and makes it easy to integrate into your CI/CD pipeline.</blockquote><pre># wordpress.yaml - application manifest to deploy wordpress and service.<br># refer the env section for connection details to the DB<br>---<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: wordpress<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: wordpress<br>  template:<br>    metadata:<br>      labels:<br>        app: wordpress<br>    spec:<br>      initContainers:<br>      - name: init-db<br>        image: busybox:1.28<br>        command:<br>          - sh<br>          - -c<br>          - &gt;<br>            until nslookup ndb-mysql-01-svc.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local;<br>            do echo waiting for database service; sleep 2; done<br>      containers:<br>      - name: wordpress<br>        image: wordpress:latest<br>        env:<br>        - name: WORDPRESS_DB_HOST<br>          value: ndb-mysql-01-svc.default.svc.cluster.local:80<br>        - name: WORDPRESS_DB_USER<br>          value: root<br>        - name: WORDPRESS_DB_PASSWORD<br>          valueFrom:<br>            secretKeyRef:<br>              name: db-instance-secret<br>              key: password<br>        - name: WORDPRESS_DB_NAME<br>          value: database_one<br>        ports:<br>        - containerPort: 80<br>        volumeMounts:<br>        - name: wordpress-data<br>          mountPath: /var/www/html<br>      volumes:<br>      - name: wordpress-data<br>        emptyDir: {}<br>---<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: wordpress<br>spec:<br>  type: NodePort<br>  ports:<br>  - port: 80<br>    targetPort: 80<br>    nodePort: 30008<br>  selector:<br>    app: wordpress<br>---</pre><p>Apply the app manifest,</p><pre>kubectl apply -f wordpress.yaml</pre><p>To access the app you can either use the nodeport or port-forward using the below command, browse to <a href="http://localhost:8080/">http://localhost:8080</a> and complete the initial setup.</p><pre>kubectl port-forward pod/$(kubectl get pod -l app=wordpress -o jsonpath=&quot;{.items[0].metadata.name}&quot;) 8080:80</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ChStpe2Ozi7ejgKzaJ48Kw.png" /><figcaption>Worddpress — Initial config page</figcaption></figure><p>I’ve also created a sample post, which will be useful in later steps to test features like cloning and snapshots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U5Owog8SLO1RGbvadveUkg.png" /></figure><p><strong>STEP V : Cloning a Database</strong></p><p>NDB enables fast, space-efficient database cloning using snapshots or transactional logs, with minimal storage overhead.</p><p>Below is a sample manifest, to create a clone of the database we created earlier.</p><pre># clone-ndb-mysql.yaml<br><br>apiVersion: ndb.nutanix.com/v1alpha1<br>kind: Database<br>metadata:<br>  # This name that will be used within the kubernetes cluster<br>  name: clone-ndb-mysql-01<br>spec:<br>  # Name of the NDBServer resource created earlier<br>  ndbRef: ndb<br>  isClone: true<br>  # Clone specific details (that is to be provisioned)<br>  clone:<br>    # Type of the database to be cloned<br>    type: mysql<br>    # The clone instance name on NDB<br>    name: &quot;Clone-ndb-mysql-01&quot;<br>    # The description of the clone instance<br>    description: testing clones in NDB<br>    # Cluster id of the cluster where the Database has to be provisioned<br>    # Can be fetched from the GET /clusters endpoint<br>    clusterId: &quot;b7cef632-2362-4a02-b839-d9d188a0d531&quot;<br>    credentialSecret: db-instance-secret<br>    timezone: &quot;UTC&quot;<br>    # ID of the database to clone from, can be fetched from NDB REST API Explorer<br>    sourceDatabaseId: &quot;2efb9a58-3e37-448f-928f-fd87d8206917&quot;<br>    # ID of the snapshot to clone from, can be fetched from NDB REST API Explorer<br>    snapshotId: &quot;454678a0-ee26-4efc-bcb1-45654383b941&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MJRuzuj4QO8cd69uZovUig.png" /><figcaption>Cloning in progress</figcaption></figure><p><strong>STEP VI: Teardown</strong></p><p>Deleting a database is very simple, just delete the resource from the kubernetes cluster.</p><pre># To get the list of database<br>kubectl get database<br><br># To delete a database <br>kubectl delete database &lt;database_name&gt;</pre><h3>Final Thoughts</h3><p>With Nutanix Database Service and the NDB Operator, managing databases becomes not just easier, but smarter. From rapid provisioning to effortless cloning and recovery, NDB brings cloud-like simplicity to your database workflows.</p><p>Thanks for reading! Try it out, and see how much easier database management can be, right from your Kubernetes cluster.</p><h4>In Case You’re Curious</h4><ul><li>Demo Video — <a href="https://www.youtube.com/watch?v=3-sPm9nIGrU&amp;list=PLAHgaS9IrJeeaY9GizEOtREfbyVIYUCKg&amp;index=6">https://www.youtube.com/watch?v=3-sPm9nIGrU&amp;list=PLAHgaS9IrJeeaY9GizEOtREfbyVIYUCKg&amp;index=6</a></li><li>GitHub — <a href="https://github.com/nutanix-cloud-native/ndb-operator">https://github.com/nutanix-cloud-native/ndb-operator</a></li><li>NDB User Guide — <a href="https://portal.nutanix.com/page/documents/details?targetId=Nutanix-NDB-User-Guide-v2_8:Nutanix-NDB-User-Guide-v2_8">https://portal.nutanix.com/page/documents/details?targetId=Nutanix-NDB-User-Guide-v2_8:Nutanix-NDB-User-Guide-v2_8</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=742fbd4c40d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Helm or Kustomize?]]></title>
            <link>https://medium.com/@rarun.unofficial/helm-or-kustomize-d9f339dab94d?source=rss-4e90f1c3ad45------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9f339dab94d</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kustomize]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Arun Kumar R]]></dc:creator>
            <pubDate>Fri, 16 May 2025 18:27:34 GMT</pubDate>
            <atom:updated>2025-05-16T18:27:34.317Z</atom:updated>
            <content:encoded><![CDATA[<p>When I first started working with Kubernetes, <strong>Helm</strong> and <strong>Kustomize</strong> were the most confusing tools I came across. At a glance, they seemed to do the exact same thing, allowing you to tweak Kubernetes YAML files without rewriting everything from scratch. I often wondered, <em>Why do we need two tools for this? Why not just stick to one? </em>But as I explored further, I realised they serve fundamentally different purposes.</p><p>In this blog, I’ve tried my best to simplify the differences between Helm and Kustomize, helping you understand how they work at a basic level.</p><p>Ah hold on, feeling hungry, let’s order some food!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KtxNjYlinVRYlOiTUCA2-Q.png" /></figure><p>Helm is like ordering a combo meal. The restaurant has a predefined menu, which includes categories like a burger, fries, and a drink. However, you can customise each component, choosing between a veg or chicken burger, selecting peri-peri or regular fries, and picking your preferred drink.</p><p>On the other hand, Kustomize can do even more, like when you don’t like mayonnaise in your burger, but there’s no option available on the app to remove it. In this case, what you can do is you can select a regular burger and leave a special note to the chef mentioning, <em>“Please don’t add mayonnaise in the Burger.” </em>The chef then follows the standard recipe but makes that one specific change, no mayo!</p><p>As an end user, Helm is simple and easy to use, but you’re limited to customising only the variables that are explicitly allowed by the owner of the helm chart. In the example of ordering a combo meal, you can choose your drink, but you can’t change the size, because the restaurant has fixed it and doesn’t allow modifications. But, Kustomize is a template-less approach, where you can modify or add anything to the existing recipe, for example, you can even “request extra ketchup” or “no onions”……, using this approach is a bit of overhead to the end-user, because the user has to specify the change aswell as the base recipe or the source YAML file, where the change needs to be made.</p><h3><strong>Helm:</strong></h3><p>Using the same analogy, let’s explore the different components of Helm,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*my0_AXI9J5U8E8LPg_M5hw.png" /><figcaption>Important components of a Helm chart</figcaption></figure><p>Now, let’s see a real example of, installing a nginx application using helm,</p><blockquote>Note: As a pre-requisite, you need to have helm installed on your local machine and have a running K8s cluster to install the chart.</blockquote><ol><li>First initialise the helm chart by running the below command, this will create the directory structure for helm.</li></ol><pre>helm create mynginx</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*ViepuK05EoF2WIALKNcIxw.png" /></figure><p>2. Inside templates directory, is where we need to place all the YAML files of the application, also templating the required variables. For this example, we will just use a single <em>deployment.yaml</em> file.</p><pre># templates/deployment.yaml<br><br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: {{ .Release.Name }}-nginx<br>  labels:<br>    app: nginx<br>spec:<br>  replicas: {{ .Values.replicaCount }}<br>  selector:<br>    matchLabels:<br>      app: nginx<br>  template:<br>    metadata:<br>      labels:<br>        app: nginx<br>    spec:<br>      containers:<br>        - name: nginx<br>          image: nginx:latest<br>          ports:<br>            - containerPort: 80</pre><blockquote><strong>Note: </strong>{{ .Release.Name }} is a builtin variable, which is the release name that you specify while installing the chart and {{ .Values.replicaCount }} is a template variable we are defining, which will allow the user to modify the replicas while deploying the chart.</blockquote><p>3. Delete all the other, unwanted files in the <em>templates/ </em>directory, except <em>deployment.yaml</em>.</p><p>4. For all the variables, that we had defined in the template files, we have to define a corresponding default value, incase user did not specify any override value, the defaults will be used. In our case, it’s just one variable, <em>“replicaCount”.</em></p><pre># values.yaml<br><br>replicaCount: 2</pre><p>5. Finally, lets install the helm chart, run below command from within the same directory of <em>chart.yaml.</em></p><pre>helm install test1 .</pre><blockquote><strong>Note: “</strong>test1” is the release name, you can deploy the same helm chart multiple times by specifying different release names for each instance.</blockquote><p>The chart has, deployed a nginx deployment with 2 replicas(default as per values.yaml)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dVoio-2PuMm_dp0mbc8xOw.png" /></figure><p>6. Now, try creating a separate values.yaml, by adjusting the replica count. So, ideally in a real world situation, we can have different values.yaml file for different environment, for example,</p><pre># values_dev.yaml<br><br>replicaCount: 2</pre><pre># values_stg.yaml<br><br>replicaCount: 8</pre><pre># values_prod.yaml<br><br>replicaCount: 25</pre><p>To point a specific values.yaml file during the helm installation, use the below format.</p><pre>helm install -f values.yaml &lt;releasename&gt; . </pre><p>7. After installation, to view the YAML files rendered by a helm release, you can run the below command:</p><pre>helm get manifest &lt;release-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9EgiJABjIJIUJbEWvdkYPA.png" /><figcaption>sample output of get manifest</figcaption></figure><h3><strong>Kustomize:</strong></h3><p><em>“Kustomize is like a forked Git repository, you can reference to a </em><strong><em>base</em></strong><em> code, but make the modifications in your own </em><strong><em>overlay</em></strong><em> repository”</em></p><p>Kustomize is a Kubernetes-native tool for managing configuration overlays. You can directly use it with kubectl -k or the standalone Kustomize CLI.</p><p>The core of Kustomize is the kustomization.yaml file, it&#39;s what defines and drives the customisation process.</p><p><strong>Kustomization.yaml</strong></p><pre># kustomization.yaml<br><br># Define all your base YAML resources here<br>resources:<br>  - deployment.yaml<br><br># Define all the customizations/patches to be applied<br>namePrefix: test-<br>replicas:<br>  - name: your-deployment-name<br>    count: 3</pre><ol><li>To test this in action, let’s use the same nginx application, create a <em>deployment.yaml</em> file by copying the below contents.</li></ol><pre># deployment.yaml<br><br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: nginx-deploy<br>  labels:<br>    app: nginx<br>spec:<br>  replicas: 2<br>  selector:<br>    matchLabels:<br>      app: nginx<br>  template:<br>    metadata:<br>      labels:<br>        app: nginx<br>    spec:<br>      containers:<br>        - name: nginx<br>          image: nginx:latest<br>          ports:<br>            - containerPort: 80  </pre><p>2. Now, let’s create a <em>kustomzation.yaml</em> in the same directory, here under resources, we specify all the base YAML files, in our case it’s only one <em>deployment.yaml</em>. And the remaining section describes the customisations, for this example, we are just changing the replica count to 7 for the deployment.</p><pre># kustomization.yaml<br><br># Define all your base YAML resources here<br>resources:<br>  - deployment.yaml<br><br># changing replicas to 7 instead of 2<br>replicas:<br>  - name: nginx-deploy<br>    count: 7</pre><blockquote><strong>Note: </strong>The “replicas” used above to patch the replicacount is a built-in transformer, there are multiple such available. If there is something you want to change and it’s not possible by a transformer, you will have to use patches.</blockquote><blockquote><strong>Please refer the docs for more details</strong> <a href="https://kubectl.docs.kubernetes.io/references/kustomize/builtins/">https://kubectl.docs.kubernetes.io/references/kustomize/builtins/</a></blockquote><p>3. Now, to build and apply the application with the custom configuration, just run the below command on the cluster, from within the same directory of<em> kustomization.yaml.</em></p><pre>kubectl apply -k .</pre><p>Kustomize has successfully patched the replicacount and created a nginx deployment with 7 replicas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-oyy_2m5KeiLJFckZKsnsg.png" /></figure><p>In a real-world environment, where you’re required to manage multiple environments such as <strong>dev</strong>, <strong>staging</strong>, and <strong>prod</strong>, it’s important to maintain a structured folder layout. Each environment should have its own overlay directory, containing a kustomization.yaml file. The resources defined in each of these environment-specific directories should reference a common <strong>base</strong> directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*OOwsTMROOBEltIJgO3u80w.png" /></figure><pre># base kustomization.yaml<br><br>resources:<br>- pod.yaml</pre><pre># dev kustomization.yaml<br><br>resources:<br>- ./../base<br><br>namePrefix: dev-</pre><pre># to build and apply to dev environment<br><br>kubectl apply -k kustomize/overlays/dev</pre><p>I know things can seem a bit complicated at first, but once you get hands-on, you’ll realize it’s more straightforward than it looks. I’ve kept this blog at a beginner-friendly level to help solidify the core concepts, because once those are clear, building on top of them becomes much easier.</p><p>Both <strong>Helm</strong> and <strong>Kustomize</strong> are incredibly powerful tools that can do far more than what we’ve covered here. I highly recommend exploring the official documentation to unlock more advanced and efficient ways of managing your Kubernetes configurations and also check how these can be configured to the CI/CD pipelines.</p><p>Ding Dong! 🚪🎉 Guess what? My food has arrived! 🍔🍟 Let me take a break and enjoy it.</p><p>Thank you so much for taking the time to read through this post. I truly hope you found it helpful and learned something new.</p><p><strong>Links for reference:</strong></p><ul><li><a href="https://helm.sh/">Helm</a></li><li><a href="https://kustomize.io/">Kubernetes native configuration management</a></li><li><a href="https://kubectl.docs.kubernetes.io/guides/example/multi_base/">Multibase</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9f339dab94d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I built a Private GPT Using the Nutanix Enterprise AI (NAI)?]]></title>
            <link>https://medium.com/@rarun.unofficial/how-i-built-a-private-gpt-using-the-nutanix-enterprise-ai-nai-92cd002d1bef?source=rss-4e90f1c3ad45------2</link>
            <guid isPermaLink="false">https://medium.com/p/92cd002d1bef</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[hugging-face]]></category>
            <category><![CDATA[artificail-intelligence]]></category>
            <category><![CDATA[privategpt]]></category>
            <dc:creator><![CDATA[Arun Kumar R]]></dc:creator>
            <pubDate>Wed, 30 Apr 2025 17:54:14 GMT</pubDate>
            <atom:updated>2025-05-24T14:38:01.091Z</atom:updated>
            <content:encoded><![CDATA[<p>AI is all around us these days, from robot vacuum cleaners in our homes to rockets launched by ISRO. It helps decide what we see on social media, what we buy online, and even keeps an eye on how we sleep. Most of the time, we don’t even realize it’s there. Whether we’re using chat tools like ChatGPT or DeepSeek, AI has become a regular part of our everyday lives.</p><p>It’s pretty amazing, right? AI has definitely made things easier and helped us get more done. But along with all the good stuff, there are also some real challenges, like security issues and the struggle to actually start using it. For individual users, these might not seem like a big deal, but for companies, they can be a serious challenge.</p><p>In this blog, we’ll take a look at how Nutanix Enterprise AI (NAI) helps organizations tackle the common roadblocks in AI adoption and speed up their AI journey. We’ll go through the steps to deploy <strong>NAI </strong>on the <strong>Nutanix Kubernetes Platform (NKP)</strong>, set up a secure inference endpoint, and connect it to a chat app similar to ChatGPT. The end result? A powerful private GPT setup that gives you all the benefits of AI, while keeping your data completely private and safe within your own infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6k-MVx04oVwzcUML0fmzJQ.png" /><figcaption>A preview of how the GPT app will look like.</figcaption></figure><p><strong>Pre-Requisites:</strong></p><p>While NAI can be deployed on any kubernetes infrastructure(&gt;1.28), for this specific demo we will be using a NKP cluster hosted on Nutanix infrastructure.</p><ol><li>Nutanix Kuberentes Platform (NKP) cluster — already deployed (v2.14)</li><li>NFS server — we will be using Nutanix files for this demo</li><li>Sufficient compute power to run the inference endpoints</li><li>Install NVIDIA GPU Operator (if GPU nodes)</li><li>Access token from hugging face to download the required models, which you can generate for free (<a href="https://huggingface.co/">https://huggingface.co/</a>).</li></ol><blockquote><strong>Note: </strong>While it’s best to use GPU nodes for top performance, NAI does support CPU-only nodes too. That said, if you want the fastest results, GPUs are definitely the way to go.</blockquote><figure><img alt="Image credits: Nutanix" src="https://cdn-images-1.medium.com/max/880/1*I3AFliVI3zIJJ6XiFmenTA.png" /><figcaption>Image credits: Nutanix</figcaption></figure><p><strong>Refer the link below for more details:</strong> <a href="https://portal.nutanix.com/page/documents/details?targetId=Nutanix-Enterprise-AI-v2_0:top-nai-requirements-c.html">https://portal.nutanix.com/page/documents/details?targetId=Nutanix-Enterprise-AI-v2_0:top-nai-requirements-c.html</a></p><p><strong>Now, Time for some action!</strong></p><p><strong>STEP 1 — Let’s create a files storage class to access the NFS server</strong></p><ol><li>In Nutanix files, we will first create a Rest API user on the files server, which can be done using the files console, configuration-&gt;Manage roles.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HI_GrEdllDI9xiPasdBngA.png" /><figcaption>Files console to create restapi user</figcaption></figure><p>2. Now, create a secret on the NKP cluster, contains the PE and files user credentials, following the below template.</p><pre>apiVersion: v1<br>kind: Secret<br>metadata:<br> name: pe-files-secret<br> namespace: ntnx-system<br>stringData:<br># Provide Nutanix Prism Element credentials which is a default UI credential separated by colon in &quot;key:&quot;.<br># Provide Nutanix File Server credentials which is a REST API user created on File server UI separated by colon in &quot;files-key:&quot;.<br>  key: &quot;192.168.5.7:9440:admin:nutanix/4u&quot;<br>  files-key: &quot;files-test.lab.local:nai:nutanix/4u&quot;</pre><p>3. To create the storage class, use the below template, you may need to modify the nfsServerName.</p><pre>apiVersion: storage.k8s.io/v1<br>kind: StorageClass<br>metadata:<br>    name: nai-nfs-storage<br>provisioner: csi.nutanix.com<br>parameters:<br>    csi.storage.k8s.io/node-publish-secret-name: pe-files-secret<br>    csi.storage.k8s.io/node-publish-secret-namespace: ntnx-system <br>    csi.storage.k8s.io/controller-expand-secret-name: pe-files-secret<br>    csi.storage.k8s.io/controller-expand-secret-namespace: ntnx-system<br>    dynamicProv: ENABLED<br>    nfsServerName: files-test<br>    csi.storage.k8s.io/provisioner-secret-name: pe-files-secret<br>    csi.storage.k8s.io/provisioner-secret-namespace: ntnx-system<br>    storageType: NutanixFiles<br>    squashType: root-squash<br>reclaimPolicy: Delete<br>volumeBindingMode: Immediate<br>allowVolumeExpansion: true<br>mountOptions:<br>   - vers=4</pre><p><strong>STEP 2- Installing the dependencies</strong></p><p>Enable the below platform applications from the NKP dashboard, so it gets deployed automatically.</p><ul><li>ISTIO service mesh</li><li>Cert Manager</li><li>Knative</li><li>NVIDIA GPU operator</li></ul><blockquote><strong>Note:</strong> This is only supported for NKP pro and ultimate tiers, if on starter, then need to install the apps manually.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L06o4OScCZI4YJmZ0OX2cQ.png" /><figcaption>NKP dashboard</figcaption></figure><p>Install Kserve by running the below commands:</p><pre>git clone --depth 1 --branch v0.14.0 https://github.com/kserve/kserve.git<br><br>#go into the kserve-crd directory<br>cd ./kserve/charts<br><br>#install the crds<br>helm upgrade --install kserve-crd ./kserve-crd -n kserve --create-namespace<br><br>#intall the kserve resources<br>helm upgrade --install kserve-resource ./kserve-resources -n kserve --create-namespace </pre><p>Verify if the pods are deployed and in running state:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7BvkyXFnfRd4yiI2y3LaLQ.png" /></figure><p><strong>STEP 3 — Deploing NAI</strong></p><ol><li>Add the NAI helm repo and pull the charts for required version:</li></ol><pre>helm repo add ntnx-charts https://nutanix.github.io/helm-releases &amp;&amp; helm repo update ntnx-charts<br>helm pull ntnx-charts/nai-core --version=2.3.0 --untar=true<br><br><br>#for other versions you can use below command to list<br>helm search repo ntnx-charts/nai-core --versions</pre><p>2. To get access to NAI container images, you need to get the docker token from the Nutanix support portal, please refer the below link to get the docker tokens.</p><p><a href="https://portal.nutanix.com/page/documents/details?targetId=Portal-Help:sup-docker-hub-private-repository-sp-c.html">https://portal.nutanix.com/page/documents/details?targetId=Portal-Help:sup-docker-hub-private-repository-sp-c.html</a></p><p>3. Now, let’s deploy NAI using the helm chart</p><pre>helm install nai-core ntnx-charts/nai-core --version=2.3.0 -n nai-system --create-namespace --wait \<br>--set imagePullSecret.credentials.username=docker_user \<br>--set imagePullSecret.credentials.email=docker_user \<br>--set imagePullSecret.credentials.password=docker_password \<br>--insecure-skip-tls-verify \<br>--set naiApi.storageClassName=nai-nfs-storage \<br>--set defaultStorageClassName=nutanix-volume </pre><p>4. Verify, if all the pods in the “nai-system” namespace are in a good state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gRWbZ-7qr3fNttNb9rnFaw.png" /></figure><p><strong>STEP 4— Making NAI secure</strong></p><ol><li>If you have a CA, you can generate a signed certificate, if not we can also use a self-signed certificate. For, this demo we will use a self-signed certificate using openssl.</li></ol><pre>openssl req -x509 -newkey rsa:2048 -keyout tls.key -out tls.crt -days 365 -nodes -subj &quot;/CN=lab.local&quot;</pre><p>2. Create a secret containing the certificate files on the NKP cluster.</p><pre>kubectl create secret tls nai-istio-ingressgateway-certs --cert=tls.crt --key=tls.key -n istio-system</pre><p>3. Now, edit the istio gateway resource to use HTTPS, by adding the new certificate.</p><pre>kubectl edit gateways.networking.istio.io knative-ingress-gateway -n knative-serving</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xG6s5tz07SikMvuyE98YNA.png" /><figcaption>sample configuration</figcaption></figure><p>4. Now, let’s try accessing the NAI dashboard, using the external IP of ISTIO gateway, you can run the below command to retrieve the url.</p><p>First time credentials: admin/Nutanix.123</p><pre>kubectl get svc istio-ingressgateway -n istio-system -o jsonpath=&#39;https://{.status.loadBalancer.ingress[0].ip}&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a-JCOuZH9vojdf0bRT7ozw.png" /><figcaption>NAI Dashboard Login</figcaption></figure><p>The finish line’s in sight, hang in there!</p><p><strong>STEP 5 — Downloading a model and creating an inference endpoint</strong></p><ol><li>First, add the hugging face access token to NAI, from Settings-&gt;Third Party Credentials.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YDfi3JXr2_tU4qtgE-H-VA.png" /></figure><p>2. From Models tab, import a hugging face model, based on your compute and requirement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mqQEOfqtwmiG8mjigQ97Tg.png" /></figure><blockquote><strong>Note:</strong> Ensure that your hugging face token account, has access to the model you want to download, else you may need to request access from hugging face website.</blockquote><p>3. Once you click on import, the model gets downloaded locally and stored in the files storage class we created earlier and once the status changes to active means the model ready for usage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-hFou5SCIQ3uE-BhKTpm9Q.png" /></figure><p>4. Create an inference endpoint that allows end-user applications to interact with the LLM. Additionally, generate an API key to secure access to this endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ipxu0ejBVcwwGZ9CK5F1nw.png" /></figure><blockquote>Note: You can select or disable the GPUs based on your infrastructure.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XCWue_AaeuyTwiOf5LskjA.png" /><figcaption>select an api key or create a new one</figcaption></figure><p>5. The endpoints gets deployed on the “nai-admin” namespace, you can list the pods to verify the status. Also, from NAI dashboard, you get the metrics and health status of the endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W9zlTAFyL85Kwcm6ud76BQ.png" /></figure><p>6. To test, before connecting with the client application, you can click on the test button and send a sample query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yy3IjWVKTkCYiJeskyeDcw.png" /><figcaption>Testing the endpoint from NAI dashboard</figcaption></figure><p><strong>Final STEP — Connecting the endpoint to a chat application</strong></p><p>We will be using LibreChat as the chat application, which is very powerful and opensource. It allows connecting custom LLM endpoints and has a very similar UI to chatGPT.</p><ol><li>Clone the git repo for LibreChat</li></ol><pre>git clone https://github.com/danny-avila/LibreChat.git</pre><p>2. Go into the project directory and edit/create the docker-compose.override.yml file, adding the below contents.</p><pre>version: &#39;3.4&#39;<br>services:<br>  api:<br>    volumes:<br>    - type: bind<br>      source: ./librechat.yaml<br>      target: /app/librechat.yaml<br>    environment:<br>      NODE_TLS_REJECT_UNAUTHORIZED: &#39;0&#39;</pre><p>3. Now, create/edit a file named librechat.yaml at the project root, add the following spec to connect the NAI inference endpoint.</p><pre>version: 1.0.0<br>cache: true<br>endpoints:<br>  custom:<br>    - name: &quot;NAI&quot;<br>      apiKey: &quot;{replace with your api key}&quot;<br>      baseURL: &quot;https://{replace with your endpoint ip}/api/v1/chat/completions&quot;<br>      directEndpoint: true<br>      allowInsecure: true<br>      models:<br>        default: [&quot;nai&quot;]  #this name should be same as your endpoint name<br>        fetch: false<br>      titleConvo: true<br>      titleModel: &quot;nai&quot;<br>      modelDisplayLabel: &quot;NAI-Model&quot;<br>      dropParams:<br>        - &quot;stop&quot;<br>        - &quot;user&quot;<br>        - &quot;frequency_penalty&quot;<br>        - &quot;presence_penalty&quot;<br>      headers:<br>        Authorization: &quot;Bearer {replace with your api key}&quot;<br>        Content-Type: &quot;application/json&quot;</pre><p>4. Now, let’s spin up the app locally, but you can also deploy this on a Kubernetes cluster so users need not run their own instance of the chat app, instead they can all point to a central URL, which would be ideal for a production setup.</p><pre>docker compose up</pre><p>Now, after successful startup, the app should be accessible using the below url.</p><p><a href="http://localhost:3080/">http://localhost:3080</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hf48Iut8LaS7Z661irLcTQ.png" /><figcaption>LibreChat Login screen</figcaption></figure><p>You will have to create a new user by clicking on signup and once you are in, you can just change the model to NAI from the drop down on the top and thats all!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZT0N7i3JFcXvpvW8OaJO3Q.png" /><figcaption>select the NAI model from the dropdown</figcaption></figure><p>We have built a privateGPT, now start using it by sending unlimited queries, the interface is very similar to chatGPT, it can have chat history, have multiple users with proper access control and much more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uwgFjXDuNs_Df5z-mLELzw.png" /><figcaption>sample query about GPU</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qZz4JATEgUt8vErZnrxFJw.png" /><figcaption>Asking to fix a simple code</figcaption></figure><p>To further extend its capabilities, explore integrations with MCP tools and automation agents, unlocking seamless workflows, intelligent task handling and streamlined operations. The journey to private, powerful AI starts here, make it yours!</p><blockquote><strong><em>Disclaimer:</em></strong><em><br>The views and opinions expressed in this blog are my own and do not necessarily reflect those of any company or organization. The information provided is based on personal experience and research. It is presented </em>as-is<em> without any warranties. For official guidance, please refer to the official documentation or support channels.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92cd002d1bef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Canary deployments on Multi-Cluster Kubernetes with ISTIO]]></title>
            <link>https://medium.com/@rarun.unofficial/implementing-canary-deployments-on-multi-cluster-kubernetes-with-istio-68241f7ed406?source=rss-4e90f1c3ad45------2</link>
            <guid isPermaLink="false">https://medium.com/p/68241f7ed406</guid>
            <category><![CDATA[service-mesh]]></category>
            <category><![CDATA[canary-deployments]]></category>
            <category><![CDATA[istio]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[multi-cluster]]></category>
            <dc:creator><![CDATA[Arun Kumar R]]></dc:creator>
            <pubDate>Fri, 04 Apr 2025 19:45:21 GMT</pubDate>
            <atom:updated>2025-04-04T19:45:21.311Z</atom:updated>
            <content:encoded><![CDATA[<p>Running an application in a single Kubernetes cluster is great — until that cluster goes down 😬! True resiliency comes with spreading workloads across multiple clusters, ideally at different data centres or even different cloud providers. But the challenge is how do services from one cluster discover and communicate with each other?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*l5LWeq_z_nUAFeYP-JHcWA.jpeg" /></figure><p>The answer is ISTIO!</p><p>With this you can create a mesh out of multiple kubernetes clusters, whether they’re on same or different networks, allowing services from different clusters discover and securely talk with each other, as if they are part of the same k8s cluster.</p><p><strong>What is Canary?</strong></p><p>Canary deployment is a way to safely release a new version of a service by first letting only a small number of users try it out. It’s like in war when a small group of soldiers is sent ahead to check if it’s safe — if everything goes well, the rest can follow. If there’s a problem, only a few are affected, and it’s easy to pull back and fix things before everyone uses it.</p><p><strong>What’s our plan here?</strong></p><ol><li><strong>Create an ISTIO multi-cluster mesh: </strong>we will create a service mesh connecting two Kubernetes clusters on different networks, expose the services and enable endpoint discovery.</li><li><strong>Deploy a microservice app in multi-cluster: </strong>we will be deploy a micro-service application, splitting the services between both the clusters and visualise how ISTIO helps seamless connectivity accross clusters.</li><li><strong>Canary deployment: </strong>Application<strong> </strong>upgrades are risky, so instead of rolling out a new version all at once, we use a canary deployment with Istio. The new version is deployed in a single cluster and Istio’s traffic shifting capabilities gradually route a small percentage of traffic to it.</li></ol><p><strong>Lets’ get into action!</strong></p><p><strong>Pre-requisites</strong></p><ol><li>Two Kubernetes clusters — can be deployed on same or different network.</li><li>LoadBalancer — If your k8s cluster is on-prem, then it should support service of type LoadBalancer, you can also use MetalLB.</li><li>Kubectl access to both the clusters</li></ol><p>For this Demo, I will be using two Kubernetes clusters hosted on different networks, cluster01(Bangalore) and cluster02(Mumbai).</p><p><strong>TASK1 — Connecting the clusters:</strong></p><p>We have two independent Kubernetes clusters, let’s connect connect them together, forming a single mesh.</p><p><strong>Deploy ISTIO on both the clusters</strong></p><ol><li>Create the istio-system namespace on both the clusters</li></ol><pre>kubectl create ns istio-system</pre><p>2. For a multi-cluster setup the CA should be same for establishing trust between the clusters, hence we will be creating a common CA cert for both the clusters.</p><pre>openssl req -x509 -newkey rsa:4096 -keyout ca-key.pem -out ca-cert.pem -days 3650 -nodes -subj &quot;/CN=Istio-CA&quot;</pre><p>3. Now create the istio CA secret on both the clusters, with the newly generated certificate.</p><pre>kubectl create secret generic cacerts -n istio-system \<br>    --from-file=ca-cert.pem \<br>    --from-file=ca-key.pem \<br>    --from-file=cert-chain.pem=ca-cert.pem \<br>    --from-file=root-cert.pem=ca-cert.pem</pre><p>4. Download and update the ISTIO helm repo to your local system.</p><pre>helm repo add istio https://istio-release.storage.googleapis.com/charts<br>helm repo update</pre><p>5. Set the default network label for each cluster and install istio primary, on both the clusters.</p><p><em>Cluster01(Bangalore) — commands</em></p><pre>#Set the default network label for cluster1<br>kubectl label namespace istio-system topology.istio.io/network=network1<br><br>#install ISTIO base chart<br>helm install istio-base istio/base -n istio-system<br><br>#install ISTIO control plane<br>helm install istiod istio/istiod -n istio-system \<br>  --set meshConfig.proxyMetadata.ISTIO_META_DNS_CAPTURE=&quot;true&quot; \<br>  --set meshConfig.proxyMetadata.ISTIO_META_DNS_AUTO_ALLOCATE=&quot;true&quot; \<br>  --set global.meshID=mesh1 \<br>  --set global.multiCluster.clusterName=cluster1 \<br>  --set global.network=network1</pre><p><em>Cluster02(Mumbai) — commands</em></p><pre>#Set the default network label for cluster2<br>kubectl label namespace istio-system topology.istio.io/network=network2<br><br>#install ISTIO base chart<br>helm install istio-base istio/base -n istio-system<br><br>#install ISTIO control plane<br>helm install istiod istio/istiod -n istio-system \<br>  --set meshConfig.proxyMetadata.ISTIO_META_DNS_CAPTURE=&quot;true&quot; \<br>  --set meshConfig.proxyMetadata.ISTIO_META_DNS_AUTO_ALLOCATE=&quot;true&quot; \<br>  --set global.meshID=mesh1 \<br>  --set global.multiCluster.clusterName=cluster2 \<br>  --set global.network=network2</pre><p>6. You can verify if the Istio pods are deployed and in running state</p><pre>kubectl get pods -n istio-system</pre><p><strong>Install east-west gateway, expose services and configure the remote secret for endpoint discovery.</strong></p><ol><li>Install the East-West gateway</li></ol><p><em>Cluster01(Bangalore)</em></p><pre>helm install istio-eastwestgateway istio/gateway -n istio-system --set name=istio-eastwestgateway --set networkGateway=network1</pre><p><em>Cluster02(Mumbai)</em></p><pre>helm install istio-eastwestgateway istio/gateway -n istio-system --set name=istio-eastwestgateway --set networkGateway=network2</pre><p>2. Expose the services, by creating the below istio gateway resource on both the clusters.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d4ec856970f15737fa7f317b302b71f7/href">https://medium.com/media/d4ec856970f15737fa7f317b302b71f7/href</a></iframe><pre>kubectl apply -f expose-services.yaml -n istio-system</pre><p>3. Download and install Istio cli — istioctl.</p><pre>curl -sL https://istio.io/downloadIstioctl | sh -<br>export PATH=$HOME/.istioctl/bin:$PATH</pre><p>4. Enable endpoint discovery — create a remote secret for istio to access the api server of the remote connected cluster.</p><blockquote>Note: In below command replace the “cluster name” and “remote-cluster-kubeconfig.yaml”<em> </em>with the actual name and kubeconfig file of the remote cluster, this secret needs to be created for both the clusters</blockquote><pre>istioctl create-remote-secret \<br>  --kubeconfig=remote-cluster-kubeconfig.yaml \<br>  --name=cluster1 | kubectl apply -f -</pre><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fFPbwQS_avtDs-7G4LfHAA.png" /><figcaption>This is executed on Bangalore cluster, hence remote secret is mumbai01-kubeconfig.yaml</figcaption></figure><p>Now, successfully we have connected the k8s clusters, so services can discover and talk with each other.</p><p><strong>TASK2 — Deploying the basic App</strong></p><p>We will be using the classic bookinfo app for this lab, but instead of deploying the whole app on a single cluster, we will be deploying only the required parts, between the two clusters. Our, initial design would look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*hj4Gylp-gsiBi2vbcSTvrg.png" /></figure><p>Product page app and reviews v1, are deployed on both the clusters. When product page talks to reviews service, by default it’s load balanced between both the clusters. So, even if reviews on the local cluster fails, the application will not be affected.</p><p><strong>Deploy product and review-v1 on both the clusters:<br></strong>1. First, let’s create a namespace called “sample”, with Istio injection enabled, to deploy our bookinfo app.</p><pre>kubectl create namespace sample &amp;&amp; kubectl label namespace sample istio-injection=enabled</pre><p>2. Now, apply the below yaml on both the clusters, by running this command.</p><pre>kubectl -n sample apply -f https://gist.githubusercontent.com/rathnaarun77/ada26819ca96ee9caa73da7b9df33d61/raw/</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/17894d2e16ec93576f28e4206417083c/href">https://medium.com/media/17894d2e16ec93576f28e4206417083c/href</a></iframe><p>3. Lets verify, if the pods are running and application is accessible.</p><pre>kubectl get pods -n sample</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*zH9Q2jSG62GQLeJxHUJ6ww.png" /></figure><p>4. The UI for the products page can be accessed from both the clusters, but in an actual environment you can also use an external load balancer to route traffic to both the clusters, so to withstand site failures.</p><p>For this, demo we will access the UI separately, you can either use the nodeport or run this command to port-forward to localhost.</p><pre>kubectl port-forward svc/productpage -n sample 9080:9080After running the above command, you can launch the UI using below url from a browser,</pre><p>After running the above command, you can access the UI using below url from a browser,</p><p><a href="http://localhost:9080/productpage?u=normal">http://localhost:9080/productpage?u=normal</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LjlmZQvxohynYEskhsmvSg.png" /></figure><blockquote>Note that in the above screenshot, the reviews are served by V1, as we don’t have any other versions deployed yet.</blockquote><p><strong>TASK3 — Time to upgrade!</strong></p><p>Now, that we have a new version of reviews app (V2), let’s use the canary model to rollout in phases, we will just deploy the reviews-v2 on a single cluster and then use Istio to control the traffic, 80% to V1 and 20% to reviews V2. Here is the updated design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*jn68tu3Yv9YVGSf3U2woZw.png" /><figcaption>Architecture2 — Canary</figcaption></figure><blockquote>Note: The V2 review service is deployed on the Mumbai01 cluster, but that doesn’t mean only the product page from the local cluster can access it. In fact, 20% of the traffic from the Bangalore cluster is also routed to the V2 reviews service.</blockquote><ol><li>Deploy the v2 reviews app, only to the cluster02</li></ol><pre>kubectl -n sample apply -f https://gist.githubusercontent.com/rathnaarun77/05ccb7b8d8fa51fec67096d18ba25a36/raw/</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f6de54c2f180bfa228bc92109d153796/href">https://medium.com/media/f6de54c2f180bfa228bc92109d153796/href</a></iframe><p>Now that we have deployed the v2 version of the reviews service on the Mumbai cluster, traffic will still not be routed to the new version, even from within the same cluster. This is because we haven’t defined a routing rule in the reviews VirtualService to direct 20% of the traffic to v2.</p><p>2. To modify the virtual service, apply the below yaml on both the clusters.</p><pre>kubectl -n sample apply -f https://gist.githubusercontent.com/rathnaarun77/f3530926d38f9ec85b61d235bf7c2d24/raw/</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/41d9e71ba638db0c277b47656df7a8d3/href">https://medium.com/media/41d9e71ba638db0c277b47656df7a8d3/href</a></iframe><blockquote>Note: The weight for v1 is 80% and v2 is set to 20%</blockquote><p>The available versions of the reviews app needs to be pre-defined using a DestinationRule custom resource, which we have already created while deploying the app in earlier step. Just for reference I am giving the yaml here,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2535d32f837339e18c4bbda7a443fa5e/href">https://medium.com/media/2535d32f837339e18c4bbda7a443fa5e/href</a></iframe><p>3. Now, again let’s try accessing the UI from cluster01 and try refreshing it multiple times, you should notice that 2/10 the traffic gets routed to the v2 reviews, which is actually running on the remote cluster.</p><blockquote>Note: The traffic to the remote cluster uses the Istio east-west gateway.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MngpMFgE4iGWsR35wkBMjw.png" /></figure><p>Once you are confident, you can again modify the virtual service to route 100% traffic to the new version and delete the old deployments.</p><p><strong>Conclusion</strong></p><p>With this, we have successfully implemented multi-cluster using Istio, on top of that we have also tried canary, for application upgrades. Hope, this was helpful, I have tried to simplify as much as i can, so it would be easy to understand. But there’s so much more you can do with Istio multi-cluster!</p><p><strong>Reference:</strong></p><ul><li><a href="https://istio.io/latest/docs/setup/install/multicluster/multi-primary_multi-network/">Install Multi-Primary on different networks</a></li><li><a href="https://istio.io/latest/docs/tasks/traffic-management/traffic-shifting/">Traffic Shifting</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68241f7ed406" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Deployment of Nutanix Kubernetes Platform (NKP) with Ansible]]></title>
            <link>https://medium.com/@rarun.unofficial/automating-deployment-of-nutanix-kubernetes-platform-nkp-with-ansible-bb89142176ee?source=rss-4e90f1c3ad45------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb89142176ee</guid>
            <dc:creator><![CDATA[Arun Kumar R]]></dc:creator>
            <pubDate>Fri, 14 Mar 2025 21:26:25 GMT</pubDate>
            <atom:updated>2025-05-19T14:04:43.895Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><p>Nutanix Kubernetes Platform (NKP) delivers a seamless Kubernetes experience across on-prem, edge and cloud environments. It combines pure upstream Kubernetes with carefully selected infrastructure applications, ensuring a production-ready setup from day one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXcEhd4cWhxcPWCljUE6MQ.png" /><figcaption>Image courtesy of Nutanix.</figcaption></figure><blockquote>For more details: <a href="https://www.nutanixbible.com/18a-book-of-cloud-native-services-nutanix-kubernetes-platform.html">https://www.nutanixbible.com/18a-book-of-cloud-native-services-nutanix-kubernetes-platform.html</a></blockquote><p>In this blog, I’ll walk through how I automated the deployment of an NKP management cluster on Nutanix using Ansible. I have also published the role on Ansible-galaxy, so anyone can download and use it.</p><p>Deploying NKP management cluster involves ensuring multiple dependencies, which can be time-consuming and easy to overlook. Below is a high level flow of tasks that will be accomplished by this playbook.</p><ul><li><strong>OS Image Check</strong> — Verifies and downloads the NKP Rocky Linux image to Prism Central.</li><li><strong>Bastion VM Deployment</strong> — Deploys and configures a bastion VM on the same cluster.</li><li><strong>NKP Binaries Setup</strong> — Downloads and extracts NKP binaries on the bastion VM.</li><li><strong>Management Cluster Deployment</strong> — Creates the NKP management cluster using the NKP CLI.</li><li><strong>Access Info</strong> — Prints the NKP dashboard URL and credentials post-deployment.</li></ul><p><strong>Deploying Your NKP Cluster with Ansible</strong></p><p><strong>Pre-requisites:</strong></p><ol><li>Nutanix infrastructure with a supported AOS and Prism Central version. (Tested with PC 2024.2 and AOS 6.10; other supported versions should work as well.)</li><li>An Ansible control node — since Ansible runs on Python, it supports any OS with Python installed. You can even install Ansible on your laptop using the command below.</li></ol><pre>sudo pip3 install ansible<br>ansible --version</pre><p>3. Next, let’s install the nutanix.ncp Ansible collection to enable the control node to communicate with Nutanix APIs.</p><pre>ansible-galaxy collection install nutanix.ncp</pre><p>That’s all for the pre-requisites, let’s get to action!</p><blockquote>For more details refer: <a href="https://portal.nutanix.com/page/documents/details?targetId=Nutanix-Kubernetes-Platform-v2_14:top-nutanix-basic-prerequisites-c.html">NKP Pre-requirements</a></blockquote><p><strong>Steps:</strong></p><ol><li>First we will need to download the nkp_ansible role from ansible-galaxy:</li></ol><pre>ansible-galaxy role install rathnaarun77.nkp_ansible</pre><blockquote>Link for ref: <a href="https://github.com/rathnaarun77/nkp_ansible">https://github.com/rathnaarun77/nkp_ansible</a></blockquote><p>2. Create an Ansible inventory file with name inventory.ini and paste the below contents into it. Alternatively, you can download the file from the above git repo.</p><p>Here we are defining that Ansible will execute the tasks on the local machine.</p><pre>[localhost]<br>localhost ansible_connection=local</pre><p>3. Now, create the below playbook.yml file and configure all the variables.</p><blockquote>Note: All the variables are mandatory</blockquote><pre>---<br>- hosts: localhost<br>  gather_facts: no<br>  roles:<br>    - rathnaarun77.nkp_ansible<br>  environment:<br>    ANSIBLE_HOST_KEY_CHECKING: &quot;False&quot;<br>  vars:<br>    NODE_IMAGE_URL: &quot;&quot;  # Download URL for NKP Rocky node OS image<br>    SSH_PUBLIC_KEY: &quot;&quot;  # SSH public key of Ansible control node<br>    NKP_LINUX_URL: &quot;&quot;  # NKP binary download link for Linux<br>    CLUSTER_NAME: &quot;&quot;  # NKP cluster name<br>    NUTANIX_USER: &quot;&quot;  # Prism Central username<br>    NUTANIX_PASSWORD: &#39;&#39;  # Keep the password enclosed between single quotes<br>    NUTANIX_ENDPOINT: &quot;&quot;  # Prism Central IP address<br>    NUTANIX_PORT: &quot;9440&quot;  # Prism Central port<br>    LB_IP_RANGE: &quot;&quot;  # Load balancer IP range<br>    CONTROL_PLANE_ENDPOINT_IP: &quot;&quot;  # Kubernetes VIP<br>    NUTANIX_PRISM_ELEMENT_CLUSTER_NAME: &quot;&quot;  # Prism Element cluster name<br>    NUTANIX_SUBNET_NAME: &quot;&quot;  # Example: primary<br>    NUTANIX_STORAGE_CONTAINER_NAME: &quot;&quot;  # Prism storage container <br>    # MIRROR_REGISTRY_URL: &quot;&quot;  # Override Mirror Image registry URL(default is docker.io)<br>    DOCKER_USERNAME: &quot;&quot; #Enter your docker username or private registry username(for unauthenticated leave empty)<br>    DOCKER_PASSWORD: &quot;&quot; #Enter your docker password or private registry password(for unauthenticated leave empty)<br>    CP_MEMORY: 8  # Control Plane memory in GB<br>    CP_VCPU: 4  # Control Plane vCPUs<br>    WORKER_MEMORY: 16  # Worker memory in GB<br>    WORKER_VCPU: 8  # Worker vCPUs<br>    CP_REPLICAS: 3  # Number of control plane replicas<br>    WORKER_REPLICAS: 3  # Number of worker replicas</pre><p>In the file above, NODE_IMAGE_URL and NKP_LINUX_URL are the links used by Ansible to download the base OS image used to deploy the K8s nodes and NKP binaries. For Nutanix AHV, the ready to use rocky linux image is available on <a href="https://portal.nutanix.com/page/downloads?product=nkp">Nutanix downloads page</a>, you can copy the url for the required version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0MIH70mWzhMLWETMEL-LFQ.png" /><figcaption>Node OS Image (version on screenshot was used for testing)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q9-A0A79P9LgDUcIKaTp3A.png" /><figcaption>NKP binary for Linux</figcaption></figure><p>4. Finally, lets trigger the playbook.</p><pre>ansible-playbook -i inventory.ini playbook.yml</pre><blockquote>The inventory.ini file and playbook.yml are the files we created in the previous steps.</blockquote><p>Just sit back and relax! Your NKP cluster is getting ready. Once the playbook finishes, you’ll see the NKP dashboard URL and credentials — you are good to go!</p><p><strong>Below are some of the screenshots for reference:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1gahZ9LL5rw0h6WI3XPJWQ.png" /><figcaption><strong>If you go to images on prism central, you can see the NKP OS image automatically created.</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r0t_5Wl1mNY4UIwnQ9Zx7w.png" /><figcaption><strong>Sample output while ansible playbook is in progress</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b76hBcWeWduKFt6bBA3JjQ.png" /><figcaption><strong>You can see the bastion VM and NKP nodes getting created automatically on prism central</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L7lHJoAB-3Z6cXHMjwSDJA.png" /><figcaption><strong>Upon successful execution, the final output looks like this.</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qJ7E8twXsdV3bXAO8u-UsQ.png" /><figcaption><strong>Logging into the NKP dashboard</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uRvQ2DxLa9oOpkxBfxUiZQ.png" /><figcaption><strong>NKP Dashboard is live!</strong></figcaption></figure><blockquote><strong>Disclaimer:</strong><br>The views and opinions expressed in this blog are my own and do not necessarily reflect those of any company or organization. The information provided is based on personal experience and research. It is presented <em>as-is</em> without any warranties. For official guidance, please refer to the official documentation or support channels.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb89142176ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>