= Kubebox [small]#^⎈❏^#
Antonin Stefanutti https://github.com/astefanutti[@astefanutti]
// Meta
:description: Terminal console for Kubernetes clusters
// Settings
:idprefix:
:idseparator: -
:experimental:
// Aliases
ifdef::env-github[]
:note-caption: :information_source:
:icon-edit: :pencil2:
endif::[]
ifndef::env-github[]
:icons: font
:icon-edit: icon:pencil[fw]
endif::[]
// URIs
:uri-badge-npm: https://img.shields.io/npm/v/kubebox.svg
:uri-badge-node: https://img.shields.io/node/v/kubebox.svg
:uri-kubebox-npm: https://www.npmjs.com/package/kubebox
:uri-kubebox-download: https://github.com/astefanutti/kubebox/releases/download/latest
:uri-kube-apiserver: https://kubernetes.io/docs/admin/kube-apiserver/
:uri-ingress-controllers: https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-controllers
:uri-minikube: https://github.com/kubernetes/minikube
:uri-minikube-kubernetes: https://github.com/kubernetes/minikube/blob/master/docs/configuring_kubernetes.md
:uri-minishift: https://github.com/minishift/minishift
:uri-terminal-forever: http://www.commitstrip.com/en/2016/12/22/terminal-forever/
image:{uri-badge-npm}[link="{uri-kubebox-npm}"] image:{uri-badge-node}[]
{description}
//image::https://astefanutti.github.io/kubebox/kubebox.gif[align="center"]
++++
++++
=== Features
== Run
=== Executable
Download the Kubebox standalone executable for your OS:
--
[source,shell,subs=attributes+]
OSX
$ curl -Lo kubebox {uri-kubebox-download}/kubebox-macos && chmod +x kubebox
Linux
$ curl -Lo kubebox {uri-kubebox-download}/kubebox-linux && chmod +x kubebox
Windows
$ curl -Lo kubebox.exe {uri-kubebox-download}/kubebox-windows
=== NPM
Install Kubebox globally and run it:
$ npm install -g kubebox
$ kubebox
Or locally:
$ npm install kubebox
$ `npm bin`/kubebox
=== Docker
You can run Kubebox using Docker, e.g.:
$ docker run -it --rm astefanutti/kubebox
You may want to mount your home directory so that Kubebox can rely on the ~./kube/config
file, e.g.:
$ docker run -it --rm -v ~/.kube/:/root/.kube/:ro astefanutti/kubebox
=== Online
Kubebox is available online at http://kube.sh. Note that this requires this address to match the allowed origins for CORS by the API server.
This can be achived with the {uri-kube-apiserver}[Kubernetes API server CLI], e.g.:
$ kube-apiserver --cors-allowed-origins .*
In case you use {uri-minikube}[Minikube], this can be achieved with:
$ minikube start --extra-config=apiserver.GenericServerRunOptions.CorsAllowedOriginList=.*
See {uri-minikube-kubernetes}[Configuring Kubernetes] for more information.
Or if you use {uri-minishift}[Minishift]:
$ minishift openshift config set --patch '{"corsAllowedOrigins": [".*"]}'
=== On Premises
Kubebox can be served from a container deployed in a Kubernetes cluster whose address to connect to is pre-configured during the deployment.
Note that the externally-reachable host name that routes to the Kubebox service is required to match the allowed origins for CORS by the API server.
==== Kubernetes
$ kubectl create -f https://raw.githubusercontent.com/astefanutti/kubebox/master/kubernetes.yaml
In order for the Ingress resource to work, the cluster must have an Ingress controller running. See {uri-ingress-controllers}[Ingress controllers] for more information.
In case you use Minikube, this can be achieved with:
$ minikube addons enable ingress
==== OpenShift
$ oc new-app -f https://raw.githubusercontent.com/astefanutti/kubebox/master/openshift.yaml \
-p ROUTE_HOSTNAME=<HOST> \
-p OPENSHIFT_MASTER=<URL>
== Commands
[cols="1v,2v"]
|===
|Keybinding |Description
2+^.e|General
|kbd:[l], kbd:[CTRL+l]
|Login
|kbd:[←], kbd:[→]
|Navigate screen
|kbd:[↑], kbd:[↓]
|Navigate list / form
|kbd:[ESC]
|Close modal window / cancel form
|kbd:[q], kbd:[CTRL+c]
|Exit footnoteref:[online keys, Not available in online version.]
2+^.e|Login
|kbd:[←], kbd:[→]
|Navigate Kube configurations
2+^.e|Dashboard
|kbd:[n]
|Change current namespace
|kbd:[m]
|Memory usage
|kbd:[c]
|CPU usage
|kbd:[t]
|Network usage
|===
== Usage
{icon-edit}
== Development
$ git clone https://github.com/astefanutti/kubebox.git
$ cd kubebox
$ npm install
$ node index.js
== Terminal forever
//image::https://astefanutti.github.io/kubebox/terminal-forever.jpg[align="center", link={uri-terminal-forever}]
++++
++++