Closed swright-eti closed 2 years ago
Same here...
It Seems as if there was a call missing to
_kube_ps1_get_context_ns
You are right. I added _kube_ps1_get_context_ns
to the kube_ps1()
function and it started working.
# Build our prompt
kube_ps1() {
_kube_ps1_get_context_ns
[[ "${KUBE_PS1_ENABLED}" == "off" ]] && return
[[ -z "${KUBE_PS1_CONTEXT}" ]] && [[ "${KUBE_PS1_CONTEXT_ENABLE}" == true ]] && return
...
Oh seems i forgot to add an other comment.
For me it got also working after adding the .kube/config file.
I was using k3s but somewhere in the Update Cache Methode there is a Check for the KubeConfig File... That file was missing because k3s uses it's own from /etc ...
Could be a bit more performant
The application uses the kubectl configuration conventions, so it will expect either the environment variable KUBECONFIG
to be set, or the existence of a .kube/config
file. Accounting for the locations of various config files would be beyond the scope of the application, but this could be solved by setting your KUBECONFIG
to the location of the file regardless which distribution of Kubernetes you have running.
This issue seems to be resolved.
I am trying to set this up in bash for Ubuntu and I am not sure what I am doing wrong.
I have this in my .bashrc file:
I source the .bashrc file and my existing color set goes away, but I dont see any context information added to my prompt.
I have kubectl. CTX, and NS installed.
Can you please let me know where I am going wrong? Thanks.