Last active
September 16, 2024 13:57
Revisions
-
msiegenthaler revised this gist
Jun 29, 2018 . 2 changed files with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ function k --wraps kubectl set -l cmd if test -n "$argv" set cmd $argv This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ function secret set -l secret $argv[1] set -l value $argv[2] if test -z $secret; or test -z $value echo "Usage: secret <secret> <value>" return 121 end k get secret "$secret" -o jsonpath=\{.data.$value\} | base64 -d end -
msiegenthaler revised this gist
Jun 29, 2018 . 2 changed files with 19 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,10 +13,11 @@ function kubernetes_status return end set -l ns $namespace [ -z $ns ]; and set -l ns (kubectl config view -o json | jq --arg context $ctx -r '.contexts[] | select(.name | contains($context)) | .context.namespace') [ -z $ns ]; and set -l ns 'default' echo (set_color 666666)"$ctx$KUBECTL_PROMPT_SEPARATOR$ns" end function enable_kubernetes This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ function k set -l cmd if test -n "$argv" set cmd $argv else if [ (tput cols) -lt 150 ] set cmd get pod else set cmd get pod -o wide end if test -n "$namespace" kubectl --namespace "$namespace" $cmd else kubectl $cmd end end -
msiegenthaler renamed this gist
Jun 28, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
msiegenthaler revised this gist
Jun 28, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ function kubernetes_status return end set -l ns (kubectl config view -o json | jq --arg context $context -r '.contexts[] | select(.name | contains($ctx)) | .context.namespace') [ -z $ns ]; and set -l ns 'default' echo (set_color 999999)"$ctx$KUBECTL_PROMPT_SEPARATOR$ns" -
msiegenthaler revised this gist
Jun 28, 2018 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ function kubernetes_status [ -z "$KUBECTL_PROMPT_SEPARATOR" ]; and set -l KUBECTL_PROMPT_SEPARATOR "/" set -l config $KUBECONFIG [ -z "$config" ]; and set -l config "$HOME/.kube/config" @@ -19,6 +19,8 @@ function kubectl_status echo (set_color 999999)"$ctx$KUBECTL_PROMPT_SEPARATOR$ns" end function enable_kubernetes function fish_right_prompt echo (kubernetes_status) end end -
msiegenthaler created this gist
Jun 28, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ function kubectl_status [ -z "$KUBECTL_PROMPT_SEPARATOR" ]; and set -l KUBECTL_PROMPT_SEPARATOR "/" set -l config $KUBECONFIG [ -z "$config" ]; and set -l config "$HOME/.kube/config" if [ ! -f $config ] echo (set_color red)$KUBECTL_PROMPT_ICON" "(set_color white)"no config" return end set -l ctx (kubectl config current-context 2>/dev/null) if [ $status -ne 0 ] echo (set_color red)$KUBECTL_PROMPT_ICON" "(set_color white)"no context" return end set -l ns (kubectl config view -o json | jq --arg context $context -r '.contexts[] | select(.name | contains($context)) | .context.namespace') [ -z $ns ]; and set -l ns 'default' echo (set_color 999999)"$ctx$KUBECTL_PROMPT_SEPARATOR$ns" end function fish_right_prompt echo (kubectl_status) end