npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kfwd

v1.0.5

Published

Poor man's vpn to kubernetes, kubectl port-forward on steroids, simple hack wannabe-Telepresence

Downloads

9

Readme

kfwd

Poor man's VPN (tcp port forwardning only) into a kubernetes cluster / kubectl port-forward on steroids. For something more advanced, see https://www.telepresence.io/.

  • spins up a haproxy-pod configured for tcp proxying inside the current namespace (using kubectl run ...)
  • spins up a local docker port-forwarder to the haproxy-pod (1-n kubectl port-forward per container/service port)
  • edits /etc/localhost (write access required, obv..) or ~/.hosts (HOSTALIASES format)

et voila - all applications and development tools on your computer can now access services inside the cluster. Use with caution.

Quick and dirty hack. Don't expect pretty code :).

Usage

╰─>$ kfwd --help
kfwd [options] <args...>

forward dns names to cluster services

Options:
  --version                Show version number                         [boolean]
  --use-etc-hosts, -y      Will not ask if to edit /etc/hosts or ~/.hosts.
                           /etc/hosts is automatically selected        [boolean]
  --namespace, -n          Choose kubernetes namespaces instead of picking the
                           current one                                  [string]
  --use-homedir-hosts, -h  Will not ask if to edit /etc/hosts or ~/.hosts.
                           ~/.hosts is automatically selected          [boolean]
  --local, -l              Local docker kfwd mode - should not be used by end
                           users of kfwd. Intended for master internally.
                                                                       [boolean]
  --help                   Show help                                   [boolean]

Examples:
  kfwd svc1 svc2                    Starts kfwd in master mode, forwarding http
                                    requests made on this computer to to dns
                                    names 'svc1' and 'svc2' -> corresponding
                                    kubernetes cluster services. After this you
                                    can open a new shell and do `curl
                                    http://svc1[:some port]` to talk to these
                                    services running in the cluster
  kfwd alias1=svc1 alias2=svc2      Starts kfwd in master mode, forwarding http
                                    requests made on this computer to to dns
                                    names 'alias1' and 'alias2' -> corresponding
                                    kubernetes cluster services svc1 and svc2.
                                    After this you can open a new shell and do
                                    `curl http://svc1[:some port]` to talk to
                                    these services running in the cluster

Additional examples

shell 1:

sudo env "PATH=$PATH" kfwd -y my-service my-other-service

(env stuff not necessary if root has nodejs and kubectl configured)

shell 2:

curl my-service:1234

curl my-service:8080

curl my-other-service

Platform compatibility

  • Tested only on ubuntu 18.04 and 16.04

  • May work with some tweaks on mac (untested)

  • Does NOT work on windows (needs tools like sed, expects to find /etc/hosts and a few other issues)

Warning

Written in Node.js, which I am a beginner in. All advice on style and best practices very welcome! Expect things to break :S.