このドキュメントでは、クラスタの作成に使用できる Anthos clusters on VMware(GKE on-prem)の管理ワークステーションを作成する方法について説明します。
この手順はクイックスタートの一部です。管理ワークステーションの作成方法の詳細については、管理ワークステーションの作成をご覧ください。
始める前に
Google Cloud プロジェクトを作成する(クイックスタート)。
vCenter サーバーのアドレスと CA 証明書のパスを把握する。
構成ファイルのテンプレートを生成する
このドキュメントの手順では、gkeadm
コマンドライン ツールを使用します。このツールは、64 ビット Linux、Windows 10、Windows Server 2019、macOS 10.15 以降で利用できます。
現在のディレクトリに gkeadm
をダウンロードします。
テンプレートを生成します。
./gkeadm create config
上記のコマンドにより、現在のディレクトリに次のファイルが作成されます。
credential.yaml
admin-ws-config.yaml
credential.yaml
に入力する
credential.yaml
に vCenter のユーザー名とパスワードを入力します。例:
kind: CredentialFile items: - name: vCenter username: "my-account-name" password: "AadmpqGPqq!a"
admin-ws-config.yaml
に入力する
次の項目は自動的に入力されます。
vCenter: credentials: fileRef: path: credential.yaml entry: vCenter adminWorkstation: name: gke-admin-ws-... cpus: 4 memoryMB: 8192 diskGB: 50 dataDiskName: gke-on-prem-admin-workstation-data-disk,,,.vmdk dataDiskMB: 512 network: ntpServer: ntp.ubuntu.com
次の必須フィールドに入力します。フィールドに入力する方法については、管理ワークステーションの構成ファイルをご覧ください。
gcp: componentAccessServiceAccountKeyPath: "Fill in" vCenter: credentials: address: "Fill in" datacenter: "Fill in" datastore: "Fill in" cluster: "Fill in" network: "Fill in" resourcePool: "Fill in" caCertPath: "Fill in" network: hostConfig: ipAllocationMode: Fill in. Set to "static". ip: "Fill in" gateway: "Fill in" netmask: "Fill in" dns: "Fill in"
必要に応じて、proxyURL
フィールドに入力します。
adminWorkstation: proxyURL: "Fill in"
管理ワークステーションを作成する
管理ワークステーションを作成すると、サービス アカウントが自動的に作成されます。
./gkeadm create admin-workstation --auto-create-service-accounts
出力には、管理ワークステーションの作成に関する詳細情報が含まれます。
... Getting ... service account... Creating other service accounts and JSON key files... - connect-agent-sa-2007081316 - connect-register-sa-2007081316 - log-mon-sa-2007081316 ******************************************************************** Admin workstation is ready to use. Admin workstation information saved to /usr/local/google/home/me/my-admin-workstation This file is required for future upgrades SSH into the admin workstation with the following command: ssh -i /usr/local/google/home/me/.ssh/gke-admin-workstation ubuntu@172.16.5.1 ********************************************************************
管理ワークステーションへの SSH 接続の確立
上記の出力の終わり付近に、管理ワークステーションへの SSH 接続に使用できるコマンドが表示されています。ここで、そのコマンドを入力します。例:
ssh -i /usr/local/google/home/me/.ssh/gke-admin-workstation ubuntu@172.16.5.1
管理ワークステーション上のファイルを一覧表示します。
ls -1
出力には、2 つのクラスタ構成ファイル、CA 証明書ファイル、サービス アカウントの JSON キーファイルが表示されます。次に例を示します。
admin-cluster.yaml connect-agent-sa-2007081316.json connect-register-sa-2007081316.json log-mon-sa-2007081316.json user-cluster.yaml vcenter-ca-cert.pem component-access-key.json