Giter Site home page Giter Site logo

ngrok-k8s's Introduction

ngrok-k8s

This is a simple Docker container that can be used to launch ngrok in a Kuberntes cluster to surface either services or other pods directly.

This is strictly intended for debug/dev type scenarios.

Running in Kubernetes

kubectl run --restart=Never \
  -t -i --rm \
  ngrok --image=gcr.io/kuar-demo/ngrok \
  -- http my-service:8080

Some explanation:

  • --restart=Never This says "I just want a Pod". If you don't specify this you get a Deployment. We don't need that.
  • -t -i --rm These options state that I want an interactive tty. Also clean things up when I'm done.
  • -- Says "everything past this are arguments for the container".
  • http my-service:8080 These are arguments to the ngrok utility. This says "create an HTTP forwarding tunnel to my-service:8080"

Notes

You can password protect this tunnel easily with auth='username:password'. You can make this https only with --bind-tls=true. See the ngrok docs for more options.

NOTE Using TLS tunnels for secure services (e.g. kubernetes api) you need a pro or business plan

There is nothing Kubernetes specific (yet) in the container here. This is really a super simple container with just ngrok in it. I created a separate version just for this README.

Why not kubectl port-forward? First, port-forward doesn't support targetting Services. Second, you may want this to be available beyond your local machine.

Why not kubectl proxy? This will modify/rewrite HTTP and can get a little wacky. It also requires your browser to auth to the API server -- something that may not be easy if you aren't using password auth.

ngrok-k8s's People

Contributors

jbeda avatar rothgar avatar

Watchers

 avatar 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.