romkatv / powerlevel10k

A Zsh theme
MIT License
44.91k stars 2.13k forks source link

Some more commands for AWS and Kubernetes SHOW_ON_COMMAND #904

Closed polothy closed 3 years ago

polothy commented 4 years ago

Just added a few more CLI tools to my config and thought I'd share if you are interested:

typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|jx|eksctl|helmfile|kops|tkn'
typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|cdk|terragrunt|sam|jx|eksctl|kops'

Info on the tools:

Also, just want to add, I upgraded from 1.7 to 1.12 of p10k, and wow... amazing updates. The Instant prompt, Show on command and Transient prompt are all magical. I didn't know how much I wanted those! Really amazing work, just wanted to say thank you!

romkatv commented 4 years ago

Thanks for the list!

Which of these tools would also make sense to include in POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND and POWERLEVEL9K_AWS_SHOW_ON_COMMAND? Both of them currently include terraform, so I guess at least terragrunt should apply? What else?

And what about POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND? Do any of these tools respect ~/.config/gcloud?

polothy commented 4 years ago

For Azure:

For Google Cloud

romkatv commented 4 years ago

For Azure:

  • jx
  • terragrunt

Thanks!

For Google Cloud

  • kops
  • jx
  • terragrunt

Is this for gcloud segment or for google_app_cred?

polothy commented 4 years ago

Hrm, really sorry, I don't actually use Google Cloud, so this isn't really making sense to me. But... all three of these tools would need to authenticate to Google Cloud and also make resources in Google Cloud. Not sure if that helps 😕

romkatv commented 4 years ago

Your reply indicates that there might be misunderstanding about the list of commands that are appropriate to list in POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND. Those and only those commands must be listed there whose behavior is affected by the current kubernetes context as set by kubectl config set-context ... and as reported by kubectl config current-context. If a command uses kubernetes but its behavior is not affected by the current context as defined above, it must not be listed in POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND.

Is the behavior of eksctl affected by the current kubernetes context as defined above? What about jx? What about other commands?

The same goes for POWERLEVEL9K_AWS_SHOW_ON_COMMAND. Only commands that read and respect AWS_VAULT, AWSUME_PROFILE, AWS_PROFILE, or AWS_DEFAULT_PROFILE environment variable must be on the list. Does eksctl respect any of these variables?

polothy commented 4 years ago

Yeah, eksctl should behave similarly to aws CLI, but it also talks to Kubernetes clusters in AWS, so it belongs in both AFAIK.

If these are too controversial, no worries, they were just suggestions. I was able to easily configure the lists myself for the tools I use.

If I were to rate things on how likely someone else would actually be using them (this is highly subjective), they would be:

romkatv commented 4 years ago

Sorry for the long delay.

Yeah, eksctl should behave similarly to aws CLI, but it also talks to Kubernetes clusters in AWS, so it belongs in both AFAIK.

eksctl must be listed in POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND if and only if it respects the current context as specified in ~/.kube/config. If it talks to Kubernetes clusters but does not read ~/.kube/config or does not respect the current context specified in that file, it must not be listed in POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND.

Does eksctl respects the current context specified in ~/.kube/config?

If these are too controversial

"Controversial" isn't the right word. I want POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND to list all commands that respect the current context as specified in ~/.kube/config. There is no judgement involved. Either a command respects the current context as specified in ~/.kube/config or it doesn't.

The same goes for POWERLEVEL9K_AWS_SHOW_ON_COMMAND. Those and only those commands that read and respect AWS_VAULT, AWSUME_PROFILE, AWS_PROFILE, or AWS_DEFAULT_PROFILE environment variable must be on the list.

Does eksctl read and respect AWS_VAULT, AWSUME_PROFILE, AWS_PROFILE, or AWS_DEFAULT_PROFILE environment variable?

maximbaz commented 3 years ago

the rest I never heard of, but some quick notes:

I'd wait for comments from people who actually used these and the rest of the tools

romkatv commented 3 years ago

Thanks, @maximbaz !

I've added k9s|helmfile to POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND and terragrunt to POWERLEVEL9K_{AWS,AZURE,GOOGLE_APP_CRED}_SHOW_ON_COMMAND.