2.6. 从一个远程主机为 Red Hat OpenShift 更新 mirror registry
此流程解释了如何使用 upgrade 命令从远程主机更新 Red Hat OpenShift 的镜像 registry。更新至最新版本可确保程序错误修复和安全漏洞。
当从版本 1 升级到版本 2 时,请注意以下限制:
-
worker 数量被设置为
1,因为 SQLite 中不允许多个写入。 - 您不能使用 mirror registry for Red Hat OpenShift 用户接口 (UP)。
-
不要在升级过程中访问
sqlite-storagePodman 卷。 - 镜像 registry 会出现间歇性停机时间,因为它会在升级过程中重启。
-
PostgreSQL 数据在
/$HOME/quay-install/quay-postgres-backup/目录下备份,以进行恢复。
先决条件
- 您已在远程主机上安装了 mirror registry for Red Hat OpenShift。
流程
要从远程主机升级 Red Hat OpenShift 的镜像 registry,请输入以下命令:
./mirror-registry upgrade -v --targetHostname <remote_host_url> --targetUsername <user_name> -k ~/.ssh/my_ssh_key
$ ./mirror-registry upgrade -v --targetHostname <remote_host_url> --targetUsername <user_name> -k ~/.ssh/my_ssh_keyCopy to Clipboard Copied! Toggle word wrap Toggle overflow 注意使用
./mirror-registry upgrade -v标志升级 mirror registry for Red Hat OpenShift 时需要包括在创建 mirror registry 时使用的相同凭证。例如,如果您安装了带有-quayHostname <host_example_com> 和的镜像 registry,则必须包含该字符串才能正确升级镜像 registry。--quayRoot <example_directory_name>的 Red Hat OpenShift如果您要从 1.3
2.y 升级 mirror registry for Red Hat OpenShift,并希望指定自定义 SQLite 存储路径,您必须传递-- sqliteStorage标志,例如:./mirror-registry upgrade -v --targetHostname <remote_host_url> --targetUsername <user_name> -k ~/.ssh/my_ssh_key --sqliteStorage <example_directory_name>/quay-storage
$ ./mirror-registry upgrade -v --targetHostname <remote_host_url> --targetUsername <user_name> -k ~/.ssh/my_ssh_key --sqliteStorage <example_directory_name>/quay-storageCopy to Clipboard Copied! Toggle word wrap Toggle overflow
验证
运行以下命令,确保 mirror registry for Red Hat OpenShift 已更新:
podman ps
$ podman psCopy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
registry.redhat.io/quay/quay-rhel8:v3.12.10
registry.redhat.io/quay/quay-rhel8:v3.12.10Copy to Clipboard Copied! Toggle word wrap Toggle overflow