# Inkube: Run Local Services as If They Were Inside the Kubernetes Cluster

> TL;DR: I built [Inkube](https://github.com/abdheshnayak/inkube), a tool that lets you **run local services with the same environment, network access, and runtime conditions as a Kubernetes pod** — without actually deploying. Built to ease local development in complex k8s setups.

---

## The Problem: Dev Inside Kubernetes is Painful

If you've ever worked with a large distributed system deployed in Kubernetes, you know how hard it is to:

* Mirror the cluster environment locally.
    
* Connect to in-cluster services (via DNS or service discovery).
    
* Access environment variables, secrets, and configmaps.
    
* Debug or test things without full deployment cycles.
    

This setup cost me hours of context switching. I wanted a way to spin up my app **locally** but have it **behave like it's in the cluster**.

---

## The Solution: Inkube

I created [Inkube](https://github.com/abdheshnayak/inkube) to address this exact need.

![inkube logo](https://github.com/abdheshnayak/inkube/blob/main/logo.png?raw=true align="left")

### ✨ What it does:

* 🧠 Mirrors the **runtime environment** of any pod ( `env vars`, `env mounts` )
    
* 🌐 Provides **network tunneling**, so your local app can access in-cluster services (and vice versa)
    
* 🔐 Pulls **secrets/config** directly from the pod spec
    
* 📦 Includes a **package manager** for syncing dependencies
    
* 🧪 Great for debugging, testing, or iterative development — without a full CI/CD cycle
    

---

## Powered By Devbox [\+ Kube](https://github.com/jetpack-io/devbox)VPN

[Inkube](https://github.com/kubenetworks/kubevpn) uses:

* 🧰 [**Devbo**](https://github.com/jetpack-io/devbox)[**x**](https://github.com/jetpack-io/devbox) to install & lock matching system packages for application.
    
* 🌐 [**KubeVPN**](https://github.com/kubenetworks/kubevpn) under t[he hoo](https://github.com/jetpack-io/devbox)d to [establ](https://github.com/kubenetworks/kubevpn)ish bidirectional tunnels and handle DNS/networking.
    

But Inkube wraps b[oth in](https://github.com/jetpack-io/devbox) a d[ev-frie](https://github.com/kubenetworks/kubevpn)ndly, zero-config CLI so you don't have to fight with flags or YAML.

---

## How It Works

1. **Choose a pod**: You tell Inkube which pod in the cluster you want to mirror.
    
2. **Inkube pulls metadata**: It extracts env vars, mounts, and config.
    
3. **Tunnels traffic**: It creates a bidirectional tunnel between your machine and the cluster.
    
4. **Local launch**: Run your app locally — but it behaves as if it's inside the cluster.
    

> Think: [Telepresence](https://www.telepresence.io/), but simpler, more dev-focused, and built for quick iteration cycles.

---

## Why This Matters

Modern teams often have robust Kubernetes setups — but devs don’t always want to (or can’t) replicate full environments locally. Tools like Tilt, Skaffold, and Telepresence exist, but each has a learning curve or infra requirements.

**Inkube** is intentionally minimal and developer-first. Ideal for:

* Working on one service in a large microservice setup
    
* Troubleshooting integration issues
    
* Exploring services in unfamiliar clusters
    
* Avoiding long deploy cycles for every small change
    

---

## Example Usage

```bash
inkube init # you will get prompt to pick namespace, deployment & container

devbox add <pkg> # install package 

inkube dev # you will access the shell with all env vars mounted and network access

inkube intercept # all traffic coming on deployment will start hitting your local machine.
# it will also stop all running container of that deployment.

inkube leave # stop intercepting traffic.

exit # exit from ther inkube shell
```

Your local process now:

* Has the same env vars as selected deployment’s container.
    
* Talks to other services via in-cluster DNS
    
* Can receive traffic from the cluster (via tunnel)
    
* Logs and behaves like it's "inside"
    

### Initialize

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1751378339127/145fde66-544b-41a0-96c7-89d04937e35e.gif align="center")

### Access Development Shell

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1751378378377/1a68c540-4aef-4979-908b-f9422af36a33.gif align="center")

### Intercepting Traffic

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1751378408442/6704cd45-08d4-4c0d-aea2-2d0315e05945.gif align="center")

### Accessing Container Environments

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1751378425343/972ad0e1-900d-4f10-ade8-872b26f58066.gif align="center")

### Package Manager

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1751377034349/ad15f5e1-b781-486e-948a-1afbc8bb27ee.gif align="center")

---

## Open Source & Contributions Welcome

Inkube is open source (MIT). You can check it out here:

🔗 [https://github.com/abdheshnayak/inkube](https://github.com/abdheshnayak/inkube)

If this scratches an itch you’ve had, or if you have feedback — I’d love to hear it.

---

**Thanks for reading!**  
If you found Inkube helpful, consider sharing it with a friend or teammate. Your feedback means a lot!
