Skip to content

Commit

Permalink
Merge pull request #10 from ahmetb/readme-updates
Browse files Browse the repository at this point in the history
Simplify and reformat readme
  • Loading branch information
jonmosco authored Jan 2, 2018
2 parents cc992ab + d27814c commit 7cbf3ca
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,50 @@
Kubernetes prompt for bash and zsh
kube-ps1: Kubernetes prompt for bash and zsh
==================================

A Kubernetes (k8s) bash and zsh prompt that displays the current cluster
context and namespace.
A script that lets you add the current Kubernetes context and namespace configured
on `kubectl` to your Bash/Zsh prompt strings (i.e. the `$PS1`).

Inspired by several tools used to simplify usage of kubectl
Inspired by several tools used to simplify usage of `kubectl`.

![prompt](img/screenshot.png)

![prompt2](img/screenshot-img.png)

![prompt demo](img/kube-ps1.gif)

## Installing

1. Clone this repository
2. Source the kube-ps1.sh in your `~./.zshrc` or your ~/.bashrc

For Zsh:
```sh
source /path/to/kube-ps1.sh
PROMPT='$(kube_ps1) $PROMPT'
```

For Bash:
```sh
source /path/tokube-ps1.sh
PS1='[\u@\h \W\[$(kube_ps1)\]]\$ $PS1'
```

## Requirements

The default prompt assumes you have the kubectl command line utility installed.
The default prompt assumes you have the `kubectl` command line utility installed.
It can be obtained here:

[Install and Set up kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)

If using this with OpenShift, the oc tool needs installed. It can be obtained from here:
If using this with OpenShift, the `oc` tool needs installed. It can be obtained from here:

[OC Client Tools](https://www.openshift.org/download.html)

## Helper utilities

There are several great tools that make using kubectl very enjoyable.
There are several great tools that make using kubectl very enjoyable:

[kubectx and kubenx](https://github.com/ahmetb/kubectx) are great for
- [`kubectx` and `kubens`](https://github.com/ahmetb/kubectx) are great for
fast switching between clusters and namespaces.

## Prompt Structure
Expand All @@ -38,22 +55,6 @@ The prompt layout is:
(<logo>|<cluster>:<namespace>)
```

## Install

1. Clone this repository
2. Source the kube-ps1.sh in your ~./.zshrc or your ~/.bashrc

ZSH:
```
source path/kube-ps1.sh
PROMPT='$(kube_ps1) '
```

Bash:
```
source path/kube-ps1.sh
PS1='[\u@\h \W\[$(kube_ps1)\]]\$ '
```

## Colors

Expand All @@ -63,7 +64,8 @@ for the namespace. These can of course be changed.

## Customization

The default settings can be overridden in ~/.bashrc or ~/.zshrc
The default settings can be overridden in `~/.bashrc` or `~/.zshrc` by setting
the following environment variables:

| Variable | Default | Meaning |
| :------- | :-----: | ------- |
Expand Down

0 comments on commit 7cbf3ca

Please sign in to comment.