このコンテンツは選択した言語では利用できません。
Chapter 1. Upgrade 3scale API Management 2.2 to 2.3
The 2.3 version of 3scale API Management only updates the APIcast component of the product.
Perform the steps in this document to upgrade the APIcast to version 2.3.
1.1. Prerequisites リンクのコピーリンクがクリップボードにコピーされました!
- You must be running 3scale On-Premises 2.2
- OpenShift CLI
Red Hat recommends that you establish a maintenance window when performing the upgrade because this process may cause a disruption in service.
1.2. Select the Project リンクのコピーリンクがクリップボードにコピーされました!
From a terminal session, log in to your OpenShift cluster using the following command. Here, <YOUR_OPENSHIFT_CLUSTER> is the URL of your OpenShift cluster.
oc login https://<YOUR_OPENSHIFT_CLUSTER>:8443
oc login https://<YOUR_OPENSHIFT_CLUSTER>:8443
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Select the project you want to upgrade using the following command. Here, <3scale-22-project> is the name of your project.
oc project <3scale-22-project>
oc project <3scale-22-project>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.3. Gather the Needed Values リンクのコピーリンクがクリップボードにコピーされました!
Gather the following values from the APIcast component of your current 2.2 deployment:
- APICAST_MANAGEMENT_API
- OPENSSL_VERIFY
- APICAST_RESPONSE_CODES
Export these values from the current deployment into the active shell.
export `oc env dc/apicast-production --list | grep -E '^(APICAST_MANAGEMENT_API|OPENSSL_VERIFY|APICAST_RESPONSE_CODES)=' | tr "\n" ' ' `
export `oc env dc/apicast-production --list | grep -E '^(APICAST_MANAGEMENT_API|OPENSSL_VERIFY|APICAST_RESPONSE_CODES)=' | tr "\n" ' ' `
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optionally, to query individual values from the OpenShift CLI, run the following
oc get
command, where<variable_name>
is the name of the variable you want to query.oc get "-o=custom-columns=NAMES:.spec.template.spec.containers[0].env[?(.name==\"<variable_name>\")].value" dc/apicast-production
oc get "-o=custom-columns=NAMES:.spec.template.spec.containers[0].env[?(.name==\"<variable_name>\")].value" dc/apicast-production
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the value for the new version of the 3scale API Management release.
export AMP_RELEASE=2.3.0
export AMP_RELEASE=2.3.0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the values for the new environment variables.
export AMP_APICAST_IMAGE=registry.access.redhat.com/3scale-amp23/apicast-gateway
export AMP_APICAST_IMAGE=registry.access.redhat.com/3scale-amp23/apicast-gateway
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
APICAST_ACCESS_TOKEN
environment variable with the valid Access Token for Account Management API. You can extract it from theTHREESCALE_PORTAL_ENDPOINT
environment variable.oc env dc/apicast-production --list | grep THREESCALE_PORTAL_ENDPOINT
oc env dc/apicast-production --list | grep THREESCALE_PORTAL_ENDPOINT
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This will return the following output:
THREESCALE_PORTAL_ENDPOINT=http://<ACCESS_TOKEN>@system-master:3000/master/api/proxy/configs
THREESCALE_PORTAL_ENDPOINT=http://<ACCESS_TOKEN>@system-master:3000/master/api/proxy/configs
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Export the
<ACCESS_TOKEN>
value to the environment variableAPICAST_ACCESS_TOKEN
.export APICAST_ACCESS_TOKEN=<ACCESS_TOKEN>
export APICAST_ACCESS_TOKEN=<ACCESS_TOKEN>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that the necessary values are exported to the active shell.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.4. Patch APIcast リンクのコピーリンクがクリップボードにコピーされました!
To patch the
apicast-staging
deployment configuration, run the followingoc patch
command.Copy to Clipboard Copied! Toggle word wrap Toggle overflow To patch the
apicast-production
deployment configuration, run the followingoc patch
command.Copy to Clipboard Copied! Toggle word wrap Toggle overflow To patch the
amp-apicast
image stream, run the followingoc patch
command.Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Set
importPolicy.insecure
totrue
if the server is allowed to bypass certificate verification or connect directly over HTTP during image import.
1.5. Verify Upgrade リンクのコピーリンクがクリップボードにコピーされました!
After you have performed the upgrade procedure, verify the success of the upgrade by making test API calls to the updated APIcast.
It may take some time for the redeployment operations to complete in OpenShift.
1.6. Upgrade APIcast in OpenShift リンクのコピーリンクがクリップボードにコピーされました!
If you deployed APIcast outside of the complete 3scale API Management on-premises installation using the apicast.yml
OpenShift template, take the following steps to upgrade your deployment. The steps assume that the name of the deployment configuration is apicast
, which is the default value in the apicast.yml
template of the 3scale version 2.2. If you used a different name, you must adjust the commands accordingly.
Update the container image
oc patch dc/apicast --patch='{"spec":{"template":{"spec":{"containers":[{"name": "apicast", "image":"registry.access.redhat.com/3scale-amp23/apicast-gateway"}]}}}}'
oc patch dc/apicast --patch='{"spec":{"template":{"spec":{"containers":[{"name": "apicast", "image":"registry.access.redhat.com/3scale-amp23/apicast-gateway"}]}}}}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the port definition for port
9421
used for Prometheus metricsoc patch dc/apicast --patch='{"spec": {"template": {"spec": {"containers": [{"name": "apicast","ports": [{"name": "metrics", "containerPort": 9421, "protocol": "TCP"}]}]}}}}'
oc patch dc/apicast --patch='{"spec": {"template": {"spec": {"containers": [{"name": "apicast","ports": [{"name": "metrics", "containerPort": 9421, "protocol": "TCP"}]}]}}}}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add Prometheus annotations
oc patch dc/apicast --patch='{"spec": {"template": {"metadata": {"annotations": {"prometheus.io/scrape": "true", "prometheus.io/port": "9421"}}}}}'
oc patch dc/apicast --patch='{"spec": {"template": {"metadata": {"annotations": {"prometheus.io/scrape": "true", "prometheus.io/port": "9421"}}}}}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remove the
APICAST_WORKERS
environment variableoc env dc/apicast APICAST_WORKERS-
oc env dc/apicast APICAST_WORKERS-
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
APICAST_WORKERS
allows specifying the value for the directive worker_processes
. By default, APIcast uses the value auto
, which triggers auto-detection of the best number of workers, when running in OpenShift or Kubernetes environments. Thus, it is recommended not set the APICAST_WORKERS
value explicitly and let APIcast perform auto-detection.
The APICAST_WORKERS
parameter is no longer present in the apicast.yml
OpenShift template. In case you are using scripts that deploy the template with APICAST_WORKERS
parameter, make sure you remove this parameter from the scripts, otherwise the deployment will fail with the following error: error: unexpected parameter name "APICAST_WORKERS"