Java OpenResty Spring Spring Boot MySQL Redis MongoDB PostgreSQL Linux Android Nginx 面试 小程序 Arthas JVM AQS juc Kubernetes Docker DevOps


Kubernetes kubectl 命令提示

Kubernetes 大约 937 字

PowerShell

将如下命令追加到$PROFILE中,且重新打开PowerShell

kubectl completion powershell | Out-String | Invoke-Expression

示例

echo 'kubectl completion powershell | Out-String | Invoke-Expression' >> $PROFILE

注意:$PROFILE的路径位于$HOME/WindowsPowerShell下,WindowsPowerShell默认不存在,需提前创建。

mkdir $HOME/WindowsPowerShell

Bash

Linux

echo 'source <(kubectl completion bash)' >>~/.bashrc

配置别名也生效

echo 'alias k=kubectl' >>~/.bashrc
echo 'complete -o default -F __start_kubectl k' >>~/.bashrc

macOS

echo 'source <(kubectl completion bash)' >>~/.bash_profile

配置别名也生效

echo 'alias k=kubectl' >>~/.bash_profile
echo 'complete -o default -F __start_kubectl k' >>~/.bash_profile

参考

https://kubernetes.io/docs/tasks/tools/included/optional-kubectl-configs-pwsh

https://kubernetes.io/docs/tasks/tools/included/optional-kubectl-configs-bash-linux

https://kubernetes.io/docs/tasks/tools/included/optional-kubectl-configs-bash-mac

阅读 83 · 发布于 2022-10-28

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb

扫描下方二维码关注公众号和小程序↓↓↓

扫描二维码关注我
昵称:
随便看看 换一批