第 2 章 为 OpenShift 配置 Red Hat Single Sign-On
2.1. 将 Red Hat Single Sign-On 用于 OpenShift 镜像流和应用程序模板 复制链接链接已复制到粘贴板!
从安全的 Red Hat Registry: registry.redhat.io 中拉取(需要身份验证)的 Red Hat JBoss Middleware for OpenShift 镜像。要获得内容,您需要使用红帽帐户登录到 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。
- 创建 Service Account 后,点 Registry Service Accounts 页面中的 Account name 列中的 registry.redhat.io-sa 链接。
- 最后,单击 OpenShift Secret 选项卡,并执行该页面中列出的所有步骤。
如需更多信息,请参阅 Red Hat Container Registry 身份验证 文档。
流程
-
确保您已作为集群管理员或具有项目管理员访问权限的用户登陆到全局
openshift项目: 根据您的 OpenShift Container Platform 版本选择一个命令。
运行以下命令,为
openshift项目中的 OpenShift 更新 Red Hat Single Sign-On 7.6.11 资源的核心集合。如果使用 OpenShift 3.x 集群,请使用以下命令:
$ for resource in sso76-image-stream.json \ passthrough/ocp-3.x/sso76-ocp3-https.json \ passthrough/ocp-3.x/sso76-ocp3-postgresql.json \ passthrough/ocp-3.x/sso76-ocp3-postgresql-persistent.json \ reencrypt/ocp-3.x/sso76-ocp3-x509-https.json \ reencrypt/ocp-3.x/sso76-ocp3-x509-postgresql-persistent.json do oc replace -n openshift --force -f \ https://raw.githubusercontent.com/jboss-container-images/redhat-sso-7-openshift-image/sso76-dev/templates/${resource} done如果使用 OpenShift 4.x 集群,请使用下列命令:
$ for resource in sso76-image-stream.json \ passthrough/ocp-4.x/sso76-ocp4-https.json \ passthrough/ocp-4.x/sso76-ocp4-postgresql.json \ passthrough/ocp-4.x/sso76-ocp4-postgresql-persistent.json \ reencrypt/ocp-4.x/sso76-ocp4-x509-https.json \ reencrypt/ocp-4.x/sso76-ocp4-x509-postgresql-persistent.json do oc replace -n openshift --force -f \ https://raw.githubusercontent.com/jboss-container-images/redhat-sso-7-openshift-image/sso76-dev/templates/${resource} done运行以下命令,以在
openshift项目中安装 Red Hat Single Sign-On 7.6.11 OpenShift 镜像流:$ oc -n openshift import-image rh-sso-7/sso76-openshift-rhel8:7.6 --from=registry.redhat.io/rh-sso-7/sso76-openshift-rhel8:7.6 --confirm