5.7. 为 IBM Cloud VPC 手动创建 IAM
安装集群需要 Cloud Credential Operator(CCO)以手动模式运行。虽然安装程序为手动模式配置 CCO,但您必须为云供应商指定身份和访问管理 secret。
您可以使用 Cloud Credential Operator (CCO) 实用程序 (ccoctl) 创建所需的 IBM Cloud VPC 资源。
先决条件
-
您已配置了
ccoctl二进制文件。 -
您有一个现有的
install-config.yaml文件。
流程
编辑
install-config.yaml配置文件,使其包含将credentialsMode参数设置为Manual。install-config.yaml配置文件示例Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 添加这一行将
credentialsMode参数设置为Manual。
要生成清单,请在包含安装程序的目录中运行以下命令:
openshift-install create manifests --dir <installation_directory>
$ openshift-install create manifests --dir <installation_directory>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 从包含安装程序的目录中,获取构建
openshift-install二进制文件的 OpenShift Container Platform 发行镜像:RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}')$ RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}')Copy to Clipboard Copied! Toggle word wrap Toggle overflow 从 OpenShift Container Platform 发行镜像中提取
CredentialsRequest对象:oc adm release extract --cloud=ibmcloud --credentials-requests $RELEASE_IMAGE \ --to=<path_to_credential_requests_directory>$ oc adm release extract --cloud=ibmcloud --credentials-requests $RELEASE_IMAGE \ --to=<path_to_credential_requests_directory>1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 存储凭据请求的目录。
此命令为每个
CredentialsRequest对象创建一个 YAML 文件。CredentialsRequest对象示例Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果您的集群使用集群功能禁用一个或多个可选组件,请删除任何禁用组件的
CredentialsRequest自定义资源。IBM Cloud VPC 上的 OpenShift Container Platform 4.12 的
credrequests目录的内容示例0000_26_cloud-controller-manager-operator_15_credentialsrequest-ibm.yaml 0000_30_machine-api-operator_00_credentials-request.yaml 0000_50_cluster-image-registry-operator_01-registry-credentials-request-ibmcos.yaml 0000_50_cluster-ingress-operator_00-ingress-credentials-request.yaml 0000_50_cluster-storage-operator_03_credentials_request_ibm.yaml
0000_26_cloud-controller-manager-operator_15_credentialsrequest-ibm.yaml1 0000_30_machine-api-operator_00_credentials-request.yaml2 0000_50_cluster-image-registry-operator_01-registry-credentials-request-ibmcos.yaml3 0000_50_cluster-ingress-operator_00-ingress-credentials-request.yaml4 0000_50_cluster-storage-operator_03_credentials_request_ibm.yaml5 Copy to Clipboard Copied! Toggle word wrap Toggle overflow 为每个凭证请求创建服务 ID,分配定义的策略,在 IBM Cloud VPC 中创建 API 密钥并生成 secret:
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> \ --resource-group-name <resource_group_name>3 Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意如果您的集群使用
TechPreviewNoUpgrade功能集启用的技术预览功能,则必须包含--enable-tech-preview参数。如果提供了不正确的资源组名称,安装会在 bootstrap 阶段失败。要查找正确的资源组名称,请运行以下命令:
grep resourceGroupName <installation_directory>/manifests/cluster-infrastructure-02-config.yml
$ grep resourceGroupName <installation_directory>/manifests/cluster-infrastructure-02-config.ymlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
验证
-
确保在集群的
manifests目录中生成了适当的 secret。