$ RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}')
在无法访问云身份和访问管理 (IAM) API 的环境中,必须在安装集群之前将 Cloud Credential Operator (CCO) 置于手动模式。
Cloud Credential Operator (CCO) 将云提供商凭据管理为 Kubernetes 自定义资源定义 (CRD)。可以通过为install-config.yaml
文件中的credentialsMode
参数设置不同的值,来配置 CCO 以适应组织的安全要求。
对于 IBM Cloud®,不支持在集群kube-system
项目中存储管理员级凭据密钥;因此,在安装 OpenShift Container Platform 时,必须将 CCO 的credentialsMode
参数设置为Manual
,并手动管理云凭据。
使用手动模式允许每个集群组件仅拥有其所需的权限,而无需在集群中存储管理员级凭据。如果您的环境无法连接到云提供商公共 IAM 端点,也可以使用此模式。但是,必须为每次升级手动协调新发行版映像的权限。还必须手动为请求凭据的每个组件提供凭据。
当 Cloud Credential Operator (CCO) 处于手动模式时,要从集群外部创建和管理云凭据,请提取并准备 CCO 实用程序 (ccoctl
) 二进制文件。
|
您可以访问具有集群管理员访问权限的 OpenShift Container Platform 帐户。
您已安装 OpenShift CLI (oc
)。
通过运行以下命令设置 OpenShift Container Platform 发行版映像的变量
$ RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}')
通过运行以下命令从 OpenShift Container Platform 发行版映像中获取 CCO 容器映像
$ CCO_IMAGE=$(oc adm release info --image-for='cloud-credential-operator' $RELEASE_IMAGE -a ~/.pull-secret)
确保 |
通过运行以下命令从 OpenShift Container Platform 发行版映像中的 CCO 容器映像中提取ccoctl
二进制文件
$ oc image extract $CCO_IMAGE \
--file="/usr/bin/ccoctl.<rhel_version>" \(1)
-a ~/.pull-secret
1 | 对于<rhel_version> ,请指定与主机使用的 Red Hat Enterprise Linux (RHEL) 版本相对应的值。如果未指定值,则默认使用ccoctl.rhel8 。以下值为有效值
|
更改权限以使ccoctl
可执行,方法是运行以下命令
$ chmod 775 ccoctl.<rhel_version>
要验证ccoctl
是否可以使用,请显示帮助文件。运行命令时,请使用相对文件名,例如
$ ./ccoctl.rhel9
OpenShift credentials provisioning tool
Usage:
ccoctl [command]
Available Commands:
aws Manage credentials objects for AWS cloud
azure Manage credentials objects for Azure
gcp Manage credentials objects for Google cloud
help Help about any command
ibmcloud Manage credentials objects for {ibm-cloud-title}
nutanix Manage credentials objects for Nutanix
Flags:
-h, --help help for ccoctl
Use "ccoctl [command] --help" for more information about a command.