

GitHub - astefanutti/kubebox: ⎈❏ Terminal console for Kubernetes clusters
source link: https://github.com/astefanutti/kubebox
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.adoc
Kubebox ⎈❏
Features
-
✓ Configuration sourcing from kubeconfig files (
KUBECONFIG
environment variable or$HOME/.kube
) -
✓ Switch contexts interactively
-
✓ Login and OAuth authentication support
-
✓ Namespace selection and pods list watching
-
✓ Container log scrolling / watching
-
✓ Container resources usage (memory, CPU, network charts) [1]
-
✓ Container remote exec terminal
-
❏ Object configuration editor and CRUD operations
-
❏ Cluster and nodes views / monitoring
Run
The following alternatives are available for you to use Kubebox, depending on your preferences and constraints.
Executable
Download the Kubebox standalone executable for your OS:
# OSX $ curl -Lo kubebox https://github.com/astefanutti/kubebox/releases/download/v0.3.1/kubebox-macos && chmod +x kubebox # Linux $ curl -Lo kubebox https://github.com/astefanutti/kubebox/releases/download/v0.3.1/kubebox-linux && chmod +x kubebox # Windows $ curl -Lo kubebox.exe https://github.com/astefanutti/kubebox/releases/download/v0.3.1/kubebox-windows
Kubectl
You can run Kubebox as an in-cluster client with kubectl
, e.g.:
$ kubectl run kubebox -it --rm --image=astefanutti/kubebox --restart=Never
See the RBAC section for more information about RBAC authorization.
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/:/home/node/.kube/:ro astefanutti/kubebox
Server
Kubebox can be served from a service deployed in the target Kubernetes cluster. Terminal emulation is provided by Xterm.js and the communication with the Kubernetes master API is proxied by the server.
To deploy the server in your Kubernetes cluster, run:
# Replace the ROUTE_HOSTNAME variable
$ kubectl create -f https://raw.github.com/astefanutti/kubebox/master/kubernetes.yaml
For the Ingress resource to work, the cluster must have an Ingress controller running. See Ingress controllers for more information. Besides, see the RBAC section for more information about RBAC authorization.
Alternatively, to deploy the server in your OpenShift cluster, run:
$ oc new-app -f https://raw.github.com/astefanutti/kubebox/master/openshift.yaml
Online
Kubebox is available online at https://astefanutti.github.com/kubebox. Note that this requires this address to match the allowed origins for CORS by the API server. This can be achived with the Kubernetes API server CLI, e.g.:
$ kube-apiserver --cors-allowed-origins .*
NPM
Install Kubebox globally and run it:
$ npm install -g kubebox $ kubebox
Or locally:
$ npm install kubebox
$ `npm bin`/kubebox
RBAC
If RBAC is enabled, Kubebox needs RBAC permissions to access the cluster resources.
By default, while running as in-cluster client or server, Kubebox uses the default
service account credentials to access the API server.
The following command can be run to bind the cluster-admin
role to the default
service account:
$ kubectl create clusterrolebinding default-cluster-admin --clusterrole=cluster-admin --serviceaccount=default:default
You can find more information in Configure Service Accounts for Pods.
Commands
General
[Alt+]1, …, 9
(use ⇧ or Alt inside exec terminal)
Login
Namespace
Log
Usage
✏️
Development
$ git clone https://github.com/astefanutti/kubebox.git
$ cd kubebox
$ npm install
$ node index.js
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK