Migrating 3scale
Migrate or upgrade 3scale API Management and its components
Abstract
Preface Copy linkLink copied to clipboard!
This guide provides the information to migrate Red Hat 3scale API Management from a template to an operator-based installation, the details required to upgrade your 3scale installation from 2.10 to 2.11, as well as the steps to upgrade APIcast in an operator-based deployment.
To migrate from a template-based to an operator-based deployment, refer to the procedures listed in the 3scale migration guide.
To upgrade your 3scale On-premises deployment from 2.10 to 2.11, refer to one of the following guides depending on the installation type:
To upgrade APIcast in an operator-based deployment, refer to the steps listed in the APIcast upgrade guide.
Making open source more inclusive Copy linkLink copied to clipboard!
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.
Chapter 1. 3scale migration guide: from template to operator-based deployments Copy linkLink copied to clipboard!
This section contains information about migrating Red Hat 3scale API Management from a template-based deployment using Red Hat OpenShift 3.11, to an operator-based deployment using Red Hat OpenShift 4.x.
In order to understand the required conditions and procedure, read the entire migration guide before applying the listed steps. The migration process disrupts the provision of the service until the procedure finishes. Due to this disruption, make sure to have a maintenance window.
1.1. Prerequisites to perform the migration Copy linkLink copied to clipboard!
Before migrating your 3scale installation from a template to an operator-based deployment, confirm that your deployment is supported by consulting the following guides:
1.2. Migrating 3scale template to operator-based deployments Copy linkLink copied to clipboard!
The basic setup before migration is that 3scale points to the OCP3 domain: 3scale.example.com → ocp3.example.com
To migrate 3scale from a template-based deployment using Red Hat OpenShift 3.11 to an operator-based deployment using Red Hat OpenShift 4.1, follow these steps:
- Create a 3scale backup from the template-based deployment.
- Deploy 3scale using the operator.
- Restore the backup in the operator-based deployment.
-
Point the 3scale WILDCARD_DOMAIN, in this case
3scale.example.com, toocp4.example.com.
After you have performed all the listed steps, 3scale migration from a template to an operator-based deployment is now complete.
Chapter 2. Upgrading 3scale version 2.11 to version 2.12 using templates Copy linkLink copied to clipboard!
You can upgrade Red Hat 3scale API Management from version 2.11 to version 2.12 using a template-based deployment on OpenShift 3.11.
This is the last release supporting upgrades of 3scale deployed with templates on OpenShift 3.11. You should follow the 3scale migration guide: from template to operator-based deployments to stay supported in future releases.
To understand the required conditions and procedures, be sure to read the entire upgrade guide before applying the listed steps. The upgrade process disrupts the provision of the service until the procedure finishes. Due to this disruption, be sure to have a maintenance window.
2.1. Prerequisites to perform the upgrade Copy linkLink copied to clipboard!
This section describes the required configurations, tasks, and tools to upgrade 3scale from 2.11 to 2.12 in a template-based installation.
2.1.1. Configurations Copy linkLink copied to clipboard!
- 3scale supports upgrade paths from 2.11 to 2.12 with templates on OpenShift 3.11.
2.1.2. Preliminary tasks Copy linkLink copied to clipboard!
- Ensure your OpenShift CLI tool is configured in the same project where 3scale is deployed.
- Perform a backup of the database you are using with 3scale. The procedure of the backup is specific to each database type and setup.
2.1.3. Tools Copy linkLink copied to clipboard!
You need these tools to perform the upgrade:
- 3scale 2.11 deployed with templates in an OpenShift 3.11 project.
- Bash shell: To run the commands detailed in the upgrade procedure.
- base64: To encode and decode secret information.
- jq: For JSON transformation purposes.
2.2. Upgrading from 2.11 to 2.12 in a template-based installation Copy linkLink copied to clipboard!
Follow the procedure described in this section to upgrade 3scale 2.11 to 2.12 in a template-based installation.
To start with the upgrade, go to the project where 3scale is deployed.
oc project <3scale-project>
$ oc project <3scale-project>
Then, follow these steps in this order:
2.2.1. Creating a backup of the 3scale project Copy linkLink copied to clipboard!
Previous step
None.
Current step
This step lists the actions necessary to create a backup of the 3scale project.
Procedure
Depending on the database used with 3scale, set ${SYSTEM_DB} with one of the following values:
-
If the database is MySQL,
SYSTEM_DB=system-mysql. -
If the database is PostgreSQL,
SYSTEM_DB=system-postgresql.
-
If the database is MySQL,
Create a backup file with the existing DeploymentConfigs:
THREESCALE_DC_NAMES="apicast-production apicast-staging backend-cron backend-listener backend-redis backend-worker system-app system-memcache ${SYSTEM_DB} system-redis system-sidekiq system-sphinx zync zync-database zync-que" for component in ${THREESCALE_DC_NAMES}; do oc get --export -o yaml dc ${component} > ${component}_dc.yml ; done$ THREESCALE_DC_NAMES="apicast-production apicast-staging backend-cron backend-listener backend-redis backend-worker system-app system-memcache ${SYSTEM_DB} system-redis system-sidekiq system-sphinx zync zync-database zync-que" for component in ${THREESCALE_DC_NAMES}; do oc get --export -o yaml dc ${component} > ${component}_dc.yml ; doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow Backup all existing OpenShift resources in the project that are exported through the
export allcommand:oc get -o yaml --export all > threescale-project-elements.yaml
$ oc get -o yaml --export all > threescale-project-elements.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a backup file with the additional elements that are not exported with the
export allcommand:for object in rolebindings serviceaccounts secrets imagestreamtags cm rolebindingrestrictions limitranges resourcequotas pvc templates cronjobs statefulsets hpa deployments replicasets poddisruptionbudget endpoints do oc get -o yaml --export $object > $object.yaml done
$ for object in rolebindings serviceaccounts secrets imagestreamtags cm rolebindingrestrictions limitranges resourcequotas pvc templates cronjobs statefulsets hpa deployments replicasets poddisruptionbudget endpoints do oc get -o yaml --export $object > $object.yaml doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Verify that all of the generated files are not empty, and that all of them have the expected content.
Next step
2.2.2. Removing unused AMP_RELEASE variables Copy linkLink copied to clipboard!
Previous step
Current step
This step removes unused AMP_RELEASE variables from system-app containers, the system-app pre hook, and then verifies that AMP_RELEASE does not exist.
Procedure
Remove the variable from the
system-appcontainers:Note the dash char after the variable name.
oc set env dc/system-app AMP_RELEASE-
$ oc set env dc/system-app AMP_RELEASE-Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Remove the variable from the
system-apppre hook:INDEX=$(oc get dc system-app -o json | jq '.spec.strategy.rollingParams.pre.execNewPod.env | map(.name == "AMP_RELEASE") | index(true)') oc patch dc/system-app --type=json -p "[{'op': 'remove', 'path': '/spec/strategy/rollingParams/pre/execNewPod/env/$INDEX'}]"$ INDEX=$(oc get dc system-app -o json | jq '.spec.strategy.rollingParams.pre.execNewPod.env | map(.name == "AMP_RELEASE") | index(true)') oc patch dc/system-app --type=json -p "[{'op': 'remove', 'path': '/spec/strategy/rollingParams/pre/execNewPod/env/$INDEX'}]"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify AMP_RELEASE does not exist:
oc get dc system-app -o yaml | grep AMP_RELEASE
$ oc get dc system-app -o yaml | grep AMP_RELEASECopy to Clipboard Copied! Toggle word wrap Toggle overflow
Next step
2.2.3. Upgrading your MySQL configuration Copy linkLink copied to clipboard!
If your 3scale deployment has the external databases mode enabled and uses MySQL 8.0, set the authentication plugin to mysql_native_password for 3scale 2.12.
Add the following to the MySQL configuration file:
[mysqld] default_authentication_plugin=mysql_native_password
[mysqld]
default_authentication_plugin=mysql_native_password
Previous step
Current step
This step patches the MySQL configuration configmap to enable upgrade to MySQL 8.0.
Only follow this procedure if a system-mysql deployment exists in your current 3scale installation.
Procedure
Patch the
configmap:oc patch configmap/mysql-extra-conf --type merge -p '{"data": {"mysql-default-authentication-plugin.cnf": "[mysqld]\ndefault_authentication_plugin=mysql_native_password"}}'$ oc patch configmap/mysql-extra-conf --type merge -p '{"data": {"mysql-default-authentication-plugin.cnf": "[mysqld]\ndefault_authentication_plugin=mysql_native_password"}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify the
configmapis updated:oc get cm mysql-extra-conf -o jsonpath='{.data.mysql-default-authentication-plugin\.cnf}'$ oc get cm mysql-extra-conf -o jsonpath='{.data.mysql-default-authentication-plugin\.cnf}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Should return:
[mysqld] default_authentication_plugin=mysql_native_password
[mysqld] default_authentication_plugin=mysql_native_passwordCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Next step
2.2.4. Upgrading 3scale images Copy linkLink copied to clipboard!
Previous step
Current step
This step updates the 3scale images required for the upgrade process.
2.2.4.1. Patch the system image Copy linkLink copied to clipboard!
Create the new image stream tag:
oc patch imagestream/amp-system --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP system 2.12"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/system-rhel7:3scale2.12"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'$ oc patch imagestream/amp-system --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP system 2.12"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/system-rhel7:3scale2.12"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow To continue the procedure, consider the database used with your 3scale deployment:
- If the database is Oracle DB, follow the steps listed in Patching the system image: 3scale with Oracle Database
- If the database is different from Oracle DB, follow the steps listed in Patching the system image: 3scale with other databases
2.2.4.1.1. Patching the system image: 3scale with Oracle Database Copy linkLink copied to clipboard!
To start patching the system image of 3scale with an Oracle Database, you must build the system image:
Download 3scale OpenShift templates from the GitHub repository and extract the archive:
tar -xzf 3scale-amp-openshift-templates-3scale-2.12.0-GA.tar.gz
tar -xzf 3scale-amp-openshift-templates-3scale-2.12.0-GA.tar.gzCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Place your Oracle Database Instant Client Package files into the
3scale-amp-openshift-templates-3scale-2.12.0-GA/amp/system-oracle/oracle-client-filesdirectory. Run the
oc processcommand with the-foption and specify thebuild.ymlOpenShift template with theoc applycommand and the-foption to override the existing build:oc process -f build.yml | oc apply -f -
$ oc process -f build.yml | oc apply -f -Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the
oc start-buildcommand to build the new system image:oc start-build 3scale-amp-system-oracle --from-dir=.
$ oc start-build 3scale-amp-system-oracle --from-dir=.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Patch the
system-appImageChangeTrigger:Remove the old
2.11-oracletrigger:oc set triggers dc/system-app --from-image=amp-system:2.11-oracle --containers=system-master,system-developer,system-provider --remove
$ oc set triggers dc/system-app --from-image=amp-system:2.11-oracle --containers=system-master,system-developer,system-provider --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/system-app --from-image=amp-system:2.12-oracle --containers=system-master,system-developer,system-provider
$ oc set triggers dc/system-app --from-image=amp-system:2.12-oracle --containers=system-master,system-developer,system-providerCopy to Clipboard Copied! Toggle word wrap Toggle overflow This triggers a redeployment of
system-app. Wait until it is redeployed, its corresponding new pods are ready, and the old ones terminated.
Patch the
system-sidekiqImageChange trigger:Remove the old
2.11-oracletrigger:oc set triggers dc/system-sidekiq --from-image=amp-system:2.11-oracle --containers=system-sidekiq,check-svc --remove
$ oc set triggers dc/system-sidekiq --from-image=amp-system:2.11-oracle --containers=system-sidekiq,check-svc --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/system-sidekiq --from-image=amp-system:2.12-oracle --containers=system-sidekiq,check-svc
$ oc set triggers dc/system-sidekiq --from-image=amp-system:2.12-oracle --containers=system-sidekiq,check-svcCopy to Clipboard Copied! Toggle word wrap Toggle overflow This triggers a redeployment of
system-sidekiq. Wait until it is redeployed, its corresponding new pods are ready, and the old ones terminated.
Patch the
system-sphinxImageChange trigger:Remove the old
2.11-oracletrigger:oc set triggers dc/system-sphinx --from-image=amp-system:2.11-oracle --containers=system-sphinx,system-master-svc --remove
$ oc set triggers dc/system-sphinx --from-image=amp-system:2.11-oracle --containers=system-sphinx,system-master-svc --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/system-sphinx --from-image=amp-system:2.12-oracle --containers=system-sphinx,system-master-svc
$ oc set triggers dc/system-sphinx --from-image=amp-system:2.12-oracle --containers=system-sphinx,system-master-svcCopy to Clipboard Copied! Toggle word wrap Toggle overflow This triggers a redeployment of
system-sphinx. Wait until it is redeployed, its corresponding new pods are ready, and the old ones terminated.
- Scale 3scale back if you scaled it down.
2.2.4.1.2. Patching the system image: 3scale with other databases Copy linkLink copied to clipboard!
Patch the
system-appImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/system-app --from-image=amp-system:2.11 --containers=system-master,system-developer,system-provider --remove
$ oc set triggers dc/system-app --from-image=amp-system:2.11 --containers=system-master,system-developer,system-provider --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/system-app --from-image=amp-system:2.12 --containers=system-master,system-developer,system-provider
$ oc set triggers dc/system-app --from-image=amp-system:2.12 --containers=system-master,system-developer,system-providerCopy to Clipboard Copied! Toggle word wrap Toggle overflow This triggers a redeployment of
system-app. Wait until it is redeployed, its corresponding new pods are ready, and the old ones terminated.
Patch the
system-sidekiqImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/system-sidekiq --from-image=amp-system:2.11 --containers=system-sidekiq,check-svc --remove
$ oc set triggers dc/system-sidekiq --from-image=amp-system:2.11 --containers=system-sidekiq,check-svc --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/system-sidekiq --from-image=amp-system:2.12 --containers=system-sidekiq,check-svc
$ oc set triggers dc/system-sidekiq --from-image=amp-system:2.12 --containers=system-sidekiq,check-svcCopy to Clipboard Copied! Toggle word wrap Toggle overflow This triggers a redeployment of
system-sidekiq. Wait until it is redeployed, its corresponding new pods are ready, and the old ones terminated.
Patch the
system-sphinxImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/system-sphinx --from-image=amp-system:2.11 --containers=system-sphinx,system-master-svc --remove
$ oc set triggers dc/system-sphinx --from-image=amp-system:2.11 --containers=system-sphinx,system-master-svc --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/system-sphinx --from-image=amp-system:2.12 --containers=system-sphinx,system-master-svc
$ oc set triggers dc/system-sphinx --from-image=amp-system:2.12 --containers=system-sphinx,system-master-svcCopy to Clipboard Copied! Toggle word wrap Toggle overflow This triggers a redeployment of
system-sphinx. Wait until it is redeployed, its corresponding new pods are ready, and the old ones terminated.
2.2.4.2. Patch the apicast image Copy linkLink copied to clipboard!
Patch the
amp-apicastimage stream:oc patch imagestream/amp-apicast --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP APIcast 2.12"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/apicast-gateway-rhel8:3scale2.12"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'$ oc patch imagestream/amp-apicast --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP APIcast 2.12"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/apicast-gateway-rhel8:3scale2.12"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Patch the
apicast-stagingImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/apicast-staging --from-image=amp-apicast:2.11 --containers=apicast-staging --remove
$ oc set triggers dc/apicast-staging --from-image=amp-apicast:2.11 --containers=apicast-staging --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/apicast-staging --from-image=amp-apicast:2.12 --containers=apicast-staging
$ oc set triggers dc/apicast-staging --from-image=amp-apicast:2.12 --containers=apicast-stagingCopy to Clipboard Copied! Toggle word wrap Toggle overflow This triggers a redeployment of
apicast-staging. Wait until it is redeployed, its corresponding new pods are ready, and the old ones terminated.
Patch the
apicast-productionImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/apicast-production --from-image=amp-apicast:2.11 --containers=apicast-production,system-master-svc --remove
$ oc set triggers dc/apicast-production --from-image=amp-apicast:2.11 --containers=apicast-production,system-master-svc --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/apicast-production --from-image=amp-apicast:2.12 --containers=apicast-production,system-master-svc
$ oc set triggers dc/apicast-production --from-image=amp-apicast:2.12 --containers=apicast-production,system-master-svcCopy to Clipboard Copied! Toggle word wrap Toggle overflow This triggers a redeployment of
apicast-production. Wait until it is redeployed, its corresponding new pods are ready, and the old ones terminated.
2.2.4.3. Patch the backend image Copy linkLink copied to clipboard!
Patch the
amp-backendimage stream:oc patch imagestream/amp-backend --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP Backend 2.12"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/backend-rhel8:3scale2.12"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'$ oc patch imagestream/amp-backend --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP Backend 2.12"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/backend-rhel8:3scale2.12"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Patch the
backend-listenerImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/backend-listener --from-image=amp-backend:2.11 --containers=backend-listener --remove
$ oc set triggers dc/backend-listener --from-image=amp-backend:2.11 --containers=backend-listener --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/backend-listener --from-image=amp-backend:2.12 --containers=backend-listener
$ oc set triggers dc/backend-listener --from-image=amp-backend:2.12 --containers=backend-listenerCopy to Clipboard Copied! Toggle word wrap Toggle overflow This triggers a redeployment of
backend-listener. Wait until it is redeployed, its corresponding new pods are ready, and the old ones terminated.
Patch the
backend-workerImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/backend-worker --from-image=amp-backend:2.11 --containers=backend-worker,backend-redis-svc --remove
$ oc set triggers dc/backend-worker --from-image=amp-backend:2.11 --containers=backend-worker,backend-redis-svc --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/backend-worker --from-image=amp-backend:2.12 --containers=backend-worker,backend-redis-svc
$ oc set triggers dc/backend-worker --from-image=amp-backend:2.12 --containers=backend-worker,backend-redis-svcCopy to Clipboard Copied! Toggle word wrap Toggle overflow This triggers a redeployment of
backend-worker. Wait until it is redeployed, its corresponding new pods are ready, and the old ones terminated.
Patch the
backend-cronImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/backend-cron --from-image=amp-backend:2.11 --containers=backend-cron,backend-redis-svc --remove
$ oc set triggers dc/backend-cron --from-image=amp-backend:2.11 --containers=backend-cron,backend-redis-svc --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/backend-cron --from-image=amp-backend:2.12 --containers=backend-cron,backend-redis-svc
$ oc set triggers dc/backend-cron --from-image=amp-backend:2.12 --containers=backend-cron,backend-redis-svcCopy to Clipboard Copied! Toggle word wrap Toggle overflow This command triggers a redeployment of
backend-cron. Wait until it is redeployed, its corresponding new pods are ready, and the previous pods are terminated.
2.2.4.4. Patch the zync image Copy linkLink copied to clipboard!
Patch the
amp-zyncimage stream:oc patch imagestream/amp-zync --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP Zync 2.12"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/zync-rhel8:3scale2.12"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'$ oc patch imagestream/amp-zync --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "AMP Zync 2.12"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/zync-rhel8:3scale2.12"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Patch the
zyncImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/zync --from-image=amp-zync:2.11 --containers=zync,zync-db-svc --remove
$ oc set triggers dc/zync --from-image=amp-zync:2.11 --containers=zync,zync-db-svc --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/zync --from-image=amp-zync:2.12 --containers=zync,zync-db-svc
$ oc set triggers dc/zync --from-image=amp-zync:2.12 --containers=zync,zync-db-svcCopy to Clipboard Copied! Toggle word wrap Toggle overflow This triggers a redeployment of
zync. Wait until it is redeployed, its corresponding new pods are ready, and the old ones terminated.
Patch the
zync-queImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/zync-que --from-image=amp-zync:2.11 --containers=que --remove
$ oc set triggers dc/zync-que --from-image=amp-zync:2.11 --containers=que --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/zync-que --from-image=amp-zync:2.12 --containers=que
$ oc set triggers dc/zync-que --from-image=amp-zync:2.12 --containers=queCopy to Clipboard Copied! Toggle word wrap Toggle overflow This triggers a redeployment of
zync-que. Wait until it is redeployed, its corresponding new pods are ready, and the old ones terminated.
2.2.4.5. Patch the system-memcached image Copy linkLink copied to clipboard!
Patch the
system-memcachedimage stream:oc patch imagestream/system-memcached --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "System 2.12 Memcached"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/memcached-rhel7:3scale2.12"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'$ oc patch imagestream/system-memcached --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "System 2.12 Memcached"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/3scale-amp2/memcached-rhel7:3scale2.12"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Patch the
system-memcacheImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/system-memcache --from-image=system-memcached:2.11 --containers=memcache --remove
$ oc set triggers dc/system-memcache --from-image=system-memcached:2.11 --containers=memcache --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/system-memcache --from-image=system-memcached:2.12 --containers=memcache
$ oc set triggers dc/system-memcache --from-image=system-memcached:2.12 --containers=memcacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow This triggers a redeployment of the
system-memcacheDeploymentConfig. Wait until it is redeployed, its corresponding new pods are ready, and the old ones terminated.
2.2.4.6. Patch the zync-database-postgresql image Copy linkLink copied to clipboard!
Patch the
zync-database-postgresqlimage stream:oc patch imagestream/zync-database-postgresql --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "Zync 2.12 PostgreSQL"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/rhscl/postgresql-10-rhel7"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'$ oc patch imagestream/zync-database-postgresql --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "Zync 2.12 PostgreSQL"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/rhscl/postgresql-10-rhel7"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow This patch command updates the
zync-database-postgresqlimage stream to contain the 2.12 tag. You can verify that the 2.12 tag has been created with these steps:Run this command:
oc get is zync-database-postgresql
$ oc get is zync-database-postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Check that the Tags column shows the 2.12 tag.
Patch the
zync-databaseImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/zync-database --from-image=zync-database-postgresql:2.11 --containers=postgresql --remove
$ oc set triggers dc/zync-database --from-image=zync-database-postgresql:2.11 --containers=postgresql --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/zync-database --from-image=zync-database-postgresql:2.12 --containers=postgresql
$ oc set triggers dc/zync-database --from-image=zync-database-postgresql:2.12 --containers=postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow In case there are new updates on the image, this patch might also trigger a redeployment of the
zync-databaseDeploymentConfig. If this happens, wait until the new pods are redeployed and ready, and the old pods are terminated.
2.2.4.7. Additional image changes Copy linkLink copied to clipboard!
If one or more of the following DeploymentConfigs are available in your 3scale 2.11 installation, click the links that apply to obtain more information on how to proceed:
backend-redis DeploymentConfig
If the backend-redis DeploymentConfig exists in your current 3scale installation, patch the redis image for backend-redis:
Patch the
backend-redisimage stream:oc patch imagestream/backend-redis --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "Backend 2.12 Redis"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/rhscl/redis-5-rhel7:5"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'$ oc patch imagestream/backend-redis --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "Backend 2.12 Redis"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/rhscl/redis-5-rhel7:5"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow This patch updates the backend-redis image stream to contain the 2.12 tag. With the command below, you can confirm that the tag has been created if the Tags column shows 2.12:
oc get is backend-redis
$ oc get is backend-redisCopy to Clipboard Copied! Toggle word wrap Toggle overflow Patch the
backend-redisImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/backend-redis --from-image=backend-redis:2.11 --containers=backend-redis --remove
$ oc set triggers dc/backend-redis --from-image=backend-redis:2.11 --containers=backend-redis --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/backend-redis --from-image=backend-redis:2.12 --containers=backend-redis
$ oc set triggers dc/backend-redis --from-image=backend-redis:2.12 --containers=backend-redisCopy to Clipboard Copied! Toggle word wrap Toggle overflow In case there are new updates on the image, this patch might also trigger a redeployment of the
backend-redisDeploymentConfig. If this happens, wait until the new pods are redeployed and ready, and the old pods are terminated.
system-redis DeploymentConfig
If the system-redis DeploymentConfig exists in your current 3scale installation, patch the redis image for system-redis.
Patch the
system-redisimage stream:oc patch imagestream/system-redis --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "System 2.12 Redis"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/rhscl/redis-5-rhel7:5"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'$ oc patch imagestream/system-redis --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "System 2.12 Redis"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/rhscl/redis-5-rhel7:5"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow This patch updates the
system-redisimage stream to contain the 2.12 tag. With the command below, you can confirm that the tag has been created if the Tags column shows 2.12:oc get is system-redis
$ oc get is system-redisCopy to Clipboard Copied! Toggle word wrap Toggle overflow Patch the
system-redisImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/system-redis --from-image=system-redis:2.11 --containers=system-redis --remove
$ oc set triggers dc/system-redis --from-image=system-redis:2.11 --containers=system-redis --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/system-redis --from-image=system-redis:2.12 --containers=system-redis
$ oc set triggers dc/system-redis --from-image=system-redis:2.12 --containers=system-redisCopy to Clipboard Copied! Toggle word wrap Toggle overflow In case there are new updates on the image, this patch might also trigger a redeployment of the
system-redisDeploymentConfig. If this happens, wait until the new pods are redeployed and ready, and the old pods are terminated.
system-mysql DeploymentConfig
If the system-mysql DeploymentConfig exists in your current 3scale installation, patch the MySQL image for system-mysql.
Patch the
system-mysqlimage stream:oc patch imagestream/system-mysql --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "System 2.12 MySQL"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/rhel8/mysql-80:1"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'$ oc patch imagestream/system-mysql --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "System 2.12 MySQL"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/rhel8/mysql-80:1"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow This patch updates the
system-mysqlimage stream to contain the 2.12 tag. With the command below, you can confirm that the tag has been created if the Tags column shows 2.12:oc get is system-mysql
$ oc get is system-mysqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Patch the
system-mysqlImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/system-mysql --from-image=system-mysql:2.11 --containers=system-mysql --remove
$ oc set triggers dc/system-mysql --from-image=system-mysql:2.11 --containers=system-mysql --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/system-mysql --from-image=system-mysql:2.12 --containers=system-mysql
$ oc set triggers dc/system-mysql --from-image=system-mysql:2.12 --containers=system-mysqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow In case there are new updates on the image, this patch might also trigger a redeployment of the
system-mysqlDeploymentConfig. If this happens, wait until the new pods are redeployed and ready, and the old pods are terminated.
system-postgresql DeploymentConfig
If the system-postgresql DeploymentConfig exists in your current 3scale installation, patch the PostgreSQL image for system-postgresql.
Patch the
system-postgresqlimage stream:oc patch imagestream/system-postgresql --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "System 2.12 PostgreSQL"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/rhscl/postgresql-10-rhel7"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'$ oc patch imagestream/system-postgresql --type=json -p '[{"op": "add", "path": "/spec/tags/-", "value": {"annotations": {"openshift.io/display-name": "System 2.12 PostgreSQL"}, "from": { "kind": "DockerImage", "name": "registry.redhat.io/rhscl/postgresql-10-rhel7"}, "name": "2.12", "referencePolicy": {"type": "Source"}}}]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow This patch updates the
system-postgresqlimage stream to contain the 2.12 tag. With the command below, you can confirm that the tag has been created if the Tags column shows 2.12:oc get is system-postgresql
$ oc get is system-postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Patch the
system-postgresqlImageChange trigger:Remove the old
2.11trigger:oc set triggers dc/system-postgresql --from-image=system-postgresql:2.11 --containers=system-postgresql --remove
$ oc set triggers dc/system-postgresql --from-image=system-postgresql:2.11 --containers=system-postgresql --removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the new version-specific trigger:
oc set triggers dc/system-postgresql --from-image=system-postgresql:2.12 --containers=system-postgresql
$ oc set triggers dc/system-postgresql --from-image=system-postgresql:2.12 --containers=system-postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow In case there are new updates on the image, this patch might also trigger a redeployment of the
system-postgresqlDeploymentConfig. If this happens, wait until the new pods are redeployed and ready, and the old pods are terminated.
2.2.4.8. Confirm image URLs Copy linkLink copied to clipboard!
Confirm that all the image URLs of the DeploymentConfigs contain the new image registry URLs with a hash added at the end of each URL address:
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 zync-que"
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
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 zync-que"
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
Next step
2.2.5. Removing unused MessageBus variables Copy linkLink copied to clipboard!
Previous step
Current step
This step removes unused MESSAGE_BUS_REDIS_* variables.
2.2.5.1. Remove MESSAGE_BUS_REDIS_* variables from the system-app deploymentconfig Copy linkLink copied to clipboard!
Remove MESSAGE_BUS_REDIS_* variables from the
system-appcontainers:Note the dash char after the variable name.
oc set env dc/system-app MESSAGE_BUS_REDIS_URL- oc set env dc/system-app MESSAGE_BUS_REDIS_NAMESPACE- oc set env dc/system-app MESSAGE_BUS_REDIS_SENTINEL_HOSTS- oc set env dc/system-app MESSAGE_BUS_REDIS_SENTINEL_ROLE-
$ oc set env dc/system-app MESSAGE_BUS_REDIS_URL- $ oc set env dc/system-app MESSAGE_BUS_REDIS_NAMESPACE- $ oc set env dc/system-app MESSAGE_BUS_REDIS_SENTINEL_HOSTS- $ oc set env dc/system-app MESSAGE_BUS_REDIS_SENTINEL_ROLE-Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Remove MESSAGE_BUS_REDIS_* variables from the
system-apppre hook:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify MESSAGE_BUS_REDIS_* environment variables do not exist:
oc get dc system-app -o yaml | grep MESSAGE_BUS_REDIS
$ oc get dc system-app -o yaml | grep MESSAGE_BUS_REDISCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2.5.2. Remove MESSAGE_BUS_REDIS_* variables from the system-sidekiq deploymentconfig Copy linkLink copied to clipboard!
Remove MESSAGE_BUS_REDIS_* variables from the
system-sidekiqcontainers:Note the dash char after the variable name.
oc set env dc/system-sidekiq MESSAGE_BUS_REDIS_URL- oc set env dc/system-sidekiq MESSAGE_BUS_REDIS_NAMESPACE- oc set env dc/system-sidekiq MESSAGE_BUS_REDIS_SENTINEL_HOSTS- oc set env dc/system-sidekiq MESSAGE_BUS_REDIS_SENTINEL_ROLE-
$ oc set env dc/system-sidekiq MESSAGE_BUS_REDIS_URL- $ oc set env dc/system-sidekiq MESSAGE_BUS_REDIS_NAMESPACE- $ oc set env dc/system-sidekiq MESSAGE_BUS_REDIS_SENTINEL_HOSTS- $ oc set env dc/system-sidekiq MESSAGE_BUS_REDIS_SENTINEL_ROLE-Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Remove MESSAGE_BUS_REDIS_* variables from the
system-sidekiqinit-container:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify MESSAGE_BUS_REDIS_* environment variables do not exist:
oc get dc system-sidekiq -o yaml | grep MESSAGE_BUS_REDIS
$ oc get dc system-sidekiq -o yaml | grep MESSAGE_BUS_REDISCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2.5.3. Remove MESSAGE_BUS_REDIS_* variables from the system-sphinx deploymentconfig Copy linkLink copied to clipboard!
Remove MESSAGE_BUS_REDIS_* variables from the
system-sphinxcontainers:Note the dash char after the variable name.
oc set env dc/system-sphinx MESSAGE_BUS_REDIS_URL- oc set env dc/system-sphinx MESSAGE_BUS_REDIS_NAMESPACE- oc set env dc/system-sphinx MESSAGE_BUS_REDIS_SENTINEL_HOSTS- oc set env dc/system-sphinx MESSAGE_BUS_REDIS_SENTINEL_ROLE-
$ oc set env dc/system-sphinx MESSAGE_BUS_REDIS_URL- $ oc set env dc/system-sphinx MESSAGE_BUS_REDIS_NAMESPACE- $ oc set env dc/system-sphinx MESSAGE_BUS_REDIS_SENTINEL_HOSTS- $ oc set env dc/system-sphinx MESSAGE_BUS_REDIS_SENTINEL_ROLE-Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verify MESSAGE_BUS_REDIS_* environment variables do not exist:
oc get dc system-sphinx -o yaml | grep MESSAGE_BUS_REDIS
$ oc get dc system-sphinx -o yaml | grep MESSAGE_BUS_REDISCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2.5.4. Remove MESSAGE_BUS_REDIS_* variables from the system-redis secret Copy linkLink copied to clipboard!
Remove MESSAGE_BUS_REDIS_* variables from the
system-redissecret:oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_URL'}]" oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_NAMESPACE'}]" oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_SENTINEL_HOSTS'}]" oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_SENTINEL_ROLE'}]"$ oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_URL'}]" $ oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_NAMESPACE'}]" $ oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_SENTINEL_HOSTS'}]" $ oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_SENTINEL_ROLE'}]"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify MESSAGE_BUS_REDIS_* environment variables do not exist:
oc get secret system-redis -o yaml | grep MESSAGE_BUS
$ oc get secret system-redis -o yaml | grep MESSAGE_BUSCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2.5.5. Upgrading with external system-database using PostgreSQL 10 and PostgreSQL 13 Copy linkLink copied to clipboard!
This upgrade supports external system-database using PostgreSQL 10. You should complete your 3scale upgrade first, then upgrade to PostgreSQL 13.
Next step
None. After you have performed all the listed steps, 3scale upgrade from 2.11 to 2.12 in a template-based deployment is now complete.
2.3. Upgrading 3scale with an Oracle Database in a template-based installation Copy linkLink copied to clipboard!
This section explains how to update Red Hat 3scale API Management when you are using a 3scale system image with an Oracle Database, in a template-based installation with OpenShift 3.11.
Prerequisites
A 3scale installation with the Oracle Database. See Setting up your 3scale system image with an Oracle Database.
To upgrade your 3scale system image with an Oracle Database in a template-based installation, perform the procedure below:
2.3.1. Upgrading 3scale with Oracle 19c Copy linkLink copied to clipboard!
This procedure guides you through an Oracle Database 19c update for 3scale 2.12 from an existing 3scale 2.11 installation.
IMPORTANT: Loss of connection to the database can potentially corrupt 3scale. Make a backup before proceeding to perform the upgrade. For more information see the Oracle Database documentation: Oracle Database Backup and Recovery User’s Guide.
Prerequisites
- A 3scale 2.11 installation.
An Oracle Database 19c installation.
- For more information about configuring 3scale with Oracle, see Preparing the Oracle Database.
Procedure
Download 3scale OpenShift templates from the GitHub repository and extract the archive:
tar -xzf 3scale-amp-openshift-templates-3scale-2.12.0-GA.tar.gz
tar -xzf 3scale-amp-openshift-templates-3scale-2.12.0-GA.tar.gzCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Place your Oracle Database Instant Client Package files into the
3scale-amp-openshift-templates-3scale-2.12.0-GA/amp/system-oracle/oracle-client-filesdirectory. Run the
oc processcommand with the-foption and specify thebuild.ymlOpenShift template:oc process -f build.yml | oc apply -f -
$ oc process -f build.yml | oc apply -f -Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
oc new-appcommand with the-foption to indicate theamp.ymlOpenShift template, and the-poption to specify theWILDCARD_DOMAINparameter with the domain of your OpenShift cluster:oc new-app -f amp.yml -p WILDCARD_DOMAIN=mydomain.com
$ oc new-app -f amp.yml -p WILDCARD_DOMAIN=mydomain.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe following steps are optional. Use them if you remove
ORACLE_SYSTEM_PASSWORDafter the installation or a system upgrade.Enter the following
oc patchcommands, replacingSYSTEM_PASSWORDwith the Oracle Databasesystempassword you set up in Preparing the Oracle Database:oc patch dc/system-app -p '[{"op": "add", "path": "/spec/strategy/rollingParams/pre/execNewPod/env/-", "value": {"name": "ORACLE_SYSTEM_PASSWORD", "value": "SYSTEM_PASSWORD"}}]' --type=json oc patch dc/system-app -p '{"spec": {"strategy": {"rollingParams": {"post":{"execNewPod": {"env": [{"name": "ORACLE_SYSTEM_PASSWORD", "value": "SYSTEM_PASSWORD"}]}}}}}}'$ oc patch dc/system-app -p '[{"op": "add", "path": "/spec/strategy/rollingParams/pre/execNewPod/env/-", "value": {"name": "ORACLE_SYSTEM_PASSWORD", "value": "SYSTEM_PASSWORD"}}]' --type=json $ oc patch dc/system-app -p '{"spec": {"strategy": {"rollingParams": {"post":{"execNewPod": {"env": [{"name": "ORACLE_SYSTEM_PASSWORD", "value": "SYSTEM_PASSWORD"}]}}}}}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the following command, replacing
DATABASE_URLto point to your Oracle Database, specified in Preparing the Oracle Database:oc patch secret/system-database -p '{"stringData": {"URL": "DATABASE_URL"}}'$ oc patch secret/system-database -p '{"stringData": {"URL": "DATABASE_URL"}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the
oc start-buildcommand to build the new system image:oc start-build 3scale-amp-system-oracle --from-dir=.
$ oc start-build 3scale-amp-system-oracle --from-dir=.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Wait until the build completes. To see the state of the build, run the following command:
oc get build <build-name> -o jsonpath="{.status.phase}"$ oc get build <build-name> -o jsonpath="{.status.phase}"Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Wait until the build is in a Complete state.
Once you have set up your 3scale system image with your Oracle Database, remove
ORACLE_SYSTEM_PASSWORDfrom thesystem-appDeploymentConfig. It is not necessary again until you upgrade to a new version of 3scale.oc set env dc/system-app ORACLE_SYSTEM_PASSWORD-
$ oc set env dc/system-app ORACLE_SYSTEM_PASSWORD-Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification for the open_cursors parameter setting
You must confirm that the open_cursors parameter in this database is set to a value that is greater than 1000.
To do this, log in to your Oracle Database as SYSTEM user and run the following command:
show parameter open_cursors;
show parameter open_cursors;
The return value should be at least 1000. If it is not, change the parameter to a value greater than 1000 by following Oracle’s documentation on open cursors.
If the open_cursors parameter was previously configured to some limit less than 1000, and you do not increase the value, you might see the following error in one of the OpenShift system-app pod logs:
ORA-01000: maximum open cursors exceeded
ORA-01000: maximum open cursors exceeded
Additional resources
For more information about 3scale and Oracle Database support, see Red Hat 3scale API Management Supported Configurations.
Chapter 3. 3scale operator-based upgrade guide: from 2.11 to 2.12 Copy linkLink copied to clipboard!
Upgrade Red Hat 3scale API Management from version 2.11 to 2.12, in an operator-based installation to manage 3scale on OpenShift 4.x.
To automatically obtain a micro-release of 3scale, make sure automatic updates is on. To check this, see Setting up the 3scale operator for micro releases.
In order to understand the required conditions and procedure, read the entire upgrade guide before applying the listed steps. The upgrade process disrupts the provision of the service until the procedure finishes. Due to this disruption, make sure to have a maintenance window.
3.1. Prerequisites to perform the upgrade Copy linkLink copied to clipboard!
This section describes the required configurations to upgrade 3scale from 2.11 to 2.12 in an operator-based installation.
- An OpenShift Container Platform (OCP) 4.6, 4.7, 4.8, 4.9, or 4.10 cluster with administrator access.
- 3scale 2.11 previously deployed via the 3scale operator.
Make sure the latest CSV of the
threescale-2.11channel is in use. To check it:- If the approval setting for the subscription is automatic you should already be in the latest CSV version of the channel.
- If the approval setting for the subscription is manual make sure you approve all pending InstallPlans and have the latest CSV version.
- Keep in mind if there is a pending install plan, there might be more pending install plans, which will only be shown after the existing pending plan has been installed.
3.2. Upgrading from 2.11 to 2.12 in an operator-based installation Copy linkLink copied to clipboard!
To upgrade 3scale from version 2.11 to 2.12 in an operator-based deployment:
- Log in to the OCP console using the account with administrator privileges.
- Select the project where the 3scale-operator has been deployed.
- Click Operators > Installed Operators.
- Select Red Hat Integration - 3scale > Subscription > Channel.
Edit the channel of the subscription by selecting threescale-2.12 and save the changes.
This will start the upgrade process.
Query the pods' status on the project until you see all the new versions are running and ready without errors:
oc get pods
$ oc get podsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note- The pods might have temporary errors during the upgrade process.
- The time required to upgrade pods can vary from 5-10 minutes.
- After new pod versions are running, confirm a successful upgrade by logging in to the 3scale Admin Portal and checking that it works as expected.
Check the status of the APIManager objects and get the YAML content by running the following command. <myapimanager> represents the name of your APIManager:
oc get apimanager <myapimanager> -o yaml
$ oc get apimanager <myapimanager> -o yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow The new annotations with the values should be as follows:
apps.3scale.net/apimanager-threescale-version: "2.12" apps.3scale.net/threescale-operator-version: "0.9.0"
apps.3scale.net/apimanager-threescale-version: "2.12" apps.3scale.net/threescale-operator-version: "0.9.0"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
After you have performed all steps, 3scale upgrade from 2.11 to 2.12 in an operator-based deployment is complete.
3.2.1. Upgrading the external MySQL version to 8.0 Copy linkLink copied to clipboard!
If your 3scale deployment has the external databases mode enabled and uses MySQL 8.0, set the authentication plugin to mysql_native_password for 3scale 2.12.
Add the following to the MySQL configuration file.
[mysqld] default_authentication_plugin=mysql_native_password
[mysqld]
default_authentication_plugin=mysql_native_password
3.2.2. Removing unused MessageBus variables Copy linkLink copied to clipboard!
If your 3scale deployment has the external databases mode enabled, you must manually remove the MESSAGE_BUS_* field from the system-redis secret.
Remove
MESSAGE_BUS_*fields from thesystem-redissecret. If the secret is not managed by external controller, update manually using the following commands:oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_URL'}]" oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_NAMESPACE'}]" oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_SENTINEL_HOSTS'}]" oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_SENTINEL_ROLE'}]"$ oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_URL'}]" $ oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_NAMESPACE'}]" $ oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_SENTINEL_HOSTS'}]" $ oc patch secret/system-redis --type=json -p "[{'op': 'remove', 'path': '/data/MESSAGE_BUS_SENTINEL_ROLE'}]"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify
MESSAGE_BUS_*fields do not exist. The following command should return empty:oc get secret system-redis -o yaml | grep MESSAGE_BUS
$ oc get secret system-redis -o yaml | grep MESSAGE_BUSCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2.3. Upgrading with external system-database using PostgreSQL 10 and PostgreSQL 13 Copy linkLink copied to clipboard!
This upgrade supports external system-database using PostgreSQL 10. You should complete your 3scale upgrade first, then upgrade to PostgreSQL 13.
Chapter 4. APIcast operator-based upgrade guide: from 2.11 to 2.12 Copy linkLink copied to clipboard!
Upgrading APIcast from 2.11 to 2.12 in an operator-based installation helps you use the APIcast API gateway to integrate your internal and external API services with 3scale.
In order to understand the required conditions and procedure, read the entire upgrade guide before applying the listed steps. The upgrade process disrupts the provision of the service until the procedure finishes. Due to this disruption, make sure to have a maintenance window.
4.1. Prerequisites to perform the upgrade Copy linkLink copied to clipboard!
To perform the upgrade of APIcast from 2.11 to 2.12 in an operator-based installation, the following required prerequisites must already be in place:
- An OpenShift Container Platform (OCP) 4.6, 4.8, 4.9, or 4.10 cluster with administrator access.
- APIcast 2.11 previously deployed via the APIcast operator.
Make sure the latest CSV of the
threescale-2.11channel is in use. To check it:- If the approval setting for the subscription is automatic you should already be in the latest CSV version of the channel.
- If the approval setting for the subscription is manual make sure you approve all pending InstallPlans and have the latest CSV version.
- Keep in mind if there is a pending install plan, there might be more pending install plans, which will only be shown after the existing pending plan has been installed.
4.2. Upgrading APIcast from 2.11 to 2.12 in an operator-based installation Copy linkLink copied to clipboard!
Upgrade APIcast from 2.11 to 2.12 in an operator-based installation so that APIcast can function as the API gateway in your 3scale installation.
Procedure
- Log in to the OCP console using the account with administrator privileges.
- Select the project where the APIcast operator has been deployed.
- Click Operators > Installed Operators.
- In Subscription > Channel, select Red Hat Integration - 3scale APIcast gateway.
Edit the channel of the subscription by selecting the threescale-2.12 channel and save the changes.
This will start the upgrade process.
Query the pods status on the project until you see all the new versions are running and ready without errors:
oc get pods
$ oc get podsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note- The pods might have temporary errors during the upgrade process.
- The time required to upgrade pods can vary from 5-10 minutes.
Check the status of the APIcast objects and get the YAML content by running the following command:
oc get apicast <myapicast> -o yaml
$ oc get apicast <myapicast> -o yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow The new annotations with the values should be as follows:
apicast.apps.3scale.net/operator-version: “0.6.0”
apicast.apps.3scale.net/operator-version: “0.6.0”Copy to Clipboard Copied! Toggle word wrap Toggle overflow
After you have performed all the listed steps, APIcast upgrade from 2.11 to 2.12 in an operator-based deployment is now complete.