OpenFaaS comes to k9s, the Kubernetes CUI

Last night I saw a tweet from Fernand Galiana, the author of the popular open source text UI for Kubernetes named "k9s". Fernand added support for OpenFaaS Functions and Services via his project. k9s has over 5k GitHub stars and many fans in the Cloud Native community. If you've not tried it yet, you are missing out.

Here's the Pod view from the docs:

k9s Pod view

And a neat way of getting logs, too:

k9s log view

This isn't just kubectl get pods / kubectl logs wrapped in a CLI, but to me that's definitely a core part of the value offering. In Fernand's OpenFaaS demo you'll see him show metrics from his Nginx IngressController.

Let's take a quick look at it, and then I'll leave his video below for his tour of the new feature.

I'm using some free credits I have from my friends at Civo Cloud, the UK's developer-cloud. Earlier in the year I helped them build out The World's First Managed k3s and I heard about k9s from their team.

The video tour

Try it for yourself

If you don't have OpenFaaS deployed yet then you can install it via k3sup (ketchup), an app installer for Kubernetes and it will only take a few moments:

curl -sSLf https://dl.arkade.dev | sudo sh

arkade install openfaas

After following the instructions given by the output, you'll log in and port-forward the OpenFaaS gateway to your local machine on port 8080.

If you have a remote OpenFaaS gateway, you can also set an environment variable.

# Default
kubectl port-forward -n openfaas svc/gateway 8080:8080 &
export OPENFAAS_GATEWAY=http://127.0.0.1:8080

# Remote
export OPENFAAS_GATEWAY=https://my-gateway.example.com

There are several ways to get k9s including brew, but since it's a single binary, I prefer to download it myself and put it into /usr/local/bin. On MacOS, this is how I did it:

curl -sSLf https://github.com/derailed/k9s/releases/download/v0.15.1/k9s_Darwin_x86_64.tar.gz > k9s.tgz

tar -xvf k9s.tgz -C /tmp/
sudo mv /tmp/k9s /usr/local/bin/

Then run it:

k9s

The navigation may take some getting used to, but once you know a few keyboard shortcuts you'll be set.

Here, we can see the OpenFaaS control-plane coming up:

control-plane

Now let's deploy a function from the store:

faas-cli store deploy nodeinfo

You can navigate to your OpenFaaS function view by entering command mode :openfaas or using aliases :ofaas or ofa

I'm invoking the function under a load test, as per Lab 9 of the OpenFaaS workshop and we can see it scaling up.

scale

And here are the logs, remember you can set write_debug or write to STDIO for additional verbosity.

logs

Wrapping up

I want to thank Fernand for taking time to integrate his cool open-source project with OpenFaaS and for sharing it with us on YouTube. I hope the community will try it out and give him feedback.

One of the things I'd like to see is a little text-based graph showing invocation metrics and auto-scaling, just like we provide with the Grafana dashboard:

OpenFaaS dashboard

You can follow Fernand on Twitter, and star his project on GitHub derailed/k9s.

To connect with the OpenFaaS community, join us on Slack

Did you know? We just launched a SWAG store, and you can get your own super-soft cotton t-shirts shipped directly to your door. Use discount code teamserverless-earlybird for money off, whilst stocks last.

Alex Ellis

Read more posts by this author.

Subscribe to Alex Ellis' Blog

Subscribe to keep in touch. By providing your email, you agree to receive marketing emails from OpenFaaS Ltd

or subscribe via RSS with your favourite RSS reader

Learn Go with my new eBook

eBook cover

"Everyday Go" is the fast way to learn tools, techniques and patterns from real tools used in production based upon my experience of building and running OpenFaaS at scale.

Buy a copy on Gumroad