ktunnel

by omrikiei

omrikiei / ktunnel

A cli that exposes your local resources to kubernetes

230 Stars 15 Forks Last release: 15 days ago (v1.3.0) MIT License 147 Commits 23 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Ktunnel logo

ktunnel

Status GitHub Issues GitHub Pull Requests License


Expose your local resources to kubernetes

πŸ“ Table of Contents

🧐 About

Ktunnel is a CLI tool that establishes a reverse tunnel between a kubernetes cluster and your local machine. It lets you expose your machine as a service in the cluster or expose it to a specific deployment. You can also use the client and server without the orchestration part. Although ktunnel is identified with kubernetes, it can also be used as a reverse tunnel on any other remote system

Ktunnel was born out of the need to access my development host when running applications on kubernetes. The aim of this project is to be a holistic solution to this specific problem (accessing the local machine from a kubernetes pod). If you found this tool to be helpful on other scenarios, or have any suggesstions for new features - I would love to get in touch.

Ktunnel schema

Ktunnel schema

🏁 Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Installation

Homebrew

brew tap omrikiei/ktunnel
brew install ktunnel

From the releases page

Download here and extract it to a local bin path

Building from source

Clone the project

git clone https://github.com/omrikiei/ktunnel; cd ktunnel
Build the binary
CGO_ENABLED=0 go build -ldflags="-s -w"
You can them move it to your bin path
sudo mv ./ktunnel /usr/local/bin/ktunnel
Test the commamd
ktunnel -h

🎈 Usage

Expose your local machine as a service in the cluster

This will allow pods in the cluster to access your local web app (listening on port 8000) via http (i.e kubernetes applications can send requests to myapp:8000)

bash
ktunnel expose myapp 80:8000

Inject to an existing deployment

This will currently only work for deployments with 1 replica - it will expose a listening port on the pod through a tunnel to your local machine

bash
ktunnel inject deployment mydeployment 3306

✍️ Authors

See also the list of contributors who participated in this project.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.