このページの情報の一部またはすべては、S3NS の Trusted Cloud には適用されない場合があります。
Cloud Code for VS Code で kubeconfig ファイルを操作する
kubeconfig ファイルは、クラスタ アクセス、ユーザー、コンテキストを整理する Kubernetes 構成ファイルです。このページでは、Cloud Code でさまざまな kubeconfig の追加、削除、切り替えを行う方法について説明します。
kubeconfig ファイルの詳細については、kubeconfig ファイルを使用してクラスタ アクセスを整理するに関する Kubernetes のドキュメントをご覧ください。
kubeconfig を管理する
デフォルトでは、Cloud Code プラグインはデフォルトの kubeconfig ファイル($HOME/.kube
ディレクトリ内)を使用して Kubernetes リソースを取得し、コマンドを実行します。ただし、追加の kubeconfig ファイルが構成される場合があります。
追加の kubeconfig ファイルを追加する
kubeconfig ファイルを追加するには:
- コマンド パレットを開きます(
Ctrl
/Cmd
+Shift
+P
を押下するか、[表示] > [コマンド パレット] をクリックします)。その後、Cloud Code: Switch kubeconfig を実行します。
- [+ kubeconfig を読み込む] をクリックし、追加する kubeconfig ファイルの場所に移動します。
- 追加する kubeconfig ファイルを選択し、[KubeConfig パスを追加] をクリックします。
- プロンプトが表示されたら、新しい kubeconfig の名前を指定します。
Enter
キーを押して確定します。
kubeconfig ファイルを削除する
kubeconfig ファイルを削除するには:
- コマンド パレットを開きます(
Ctrl
/Cmd
+Shift
+P
を押下するか、[表示] > [コマンド パレット] をクリックします)。その後、Cloud Code: Remove KubeConfig from Kubernetes Explorer を実行します。
- 削除する kubeconfig の横にあるチェックボックスをオンにして、[OK] をクリックします。
kubeconfig を切り替える
[コマンド パレット] を使用して kubeconfig を切り替えることができます。kubeconfig を切り替えるには:
- [コマンド パレット] を開き、[Cloud Code: Switch KubeConfig] を実行します。
- 使用する kubeconfig をクリックします。
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-02-17 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-02-17 UTC。"],[[["Kubeconfig files are Kubernetes configuration files that manage cluster access, users, and contexts, and Cloud Code utilizes them for various operations."],["Cloud Code defaults to the kubeconfig file in the `$HOME/.kube` directory but allows the addition of other kubeconfig files for managing different contexts."],["You can add kubeconfig files in Cloud Code by using the \"Cloud Code: Switch kubeconfig\" command in the command palette and navigating to the desired file, and you can name them as well."],["Removing kubeconfig files in Cloud Code is possible by using the command \"Cloud Code: Remove KubeConfig from Kubernetes Explorer\", and selecting the files to remove."],["Switching between different kubeconfigs is easily done through the command palette by using the \"Cloud Code: Switch KubeConfig\" command and selecting the desired kubeconfig."]]],[]]