Upgrading API Connect on Kubernetes
Upgrade your API Connect subsystems to a newer version on Kubernetes.
Before you begin
About this task
- To ensure operator compatibility, upgrade the API Connect management subsystem first and the gateway subsystem second. This requirement applies to all upgrade scenarios.
- The gateway subsystem remains available during the upgrade of the management, portal, and analytics subsystems.
- If any subsystem database backups are running or are scheduled to run within a few hours, do not start the upgrade process.
- Do not perform maintenance tasks such as updating certificates, restoring subsystem databases from backup, or triggering subsystem database backups at any time while you are upgrading API Connect.
- Upgrading to v10.0.11.0 removes all existing scan records to align with the updated database schema. As a result, customers upgrading from 10.0.10.0 will lose all previous scan history. To preserve critical information, archive or export important scan results before starting the upgrade.
Procedure
- If you did not run the pre-upgrade health checks recently, run them now.
- If you have a two data center disaster recovery deployment, then upgrade the warm-standby data center
first. See the special steps for 2DCDR upgrades: Upgrading a 2DCDR deployment on Kubernetes and OpenShift from V10.0.9
- Apply the API Connect CRDs that you
downloaded and extracted in the pre-upgrade
steps:
kubectl apply --server-side --force-conflicts -f ibm-apiconnect-crds.yaml - Apply the new DataPower Operator YAML into the namespace where the DataPower operator is
running.
- Edit the
ibm-datapower.yamlfile and set the following properties:thenamespaceproperty to the namespace where you deployed the operator.- Set all instances of the
namespaceproperty to the namespace where you deployed the operator. - Set the
containers.imageproperty to the location of thedatapower-operatorimage, either uploaded to your own registry or pulled from a public registry.
- Set all instances of the
- Run the following command:
kubectl -n <namespace> apply -f ibm-datapower.yamlThe gateway CR goes to
Pendingstate when the operator is updated, and then changes toRunningafter installation of the API Connect operator in the next step.Troubleshooting: If your DataPower operator pod fails to start, see Troubleshooting upgrade.
- Edit the
- Upgrade cert-manager to version 1.18.2.
- Run the following command to back up the existing certificates and issuers to a file
called backup.yaml:
kubectl get --all-namespaces -oyaml issuer,clusterissuer,cert,secret > backup.yaml - Run the following command to verify the version of cert-manager that you are
upgrading:
- API Connect
10.0.5.4: verify that you are upgrading cert-manager
1.9.1:
kubectl get crds certificates.cert-manager.io -o jsonpath='{.metadata.labels.app\.kubernetes\.io\/version}' v1.9.1 - API Connect 10.0.5.5
or 10.0.7.0: verify that you are upgrading cert-manager
1.11.5:
kubectl get crds certificates.cert-manager.io -o jsonpath='{.metadata.labels.app\.kubernetes\.io\/version}' v1.11.5 - API Connect
10.0.5.6: verify that you are upgrading cert-manager
1.12.7:
kubectl get crds certificates.cert-manager.io -o jsonpath='{.metadata.labels.app\.kubernetes\.io\/version}' v1.12.7 - API Connect
10.0.5.7: verify that you are upgrading cert-manager
1.12.9:
kubectl get crds certificates.cert-manager.io -o jsonpath='{.metadata.labels.app\.kubernetes\.io\/version}' v1.12.9 - API Connect 10.0.5.8: no upgrade needed.
- API Connect
10.0.8.0: verify that you are upgrading cert-manager
1.12.10:
kubectl get crds certificates.cert-manager.io -o jsonpath='{.metadata.labels.app\.kubernetes\.io\/version}' v1.12.10 - API Connect
10.0.9.0: verify that you are upgrading cert-manager
1.12.13:
kubectl get crds certificates.cert-manager.io -o jsonpath='{.metadata.labels.app\.kubernetes\.io\/version}' v1.12.13 - API Connect
10.0.10.0: verify that you are upgrading cert-manager
1.17.2:
kubectl get crds certificates.cert-manager.io -o jsonpath='{.metadata.labels.app\.kubernetes\.io\/version}' v1.17.2
- API Connect
10.0.5.4: verify that you are upgrading cert-manager
1.9.1:
- Run the following command to upgrade cert-manager to version 1.18.2:
kubectl apply -f helper_files/cert-manager-1.18.2.yaml
- Run the following command to back up the existing certificates and issuers to a file
called backup.yaml:
- If you generated your internal certificates with the
custom-certs-internal.yaml file when you installed API Connect (following these
steps Generating custom certificates using cert-manager), then apply the new
custom-certs-internal.yaml file from your target release files and renew
db-server-certificate.Note: If you are not sure if API Connect was installed with custom-certs-internal.yaml, then check the follow these steps to confirm:- Check whether the management CR has a
customCertificatessection:kubectl -n <management namespace> get mgmt -o yaml | grep customCertificatesIf the management CR does not have this section, then custom-certs-internal.yaml was not used. If it does have this section, then continue to the next check.
- Check the issuer of the
management-servercertificate:kubectl -n <management namespace> describe secret management-server | grep issuer-nameIf the command returns:
then custom-certs-internal.yaml was used.cert-manager.io/issuer-name: ingress-issuer
- Edit the new custom-certs-internal.yaml file. Replace all
instances of
<namespace>and<site_name>with the values from the original custom-certs-internal.yaml file that you used during installation. - Apply the new custom-certs-internal.yaml file.
kubectl apply -f helper_files/custom-certs-internal.yaml - Renew
db-server-certificate.kubectl -n <management namespace> delete secret db-server-certificate
- Check whether the management CR has a
- Apply the new API Connect operator YAML
into the namespace where the API Connect operator is
running.
- For a single-namespace deployment:
- For a single-namespace deployment, update the configuration file by replacing each occurrence of
namespace: defaultwithnamespace: <namespace>. Replace<namespace>with the actual name of the namespace where you deployed API Connect.Note: If you are using Operator Lifecycle Manager (OLM), then skip this step. - Edit the
ibm-apiconnect.yamlfile and replace each occurrence ofREPLACE-DOCKER-REGISTRYwith the location of theapiconnectoperator images, either uploaded to your own registry or pulled from a public registry. This includes replacing theREPLACE-DOCKER-REGISTRYplaceholder in the following locations:imageproperties for containers.- Any other instances of
REPLACE-DOCKER-REGISTRYin the file, regardless of whether they are part of animagekey.
- Run the following command:
kubectl -n <namespace> apply -f ibm-apiconnect.yaml
- For a single-namespace deployment, update the configuration file by replacing each occurrence of
- For a multi-namespace deployment:
- Edit the
ibm-apiconnect-distributed.yamlfile and replace each occurrence of$OPERATOR_NAMESPACEwith the namespace for the deployment. - Also in
ibm-apiconnect-distributed.yaml, set the values of thecontainers.imageproperties. Replace the placeholder valuesREPLACE-DOCKER-REGISTRYwith the docker registry host location of the API Connect operator image (either uploaded to own registry or pulled from public registry). - Install
ibm-apiconnect-distributed.yamlwith the following command:kubectl apply -f ibm-apiconnect-distributed.yaml
- Edit the
- For a single-namespace deployment:
- Verify that the
ibm-datapower-operatorand theibm-apiconnectoperators are restarted. - Ensure that the
apiconnectoperator re-created the necessary microservices:kubectl get apic -n <namespace>Do not proceed to upgrade the API Connect subsytems until the operator upgrade is complete.
Note: If analytics backups are configured, then after the API Connect operator is upgraded, the analytics CR reports a status ofBlockeduntil the analytics subsystem is upgraded to V10.0.8. With top-level CR deployments, theapiconnectclusterCR reportsPendinguntil the analytics CR is no longerBlocked. For more information, see Analytics backup changes. - Upgrade the API Connect subsystems:
- Verify that the upgraded subsystems report as
Runningand theRECONCILED VERSIONdisplays the new version of API Connect.Run the following command:
kubectl get apic --all-namespacesExample response:
NAME READY STATUS VERSION RECONCILED VERSION AGE analyticscluster.analytics.apiconnect.ibm.com/analytics 8/8 Running 10.0.11.0 10.0.11.0-1074 121m NAME PHASE READY SUMMARY VERSION AGE datapowerservice.datapower.ibm.com/gw1 Running True StatefulSet replicas ready: 1/1 10.0.11.0 100m NAME PHASE LAST EVENT WORK PENDING WORK IN-PROGRESS AGE datapowermonitor.datapower.ibm.com/gw1 Running false false 100m NAME READY STATUS VERSION RECONCILED VERSION AGE gatewaycluster.gateway.apiconnect.ibm.com/gw1 2/2 Running 10.0.11.0 10.0.11.0-1074 100m NAME READY STATUS VERSION RECONCILED VERSION AGE managementcluster.management.apiconnect.ibm.com/m1 16/16 Running 10.0.11.0 10.0.11.0-1074 162m NAME READY STATUS VERSION RECONCILED VERSION AGE portalcluster.portal.apiconnect.ibm.com/portal 3/3 Running 10.0.11.0 10.0.11.0-1074 139mImportant: If you need to restart the deployment, wait until all portal sites complete the upgrade.After the portal subsystem upgrade is complete, each portal site is upgraded. You can monitor the site upgrade progress from theMESSAGEcolumn in theoc get ptloutput. You can still use the portal while sites are upgrading, although a maintenance page is shown for any sites that are being upgraded. When the site upgrades are complete, theoc get ptloutput shows how many sites the portal is serving:NAME READY STATUS VERSION RECONCILED VERSION MESSAGE AGE portal 3/3 Running <version> <version> Serving 2 sites 22hOn two data center disaster recovery deployments, the sites are not upgraded until both data centers are upgraded.
- Optional: If upgrading from 10.0.5.x or
10.0.7.0: Provide a custom endpoint for the Consumer Catalog.
Skip this step if you are upgrading from 10.0.8.0 or later.
Beginning with version 10.0.8.0, API Connect includes the Consumer Catalog feature. If your deployment uses cert-manager, then during the upgrade from 10.0.5.x or 10.0.7.0, a new endpoint is added to the management CR for the Custom Catalog.
The following definition is generated and automatically added to the management CR during the upgrade, using a certificate from cert-manager:
consumerCatalogEndpoint: annotations: cert-manager.io/issuer: ingress-issuer hosts: - name: consumer-catalog.<domain> secretName: <name>-consumer-catalog-endpoint- Make the following optional changes to the endpoint definition in the CR:
- Change the
nameto a host name of your own choosing. - Specify a custom cert-manager certificate.
- Change the
- Run the following command to save and apply the CR:
wq
- Make the following optional changes to the endpoint definition in the CR:
- Optional: For the optional components API Connect Toolkit and API Connect Local Test Environment, install the latest version of each after you complete the upgrade of the subsystems.