第 2 章 Configuring Red Hat Single Sign-On for OpenShift
2.1. 为 OpenShift 镜像流和应用程序模板使用 Red Hat Single Sign-On 复制链接链接已复制到粘贴板!
从安全 Red Hat Registry: registry.redhat.io 需要身份验证时,会按需拉取用于 OpenShift 镜像的 Red Hat JBoss Middleware。要检索内容,您需要使用红帽帐户登录 registry。
要在 OpenShift 等共享环境中使用 registry.redhat.io 中的容器镜像,建议管理员使用 Registry 服务帐户(也称为身份验证令牌)来代替个人的红帽客户门户网站凭证。
流程
- 要创建 Registry Service Account,请导航到 Registry Service Account Management Application,并在需要时登录。
- 在 Registry Service Accounts 页面中,点 Create Service Account。
为服务帐户提供名称,如 registry.redhat.io-sa。它将以固定、随机字符串开头。
- 为服务帐户输入描述,例如使用 registry.redhat.io 中的容器镜像。
- 点 Create。
- 创建服务帐户后,点 Registry Service Accounts 页面中的" 帐户名称" 列中的 registry.redhat.io-sa 链接。
- 最后,单击 OpenShift Secret 选项卡,然后执行该页面中列出的所有步骤。
如需更多信息,请参阅 Red Hat Container Registry 身份验证 文章。
流程
-
确保您已作为集群管理员或具有全局
openshift项目的项目管理员访问权限的用户身份登录: 根据您的 OpenShift Container Platform 版本选择命令。
如果您在 master 主机(一些)上运行基于 OpenShift Container Platform v3 的集群实例,请执行以下操作:
oc login -u system:admin
$ oc login -u system:adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow 如果您正在运行基于 OpenShift Container Platform v4 的集群实例,以 kubeadmin 用户身份登录 CLI :
oc login -u kubeadmin -p password https://openshift.example.com:6443
$ oc login -u kubeadmin -p password https://openshift.example.com:6443Copy to Clipboard Copied! Toggle word wrap Toggle overflow
运行以下命令更新
openshift项目中的 OpenShift 的 Red Hat Single Sign-On 7.5.3 资源集:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 运行以下命令,在
openshift项目中安装 Red Hat Single Sign-On 7.5.3 OpenShift 镜像流:oc -n openshift import-image rh-sso-7/sso75-openshift-rhel8:7.5 --from=registry.redhat.io/rh-sso-7/sso75-openshift-rhel8:7.5 --confirm
$ oc -n openshift import-image rh-sso-7/sso75-openshift-rhel8:7.5 --from=registry.redhat.io/rh-sso-7/sso75-openshift-rhel8:7.5 --confirmCopy to Clipboard Copied! Toggle word wrap Toggle overflow