Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 5. Preparing to update to OpenShift Container Platform 4.12
OpenShift Container Platform 4.12 uses Kubernetes 1.25, which removed several deprecated APIs.
A cluster administrator must provide a manual acknowledgment before the cluster can be updated from OpenShift Container Platform 4.11 to 4.12. This is to help prevent issues after upgrading to OpenShift Container Platform 4.12, 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.11 cluster to 4.12, you must provide the administrator acknowledgment.
5.1. Removed Kubernetes APIs Link kopierenLink in die Zwischenablage kopiert!
OpenShift Container Platform 4.12 uses Kubernetes 1.25, which removed the following deprecated APIs. You must migrate manifests and API clients to use the appropriate API version. For more information about migrating removed APIs, see the Kubernetes documentation.
| Resource | Removed API | Migrate to | Notable changes |
|---|---|---|---|
|
|
|
| No |
|
|
|
| |
|
|
|
| |
|
|
|
| No |
|
|
|
| |
|
|
| ||
|
|
|
| No |
- For more information about pod security admission in OpenShift Container Platform, see Understanding and managing pod security admission.
5.2. Evaluating your cluster for removed APIs Link kopierenLink in die Zwischenablage kopiert!
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.
5.2.1. Reviewing alerts to identify uses of removed APIs Link kopierenLink in die Zwischenablage kopiert!
Two alerts fire when an API is in use that will be removed in the next release:
-
- for APIs that will be removed in the next OpenShift Container Platform release.
APIRemovedInNextReleaseInUse -
- for APIs that will be removed in the next OpenShift Container Platform Extended Update Support (EUS) release.
APIRemovedInNextEUSReleaseInUse
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
APIRequestCount
5.2.2. Using APIRequestCount to identify uses of removed APIs Link kopierenLink in die Zwischenablage kopiert!
You can use the
APIRequestCount
Prerequisites
-
You must have access to the cluster as a user with the role.
cluster-admin
Procedure
Run the following command and examine the
column of the output to identify the removed APIs that are currently in use:REMOVEDINRELEASE$ oc get apirequestcountsExample output
NAME REMOVEDINRELEASE REQUESTSINCURRENTHOUR REQUESTSINLAST24H ... poddisruptionbudgets.v1.policy 391 8114 poddisruptionbudgets.v1beta1.policy 1.25 2 23 podmonitors.v1.monitoring.coreos.com 3 70 podnetworkconnectivitychecks.v1alpha1.controlplane.operator.openshift.io 612 11748 pods.v1 1531 38634 podsecuritypolicies.v1beta1.policy 1.25 3 39 podtemplates.v1 2 79 preprovisioningimages.v1alpha1.metal3.io 2 39 priorityclasses.v1.scheduling.k8s.io 12 248 prioritylevelconfigurations.v1beta1.flowcontrol.apiserver.k8s.io 1.26 3 86 ...ImportantYou can safely ignore the following entries that appear in the results:
-
The and the
system:serviceaccount:kube-system:generic-garbage-collectorusers might appear in the results because these services invoke all registered APIs when searching for resources to remove.system:serviceaccount:kube-system:namespace-controller -
The and
system:kube-controller-managerusers might appear in the results because they walk through all resources while enforcing various policies.system:cluster-policy-controller
You can also use
to filter the results:-o jsonpath$ oc get apirequestcounts -o jsonpath='{range .items[?(@.status.removedInRelease!="")]}{.status.removedInRelease}{"\t"}{.metadata.name}{"\n"}{end}'Example output
1.26 flowschemas.v1beta1.flowcontrol.apiserver.k8s.io 1.26 horizontalpodautoscalers.v2beta2.autoscaling 1.25 poddisruptionbudgets.v1beta1.policy 1.25 podsecuritypolicies.v1beta1.policy 1.26 prioritylevelconfigurations.v1beta1.flowcontrol.apiserver.k8s.io-
The
5.2.3. Using APIRequestCount to identify which workloads are using the removed APIs Link kopierenLink in die Zwischenablage kopiert!
You can examine the
APIRequestCount
Prerequisites
-
You must have access to the cluster as a user with the role.
cluster-admin
Procedure
Run the following command and examine the
andusernamefields to help identify the workloads that are using the API:userAgent$ oc get apirequestcounts <resource>.<version>.<group> -o yamlFor example:
$ oc get apirequestcounts poddisruptionbudgets.v1beta1.policy -o yamlYou can also use
to extract the-o jsonpathandusernamevalues from anuserAgentresource:APIRequestCount$ oc get apirequestcounts poddisruptionbudgets.v1beta1.policy \ -o jsonpath='{range .status.currentHour..byUser[*]}{..byVerb[*].verb}{","}{.username}{","}{.userAgent}{"\n"}{end}' \ | sort -k 2 -t, -u | column -t -s, -NVERBS,USERNAME,USERAGENTExample output
VERBS USERNAME USERAGENT watch system:serviceaccount:openshift-operators:3scale-operator manager/v0.0.0 watch system:serviceaccount:openshift-operators:datadog-operator-controller-manager manager/v0.0.0
5.3. Migrating instances of removed APIs Link kopierenLink in die Zwischenablage kopiert!
For information about how to migrate removed Kubernetes APIs, see the Deprecated API Migration Guide in the Kubernetes documentation.
5.4. Providing the administrator acknowledgment Link kopierenLink in die Zwischenablage kopiert!
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.11 to 4.12.
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 role.
cluster-admin
Procedure
Run the following command to acknowledge that you have completed the evaluation and your cluster is ready for the Kubernetes API removals in OpenShift Container Platform 4.12:
$ oc -n openshift-config patch cm admin-acks --patch '{"data":{"ack-4.11-kube-1.25-api-removals-in-4.12":"true"}}' --type=merge