Skip to main content

Powerline Kubernetes PyPI version

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.

Release files for powerline-kubernetes 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for powerline-kubernetes 1.2.0
File Size Uploaded
powerline-kubernetes-1.2.0.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for powerline-kubernetes 1.2.0
File Interpreter ABI Platform
powerline_kubernetes-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.9 kB

Release files / powerline-kubernetes-1.2.0.tar.gz

Download URL powerline-kubernetes-1.2.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f635f648b3e0249fe7491996c5a681ead8868b9bfa0254dde8811fe2919a9711
BLAKE2b-256 checksum
How to use checksums
341f4cfd85c8e96b1a0fb67e1c29fc90dde476be7b35b248b20a4d7b4791f6e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.4

Release files / powerline_kubernetes-1.2.0-py3-none-any.whl

Download URL powerline_kubernetes-1.2.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d54a23c4b2a9da6d2d24d92511c102453b877abb63bbf9ed5e6af18ce7521292
BLAKE2b-256 checksum
How to use checksums
a2b0cd314b1be0cc123625db3da9e1972c0f274be8ef6c2a10fad3026733f142
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.4

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.1

3 release files

1.0.0

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page