This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Chapter 4. Preparing to update to OpenShift Container Platform 4.9
OpenShift Container Platform 4.9 uses Kubernetes 1.22, which removed a significant number of deprecated v1beta1
APIs.
OpenShift Container Platform 4.8.14 introduced a requirement that an administrator must provide a manual acknowledgment before the cluster can be updated from OpenShift Container Platform 4.8 to 4.9. This is to help prevent issues after upgrading to OpenShift Container Platform 4.9, where APIs that have been removed are still in use by workloads, tools, or other components running on or interacting with the cluster. Administrators must evaluate their cluster for any APIs in use that will be removed and migrate the affected components to use the appropriate new API version. After this evaluation and migration is complete, the administrator can provide the acknowledgment.
Before you can update your OpenShift Container Platform 4.8 cluster to 4.9, you must provide the administrator acknowledgment.
4.1. Removed Kubernetes APIs Copy linkLink copied to clipboard!
OpenShift Container Platform 4.9 uses Kubernetes 1.22, which removed the following deprecated v1beta1
APIs. You must migrate manifests and API clients to use the v1
API version. For more information about migrating removed APIs, see the Kubernetes documentation.
Resource | API | Notable changes |
---|---|---|
|
| No |
|
| |
|
| No |
|
| No |
|
| No |
|
| No |
|
| |
|
| |
|
| |
|
| No |
|
| No |
|
| |
|
| |
|
| No |
|
| No |
|
| No |
|
| |
|
| No |
|
| |
|
| No |
|
| |
|
| No |
4.2. Evaluating your cluster for removed APIs Copy linkLink copied to clipboard!
There are several methods to help administrators identify where APIs that will be removed are in use. However, OpenShift Container Platform cannot identify all instances, especially workloads that are idle or external tools that are used. It is the responsibility of the administrator to properly evaluate all workloads and other integrations for instances of removed APIs.
4.2.1. Reviewing alerts to identify uses of removed APIs Copy linkLink copied to clipboard!
Two alerts fire when an API is in use that will be removed in the next release:
-
APIRemovedInNextReleaseInUse
- for APIs that will be removed in the next OpenShift Container Platform release. -
APIRemovedInNextEUSReleaseInUse
- for APIs that will be removed in the next OpenShift Container Platform Extended Update Support (EUS) release.
If either of these alerts are firing in your cluster, review the alerts and take action to clear the alerts by migrating manifests and API clients to use the new API version.
Use the APIRequestCount
API to get more information about which APIs are in use and which workloads are using removed APIs, because the alerts do not provide this information. Additionally, some APIs might not trigger these alerts but are still captured by APIRequestCount
. The alerts are tuned to be less sensitive to avoid alerting fatigue in production systems.
4.2.2. Using APIRequestCount to identify uses of removed APIs Copy linkLink copied to clipboard!
You can use the APIRequestCount
API to track API requests and review whether any of them are using one of the removed APIs.
Prerequisites
-
You must have access to the cluster as a user with the
cluster-admin
role.
Procedure
Run the following command and examine the
REMOVEDINRELEASE
column of the output to identify the removed APIs that are currently in use:oc get apirequestcounts
$ oc get apirequestcounts
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantYou can safely ignore the following entries that appear in the results:
-
The
system:serviceaccount:kube-system:generic-garbage-collector
and thesystem:serviceaccount:kube-system:namespace-controller
users might appear in the results because these services invoke all registered APIs when searching for resources to remove. -
The
system:kube-controller-manager
andsystem:cluster-policy-controller
users might appear in the results because they walk through all resources while enforcing various policies.
You can also use
-o jsonpath
to filter the results:oc get apirequestcounts -o jsonpath='{range .items[?(@.status.removedInRelease!="")]}{.status.removedInRelease}{"\t"}{.metadata.name}{"\n"}{end}'
$ oc get apirequestcounts -o jsonpath='{range .items[?(@.status.removedInRelease!="")]}{.status.removedInRelease}{"\t"}{.metadata.name}{"\n"}{end}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
1.22 certificatesigningrequests.v1beta1.certificates.k8s.io 1.22 ingresses.v1beta1.extensions 1.22 ingresses.v1beta1.networking.k8s.io
1.22 certificatesigningrequests.v1beta1.certificates.k8s.io 1.22 ingresses.v1beta1.extensions 1.22 ingresses.v1beta1.networking.k8s.io
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
The
4.2.3. Using APIRequestCount to identify which workloads are using the removed APIs Copy linkLink copied to clipboard!
You can examine the APIRequestCount
resource for a given API version to help identify which workloads are using the API.
Prerequisites
-
You must have access to the cluster as a user with the
cluster-admin
role.
Procedure
Run the following command and examine the
username
anduserAgent
fields to help identify the workloads that are using the API:oc get apirequestcounts <resource>.<version>.<group> -o yaml
$ oc get apirequestcounts <resource>.<version>.<group> -o yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc get apirequestcounts ingresses.v1beta1.networking.k8s.io -o yaml
$ oc get apirequestcounts ingresses.v1beta1.networking.k8s.io -o yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can also use
-o jsonpath
to extract theusername
anduserAgent
values from anAPIRequestCount
resource:oc get apirequestcounts ingresses.v1beta1.networking.k8s.io \ -o jsonpath='{range .status.currentHour..byUser[*]}{..byVerb[*].verb}{","}{.username}{","}{.userAgent}{"\n"}{end}' \ | sort -k 2 -t, -u | column -t -s, -NVERBS,USERNAME,USERAGENT
$ oc get apirequestcounts ingresses.v1beta1.networking.k8s.io \ -o jsonpath='{range .status.currentHour..byUser[*]}{..byVerb[*].verb}{","}{.username}{","}{.userAgent}{"\n"}{end}' \ | sort -k 2 -t, -u | column -t -s, -NVERBS,USERNAME,USERAGENT
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
VERBS USERNAME USERAGENT watch bob oc/v4.8.11 watch system:kube-controller-manager cluster-policy-controller/v0.0.0
VERBS USERNAME USERAGENT watch bob oc/v4.8.11 watch system:kube-controller-manager cluster-policy-controller/v0.0.0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.3. Migrating instances of removed APIs Copy linkLink copied to clipboard!
For information on how to migrate removed Kubernetes APIs, see the Deprecated API Migration Guide in the Kubernetes documentation.
4.4. Providing the administrator acknowledgment Copy linkLink copied to clipboard!
After you have evaluated your cluster for any removed APIs and have migrated any removed APIs, you can acknowledge that your cluster is ready to upgrade from OpenShift Container Platform 4.8 to 4.9.
Be aware that all responsibility falls on the administrator to ensure that all uses of removed APIs have been resolved and migrated as necessary before providing this administrator acknowledgment. OpenShift Container Platform can assist with the evaluation, but cannot identify all possible uses of removed APIs, especially idle workloads or external tools.
Prerequisites
-
You must have access to the cluster as a user with the
cluster-admin
role.
Procedure
Run the following command to acknowledge that you have completed the evaluation and your cluster is ready to upgrade to OpenShift Container Platform 4.9:
oc -n openshift-config patch cm admin-acks --patch '{"data":{"ack-4.8-kube-1.22-api-removals-in-4.9":"true"}}' --type=merge
$ oc -n openshift-config patch cm admin-acks --patch '{"data":{"ack-4.8-kube-1.22-api-removals-in-4.9":"true"}}' --type=merge
Copy to Clipboard Copied! Toggle word wrap Toggle overflow