Meet kn—a Kubernetes native experience

Written by mhausenblas | Published 2018/10/22
Tech Story Tags: kubernetes | command-line | shell | development-tools

TLDRvia the TL;DR App

kn in action

Recently, I had a look at a bunch of shell scripts on my computer that I’m using to quickly ramp up a debug pod or publish a service in a Kubernetes cluster. I thought to myself: why not packaging them nicely and share them so that others also can benefit from it?

Meet kn, short for Kubernetes native, that you might find useful to quickly jump into a Kubernetes cluster in order to poke around or even test-drive a networked app, sharing it on the public net. Sounds fun? Let’s jump into the deep end!

This is what a typical debug session with kn could look like:

$ kn up myenv

$ kn connect myenv

<< do your stuff here >>

$ kn down myenv

Now, let’s switch gears and assume you have a service such as an app server that is exposing, for example, a HTTP API and you want to test it and/or share it with your colleagues:

$ KN_BASE_IMAGE=quay.io/mhausenblas/pingsvc:2 KN_MODE=daemon \kn up psvc 8888

The daemonized environment [psvc] is now ready!To publish your environment, do: kn publish psvc 8888

$ kn publish psvc 8888

$ curl localhost:9898/pingpong

If you want to see a hands-on walkthrough of kn have a look at the video below or check out the examples in the docs:

Thanks for your time and maybe you want to give it a try and let me know what you think?


Published by HackerNoon on 2018/10/22