Git Product home page Git Product logo

ktunnel's Introduction

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 let's 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.

ktunnel was born out of the need to access my development host when running applications on kubernetes. I specifically found it to be a challenge to run a remote pycharm debuuger on pods in a kubernetes development cluster. The aim of this project is to be an holistic solution to this specific problem(accessing the your local machine from a kubernetes pod) - although there are partial solutions to this problem such as inlets and ngrok I found them to be unsuitable and insecure for the task at hand. If you found this tool to be helpful on other scenarios(accessing a seeded development database/mocking a service and whatnot) I would love for us to communicate on that.

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.

Prerequisites

You should have proper permissions on the kubernetes cluster

Installation

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 headless 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 pods can send requests to myapp:8000)

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

ktunnel inject deployment mydeployment 3306

โœ๏ธ Authors

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

ktunnel's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.