so0k / powerline-kubernetes

A Powerline segment to show your current Kubernetes context
MIT License
41 stars 19 forks source link

What troubleshooting steps should I take when segment is not showing #21

Open tigerinus opened 4 years ago

tigerinus commented 4 years ago

I believe I've followed all the steps correctly. However segment is not showing in either shell or tmux.

I can verify that the powerline_kubernetes module works fine individually:

Python 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import powerline_kubernetes
>>> s = powerline_kubernetes.segments.KubernetesSegment()
>>> s.config['clusters'][0]['name']
'minikube'
>>>

Here is my themes/tmux/default.json:

{
    "segments": {
        "left": [
            {
                "function": "powerline_gitstatus.gitstatus"
            }
        ],
        "right": [
            {
                "function": "powerline.segments.common.sys.cpu_load_percent",
                "args": {
                    "interval": 5
                }
            },
            {
                "function": "powerline_docker.docker"
            },
            {
                "function": "powerline_kubernetes.kubernetes",
                "args": {
                    "show_kube_logo": true,
                    "show_cluster": true,
                    "show_namespace": true,
                    "show_default_namespace": false,
                    "alerts": [
                        "prod"
                    ]
                }
            },
            {
                "function": "powerline.segments.common.net.hostname"
            }
        ]
    }
}

I did add following lines to the corresponding colorscheme file (tried both colorscheme/default.json and colorscheme/tmux/default.json):

        "kubernetes":                 { "fg": "yellow",          "bg": "darkblue", "attrs": [] },
        "kubernetes:divider":         { "fg": "gray4",           "bg": "darkblue", "attrs": [] },
        "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": [] },

BTW, powerline_docker works for me fine.

Please help. Thanks!

bigornoo commented 4 years ago

Same problem for me. MacOS 10.14.6.

tigerinus commented 4 years ago

I just realized it does not work for only minikube default context. It does work for a regular k8s context.

Smirl commented 4 years ago

I just ran into issues getting this set up. Turns out I had multiple kubeconfig files in my KUBECONFIG. Fixed in this issue https://github.com/so0k/powerline-kubernetes/issues/17

I debugged this by running the powerline-daemon in the foreground with:

powerline-daemon --foreground --replace

Hope this helps you figure out the issue.

narthollis commented 2 years ago

For me when it wasn't showing the issue was #13