<?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 Vishnu Hari Dadhich on Medium]]></title>
        <description><![CDATA[Stories by Vishnu Hari Dadhich on Medium]]></description>
        <link>https://medium.com/@vishnuhd?source=rss-32f9b973c6f6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7Q78VrVCuwC-KiVB9VWTYw.png</url>
            <title>Stories by Vishnu Hari Dadhich on Medium</title>
            <link>https://medium.com/@vishnuhd?source=rss-32f9b973c6f6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 22:18:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vishnuhd/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[Run vLLM on Kubernetes with Minikube, WSL2 and NVIDIA GPU]]></title>
            <link>https://medium.com/@vishnuhd/run-vllm-on-kubernetes-with-minikube-wsl2-and-nvidia-gpu-ed931cf316e0?source=rss-32f9b973c6f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed931cf316e0</guid>
            <category><![CDATA[minikube]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[vllm]]></category>
            <category><![CDATA[gpu]]></category>
            <dc:creator><![CDATA[Vishnu Hari Dadhich]]></dc:creator>
            <pubDate>Tue, 08 Sep 2026 05:30:04 GMT</pubDate>
            <atom:updated>2026-09-08T08:04:11.915Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ryvu2fXN598csWfa.png" /></figure><p>This is the <a href="https://docs.vllm.ai/">vLLM</a> entry in my local AI series. After testing <a href="https://vishctl.dev/posts/running-ollama-on-32gb-macbook-air/">Ollama</a>, <a href="https://vishctl.dev/posts/running-llama-cpp-on-32gb-macbook-air/">llama.cpp</a>, and <a href="https://vishctl.dev/posts/running-freetoken-on-8gb-laptop-gpu/">FreeToken</a>, I wanted to run vLLM as a Kubernetes Deployment on my Windows/WSL2 setup.</p><p>The plan was simple: deploy vLLM, request nvidia.com/gpu: 1, expose an OpenAI-compatible API endpoint through a Service, and tie it into the Kubernetes workflows I write about regularly.</p><p>Getting a GPU into Kubernetes on WSL2 turned into an investigation. Not because vLLM is hard, but because container runtimes and nested clusters handle GPU passthrough in non-obvious ways. Here is what happened, how the device plugin and node prerequisites work, and how to get a working GPU cluster running with Minikube.</p><h3>What You’ll Build</h3><pre>Windows<br>   │<br>   ▼<br>WSL2 Ubuntu<br>   │<br>   ▼<br>Docker Engine + NVIDIA Container Toolkit<br>   │<br>   ▼<br>Minikube<br>   │<br>   ▼<br>Kubernetes<br>   │<br>   ├── NVIDIA GPU Operator<br>   │<br>   ├── NVIDIA Device Plugin<br>   │<br>   └── vLLM<br>         │<br>         ▼<br>      NVIDIA GPU</pre><p>By the end of this guide, you’ll have vLLM running on Kubernetes with GPU acceleration and serving an OpenAI-compatible API.</p><h3>The Test Rig</h3><p>My test machine for this run:</p><ul><li><strong>Host Machine:</strong> Windows 11 Laptop</li><li><strong>GPU:</strong> NVIDIA GeForce RTX 4070 Laptop GPU (8.0 GiB VRAM)</li><li><strong>Host Memory:</strong> 32 GB DDR5</li><li><strong>WSL2 Environment:</strong> Ubuntu 24.04 LTS (noble) with systemd enabled</li><li><strong>NVIDIA Drivers:</strong> Driver version 616.56 / CUDA 13.4 user-mode driver</li><li><strong>Kubernetes:</strong> Minikube v1.39.0 provisioning Kubernetes v1.37.0</li><li><strong>Model:</strong> Qwen3.5–0.8B (Qwen/Qwen3.5-0.8B) served by vLLM v0.28.0</li></ul><h3>Troubleshooting vLLM GPU Support on Docker Desktop WSL2 Kubernetes<a href="https://vishctl.dev/posts/vllm-on-wsl2-minikube/#troubleshooting-vllm-gpu-support-on-docker-desktop-wsl2-kubernetes">#</a></h3><p>Docker Desktop offers a one-click Kubernetes cluster in its settings. Turning it on provisions a single-node cluster named desktop-control-plane running on containerd://2.3.4.</p><p>On the WSL2 host, nvidia-smi works fine, and running standalone GPU containers ( docker run --gpus all) works without issues. The next step was applying the standard NVIDIA Kubernetes device plugin DaemonSet to enable GPU scheduling:</p><pre>kubectl create -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v0.16.2/deployments/static/nvidia-device-plugin.yml</pre><p>The DaemonSet pod started, but immediately stalled in a retry loop:</p><pre>E... Incompatible strategy detected auto E... If this is a GPU node, did you configure the NVIDIA Container Toolkit? I... No devices found. Waiting indefinitely.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*loWp3uWSGz1E0KCu.png" /></figure><p>Checking the node capacity confirmed the issue:</p><p>In this tested Docker Desktop Kubernetes setup, GPU resources were not exposed to the Kubernetes node. Despite GPU access working in WSL2 and standalone Docker containers, the Kubernetes node could not expose nvidia.com/gpu to the device plugin.</p><h3>How Kubernetes Detects NVIDIA GPUs Using the NVIDIA Device Plugin</h3><p>The <a href="https://github.com/NVIDIA/k8s-device-plugin">NVIDIA Kubernetes Device Plugin</a> is a DaemonSet that exposes GPU hardware to the Kubernetes control plane. It does not run inference, and it does not install drivers or container runtimes.</p><p>Under standard <a href="https://kubernetes.io/docs/tasks/manage-gpus/scheduling-gpus/">Kubernetes GPU scheduling</a>, pods request GPU resources by specifying limits for extended resources. The device plugin integrates with Kubelet through the Kubernetes Device Plugin API over gRPC, using a Unix domain socket at /var/lib/kubelet/device-plugins/kubelet.sock. Its responsibility comes down to three functions:</p><ol><li><strong>Discovery:</strong> The plugin queries the host system using NVML (NVIDIA Management Library) to check how many physical GPUs are present and verify their health status.</li><li><strong>Registration:</strong> It registers with Kubelet and advertises the discovered GPUs as an extended allocatable resource named nvidia.com/gpu.</li><li><strong>Allocation:</strong> When a pod requesting nvidia.com/gpu: 1 gets scheduled to the node, Kubelet calls the plugin&#39;s Allocate gRPC endpoint. The plugin picks a healthy GPU and sends back the device IDs and environment variables (NVIDIA_VISIBLE_DEVICES=&lt;UUID&gt;) to Kubelet. Kubelet then passes those variables to the container runtime so the container gets access to /dev/nvidia*.</li></ol><h3>Worker Node Prerequisites</h3><p>Because the device plugin only handles discovery and Kubelet registration, it assumes the worker node already has a functional GPU stack. For worker nodes in any Kubernetes cluster, three layers must be in place before the device plugin can run:</p><ol><li><strong>Host Kernel Drivers:</strong> The node OS must have the NVIDIA kernel modules loaded (nvidia.ko, nvidia-uvm.ko) and device nodes created in /dev. Running nvidia-smi on the host must return clean output.</li><li><strong>NVIDIA Container Toolkit:</strong> Packages such as libnvidia-container and nvidia-container-toolkit must be installed on the host. Refer to the <a href="https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html">NVIDIA Container Toolkit install guide</a> for distribution setup. This toolkit includes the OCI prestart hook that inspects container environment variables and mounts host GPU driver libraries into the target container.</li><li><strong>Runtime Configuration:</strong> The node container runtime (containerd or Docker) must have the NVIDIA runtime configured in its daemon settings (such as /etc/containerd/config.toml or /etc/docker/daemon.json) and set up to handle CDI (Container Device Interface) or NVIDIA runtime hooks.</li></ol><p>If any of those three pieces is missing or unconfigured, the device plugin pod will fail during startup or report zero allocatable GPUs.</p><h3>Why Docker Desktop Kubernetes Cannot Detect My NVIDIA GPU</h3><p>Based on the runtime architecture observed in this setup, the issue comes down to how Docker Desktop isolates its cluster node.</p><p>desktop-control-plane runs inside Docker Desktop&#39;s private utility VM ( docker-desktop), isolated using <strong>sysbox-runc</strong> rather than the standard OCI runtime runc. Sysbox provides nested container virtualization to spin up systemd, kubelet, and containerd within an unprivileged container environment.</p><p>In this setup, that isolation layer prevents GPU passthrough:</p><ul><li><strong>Missing OCI Passthrough:</strong> The node container was not launched with NVIDIA GPU passthrough flags (--gpus all). Inside the sandbox, containerd cannot access NVIDIA device nodes (/dev/nvidia*) or the WSL2 DirectX driver mapping (/usr/lib/wsl/lib).</li><li><strong>Locked-Down Lifecycle:</strong> You cannot configure the NVIDIA Container Toolkit inside the node’s containerd because Docker Desktop internally supervises the container.</li><li><strong>Daemon Defaults Do Not Propagate:</strong> Setting nvidia as the default OCI runtime in docker-desktop WSL does not alter the sysbox-runc runtime used by the Kubernetes node container.</li></ul><p>Docker has an open roadmap issue requesting native GPU passthrough for Docker Desktop Kubernetes. It remains an architectural boundary in the current setup.</p><p>Because of these issues, I pivoted to running Minikube with WSL2 using native Docker.</p><h3>Installing Docker CE and Containerd Inside WSL2</h3><p>To satisfy those node prerequisites and bypass Docker Desktop’s VM isolation, we install the native Docker Community Edition engine directly inside the Ubuntu 24.04 WSL2 environment:</p><pre># Add Docker&#39;s official GPG key<br>sudo mkdir -p /etc/apt/keyrings<br>sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc<br>sudo chmod a+r /etc/apt/keyrings/docker.asc<br><br># Set up the repository<br>echo \<br>  &quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu noble stable&quot; | \<br>  sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null<br><br># Install Docker CE and containerd<br>sudo apt update<br>sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cxpPrAejyIQWxRFX.png" /></figure><p>Verify that both the Docker daemon and containerd services are running cleanly under systemd:</p><pre>systemctl status docker<br>systemctl status containerd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ku2WKKUSS06zPbXx.png" /></figure><p>Before moving to Kubernetes, sanity check that native Docker has full GPU access through the WSL2 NVIDIA container runtime:</p><pre>docker container run --gpus all --rm nvidia/cuda:13.3.1-base-ubuntu26.04 nvidia-smi -L</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6IkaOyVPqWPAS5RS.png" /></figure><h3>Run Minikube with NVIDIA GPU Support on WSL2</h3><p>Install the latest Minikube Debian package:</p><pre>curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb<br>sudo dpkg -i minikube_latest_amd64.deb</pre><p>Following the official <a href="https://minikube.sigs.k8s.io/docs/tutorials/nvidia/">Minikube GPU documentation</a>, starting Minikube with GPU acceleration requires specific driver and runtime parameters. Now start Minikube. Two flags matter here and both are easy to miss:</p><pre>minikube start \<br>  --driver=docker \<br>  --container-runtime=docker \<br>  --gpus=all \<br>  --memory=12g \<br>  --cpus=10 \<br>  --extra-config=apiserver.service-account-issuer=https://kubernetes.default.svc \<br>  --extra-config=apiserver.service-account-signing-key-file=/var/lib/minikube/certs/sa.key</pre><blockquote><em>[!IMPORTANT] </em><strong><em>Why </em></strong><strong><em>--container-runtime=docker is required:</em></strong><em> By default, even when using</em><em>--driver=docker, Minikube configures containerd as its internal in-node runtime. However, Minikube&#39;s </em><em>--gpus=all flag currently hooks into Docker&#39;s OCI runtime wrapper. If you omit </em><em>--container-runtime=docker, Minikube fails during preflight checks with an invalid flag combination error.</em></blockquote><p>Notice the startup output: Minikube automatically detects the GPU and enables the nvidia-device-plugin addon for you.</p><h3>Verifying the Cluster and GPU Allocation</h3><p>Install kubectl to talk to the cluster:</p><pre>curl -LO &quot;https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl&quot;<br>sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl<br>kubectl version --client<br>kubectl get nodes<br>kubectl get pods -A</pre><p>Next, inspect the node’s schedulable capacity:</p><pre>kubectl describe node minikube | grep -A7 &quot;Capacity:\|Allocatable:&quot;</pre><p>A quick test pod confirms the GPU is reachable from inside Kubernetes:</p><pre>cat &lt;&lt;EOF | kubectl apply -f -<br>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: gpu-test<br>spec:<br>  restartPolicy: Never<br>  containers:<br>    - name: cuda-test<br>      image: nvidia/cuda:13.3.1-base-ubuntu26.04<br>      command: [&quot;nvidia-smi&quot;, &quot;-L&quot;]<br>      resources:<br>        limits:<br>          nvidia.com/gpu: 1<br>EOF</pre><p>Check the test pod logs:</p><pre>kubectl logs gpu-test</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-4t9SRGuqSOVn3zm.png" /></figure><p>Real GPU scheduling and nvidia.com/gpu resource accounting, without Docker Desktop getting in the way.</p><h3>Deploy vLLM on Kubernetes with NVIDIA GPU</h3><p>Model choice for 8 GB VRAM: <strong>Qwen3.5–0.8B</strong> ( Qwen/Qwen3.5-0.8B). Small enough to leave real headroom for vLLM&#39;s KV cache, which is the main reason to use vLLM over llama.cpp or Ollama in the first place, and it is a capable model at that size. As detailed in the <a href="https://docs.vllm.ai/">vLLM documentation</a>, the server exposes an OpenAI-compatible API endpoint over HTTP.</p><h3>The Shared Memory (/dev/shm) Gotcha</h3><p>When running vLLM via the Docker CLI, passing --ipc=host lets workers exchange tensors and state across processes using host shared memory. In Kubernetes, pods do not share the host IPC namespace by default, and Kubernetes provisions /dev/shm as a minimal 64 MB tmpfs mount.</p><p>Some PyTorch and vLLM multiprocessing workloads can require significantly more shared memory than Kubernetes’ default /dev/shm (which defaults to a minimal 64 MB tmpfs mount). If insufficient shared memory is available, initialization or worker processes may fail. The Kubernetes solution is mounting an emptyDir volume backed by host RAM ( medium: Memory) with a dedicated sizeLimit:</p><pre># vllm-qwen-k8s.yaml<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: vllm-qwen<br>  labels:<br>    app: vllm-qwen<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: vllm-qwen<br>  template:<br>    metadata:<br>      labels:<br>        app: vllm-qwen<br>    spec:<br>      containers:<br>        - name: vllm<br>          image: vllm/vllm-openai:v0.28.0<br>          args:<br>            - &quot;--model=Qwen/Qwen3.5-0.8B&quot;<br>            - &quot;--gpu-memory-utilization=0.7&quot;<br>            - &quot;--max-model-len=8192&quot;<br>          ports:<br>            - containerPort: 8000<br>          resources:<br>            limits:<br>              nvidia.com/gpu: 1<br>          volumeMounts:<br>            - name: hf-cache<br>              mountPath: /root/.cache/huggingface<br>            - name: dshm<br>              mountPath: /dev/shm<br>      volumes:<br>        - name: hf-cache<br>          emptyDir: {}<br>        - name: dshm<br>          emptyDir:<br>            medium: Memory<br>            sizeLimit: 2Gi<br>---<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: vllm-qwen<br>spec:<br>  selector:<br>    app: vllm-qwen<br>  ports:<br>    - port: 8000<br>      targetPort: 8000<br>  type: ClusterIP</pre><p>Two practical notes on this manifest:</p><ul><li><strong>Image version pinning:</strong> I pin the image version (v0.28.0) here so the deployment remains reproducible. You can update the image tag after validating compatibility with your CUDA and model version.</li><li><strong>Hugging Face cache:</strong> emptyDir is used here for simplicity. The Hugging Face model cache is lost when the pod is recreated. For repeated testing or larger models, consider using a PersistentVolumeClaim (PVC) or a host-mounted path.</li></ul><p>Apply the manifest and watch the deployment roll out:</p><pre>kubectl apply -f vllm-qwen-k8s.yaml<br>kubectl get pods,svc</pre><p>Stream the pod logs to inspect the vLLM initialization sequence:</p><pre>kubectl logs vllm-qwen-5c8bbc786f-gdpmj -f</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W1g4j1daGey3bhBw.png" /></figure><p>Once PyTorch compilation and CUDA graph capture finish, the ASGI application completes startup and begins listening on port 8000:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bMUns65kKsnXLs_D.png" /></figure><h3>Testing Inference and Hardware Telemetry</h3><p>Forward port 8000 from the cluster service to the local machine:</p><pre>kubectl port-forward svc/vllm-qwen 8000:8000</pre><p>Now issue an OpenAI-standard chat completion request using curl:</p><pre>curl http://localhost:8000/v1/chat/completions \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{<br>    &quot;model&quot;: &quot;Qwen/Qwen3.5-0.8B&quot;,<br>    &quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Say hello in one sentence.&quot;}]<br>  }&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k11O32UEN_HZA9AX.png" /></figure><p>The response returned without issues, with server logs showing generation throughput averaging 23.5 tokens/s.</p><p>Finally, checking Windows Task Manager confirms the hardware utilization on the host:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wSCW9q8Eyv0_fFmk.png" /></figure><p>Dedicated GPU memory held at <strong>4.4 / 8.0 GB</strong> (in line with the --gpu-memory-utilization 0.7 setting plus desktop display overhead), with the GPU temperature at 45°C.</p><h3>Beyond Local Dev: Why Production Clusters Use the NVIDIA GPU Operator</h3><p>For a single-node laptop or a Minikube sandbox, managing drivers on the host and running a standalone device plugin DaemonSet gets the job done.</p><p>In production Kubernetes clusters, manual node configuration does not scale. When you operate multi-node clusters across cloud providers or bare metal, nodes get provisioned dynamically by autoscalers, Linux kernel patch levels drift, and different GPU architectures (such as A100, H100, or L40S) coexist in the same cluster.</p><p>This is why production setups deploy the <a href="https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/latest/">NVIDIA GPU Operator</a> instead of managing the device plugin directly.</p><p>The GPU Operator automates the deployment and lifecycle management of the NVIDIA software stack required for GPU-enabled Kubernetes nodes. Driven by the ClusterPolicy Custom Resource Definition, it manages several components depending on your cluster configuration:</p><ol><li><strong>Driver Management:</strong> Depending on the operating environment, the Operator can compile and load the NVIDIA driver container matched to the node kernel, or use pre-installed host drivers (common in managed Kubernetes environments like GKE, EKS, or AKS).</li><li><strong>Container Toolkit and CDI Configuration:</strong> Depending on the Operator version and runtime configuration, GPU injection can be configured through direct NVIDIA runtime integration or CDI-based device injection (Container Device Interface), which modern releases enable by default.</li><li><strong>Device Plugin Supervision:</strong> It deploys and manages the lifecycle of the NVIDIA Kubernetes Device Plugin DaemonSet, keeping it in sync with driver and runtime availability.</li><li><strong>Node Feature Discovery (GFD):</strong> It automatically detects physical GPU capabilities and labels each node (such as nvidia.com/gpu.product: NVIDIA-A100-SXM4-80GB or nvidia.com/gpu.family: ampere). Workloads can then target specific GPU models using standard Kubernetes nodeSelector or affinity rules.</li><li><strong>Cluster Metrics with DCGM Exporter:</strong> It runs the Data Center GPU Manager (DCGM) exporter to collect metrics (GPU compute utilization, VRAM usage, temperature, power draw, and memory bandwidth) and expose them to Prometheus for cluster monitoring and alerting.</li><li><strong>MIG Management:</strong> On enterprise GPUs that support Multi-Instance GPU (MIG), the Operator can dynamically partition a single physical GPU into isolated hardware instances, allowing smaller workloads to share an A100 or H100 without memory interference.</li></ol><p>In short: the device plugin provides basic GPU scheduling for pods. The GPU Operator manages the operational lifecycle, monitoring, and driver stack required to run GPU infrastructure reliably in production.</p><h3>Key Takeaways</h3><ol><li><strong>Docker Desktop Kubernetes isolates nodes without GPU passthrough:</strong> In tested setups, desktop-control-plane runs in a nested sysbox-runc sandbox without GPU device passthrough flags.</li><li><strong>Minikube on native Docker CE in WSL2 works reliably:</strong> Launching Minikube with --driver=docker --container-runtime=docker --gpus=all automatically activates the NVIDIA device plugin addon.</li><li><strong>Understand device plugin vs node prerequisites:</strong> The device plugin only manages discovery and Kubelet allocation. Host drivers, Container Toolkit, and runtime configuration must already exist on the worker node.</li><li><strong>Always size </strong><strong>/dev/shm in Kubernetes:</strong> Multiprocessing in PyTorch and vLLM quickly exceeds the default 64 MB tmpfs mount. Mount an emptyDir memory volume backed by host RAM.</li><li><strong>Budget VRAM carefully:</strong> Setting --gpu-memory-utilization 0.7 on a compact model like Qwen3.5-0.8B preserves headroom for the KV cache on an 8 GB GPU.</li><li><strong>Deploy the NVIDIA GPU Operator in production:</strong> Production multi-node clusters rely on the GPU Operator to manage drivers, CDI device injection, node feature discovery, and DCGM monitoring.</li></ol><p>Thanks for reading! If you run into issues setting up GPU passthrough on your machine, have questions, or have suggestions for other local AI setups to explore, leave a comment below.</p><p><em>Originally published at </em><a href="https://vishctl.dev/posts/vllm-on-wsl2-minikube/"><em>https://vishctl.dev</em></a><em> on September 8, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed931cf316e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running a 35B MoE Model on an 8 GB Laptop GPU: Testing FreeToken]]></title>
            <link>https://medium.com/@vishnuhd/running-a-35b-moe-model-on-an-8-gb-laptop-gpu-testing-freetoken-c1842582cb6c?source=rss-32f9b973c6f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1842582cb6c</guid>
            <category><![CDATA[local-llm]]></category>
            <category><![CDATA[free-token]]></category>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[nvidia]]></category>
            <dc:creator><![CDATA[Vishnu Hari Dadhich]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 06:30:18 GMT</pubDate>
            <atom:updated>2026-09-07T09:45:14.554Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aBBZj81JqXYcBbnP.png" /></figure><p>Running large language models locally usually comes down to a hard hardware boundary: video RAM. If a model does not fit into your GPU’s VRAM, performance usually falls off a cliff as soon as standard runtimes fall back to system memory over the PCIe bus.</p><p>Mixture of Experts (MoE) architectures offer an attractive theoretical escape hatch. While the total parameter count can be large (30B to 70B+), only a sparse subset of expert layers activates for any given token. However, standard local runtimes still require loading the entire weight footprint into memory, which puts 30B+ models out of reach for everyday consumer laptops with 8 GB of VRAM.</p><p>Enter <a href="https://github.com/FlashML-org/FreeToken">FreeToken</a> by FlashML, backed by their research paper ( <a href="https://arxiv.org/abs/2608.16157">arXiv:2608.16157</a>). FreeToken is an edge inference runtime designed specifically to run frontier MoE models on consumer hardware by dynamically managing a hierarchical cache between GPU VRAM and host RAM.</p><p>I recently downloaded FreeToken to put their claims to the test on my modest laptop GPU. Here is what the setup looked like, how FreeToken handles memory under the hood, and the real-world generation numbers I observed.</p><h3>The Test Rig<a href="https://vishctl.dev/posts/running-freetoken-on-8gb-laptop-gpu/#the-test-rig">#</a></h3><p>My test machine is a portable laptop, not a high-end multi-GPU workstation:</p><ul><li><strong>CPU:</strong> 13th Gen Intel Core i9–13900H (14 cores, 20 threads)</li><li><strong>GPU:</strong> NVIDIA GeForce RTX 4070 Laptop GPU (8.0 GiB VRAM)</li><li><strong>Host RAM:</strong> 32 GB DDR5 (31.7 GiB usable)</li><li><strong>Operating System:</strong> Windows 11</li><li><strong>Runtime:</strong> FreeToken Desktop (v0.2.0-beta.17)</li></ul><p>On paper, an 8 GB VRAM budget makes running a 35-billion parameter model look impossible. In traditional setups, 8 GB VRAM limits you to 7B or 8B parameter models in 4-bit quantizations (such as Q4_K_M). Attempting to load a 35B model typically triggers out-of-memory errors or slows inference to a crawl.</p><h3>Installing FreeToken and Exploring the Library<a href="https://vishctl.dev/posts/running-freetoken-on-8gb-laptop-gpu/#installing-freetoken-and-exploring-the-library">#</a></h3><p>The FreeToken desktop app is available to download directly from the <a href="https://www.flashml.ai/">FlashML website</a>. It provides a self-contained installer that is quick to set up on Windows. When you launch it, the interface automatically detects your hardware specs, available VRAM, and system RAM, and presents a curated library of models optimized for edge offloading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BAN8MTJND1xVG7vq.png" /></figure><p>For this test, I selected Qwen3.6-35B-A3B NVFP4 ( nvidia/Qwen3.6-35B-A3B-NVFP4). This is a 35-billion parameter MoE model using NVIDIA&#39;s 4-bit floating point (NVFP4) format, with an initial download size of 21.9 GiB.</p><p>Before loading the model, the console dashboard showed clean baseline resource usage:</p><h3>Weight Conversion: The FTW Format<a href="https://vishctl.dev/posts/running-freetoken-on-8gb-laptop-gpu/#weight-conversion-the-ftw-format">#</a></h3><p>Once the 21.9 GiB download finished, FreeToken flagged the model as needing conversion before it could be launched.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QBiWBfNMFHUn14Ht.png" /></figure><p>FreeToken converts raw Hugging Face weights into its proprietary format called <strong>FTW</strong> (FreeToken Weight format). During this process, the engine repacks and organizes the tensors into memory-mapped structures optimized for rapid streaming between host RAM and GPU memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*50XjPEfeJ6yCcZBt.png" /></figure><p>The conversion took just over a minute on the i9–13900H and NVMe storage, producing a compact 19.5 GiB weight package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bsbWkN5pwir3Ctgu.png" /></figure><h3>Loading the Model and Memory Allocation<a href="https://vishctl.dev/posts/running-freetoken-on-8gb-laptop-gpu/#loading-the-model-and-memory-allocation">#</a></h3><p>Starting the model triggers the weight allocation phase. Instead of attempting to cram the entire 19.5 GiB into the 8 GB VRAM, FreeToken partitions the workload across both memory tiers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RxxNZFgKOR7CN7Wa.png" /></figure><p>Once loaded, the memory profile was eye-opening:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yLBGfB1d8otpb93V.png" /></figure><h3>The Cache Architecture Under the Hood<a href="https://vishctl.dev/posts/running-freetoken-on-8gb-laptop-gpu/#the-cache-architecture-under-the-hood">#</a></h3><p>The console view provides detailed insight into how FreeToken manages this memory footprint:</p><ol><li><strong>MoE Expert Cache:</strong> FreeToken allocated 916 active expert slots in VRAM out of a total pool of 10,240 slots, consuming 1.51 GiB of VRAM. As different experts are needed during generation, they are dynamically paged in and out from the host RAM cache.</li><li><strong>KV Cache:</strong> 8K tokens of context were allocated in VRAM, consuming just 0.16 GiB.</li><li><strong>Mamba State Slots:</strong> 24 state slots were reserved, using 1.44 GiB of VRAM.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LAUaxd6qLR4LYAXA.png" /></figure><p>This hierarchical design is the core reason the model can run without crashing. Inactive experts reside in system RAM (filling ~30 GB of system memory), while the active attention layers, KV cache, and currently triggered experts reside in the 8 GB VRAM.</p><h3>Real-World Performance &amp; Generation Speed<a href="https://vishctl.dev/posts/running-freetoken-on-8gb-laptop-gpu/#real-world-performance--generation-speed">#</a></h3><p>To evaluate real-world performance, I tested a conversational prompt with reasoning enabled:</p><p>The model engaged its full thinking process, taking 1 minute and 9 seconds to plan and structure its response, and then generated 393 tokens at <strong>4.3 tokens per second</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*11HML_zyx229ptJF.png" /></figure><p>While 4.3 tokens per second is not real-time voice conversational speed, it is remarkably steady for running a <strong>35-billion parameter model on an 8 GB laptop GPU</strong>. For tasks like code review, background agent execution, document analysis, or local drafting, 4.3 tok/s is completely practical.</p><p>The model detail sheet confirms the architecture and licensing details:</p><ul><li><strong>Base Repository:</strong> nvidia/Qwen3.6-35B-A3B-NVFP4</li><li><strong>Context Length:</strong> 262,144 tokens (256K context window)</li><li><strong>License:</strong> Apache 2.0</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SYwiZa_LMb4k9L3J.png" /></figure><h3>Built-in Agentic Tooling &amp; Local Endpoints<a href="https://vishctl.dev/posts/running-freetoken-on-8gb-laptop-gpu/#built-in-agentic-tooling--local-endpoints">#</a></h3><p>FreeToken also includes built-in support for developer tools and coding agents.</p><p>The <strong>Apps</strong> tab exposes both OpenAI-compatible and Anthropic-compatible local HTTP endpoints:</p><ul><li><strong>OpenAI Endpoint:</strong> <a href="http://127.0.0.1:1919/v1">http://127.0.0.1:1919/v1</a></li><li><strong>Anthropic Messages Endpoint:</strong> <a href="http://127.0.0.1:1919/v1/messages">http://127.0.0.1:1919/v1/messages</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CNN_VEZaxMhZEr4E.png" /></figure><p>FreeToken provides quick configuration presets for popular coding assistants:</p><p>Having drop-in compatibility with both OpenAI and Anthropic API schemas means you can point tools like Claude Code directly to your localhost port without running a reverse proxy.</p><h3>Where FreeToken Fits<a href="https://vishctl.dev/posts/running-freetoken-on-8gb-laptop-gpu/#where-freetoken-fits">#</a></h3><p>FreeToken is a relatively young product, but its approach solves a real constraint for local inference.</p><ul><li><strong>Bypasses the VRAM limit:</strong> Running a 35B MoE model on an 8 GB laptop GPU without manual layer-by-layer offload tuning works out of the box.</li><li><strong>Hierarchical caching:</strong> The dynamic MoE expert cache keeps VRAM usage around 6.8 GiB, preventing driver resets and CUDA out-of-memory crashes.</li><li><strong>Local developer endpoints:</strong> Dual support for OpenAI and Anthropic endpoints makes integration with modern coding agents straightforward.</li><li><strong>Simple setup on Windows:</strong> No manual compilation, no CUDA toolkit troubleshooting, and a clean desktop GUI.</li></ul><h4>Limitations<a href="https://vishctl.dev/posts/running-freetoken-on-8gb-laptop-gpu/#limitations">#</a></h4><p>If you have a laptop with 32 GB of system RAM and a modest 8 GB NVIDIA GPU, FreeToken is worth checking out. It makes 35B-class MoE models runnable on consumer hardware that would otherwise choke on them, keeping your data completely local.</p><p>You can download the desktop app directly from <a href="https://www.flashml.ai/">FlashML</a>, check out the project on <a href="https://github.com/FlashML-org/FreeToken">GitHub</a>, and read their research paper on <a href="https://arxiv.org/abs/2608.16157">arXiv:2608.16157</a>.</p><p><em>Originally published at </em><a href="https://vishctl.dev/posts/running-freetoken-on-8gb-laptop-gpu/"><em>https://vishctl.dev</em></a><em> on September 7, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1842582cb6c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi-region YugabyteDB deployment on AWS EKS with Istio]]></title>
            <link>https://medium.com/@vishnuhd/multi-region-yugabytedb-deployment-on-aws-eks-with-istio-b584e155079c?source=rss-32f9b973c6f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/b584e155079c</guid>
            <category><![CDATA[yugabytedb]]></category>
            <category><![CDATA[istio]]></category>
            <category><![CDATA[multi-cloud]]></category>
            <category><![CDATA[aws-eks]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Vishnu Hari Dadhich]]></dc:creator>
            <pubDate>Thu, 02 May 2024 05:41:17 GMT</pubDate>
            <atom:updated>2024-05-02T05:50:30.528Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s distributed cloud landscape, deploying applications across multiple regions and clusters is crucial for scalability, reliability, and performance. This blog post will guide you through setting up a multi-region, multi-cluster YugabyteDB deployment on AWS EKS with Istio service mesh.</p><h3>Why YugabyteDB?</h3><p><a href="https://www.yugabyte.com/">YugabyteDB</a> is a transactional database that brings together four must-have needs of cloud native apps — namely SQL as a flexible query language, low-latency performance, continuous availability, and globally-distributed scalability. Other databases do not serve all 4 of these needs simultaneously.</p><ul><li>Monolithic SQL databases offer SQL and low-latency reads, but neither have the ability to tolerate failures, nor can they scale writes across multiple nodes, zones, regions, and clouds.</li><li>Distributed NoSQL databases offer read performance, high availability, and write scalability, but give up on SQL features such as relational data modelling and ACID transactions.</li></ul><h3>Why AWS EKS and Istio?</h3><p><a href="https://aws.amazon.com/eks/">AWS EKS</a> provides a managed Kubernetes service, simplifying cluster management and deployment. <a href="https://istio.io/">Istio</a>, an open-source service mesh, enables traffic management, security, and observability across microservices.</p><p>Combining Yugabyte with AWS EKS and Istio creates a robust, scalable, and secure cloud-native architecture that spans across multiple regions.</p><h3>Deployment overview</h3><p>Our deployment consists of:</p><ul><li>Three AWS regions (Singapore, Mumbai and Hyderabad).</li><li>One EKS cluster in each region.</li><li>One YugabyteDB master and one YugabyteDB tserver are deployed in each EKS cluster.</li><li>Istio is deployed in each cluster with an east-west gateway to provide a multi-cluster service mesh.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7ILN-GmP9SeWyFPq" /></figure><h3>DEPLOYMENT STEPS</h3><h3>Pre-requisites</h3><ul><li>AWS account with at least three regions enabled</li><li>AWS user with access to create VPC and EKS using eksctl</li><li>eksctl, aws cli, kubectl and git installed on your local system</li></ul><p>Clone the following <a href="https://github.com/vishnuhd/yugabyte-multiregion-aws-eks-istio.git">repo</a> to follow along with this blog:</p><pre>git clone https://github.com/vishnuhd/yugabyte-multiregion-aws-eks-istio.git<br>cd yugabyte-multiregion-aws-eks-istio</pre><h3>Deploy AWS EKS clusters</h3><ul><li>Deploy EKS clusters in three different regions (namely Singapore, Mumbai and Hyderabad) using eksctl:</li></ul><pre>{<br>  for region in mumbai singapore hyderabad; do<br>    echo -e &quot;Creating EKS cluster in ${region}...\n&quot;<br>    eksctl create cluster -f ${region}/cluster-config.yaml<br>    echo -e &quot;-------------\n&quot;<br>  done<br>}</pre><ul><li>Rename the kube contexts for the simplicity of this demo:</li></ul><pre>kubectl config rename-context &#39;yb-mumbai.ap-south-1.eksctl.io&#39; mumbai<br>kubectl config rename-context &#39;yb-singapore.ap-southeast-1.eksctl.io&#39; singapore<br>kubectl config rename-context &#39;yb-hyderabad.ap-south-2.eksctl.io&#39; hyderabad</pre><p><strong>NOTE</strong>: By default, EKS does not provide EBS permissions, follow <a href="https://repost.aws/knowledge-center/eks-persistent-storage"><strong>this</strong></a> article to enable EKS PVC dynamic provisioning.</p><h3>Setup Istio</h3><p>When configuring a production deployment of Istio, key considerations include whether the mesh will be in single or multiple clusters, Istio control plane setup for high availability, and the choice between a single multicluster service mesh or federated multi-mesh deployment. These factors represent independent dimensions of configuration for Istio deployment.</p><p><a href="https://istio.io/latest/docs/ops/deployment/deployment-models/"><strong>This</strong></a> guide describes the various options and considerations when configuring your Istio deployment. For this demo, we are gonna <a href="https://istio.io/latest/docs/setup/install/multicluster/multi-primary_multi-network/"><strong>Install Multi-Primary on different networks</strong></a>.</p><p>Download Istio:</p><pre>curl -L https://istio.io/downloadIstio | sh -<br>cd istio-1.21.0<br>export PATH=$PWD/bin:$PATH</pre><h3>Plug in CA Certificates for Istio</h3><p>In a multi-cluster environment, we would want to set up one root CA and use the root CA to issue intermediate certificates to the Istio CAs that run in each cluster. This would ensure the services behind it can only be accessed by services with a trusted mTLS certificate.</p><ul><li>Create a cert directory :</li></ul><pre>mkdir -p istio-1.21.0/certs</pre><ul><li>Generate the root CA certificate and key:</li></ul><pre>cd istio-1.21.0/certs<br>make -f ../tools/certs/Makefile.selfsigned.mk root-ca</pre><ul><li>For each cluster, generate an intermediate certificate and key for the Istio CA:</li></ul><pre>cd istio-1.21.0/certs</pre><pre>{<br>  for region in mumbai singapore hyderabad; do<br>    echo -e &quot;Generating certs for cluster - ${region}...\n&quot;<br>    make -f ../tools/certs/Makefile.selfsigned.mk yb-${region}-cacerts<br>    echo -e &quot;-------------\n&quot;<br>  done<br>}</pre><ul><li>In each cluster, create a secret called cacerts including all the input files ca-cert.pem, ca-key.pem, root-cert.pem and cert-chain.pem :</li></ul><pre>{<br>  for region in mumbai singapore hyderabad; do<br>    echo -e &quot;Creating namespace and secret for cluster - ${region}...\n&quot;<br>    <br>    kubectl --context ${region} create namespace istio-system<br>    kubectl --context ${region} create secret generic cacerts -n istio-system \<br>          --from-file=istio-1.21.0/certs/yb-${region}/ca-cert.pem \<br>          --from-file=istio-1.21.0/certs/yb-${region}/ca-key.pem \<br>          --from-file=istio-1.21.0/certs/yb-${region}/root-cert.pem \<br>          --from-file=istio-1.21.0/certs/yb-${region}/cert-chain.pem<br>    <br>    echo -e &quot;-------------\n&quot;<br>  done<br>}</pre><p>With this step completed, we are now prepared to install Istio on every cluster.</p><h3>Install Istio</h3><ul><li>Install Istio using istioctl:</li></ul><pre>{<br>  for region in mumbai singapore hyderabad; do<br>    echo -e &quot;Installing istio for cluster - ${region}...\n&quot;<br>    <br>    istioctl install --context ${region} -f ./${region}/istio.yaml<br>    <br>    echo -e &quot;-------------\n&quot;<br>  done<br>}</pre><ul><li>Install a gateway in each cluster, that is dedicated to <a href="https://en.wikipedia.org/wiki/East-west_traffic"><strong>east-west</strong></a> traffic. By default, this gateway will be public on the Internet. Production systems may require additional access restrictions (e.g. via firewall rules) to prevent external attacks.</li></ul><pre>{<br>  for region in mumbai singapore hyderabad; do<br>    echo -e &quot;Installing the east-west gateway for cluster - ${region}...\n&quot;<br>    <br>    ./istio-1.21.0/samples/multicluster/gen-eastwest-gateway.sh \<br>        --mesh mesh1 --cluster yb-${region} --network network-${region} | \<br>        istioctl --context ${region} install -y -f -<br>    <br>    echo -e &quot;-------------\n&quot;<br>  done<br>}</pre><ul><li>Since the clusters are on separate networks, we need to expose all services (*.local) on the east-west gateway in all three clusters. While this gateway is public on the Internet, services behind it can only be accessed by services with a trusted mTLS certificate and workload ID, just as if they were on the same network.</li></ul><pre>{<br>  for region in mumbai singapore hyderabad; do<br>    echo -e &quot;Exposing the services for cluster - ${region}...\n&quot;<br>    <br>    kubectl --context ${region} apply -n istio-system -f \<br>        ./istio-1.21.0/samples/multicluster/expose-services.yaml<br><br>    echo -e &quot;-------------\n&quot;<br>  done<br>}</pre><ul><li>Install a remote secret in each cluster that provides access to the other cluster’s Kube API server.</li></ul><pre>{<br>  for region1 in mumbai singapore hyderabad; do<br>    for region2 in mumbai singapore hyderabad; do<br>      if [[ &quot;${region1}&quot; == &quot;${region2}&quot; ]]; then continue; fi<br>      echo -e &quot;Create remote secret of ${region1} in ${region2}...\n&quot;<br>      <br>      istioctl create-remote-secret \<br>        --context ${region1} \<br>        --name=yb-${region1} | \<br>        kubectl apply -f - --context ${region2}<br><br>    echo -e &quot;-------------\n&quot;<br>    done<br>  done<br>}</pre><h3>Install YugabyteDB</h3><ul><li>To install YugabyteDB using helm charts, add the chart repo:</li></ul><pre>helm repo add yugabytedb https://charts.yugabyte.com<br>helm repo update</pre><ul><li>Create a YugabyteDB namespace (yb-demo) in each cluster and enable Istio injection:</li></ul><pre>{<br>  for region in mumbai singapore hyderabad; do<br>    echo -e &quot;Creating namespace for cluster - ${region}...\n&quot;<br>    <br>    kubectl --context ${region} create namespace yb-demo<br>    kubectl label --context ${region} namespace yb-demo istio-injection=enabled<br><br>    echo -e &quot;-------------\n&quot;<br>  done<br>}</pre><ul><li>Install YugabyteDB:</li></ul><pre>{<br>  for region in mumbai singapore hyderabad; do<br>    echo -e &quot;Installing YugabyteDB in cluster - ${region}...\n&quot;<br>    <br>    helm upgrade --install ${region} yugabytedb/yugabyte \<br>        --version 2.19.3 \<br>        --namespace yb-demo \<br>        -f ${region}/overrides.yaml \<br>        --kube-context ${region} --wait<br>    <br>    echo -e &quot;-------------\n&quot;<br>  done<br>}</pre><p>This will install YugabyteDB in each EKS cluster with 1 master and 1 tserver connected with each other through the Istio service mesh. At this point, it is important to understand each parameter being set in the <a href="https://github.com/vishnuhd/yugabyte-multiregion-aws-eks-istio/blob/main/singapore/overrides.yaml"><strong>overrides.yaml</strong></a> file. Each master and tserver pod needs to know all the master addresses to replicate data and elect leaders.</p><ul><li>In addition to the Istio setup, an extra step is required, which involves creating identical Kubernetes services in all clusters to enable DNS service discovery. More information can be found <a href="https://istio.io/latest/docs/ops/deployment/deployment-models/#dns-with-multiple-clusters"><strong>here</strong></a>. Therefore, we need to replicate the yugabyte-master and yugabyte-tserver services present in the Mumbai region to both the Singapore and Hyderabad regions, and vice versa.</li></ul><pre>{<br>  for region1 in mumbai singapore hyderabad; do<br>    for region2 in mumbai singapore hyderabad; do<br>      if [[ &quot;${region1}&quot; == &quot;${region2}&quot; ]]; then continue; fi<br>      echo -e &quot;Creating services of ${region2} in ${region1}...\n&quot;<br>      <br>      kubectl --context ${region1} apply -f ${region1}/services-${region2}.yaml -n yb-demo<br><br>      echo -e &quot;-------------\n&quot;<br>    done<br>  done<br>}</pre><ul><li>Check the YugabyteDB pods and services, all of them should be up and running:</li></ul><pre>{<br>  for region in mumbai singapore hyderabad; do<br>    echo -e &quot;Checking YugabyteDB pods and svcs for cluster - ${region}...\n&quot;<br>    <br>    kubectl --context ${region} get pods,svc -A<br><br>    echo -e &quot;-------------\n&quot;<br>  done<br>}</pre><ul><li>Finally, we need to configure global data distribution, for Yugabyte to handle the data distribution properly across regions:</li></ul><pre>kubectl --context mumbai exec -n yb-demo mumbai-yugabyte-yb-master-0 -- bash \<br>-c &quot;/home/yugabyte/master/bin/yb-admin --master_addresses mumbai-yugabyte-yb-master-0.yb-demo.svc.cluster.local,hyderabad-yugabyte-yb-master-0.yb-demo.svc.cluster.local,singapore-yugabyte-yb-master-0.yb-demo.svc.cluster.local modify_placement_info aws.ap-south-1.ap-south-1a,aws.ap-south-2.ap-south-2a,aws.ap-southeast-1.ap-southeast-1a 3&quot;</pre><p>Voila, your YugabyteDB multi-regional setup is now complete!</p><h3>Access the YugabyteDB UI</h3><ul><li>Find the yb-master-ui service in yb-demo namespace for any cluster and open it in the browser along with the port 7000:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KBl66EeJHTdwJfJz" /></figure><p>As we can see the masters are spread across regions, with Hyderabad one as the leader.</p><ul><li>Explore the tablet servers:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8qYJ_wPDWXBaYogF" /></figure><p>Similarly, we can see the tablet servers being distributed across multiple regions, each of them able to hand synchronous reads and writes.</p><ul><li>Run a sample Yugabyte application in any of the clusters:</li></ul><pre>kubectl run yb-sample-apps \<br>    -it --rm \<br>    --image yugabytedb/yb-sample-apps \<br>    --namespace yb-demo \<br>    --context singapore \<br>    --command -- sh<br><br>java -jar yb-sample-apps.jar java-client-sql \<br>    --workload SqlInserts \<br>    --nodes yb-tserver-common.yb-demo.svc.cluster.local:5433 \<br>    --num_threads_write 1 \<br>    --num_threads_read 2</pre><p>Here, we are targeting yb-tserver-common service for reads and writes, which will choose any of the tserver in any of the regions randomly. This also helps in load-balancing the traffic across regions.</p><ul><li>We can also see the tables created by this sample app:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VursyeTjkLLJsOUr" /></figure><h3>DISASTER RECOVERY</h3><p>Disasters can happen anytime, YugabyteDB provides us with a feature called Replication Factor (RF). Configurations usually include a Replication Factor (RF) of 3. In this setup, a write to the leader requires an acknowledgement from one follower before being committed, as the leader and one follower together constitute the majority. In the event of a failure, operational replicas in the Raft group can support consistent reads and writes, while those that have become separated from the Raft consensus quorum cannot make progress. We will now see this feature of Yugabyte in action.</p><ul><li>Current leaders for master and tservers:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aOzVsQc6c5GHFTUw" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qL6L0cqzm903NoPt" /></figure><p>Currently, the master pod in the Hyderabad region is the LEADER, while most of the transactions are handled by the tablet server in the Mumbai region.</p><ul><li>Let’s make the Hyderabad region go down:</li></ul><pre>kubectl scale sts hyderabad-yugabyte-yb-master-0 --replicas 0 -n yb-demo --context hyderabad<br>kubectl scale sts hyderabad-yugabyte-yb-tserver-0 --replicas 0 -n yb-demo --context hyderabad</pre><p>As soon as we decrease the pod replicas to 0 for both master and tserver, we can see the errors in the Yugabyte master UI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EqXaeRnzXS4rDYzO" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nybcwH2UNAFroYwB" /></figure><p>Here we can see that the master server from the Mumbai region is elected as a new Leader and all transactions are still operating even if one whole region is down.</p><ul><li>Yugabyte also keeps track of the under-replicated tables, so that they can be replicated to the region as soon as it comes back online:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*noEi_lpw2yx6d-jC" /></figure><ul><li>When the region comes online again, the data is replicated back to the Hyderabad region:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3auYlywQYTY3Cgem" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rxS3iX2bGIV1PiuQ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*crO3AVb_C6-ZCXxm" /></figure><p>Awesome, now you have a multi-regional fault-tolerant YugabyteDB setup on AWS EKS clusters using Istio as a service mesh.</p><h3>BONUS: SETUP KIALI FOR OBSERVABILITY</h3><p>The Istio download package comes by default with Kiali and Prometheus, let’s set it up to have a nice view of all the services in the mesh.</p><ul><li>Install Kiali and Prometheus:</li></ul><pre>{<br>  for region in mumbai singapore hyderabad; do<br>    echo -e &quot;Checking Kiali and Prometheus for cluster - ${region}...\n&quot;<br>    <br>    kubectl apply -f istio-1.21.0/samples/addons/prometheus.yaml --context ${region}<br>    kubectl apply -f istio-1.21.0/samples/addons/kiali.yaml --context ${region}<br><br>    echo -e &quot;-------------\n&quot;<br>  done<br>}</pre><ul><li>Open Kiali dashboard:</li></ul><pre>istioctl dashboard kiali --context singapore</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fRJdL9Kevlr_R5IZ" /></figure><p>The above Kiali graph shows the various clusters and services from the POV of EKS cluster in the Singapore region.</p><h3>CLEANING UP THE RESOURCES</h3><ul><li>Uninstall YugabyteDB:</li></ul><pre>{<br>  for region in mumbai singapore hyderabad; do<br>    echo -e &quot;Un-installing YugabyteDB in cluster - ${region}...\n&quot;<br>    <br>    helm uninstall ${region} --namespace yb-demo --kube-context ${region}<br>    kubectl delete pvc --namespace yb-demo \<br>      --selector component=yugabytedb,release=${region} \<br>      --context ${region}<br><br>    echo -e &quot;-------------\n&quot;<br>  done<br>}</pre><ul><li>Delete additional YB services:</li></ul><pre>{<br>  for region1 in mumbai singapore hyderabad; do<br>    for region2 in mumbai singapore hyderabad; do<br>      if [[ &quot;${region1}&quot; == &quot;${region2}&quot; ]]; then continue; fi<br>      echo -e &quot;Deleting services of ${region2} in ${region1}...\n&quot;<br>      <br>      kubectl --context ${region1} delete -f ${region1}/services-${region2}.yaml -n yb-demo<br>      <br>      echo -e &quot;-------------\n&quot;<br>    done<br>  done<br>}</pre><ul><li>Un-install Kiali and Prometheus:</li></ul><pre>{<br>  for region in mumbai singapore hyderabad; do<br>    echo -e &quot;Checking Kiali and Prometheus for cluster - ${region}...\n&quot;<br>    <br>    kubectl delete -f istio-1.21.0/samples/addons/prometheus.yaml --context ${region}<br>    kubectl delete -f istio-1.21.0/samples/addons/kiali.yaml --context ${region}<br>    <br>    echo -e &quot;-------------\n&quot;<br>  done<br>}</pre><ul><li>Uninstall Istio:</li></ul><pre>{<br>  for region in mumbai singapore hyderabad; do<br>    echo -e &quot;Un-installing Istio in cluster - ${region}...\n&quot;<br>    <br>    istioctl uninstall --purge -y --context ${region}<br><br>    echo -e &quot;-------------\n&quot;<br>  done<br>}</pre><ul><li>Delete EKS clusters:</li></ul><pre>eksctl delete cluster yb-mumbai --region ap-south-1<br>eksctl delete cluster yb-singapore --region ap-southeast-1<br>eksctl delete cluster yb-hyderabad --region ap-south-2</pre><h3>CONCLUSION</h3><p>A multi-region, multi-cluster YugabyteDB deployment on AWS EKS with Istio provides a highly available, scalable, and secure architecture for distributed applications. By leveraging YugabyteDB deployed on multiple AWS regions and EKS clusters, this setup ensures redundancy and failover capabilities, minimizing downtime and ensuring business continuity. Istio’s service mesh capabilities provide advanced traffic management, security, and observability features, allowing for fine-grained control and monitoring of the application traffic. This setup is ideal for organizations requiring a robust and resilient infrastructure for their critical applications.</p><p>The original tech blog is <a href="https://dvops.wordpress.com/2024/04/27/multi-region-yugabytedb-deployment-on-aws-eks-with-istio/">here</a>, please follow/subscribe to get notifications directly in your inbox when new content goes live. You can also find me on LinkedIn @ <a href="https://www.linkedin.com/in/vishnuhd/">in/vishnuhd</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b584e155079c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OPENTOFU VS. TERRAFORM : SAME SAME BUT DIFFERENT]]></title>
            <link>https://medium.com/@vishnuhd/opentofu-vs-terraform-same-same-but-different-ff19a571ea1d?source=rss-32f9b973c6f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff19a571ea1d</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[opentofu]]></category>
            <category><![CDATA[iac]]></category>
            <dc:creator><![CDATA[Vishnu Hari Dadhich]]></dc:creator>
            <pubDate>Wed, 14 Feb 2024 02:41:21 GMT</pubDate>
            <atom:updated>2024-02-14T02:41:40.592Z</atom:updated>
            <content:encoded><![CDATA[<h3>OPENTOFU VS. TERRAFORM : SAME SAME BUT DIFFERENT</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P8JYYmp5P8jtM0HYL73Few.png" /></figure><p>In the rapidly evolving world of cloud computing, the concept of Infrastructure as Code (IaC) has revolutionized how we manage and provision IT infrastructure. By treating servers, databases, networks, and other infrastructure elements as software code, IaC enables consistent and efficient management across diverse environments. This week marks a significant milestone in the IaC domain with the release of OpenTofu, a notable fork of the widely-used Terraform.</p><p>OpenTofu emerges at a critical juncture, promising to usher in a new phase of innovation and flexibility in IaC. As businesses increasingly adopt cloud-native technologies, understanding the impact of such tools is pivotal. This blog post aims to explore what OpenTofu is, its unique features, and its potential influence on the future of IaC, especially for businesses with a technical mindset.</p><p>In the following sections, we’ll delve deeper into the technicalities, benefits, and business implications of adopting OpenTofu, providing insights that will help you navigate this new and exciting landscape.</p><h3>OpenTofu: A Response to Licensing Changes</h3><p>A key factor in the emergence of OpenTofu was the licensing changes initiated by HashiCorp for Terraform. Originally an open-source tool under the Mozilla Public License v2.0, Terraform shifted to the Business Source License (BUSL). This change sparked a need in the community for an alternative that adhered to the principles of open-source software.</p><p><strong>Open Source to BUSL:</strong> The transition from an open-source license to BUSL by Terraform raised concerns about long-term accessibility and community contributions. BUSL, while still allowing usage and distribution, imposes certain limitations that are not typically found in open-source licenses. This shift led to the search for a solution that would preserve the open-source ethos in the IaC domain.</p><p><strong>OpenTofu’s Emergence:</strong> In response to this licensing pivot, the Linux Foundation facilitated the development of OpenTofu. Staying true to its open-source roots, OpenTofu was released under the Mozilla Public License 2, ensuring continued community access and contribution. This decision not only addressed the immediate concerns following Terraform’s licensing change but also reinforced the commitment to maintaining an open and collaborative environment for IaC development.</p><p>In the following sections, we’ll delve deeper into the features that OpenTofu brings to the table and how it stands to influence the future of cloud infrastructure management.</p><h3>Key Features and Benefits of OpenTofu</h3><p>OpenTofu introduces a host of innovative features and enhancements, making it a compelling choice for businesses and technical teams looking to leverage Infrastructure as Code. Here are some of the key features and benefits of OpenTofu:</p><p><strong>Advanced Testing for Configurations and Modules:</strong> OpenTofu brings enhanced testing capabilities, allowing users to thoroughly assess configurations and enabling module authors to conduct extensive module tests. This feature not only improves the stability of the configurations but also ensures higher reliability and efficiency in deployment processes.</p><p><strong>Enhanced S3 State Backend:</strong> The S3 state backend has been substantially updated in OpenTofu. It now includes numerous new authentication methods while maintaining compatibility with S3-compatible object storage. This enhancement adds a layer of flexibility and security, making state management more robust and adaptable to various use cases.</p><p><strong>Client-Side State Encryption:</strong> Addressing a key concern in cloud infrastructure management, OpenTofu introduces client-side state encryption. This feature is particularly crucial for projects operating in regulated environments or those prioritizing maximum security. It ensures that state and plan files are encrypted end-to-end, providing an additional layer of security.</p><p><strong>Community-Driven and Open Source:</strong> As a project under the Linux Foundation, OpenTofu benefits from a community-driven approach. This open-source nature allows for a diverse range of contributions, ensuring that the tool stays relevant and adapts to the evolving needs of its users.</p><p>These features collectively make OpenTofu a powerful tool in the realm of IaC, offering enhanced security, flexibility, and efficiency. In the next section, we’ll explore how OpenTofu is poised to influence the future landscape of Infrastructure as Code.</p><h3>OpenTofu and the Future of Infrastructure as Code</h3><p>As we step into the future, OpenTofu is positioned to significantly influence the Infrastructure as Code (IaC) landscape. Its introduction marks a pivotal moment, indicating a shift towards more flexible, secure, and community-driven IaC solutions. Let’s explore the potential impact of OpenTofu on the future of cloud infrastructure management.</p><p><strong>Driving Innovation in IaC:</strong> OpenTofu, with its advanced features and open-source nature, sets the stage for continuous innovation in IaC. Its ability to adapt to the evolving needs of developers and businesses means that it can quickly integrate new functionalities and improvements, propelling the IaC field forward.</p><p><strong>Enhancing Security and Flexibility:</strong> The emphasis on security, evident in features like client-side state encryption, positions OpenTofu as a frontrunner in secure cloud infrastructure management. This focus is increasingly critical as businesses navigate the complexities of data privacy and regulatory compliance. Additionally, its flexible architecture allows for customization and scalability, catering to a wide range of use cases.</p><p><strong>Fostering a Collaborative Community:</strong> Being under the Linux Foundation, OpenTofu benefits from a global community of developers and users. This collaborative environment not only accelerates the development and refinement of the tool but also ensures that it remains aligned with user needs and industry trends.</p><p><strong>Implications for Businesses:</strong> For businesses, the adoption of OpenTofu could mean enhanced agility, better security, and cost efficiency in managing cloud infrastructures. Its compatibility with Terraform eases the transition for existing users, while its new features present opportunities for optimizing cloud operations.</p><blockquote>In essence, OpenTofu is more than just a tool; it’s a harbinger of the evolving landscape of IaC, promising to bring about changes that will redefine how we manage cloud infrastructure.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff19a571ea1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TROUBLESHOOTING KUBERNETES LIKE A PRO WITH nsenter]]></title>
            <link>https://medium.com/@vishnuhd/troubleshooting-kubernetes-like-a-pro-with-nsenter-dd3117d59ff4?source=rss-32f9b973c6f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd3117d59ff4</guid>
            <category><![CDATA[nsenter]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Vishnu Hari Dadhich]]></dc:creator>
            <pubDate>Wed, 20 Sep 2023 09:37:12 GMT</pubDate>
            <atom:updated>2023-09-20T14:47:58.299Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NttxcHlXBLlCxYIp7Fm6ag.png" /></figure><p>Containers have revolutionized the world of software development by providing a lightweight and isolated environment for running applications. However, like any technology, they can encounter issues that require thorough troubleshooting. One powerful tool in your troubleshooting arsenal is nsenter. In this blog, we’ll explore how to troubleshoot issues with containers in namespaces using nsenter, specifically with the container runtime containerd, backed by real-life examples that highlight its effectiveness.</p><h3>UNDERSTANDING NAMESPACES AND THE NEED FOR TROUBLESHOOTING</h3><p>nsenter is a powerful command-line utility that allows you to enter namespaces of other processes and execute commands as if you were within that namespace. This tool enables you to peek inside a container’s namespace and diagnose problems that might be occurring.</p><h3>EXAMPLES</h3><p>Let’s dive into some real-life scenarios where nsenter can be a lifesaver for troubleshooting container issues in containerd:</p><h3>Example 1: Debugging Network Connectivity</h3><p>Imagine you have a containerized application that’s supposed to communicate with a database server running on the host machine. However, the application isn’t able to establish a connection, and you suspect a network issue. Instead of breaking into the container, you can use nsenter to examine the container’s network namespace.</p><pre># Find the PID of the container&#39;s init process <br>CONTAINER_ID=$(crictl inspect &lt;container_id&gt; --output json | jq -r .info.pid) <br><br># Enter the container&#39;s network namespace <br>sudo nsenter -t $CONTAINER_ID -n <br><br># Now you can diagnose network-related issues from within the container&#39;s namespace</pre><h3>Example 2: Inspecting Process Isolation</h3><p>Containers excel at isolating processes, but this can sometimes lead to difficulties in monitoring or diagnosing issues within the container. Suppose you’re experiencing unexpected high CPU usage within a container.</p><pre># Get the PID of the process you want to inspect within the container<br>PROCESS_PID=$(crictl exec &lt;container_id&gt; ps aux | grep &lt;process_name&gt; | awk &#39;{print $2}&#39;) <br><br># Enter the container&#39;s PID namespace <br>sudo nsenter -t $PROCESS_PID -m <br><br># Now you can inspect the process and its resource utilization from the host&#39;s perspective</pre><h3>Example 3: Investigating Filesystem Problems</h3><p>Filesystem-related issues can be complex to diagnose within containers. Let’s say you’re encountering file permission problems within a containerized web server.</p><pre># Get the PID of the container&#39;s init process<br>CONTAINER_ID=$(crictl inspect &lt;container_id&gt; --output json | jq -r .info.pid) <br><br># Enter the container&#39;s filesystem namespace<br>sudo nsenter -t $CONTAINER_ID -m -u -i -n -p <br><br># Now you can navigate the container&#39;s filesystem and investigate permission issues</pre><h3>CONCLUSION</h3><p>Troubleshooting container issues within namespaces can be a daunting task, but with the right tools, it becomes more manageable. nsenter empowers you to directly access and diagnose problems within a container’s isolated environment, allowing you to effectively pinpoint and resolve issues.</p><p>By mastering nsenter , you’ll be equipped to tackle a wide range of container-related problems, from networking glitches to process isolation and filesystem complications. Remember that practice makes perfect, so experiment with nsenter in different scenarios to build your troubleshooting expertise. Happy diagnosing!</p><p><em>Disclaimer: When using </em><em>nsenter, be cautious to avoid disrupting the normal operation of containers. Make sure you understand the implications of entering namespaces and running commands within them.</em></p><p>Find more such articles at <a href="https://dvops.wordpress.com/">https://dvops.wordpress.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd3117d59ff4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GET PATH AND ACCESS VOLUMES IN DOCKER FOR MAC]]></title>
            <link>https://medium.com/@vishnuhd/get-path-and-access-volumes-in-docker-for-mac-25ae421630ed?source=rss-32f9b973c6f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/25ae421630ed</guid>
            <category><![CDATA[docker-for-mac]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Vishnu Hari Dadhich]]></dc:creator>
            <pubDate>Fri, 23 Aug 2019 14:57:06 GMT</pubDate>
            <atom:updated>2019-08-23T14:57:06.944Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*NgTn09AfNKJbzXUA2MzSKg.png" /></figure><p>If you use persistent data volumes in Docker, you might want to access them via command-line. If your docker host is Linux, that’s not a problem; you can find Docker volumes by /var/lib/docker/volumes path.</p><p>However, that’s not the case when you use Docker for Mac. Try to cd /var/lib/docker/volumes from your MacOS terminal, and you’ll get nothing. You see, your Mac machine isn’t a real Docker host. Docker for Mac runs a virtual machine behind the scenes and hides it from you to make things simpler. Simpler, unless you want to dig deeper.</p><p>So, to access persistent volumes created by Docker for Mac, you need to log in that hidden virtual machine first, which is not that straightforward.</p><p>In order to accomplish this, we need to use a serial terminal on Mac. There’s a terminal application called `screen` that’s going to help us.</p><ul><li>We need to “screen into” the Docker driver by executing a command:</li></ul><pre>screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty</pre><ul><li>You should see a blank screen, just press <em>Enter</em> and after a while, you should see a command line prompt</li><li>Now you’re inside Docker’s VM and you can cd into volumes dir by typing:</li></ul><pre>cd /var/lib/docker/volumes</pre><ul><li>Profit, you got there! (To detach from screen press ctrl+a ctrl+d or to exit press ctrl+a ctrl+\ )</li><li>If you need to transfer files from your MacOS host into Docker host (for example to put files into docker volumes) use directories shared between host (mac os) and Docker host (Docker VM), you can find a list of such directories under <strong>File Sharing</strong> tab of your Docker for Mac application.</li></ul><p>Hope this helps someone!</p><p>Find this and related articles here — <a href="https://dvops.cloud/2019/08/18/get-path-and-access-volumes-in-docker-for-mac/">https://dvops.cloud/2019/08/18/get-path-and-access-volumes-in-docker-for-mac/</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25ae421630ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>