3.2. 配置 Cloud Credential Operator 工具
当 Cloud Credential Operator(CCO)以手动模式运行时,要从集群外部创建和管理云凭证,提取并准备 CCO 实用程序(ccoctl
)二进制文件。
注意
ccoctl
工具是在 Linux 环境中运行的 Linux 二进制文件。
先决条件
- 您可以访问具有集群管理员权限的 OpenShift Container Platform 帐户。
-
已安装 OpenShift CLI(
oc
)。
流程
运行以下命令,为 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 发行镜像获取 CCO 容器镜像:
CCO_IMAGE=$(oc adm release info --image-for='cloud-credential-operator' $RELEASE_IMAGE -a ~/.pull-secret)
$ CCO_IMAGE=$(oc adm release info --image-for='cloud-credential-operator' $RELEASE_IMAGE -a ~/.pull-secret)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意确保
$RELEASE_IMAGE
的架构与将使用ccoctl
工具的环境架构相匹配。运行以下命令,将 CCO 容器镜像中的
ccoctl
二进制文件提取到 OpenShift Container Platform 发行镜像中:oc image extract $CCO_IMAGE \ --file="/usr/bin/ccoctl.<rhel_version>" \ -a ~/.pull-secret
$ oc image extract $CCO_IMAGE \ --file="/usr/bin/ccoctl.<rhel_version>" \
1 -a ~/.pull-secret
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 对于
<rhel_version>
,请指定与主机使用的 Red Hat Enterprise Linux (RHEL) 版本对应的值。如果没有指定值,则默认使用ccoctl.rhel8
。以下值有效:-
rhel8
: 为使用 RHEL 8 的主机指定这个值。 -
rhel9
:为使用 RHEL 9 的主机指定这个值。
-
运行以下命令更改权限以使
ccoctl
可执行:chmod 775 ccoctl.<rhel_version>
$ chmod 775 ccoctl.<rhel_version>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
验证
要验证
ccoctl
是否准备就绪,可以尝试显示帮助文件。运行命令时使用相对文件名,例如:./ccoctl.rhel9
$ ./ccoctl.rhel9
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow