A Powerline segment to show Kubernetes context
Project description
Powerline Kubernetes
A Powerline segment to show the current Kubernetes context.
This segment shows the Kubernetes context together with a nice looking helm. Please feel free to propose more features and give me ideas on how to improve it.
Update: Now completely compatible with Kubernetes API 9.0.
## Requirements
The Kubernetes segment requires kubectl and official kubernetes Python API.
## Installation
Installing the Kubernetes segment can be done with pip
:
$ pip install powerline-kubernetes
The Kubernetes segment uses a couple of custom highlight groups. You'll need to define those groups in your colorscheme, for example in .config/powerline/colorschemes/default.json
:
{
"groups": {
"kubernetes_cluster": { "fg": "gray10", "bg": "darkestblue", "attrs": [] },
"kubernetes_cluster:alert": { "fg": "gray10", "bg": "darkestred", "attrs": [] },
"kubernetes_namespace": { "fg": "gray10", "bg": "darkestblue", "attrs": [] },
"kubernetes_namespace:alert": { "fg": "gray10", "bg": "darkred", "attrs": [] },
"kubernetes:divider": { "fg": "gray4", "bg": "darkestblue", "attrs": [] },
}
}
Then you can activate the Kubernetes segment by adding it to your segment configuration, for example in .config/powerline/themes/shell/default.json
:
{
"function": "powerline_kubernetes.kubernetes",
"priority": 30,
"args": {
"show_kube_logo": true, // set to false to omit the Kube logo
"show_cluster": true, // show cluster name
"show_namespace": true, // show namespace name
"show_default_namespace": false, // do not show namespace name if it's "default"
"alerts": [
"live", // show line in different color when namespace matches
"cluster:live" // show line in different color when cluster name and namespace match
]
}
}
By default the segment will look for the Kubernetes config under ~/.kube/config
.
## License
Licensed under the MIT License.
Authors
Created by so0k. Code contributions by:
Inspired by powerline-docker.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for powerline-kubernetes-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bdeb84eb5107736c34193842f37fa30bd630f28cf3d11916d43885b883f0eac |
|
MD5 | f6fe087d0e8c7945ab674cd8414eb072 |
|
BLAKE2b-256 | c9e53ee4bce459329ccd0498ec0966e2e6a3fd18b6e02224328c16a75d7a23bb |
Hashes for powerline_kubernetes-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fe47468207b5cb6e4b78d5937d1888357ebf194aebbe6176dbbb3be01841ad1 |
|
MD5 | 7081b28d599df91e56a6be9b4ac01ab2 |
|
BLAKE2b-256 | bc28785d2498280f2c29fb06d8716e9c67efce1dd8b2d1d0b521bc5093bf4c6e |