8.10. IAM を手動で作成する
クラスターをインストールするには、Cloud Credential Operator (CCO) が手動モードで動作する必要があります。インストールプログラムは CCO を手動モードに設定しますが、クラウドプロバイダーの ID とアクセス管理シークレットを指定する必要があります。
Cloud Credential Operator (CCO) ユーティリティー (ccoctl
) を使用して、必要な IBM Cloud® リソースを作成できます。
前提条件
-
ccoctl
バイナリーを設定している。 -
既存の
install-config.yaml
ファイルがある。
手順
install-config.yaml
設定ファイルを編集し、credentialsMode
パラメーターがManual
に設定されるようにします。サンプル
install-config.yaml
設定ファイルCopy to Clipboard Copied! Toggle word wrap Toggle overflow apiVersion: v1 baseDomain: cluster1.example.com credentialsMode: Manual compute: - architecture: amd64 hyperthreading: Enabled
apiVersion: v1 baseDomain: cluster1.example.com credentialsMode: Manual
1 compute: - architecture: amd64 hyperthreading: Enabled
- 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>
インストールプログラムが含まれているディレクトリーから、次のコマンドを実行して、インストールファイルのリリースイメージを
$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 \ --included \ --install-config=<path_to_directory_with_installation_configuration>/install-config.yaml \ --to=<path_to_directory_for_credentials_requests>
$ oc adm release extract \ --from=$RELEASE_IMAGE \ --credentials-requests \ --included \
1 --install-config=<path_to_directory_with_installation_configuration>/install-config.yaml \
2 --to=<path_to_directory_for_credentials_requests>
3 このコマンドにより、それぞれの
CredentialsRequest
オブジェクトに YAML ファイルが作成されます。サンプル
CredentialsRequest
オブジェクトCopy to Clipboard Copied! Toggle word wrap Toggle overflow apiVersion: cloudcredential.openshift.io/v1 kind: CredentialsRequest metadata: labels: controller-tools.k8s.io: "1.0" name: openshift-image-registry-ibmcos namespace: openshift-cloud-credential-operator spec: secretRef: name: installer-cloud-credentials namespace: openshift-image-registry providerSpec: apiVersion: cloudcredential.openshift.io/v1 kind: IBMCloudProviderSpec policies: - attributes: - name: serviceName value: cloud-object-storage roles: - crn:v1:bluemix:public:iam::::role:Viewer - crn:v1:bluemix:public:iam::::role:Operator - crn:v1:bluemix:public:iam::::role:Editor - crn:v1:bluemix:public:iam::::serviceRole:Reader - crn:v1:bluemix:public:iam::::serviceRole:Writer - attributes: - name: resourceType value: resource-group roles: - crn:v1:bluemix:public:iam::::role:Viewer
apiVersion: cloudcredential.openshift.io/v1 kind: CredentialsRequest metadata: labels: controller-tools.k8s.io: "1.0" name: openshift-image-registry-ibmcos namespace: openshift-cloud-credential-operator spec: secretRef: name: installer-cloud-credentials namespace: openshift-image-registry providerSpec: apiVersion: cloudcredential.openshift.io/v1 kind: IBMCloudProviderSpec policies: - attributes: - name: serviceName value: cloud-object-storage roles: - crn:v1:bluemix:public:iam::::role:Viewer - crn:v1:bluemix:public:iam::::role:Operator - crn:v1:bluemix:public:iam::::role:Editor - crn:v1:bluemix:public:iam::::serviceRole:Reader - crn:v1:bluemix:public:iam::::serviceRole:Writer - attributes: - name: resourceType value: resource-group roles: - crn:v1:bluemix:public:iam::::role:Viewer
各認証情報リクエストのサービス ID を作成し、定義されたポリシーを割り当て、API キーを作成し、シークレットを生成します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ccoctl ibmcloud create-service-id \ --credentials-requests-dir=<path_to_credential_requests_directory> \ --name=<cluster_name> \ --output-dir=<installation_directory> \ --resource-group-name=<resource_group_name>
$ ccoctl ibmcloud create-service-id \ --credentials-requests-dir=<path_to_credential_requests_directory> \
1 --name=<cluster_name> \
2 --output-dir=<installation_directory> \
3 --resource-group-name=<resource_group_name>
4 注記クラスターで
TechPreviewNoUpgrade
機能セットによって有効化されたテクノロジープレビュー機能を使用している場合は、--enable-tech-preview
パラメーターを含める必要があります。間違ったリソースグループ名が指定された場合、ブートストラップフェーズ中にインストールが失敗します。正しいリソースグループ名を見つけるには、次のコマンドを実行します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow grep resourceGroupName <installation_directory>/manifests/cluster-infrastructure-02-config.yml
$ grep resourceGroupName <installation_directory>/manifests/cluster-infrastructure-02-config.yml
検証
-
クラスターの
manifests
ディレクトリーに適切なシークレットが生成されていることを確認してください。