Kubernetes:55.kubeadm completion(自動補(bǔ)全)

語法

[09:06:48 root@ceshi-01 ~ $]kubeadm completion --help

Output shell completion code for the specified shell (bash or zsh).
自動補(bǔ)全(bash or zsh)
The shell code must be evaluated to provide interactive completion of kubeadm commands. 
必須評估shell代碼以提供kubeadm命令的交互式完成。
This can be done by sourcing it from the .bash_profile.
這可以通過從.bash_profile獲取來完成。

Note: this requires the bash-completion framework.

To install it on Mac use homebrew:
    $ brew install bash-completion
Once installed, bash_completion must be evaluated. This can be done by adding the
following line to the .bash_profile
    $ source $(brew --prefix)/etc/bash_completion

If bash-completion is not installed on Linux, please install the 'bash-completion' package
via your distribution's package manager.

Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2

Usage:
  kubeadm completion SHELL [flags]

Examples:

# Install bash completion on a Mac using homebrew
brew install bash-completion
printf "\n# Bash completion support\nsource $(brew --prefix)/etc/bash_completion\n" >> $HOME/.bash_profile
source $HOME/.bash_profile

# Load the kubeadm completion code for bash into the current shell
source <(kubeadm completion bash)

# Write bash completion code to a file and source it from .bash_profile
kubeadm completion bash > ~/.kube/kubeadm_completion.bash.inc
printf "\n# Kubeadm shell completion\nsource '$HOME/.kube/kubeadm_completion.bash.inc'\n" >> $HOME/.bash_profile
source $HOME/.bash_profile

# Load the kubeadm completion code for zsh[1] into the current shell
source <(kubeadm completion zsh)

Flags:
  -h, --help   help for completion

Global Flags:
      --log-file string          If non-empty, use this log file.
                                 如果非空,使用這里定義的日志文件
      --log-file-max-size uint   Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
                                 定義日志文件可以增長到的最大大小,單位是 MB,如果值為0,則不受限制(默認(rèn)1800)
      --rootfs string            [EXPERIMENTAL] The path to the 'real' host root filesystem.
                                【實驗】真正的主機(jī)文件系統(tǒng)的路徑
      --skip-headers             If true, avoid header prefixes in the log messages
                                 如果為true,請避免在日志消息中使用標(biāo)頭前綴
      --skip-log-headers         If true, avoid headers when opening log files
                                 如果為true,請在打開日志文件時避免使用標(biāo)頭
  -v, --v Level                  number for the log level verbosity
                                 定義日志級別
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容