Spaceship-prompt: Kubernetes context info is not showing up

Created on 27 Feb 2020  路  4Comments  路  Source: denysdovhan/spaceship-prompt

Kubernetes context info is not showing up

Kubernetes context info should show up like below
Screenshot from 2020-02-27 12-22-21

Environment

Spaceship version: 3.11.2
Zsh version: 5.4.2
Zsh framework: oh-my-zsh
Zsh plugin manager:
Terminal emulator: ubuntu terminal
Operating system: Linux

Screenshot

Screenshot from 2020-02-27 12-09-25

Possible solution
Going back to commit c047e3f is fixing.

Most helpful comment

There are inconsistencies in the documentation of kubectl / kubecontext - I am having the same problems, but until I found this ticket, I was checking SPACESHIP_KUBECONTEXT_SHOW (which is true) and I was seeing kubectl and kubecontext in SPACESHIP_PROMPT_ORDER docs (kubecontext in TROUBESHOOTING, kubectl locally)

Hopefully this helps somebody trying to figure this stuff out...

Part of the confusion is the 2 parts of KUBECTL, version and context. If you have expiring tokens and a server that just ignores expired connections, you need to enable KUBECTL, disable the kubectl version.

Just enabling SPACESHIP_KUBECTL_SHOW=true didn't work for me, the prompt just would hang because the server (teleport) was just ignoring the request for version.

This ultimately works for me:

SPACESHIP_KUBECTL_SHOW=true
SPACESHIP_KUBECTL_VERSION_SHOW=false
SPACESHIP_KUBECONTEXT_SHOW=true

All 4 comments

Please run echo $SPACESHIP_KUBECTL_SHOW, is it true ?

BTW, now kubectl section is not showing up by default, you need enable it explicitly.

Or refer to docs

Thanks. Worked after exporting $SPACESHIP_KUBECTL_SHOW to true.

There are inconsistencies in the documentation of kubectl / kubecontext - I am having the same problems, but until I found this ticket, I was checking SPACESHIP_KUBECONTEXT_SHOW (which is true) and I was seeing kubectl and kubecontext in SPACESHIP_PROMPT_ORDER docs (kubecontext in TROUBESHOOTING, kubectl locally)

Hopefully this helps somebody trying to figure this stuff out...

Part of the confusion is the 2 parts of KUBECTL, version and context. If you have expiring tokens and a server that just ignores expired connections, you need to enable KUBECTL, disable the kubectl version.

Just enabling SPACESHIP_KUBECTL_SHOW=true didn't work for me, the prompt just would hang because the server (teleport) was just ignoring the request for version.

This ultimately works for me:

SPACESHIP_KUBECTL_SHOW=true
SPACESHIP_KUBECTL_VERSION_SHOW=false
SPACESHIP_KUBECONTEXT_SHOW=true

Please note that also in SPACESHIP_PROMPT_ORDER the element kubecontext must be changed to kubectl

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MatthiasJ picture MatthiasJ  路  4Comments

AlecRust picture AlecRust  路  3Comments

ChadTaljaardt picture ChadTaljaardt  路  4Comments

xhaythemx picture xhaythemx  路  3Comments

gabrielpedepera picture gabrielpedepera  路  3Comments