2.3. 升级 3scale 镜像


本节论述了升级 3scale 镜像所需的步骤。

2.3.1. 流程

  1. amp-system 镜像流进行补丁:

    要修补 amp-system 镜像流,您需要考虑用于 3scale 部署的数据库。

    • 如果 3scale 使用 Oracle 数据库部署,请执行以下步骤以使用 Oracle 数据库构建系统镜像 :1、2、4、8 和 9。
    • 如果数据库不同,使用以下命令:

      $ oc patch imagestream/amp-system --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP system 2.7"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/system-rhel7:3scale2.7"}, "name": "2.7", "referencePolicy": {"type": "Source"}}}]'
      $ oc patch imagestream/amp-system --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP system (latest)"}, "from": { "kind": "ImageStreamTag", "name": "2.7"}, "name": "latest", "referencePolicy": {"type": "Source"}}}]'

      这会触发 system-appsystem-sphinxsystem-sidekiq DeploymentConfig 的重新部署。等待它们重新部署、对应的新容器集就绪,并且旧容器集终止。

  2. amp-apicast 镜像流进行补丁:

    $ oc patch imagestream/amp-apicast --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP APIcast 2.7"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/apicast-gateway-rhel7:3scale2.7"}, "name": "2.7", "referencePolicy": {"type": "Source"}}}]'
    $ oc patch imagestream/amp-apicast --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP APIcast (latest)"}, "from": { "kind": "ImageStreamTag", "name": "2.7"}, "name": "latest", "referencePolicy": {"type": "Source"}}}]'

    这会触发 apicast-productionapicast-staging DeploymentConfig 的重新部署。等待它们重新部署、对应的新容器集就绪,并且旧容器集终止。

  3. amp-backend 镜像流进行补丁:

    $ oc patch imagestream/amp-backend --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP Backend 2.7"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/backend-rhel7:3scale2.7"}, "name": "2.7", "referencePolicy": {"type": "Source"}}}]'
    $ oc patch imagestream/amp-backend --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP Backend (latest)"}, "from": { "kind": "ImageStreamTag", "name": "2.7"}, "name": "latest", "referencePolicy": {"type": "Source"}}}]'

    这会触发 backend-listenerbackend-workerbackend-cron DeploymentConfig 的重新部署。等待它们重新部署、对应的新容器集就绪,并且旧容器集终止。

  4. amp-zync 镜像流进行补丁:

    $ oc patch imagestream/amp-zync --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP Zync 2.7"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/zync-rhel7:3scale2.7"}, "name": "2.7", "referencePolicy": {"type": "Source"}}}]'
    $ oc patch imagestream/amp-zync --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP Zync (latest)"}, "from": { "kind": "ImageStreamTag", "name": "2.7"}, "name": "latest", "referencePolicy": {"type": "Source"}}}]'
    • 这会触发 zynczync-que DeploymentConfig 的重新部署。等待它们重新部署、对应的新容器集就绪,并且旧容器集终止。
  5. system-memcached ImageStream 进行补丁:

    $ oc patch imagestream/system-memcached --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "System 2.7 Memcached"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/memcached-rhel7:3scale2.7"}, "name": "2.7", "referencePolicy": {"type": "Source"}}}]'
    $ oc patch imagestream/system-memcached --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "System Memcached (latest)"}, "from": { "kind": "ImageStreamTag", "name": "2.7"}, "name": "latest", "referencePolicy": {"type": "Source"}}}]'

    这会触发 system-memcache DeploymentConfig 的重新部署。等待它们重新部署、对应的新容器集就绪,并且旧容器集终止。

  6. zync-database-postgresql 镜像流进行补丁:

    $ oc patch imagestream/zync-database-postgresql --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "Zync 2.7 PostgreSQL"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/rhscl/postgresql-10-rhel7"}, "name": "2.7", "referencePolicy": {"type": "Source"}}}]'
    $ oc patch imagestream/zync-database-postgresql --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "Zync PostgreSQL (latest)"}, "from": { "kind": "ImageStreamTag", "name": "2.7"}, "name": "latest", "referencePolicy": {"type": "Source"}}}]'
    • 这个补丁更新了 zync-database-postgresql 镜像流,使其包含 2.7 标签。您可以使用这个命令确认已创建了 2.7 标签:

       $ oc get is zync-database-postgresql
    • 如果镜像上有新的更新,此补丁还可能触发 zync-database DeploymentConfig 的重新部署。如果发生这种情况,请等待新容器集重新部署并就绪,并且旧容器集终止。
  7. 如果 3scale 2.6 安装中存在一个或多个 DeploymentConfig,请点适用 DeploymentConfig 的链接来获取如何继续的更多信息:

  8. 更新可见的发行版本:

    $ oc set env dc/system-app AMP_RELEASE=2.7

    这会触发 system-app DeploymentConfig 的重新部署。等待它被执行,并且对应的新容器集就绪并且旧容器集终止。

  9. 验证 DeploymentConfig 的所有镜像 URL 是否包含新镜像 registry URL,并在每个 URL 末尾添加一个哈希:

    $ THREESCALE_DC_NAMES="apicast-production apicast-staging backend-cron backend-listener backend-redis backend-worker system-app system-memcache system-mysql system-redis system-sidekiq system-sphinx zync zync-database"
    
    for component in ${THREESCALE_DC_NAMES}; do echo -n "${component} image: " && oc get dc $component -o json | jq .spec.template.spec.containers[0].image ; done
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.