2.4.2. 在 OpenShift 中配置 registry 身份验证
在使用 Red Hat 3scale API Management OpenShift 镜像流前,您必须为红帽容器 registry 配置 registry 身份验证。按照以下步骤,配置容器 registry。
以管理员身份登录 OpenShift 服务器,如下所示:
oc login -u system:admin
oc login -u system:admin
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 登录您要安装镜像流的 OpenShift 项目。红帽建议将
openshift
项目用于 3scale OpenShift 镜像流。注:它有一个是固定的、随机字符串前缀。
oc project your-openshift-project
oc project your-openshift-project
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用您在 第 2.4.3 节 “创建 registry 服务帐户” 中创建的凭证创建一个
docker-registry
secret。注意-
将
your-registry-service-account-username
替换为以 12345678|username 创建的用户名。 -
将
your-registry-service-account-password
替换为用户名下面的密码字符串,位于 Token Information 选项卡下。 -
为每个镜像流所在并使用 registry.redhat.io 的新
命名空间
创建一个docker-registry
secret。
oc create secret docker-registry threescale-registry-auth \ --docker-server=registry.redhat.io \ --docker-username="your-registry-service-account-username" \ --docker-password="your-registry-service-account-password"
$ oc create secret docker-registry threescale-registry-auth \ --docker-server=registry.redhat.io \ --docker-username="your-registry-service-account-username" \ --docker-password="your-registry-service-account-password"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
将