Anthos-gke aws 叢集

anthos-gke aws clusters 中的指令會在 GKE on AWS 使用者叢集上運作。您可以使用 get-credentials 指令,向使用者叢集進行驗證。您也可以使用 diagnose 指令收集其他資訊,以利偵錯。

取得憑證

get-credentials 指令會更新 kubeconfig 檔案,其中包含 GKE on AWS 使用者叢集的憑證和端點資訊。根據預設,憑證會附加至 ~/.kube/config。如果將 KUBECONFIG 環境變數設為其他檔案路徑,anthos-gke 會將憑證附加至該檔案。

anthos-gke aws clusters get-credentials NAME [--workspace DIRECTORY]

位置引數

NAME
:要為其產生憑證的叢集名稱。anthos-gke名稱應與 AWSCluster 資源的 metadata.name 欄位相符。

選用標記

--workspace [DIRECTORY]
:包含 anthos-gke.yaml 檔案的目錄選用引數。預設為目前目錄。

範例

如要取得目前工作目錄中定義的 cluster-0 叢集憑證,請執行下列指令:

anthos-gke aws clusters get-credentials cluster-0

診斷

diagnose snapshot 指令會產生支援套件,協助 Google Cloud 支援人員偵錯使用者叢集的問題。支援套件是 tar 檔案,內含設定、叢集事件和記錄。將這個檔案傳送給技術支援經理

anthos-gke aws clusters diagnose snapshot CLUSTER_NAME
           --ssh-key-path PATH
           [--bastion-ip IP]
           [--bastion-ssh-key-path PATH]
           [--cluster-ssh-key-path PATH]
           [--dry-run]
           [--mgmt-service-ssh-key-path PATH]
           [--nodepool-ssh-key-path PATH]
           [--output PATH]
           [--quiet]
           [--snapshot-config PATH]
           [--workspace DIRECTORY]

位置引數

CLUSTER_NAME
:要產生支援套件的叢集名稱。這個值應與 AWSClustermetadata.name 欄位相符。

旗標

--ssh-key-path PATH
必要引數,提供安全殼層金鑰檔案的路徑。如果您使用 anthos-gke management init 建立金鑰,這個值會是 ~/.ssh/anthos-gke

選用標記

[--bastion-ip IP]
目前工作區中,要覆寫的 Bastion 主機 IP 位址。
[--bastion-ssh-key-path PATH]
防禦主機的特定 SSH 金鑰檔案。預設值為 --ssh-key-path
[--cluster-ssh-key-path PATH]
工作負載叢集控制層機器的特定 SSH 金鑰檔案。預設值為 --ssh-key-path
[--dry-run]
顯示快照設定檔的選項,不必產生支援套件。
[--mgmt-service-ssh-key-path PATH]
管理服務專用的 SSH 金鑰檔案。預設值為 --ssh-key-path
[--nodepool-ssh-key-path PATH]
節點集區電腦的特定安全殼層金鑰檔案。預設值為 --ssh-key-path
[--output PATH]
支援套裝組合 tarball 的檔案路徑。
[--quiet]
可選擇要不要在控制台中顯示訊息。
[--snapshot-config PATH]
YAML 快照設定檔的路徑 (選用)。
[--workspace DIR]
工作區目錄,應包含 anthos-gke.yaml 設定檔。預設為目前目錄。

範例

如要為名為 cluster-0 的工作負載叢集產生支援套裝組合,請執行下列指令:

anthos-gke aws clusters diagnose snapshot cluster-0 \
             --ssh-key-path ~/.ssh/anthos-gke \
             --workspace ~/example/workspace

如要查看預設快照設定,請執行下列指令:

anthos-gke aws clusters diagnose snapshot cluster-0 \
             --ssh-key-path ~/.ssh/anthos-gke \
             --dry-run

如要指定自訂快照設定檔 (包括您自己的 Bash 和 kubectl 指令),請執行下列指令:

anthos-gke aws clusters diagnose snapshot cluster-0 \
             --ssh-key-path ~/.ssh/anthos-gke
             --snapshot-config ~/my-snapshot-config.yaml