3.8. Nutanix の IAM の設定
クラスターをインストールするには、Cloud Credential Operator (CCO) が手動モードで動作する必要があります。インストールプログラムが手動モード用に CCO を設定する間、ID およびアクセス管理シークレットを指定する必要があります。
前提条件
-
ccoctl
バイナリーを設定している。 -
install-config.yaml
ファイルがある。
手順
認証情報データを含む YAML ファイルを次の形式で作成します。
認証情報データの形式
Copy to Clipboard Copied! Toggle word wrap Toggle overflow credentials: - type: basic_auth data: prismCentral: username: <username_for_prism_central> password: <password_for_prism_central> prismElements: - name: <name_of_prism_element> username: <username_for_prism_element> password: <password_for_prism_element>
credentials: - type: basic_auth
1 data: prismCentral:
2 username: <username_for_prism_central> password: <password_for_prism_central> prismElements:
3 - name: <name_of_prism_element> username: <username_for_prism_element> password: <password_for_prism_element>
次のコマンドを実行して、インストールファイルのリリースイメージを
$RELEASE_IMAGE
変数に設定します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}')
$ RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}')
以下のコマンドを実行して、OpenShift Container Platform リリースイメージから
CredentialsRequest
カスタムリソース (CR) のリストを抽出します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc adm release extract \ --from=$RELEASE_IMAGE \ --credentials-requests \ --cloud=nutanix \ --to=<path_to_directory_with_list_of_credentials_requests>/credrequests
$ oc adm release extract \ --from=$RELEASE_IMAGE \ --credentials-requests \ --cloud=nutanix \ --to=<path_to_directory_with_list_of_credentials_requests>/credrequests
1 - 1
- コンポーネント
CredentialsRequests
オブジェクトのファイルを含むディレクトリーへのパスを指定します。指定したディレクトリーが存在しない場合は、このコマンドによって作成されます。
サンプル
CredentialsRequest
オブジェクトCopy to Clipboard Copied! Toggle word wrap Toggle overflow apiVersion: cloudcredential.openshift.io/v1 kind: CredentialsRequest metadata: annotations: include.release.openshift.io/self-managed-high-availability: "true" labels: controller-tools.k8s.io: "1.0" name: openshift-machine-api-nutanix namespace: openshift-cloud-credential-operator spec: providerSpec: apiVersion: cloudcredential.openshift.io/v1 kind: NutanixProviderSpec secretRef: name: nutanix-credentials namespace: openshift-machine-api
apiVersion: cloudcredential.openshift.io/v1 kind: CredentialsRequest metadata: annotations: include.release.openshift.io/self-managed-high-availability: "true" labels: controller-tools.k8s.io: "1.0" name: openshift-machine-api-nutanix namespace: openshift-cloud-credential-operator spec: providerSpec: apiVersion: cloudcredential.openshift.io/v1 kind: NutanixProviderSpec secretRef: name: nutanix-credentials namespace: openshift-machine-api
クラスターでクラスター機能を使用して 1 つ以上のオプションコンポーネントを無効にする場合は、無効なコンポーネントの
CredentialsRequest
カスタムリソースを削除します。Nutanix 上の OpenShift Container Platform 4.12 の
credrequests
ディレクトリーの内容の例Copy to Clipboard Copied! Toggle word wrap Toggle overflow 0000_30_machine-api-operator_00_credentials-request.yaml
0000_30_machine-api-operator_00_credentials-request.yaml
1 - 1
- Machine API Operator CR が必要です。
次のコマンドを実行し、
ccoctl
ツールを使用してcredrequests
ディレクトリー内のすべてのCredentialsRequest
オブジェクトを処理します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow ccoctl nutanix create-shared-secrets \ --credentials-requests-dir=<path_to_directory_with_list_of_credentials_requests>/credrequests \ --output-dir=<ccoctl_output_dir> \ --credentials-source-filepath=<path_to_credentials_file>
$ ccoctl nutanix create-shared-secrets \ --credentials-requests-dir=<path_to_directory_with_list_of_credentials_requests>/credrequests \
1 --output-dir=<ccoctl_output_dir> \
2 --credentials-source-filepath=<path_to_credentials_file>
3 - 1
- コンポーネント
CredentialsRequests
オブジェクトのファイルを含むディレクトリーへのパスを指定します。 - 2
manifests
ディレクトリーの下に、コンポーネント認証情報シークレットのファイルを含むディレクトリーを指定します。デフォルトでは、ccoctl
ツールは、コマンドが実行されるディレクトリーにオブジェクトを作成します。オブジェクトを別のディレクトリーに作成するには、--output-dir
フラグを使用します。- 3
- オプション: 認証情報データ YAML ファイルを含むディレクトリーを指定します。デフォルトでは、
ccoctl
はこのファイルが<home_directory>/.nutanix/credentials
にあると想定します。別のディレクトリーを指定するには、--credentials-source-filepath
フラグを使用します。
credentialsMode
パラメーターがManual
に設定されるように、install-config.yaml
設定ファイルを編集します。サンプル
install-config.yaml
設定ファイルCopy to Clipboard Copied! Toggle word wrap Toggle overflow apiVersion: v1 baseDomain: cluster1.example.com credentialsMode: Manual ...
apiVersion: v1 baseDomain: cluster1.example.com credentialsMode: Manual
1 ...
- 1
- この行を追加して、
credentialsMode
パラメーターをManual
に設定します。
次のコマンドを実行して、インストールマニフェストを作成します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow openshift-install create manifests --dir <installation_directory>
$ openshift-install create manifests --dir <installation_directory>
1 - 1
- クラスターの
install-config.yaml
ファイルを含むディレクトリーへのパスを指定します。
次のコマンドを実行して、生成された認証情報ファイルをターゲットマニフェストディレクトリーにコピーします。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow cp <ccoctl_output_dir>/manifests/*credentials.yaml ./<installation_directory>/manifests
$ cp <ccoctl_output_dir>/manifests/*credentials.yaml ./<installation_directory>/manifests
検証
manifests
ディレクトリーに適切なシークレットが存在することを確認します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow ls ./<installation_directory>/manifests
$ ls ./<installation_directory>/manifests
出力例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow total 64 -rw-r----- 1 <user> <user> 2335 Jul 8 12:22 cluster-config.yaml -rw-r----- 1 <user> <user> 161 Jul 8 12:22 cluster-dns-02-config.yml -rw-r----- 1 <user> <user> 864 Jul 8 12:22 cluster-infrastructure-02-config.yml -rw-r----- 1 <user> <user> 191 Jul 8 12:22 cluster-ingress-02-config.yml -rw-r----- 1 <user> <user> 9607 Jul 8 12:22 cluster-network-01-crd.yml -rw-r----- 1 <user> <user> 272 Jul 8 12:22 cluster-network-02-config.yml -rw-r----- 1 <user> <user> 142 Jul 8 12:22 cluster-proxy-01-config.yaml -rw-r----- 1 <user> <user> 171 Jul 8 12:22 cluster-scheduler-02-config.yml -rw-r----- 1 <user> <user> 200 Jul 8 12:22 cvo-overrides.yaml -rw-r----- 1 <user> <user> 118 Jul 8 12:22 kube-cloud-config.yaml -rw-r----- 1 <user> <user> 1304 Jul 8 12:22 kube-system-configmap-root-ca.yaml -rw-r----- 1 <user> <user> 4090 Jul 8 12:22 machine-config-server-tls-secret.yaml -rw-r----- 1 <user> <user> 3961 Jul 8 12:22 openshift-config-secret-pull-secret.yaml -rw------- 1 <user> <user> 283 Jul 8 12:24 openshift-machine-api-nutanix-credentials-credentials.yaml
total 64 -rw-r----- 1 <user> <user> 2335 Jul 8 12:22 cluster-config.yaml -rw-r----- 1 <user> <user> 161 Jul 8 12:22 cluster-dns-02-config.yml -rw-r----- 1 <user> <user> 864 Jul 8 12:22 cluster-infrastructure-02-config.yml -rw-r----- 1 <user> <user> 191 Jul 8 12:22 cluster-ingress-02-config.yml -rw-r----- 1 <user> <user> 9607 Jul 8 12:22 cluster-network-01-crd.yml -rw-r----- 1 <user> <user> 272 Jul 8 12:22 cluster-network-02-config.yml -rw-r----- 1 <user> <user> 142 Jul 8 12:22 cluster-proxy-01-config.yaml -rw-r----- 1 <user> <user> 171 Jul 8 12:22 cluster-scheduler-02-config.yml -rw-r----- 1 <user> <user> 200 Jul 8 12:22 cvo-overrides.yaml -rw-r----- 1 <user> <user> 118 Jul 8 12:22 kube-cloud-config.yaml -rw-r----- 1 <user> <user> 1304 Jul 8 12:22 kube-system-configmap-root-ca.yaml -rw-r----- 1 <user> <user> 4090 Jul 8 12:22 machine-config-server-tls-secret.yaml -rw-r----- 1 <user> <user> 3961 Jul 8 12:22 openshift-config-secret-pull-secret.yaml -rw------- 1 <user> <user> 283 Jul 8 12:24 openshift-machine-api-nutanix-credentials-credentials.yaml