Trident Protect CLI プラグインをインストールします
Trident Protect コマンドライン プラグインを使用できます。これは Trident tridentctl ユーティリティの拡張機能であり、Trident Protect カスタム リソース(CR)の作成と操作に使用できます。
Trident Protect CLI プラグインをインストールします
コマンドライン ユーティリティを使用する前に、クラスターにアクセスするために使用するマシンにそれをインストールする必要があります。マシンが x64 と ARM のどちらの CPU を使用しているかに応じて、次の手順に従ってください。
-
Trident Protect CLI プラグインをダウンロードします:
curl -L -o tridentctl-protect https://github.com/NetApp/tridentctl-protect/releases/download/25.10.0/tridentctl-protect-linux-amd64
-
Trident Protect CLI プラグインをダウンロードします:
curl -L -o tridentctl-protect https://github.com/NetApp/tridentctl-protect/releases/download/25.10.0/tridentctl-protect-linux-arm64
-
Trident Protect CLI プラグインをダウンロードします:
curl -L -o tridentctl-protect https://github.com/NetApp/tridentctl-protect/releases/download/25.10.0/tridentctl-protect-macos-amd64
-
Trident Protect CLI プラグインをダウンロードします:
curl -L -o tridentctl-protect https://github.com/NetApp/tridentctl-protect/releases/download/25.10.0/tridentctl-protect-macos-arm64
-
プラグイン バイナリの実行権限を有効にします:
chmod +x tridentctl-protect -
プラグインのバイナリを PATH 変数で定義されている場所にコピーします。例えば、
/usr/bin`または `/usr/local/bin(昇格した権限が必要になる場合があります):cp ./tridentctl-protect /usr/local/bin/ -
オプションで、プラグインのバイナリをホームディレクトリ内の場所にコピーすることもできます。この場合、場所が PATH 変数の一部であることを確認することをお勧めします:
cp ./tridentctl-protect ~/bin/
|
|
プラグインを PATH 変数の場所にコピーすると、 `tridentctl-protect`または `tridentctl protect`と入力することで、どこからでもプラグインを使用できるようになります。 |
Trident CLI プラグインのヘルプを表示
プラグインの機能に関する詳細なヘルプを取得するには、組み込みのプラグイン ヘルプ機能を使用できます:
-
ヘルプ機能を使用して使用方法のガイダンスを表示します:
tridentctl-protect help
コマンドの自動補完を有効にする
Trident Protect CLI プラグインをインストールしたら、特定のコマンドの自動補完を有効にすることができます。
-
完了スクリプトを作成します:
tridentctl-protect completion bash > tridentctl-completion.bash -
スクリプトを格納するための新しいディレクトリをホーム ディレクトリに作成します:
mkdir -p ~/.bash/completions -
ダウンロードしたスクリプトを `~/.bash/completions`ディレクトリに移動します:
mv tridentctl-completion.bash ~/.bash/completions/ -
ホームディレクトリ内の `~/.bashrc`ファイルに次の行を追加します:
source ~/.bash/completions/tridentctl-completion.bash
-
完了スクリプトを作成します:
tridentctl-protect completion zsh > tridentctl-completion.zsh -
スクリプトを格納するための新しいディレクトリをホーム ディレクトリに作成します:
mkdir -p ~/.zsh/completions -
ダウンロードしたスクリプトを `~/.zsh/completions`ディレクトリに移動します:
mv tridentctl-completion.zsh ~/.zsh/completions/ -
ホームディレクトリ内の `~/.zprofile`ファイルに次の行を追加します:
source ~/.zsh/completions/tridentctl-completion.zsh
次回のシェルログイン時には、tridentctl-protect プラグインによるコマンドの自動補完を使用できます。