feat: Add Kubernetes Module (#404)

Adds a Kubernetes module, which works by parsing kubeconfig.
This commit is contained in:
Thomas O'Donnell
2019-10-01 20:58:24 +02:00
committed by Kevin Song
parent 6888f3619a
commit 9fc5a43355
7 changed files with 233 additions and 0 deletions
+30
View File
@@ -85,6 +85,7 @@ The default `prompt_order` is used to define the order in which modules are show
prompt_order = [
"username",
"hostname",
"kubernetes",
"directory",
"git_branch",
"git_state",
@@ -528,6 +529,35 @@ symbol = "+ "
threshold = 4
```
## Kubernetes
Displays the current Kubernetes context name and, if set, the namespace from
the kubeconfig file. The namespace needs to be set in the kubeconfig file, this
can be done via `kubectl config set-context starship-cluster --namespace
astronaut`. If the `$KUBECONFIG` env var is set the module will use that if
not it will use the `~/.kube/config`.
### Options
| Variable | Default | Description |
| ---------- | ------------- | --------------------------------------------------- |
| `symbol` | `"☸ "` | The symbol used before displaying the Cluster info. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `kubernetes` module |
### Example
```toml
# ~/.config/starship.toml
[kubernetes]
symbol = "⛵ "
style = "dim green"
disabled = true
```
## Line Break
The `line_break` module separates the prompt into two lines.