This blog looks at troubleshooting a problematic OpenShift Container Platform update.

If you're having trouble with an OpenShift update, you should start by inspecting the Cluster Version Operator (CVO), which automates the update process. You can check the CVO to see how the update process is progressing and/or how individual components respond to the update request.

Gathering data on the cluster version is the first step. You can do this with the following command:

$ oc get clusterversion 
version   4.12.0    True        False         76m     Cluster version is 4.12.0

$ oc get clusterversion -o yaml


Run oc get clusterversion -o yaml multiple times during the update process. Update status messages will be displayed in the YAML output.

Inspecting common update issues

There are several potential causes for an update to be problematic. This article covers some of the common issues and a few resources to remember while debugging.

For instance, look at the status of the nodes in your cluster by running the following command:

$ oc get nodes
NAME                           STATUS   ROLES                  AGE   VERSION
ip-1-128-45.ec2.internal    Ready    control-plane,master   97m   v1.25.4+77bec7a
ip-1-150-124.ec2.internal   Ready    control-plane,master   97m   v1.25.4+77bec7a
ip-1-167-126.ec2.internal   Ready    worker                 90m   v1.25.4+77bec7a
ip-1-186-97.ec2.internal    Ready    worker                 90m   v1.25.4+77bec7a
ip-1-212-120.ec2.internal   Ready    control-plane,master   97m   v1.25.4+77bec7a


Sometimes nodes are not Ready, which can be due to a lack of resources on a node or a problem with kube-proxy or kubelet. These can all cause issues during an update.

Check the Cluster Operator status and make sure that all Operators are available. If they are not, check the logs of the operator pods for further debugging of the issue. Sometimes the Operators are degraded, but that does not mean the updates have failed or are not working. Run oc get clusteroperator to see the status of the Cluster Operators. For example, the etcd operator shown below is degraded:

# for example, below we can see etcd is Degraded
$ oc get clusteroperator

NAME                                       VERSION   AVAILABLE   PROGRESSING   DEGRADED   SINCE   MESSAGE
console                                    4.12.0    True        False         False      86m
control-plane-machine-set                  4.12.0    True        False         False      96m
dns                                        4.12.0    True        False         False      97m
etcd                                       4.12.0    False       False         True       25m <----
image-registry                             4.12.0    True        False         False      91m
kube-apiserver                             4.12.0    True        False         False      86m
kube-controller-manager                    4.12.0    True        False         False      94m
kube-scheduler                             4.12.0    True        False         False      94m
kube-storage-version-migrator              4.12.0    True        False         False      98m
machine-api                                4.12.0    True        False         False      93m
machine-approver                           4.12.0    True        False         False      97m
machine-config                             4.12.0    True        False         False      96m
network                                    4.12.0    True        False         False      100m
node-tuning                                4.12.0    True        False         False      97m
openshift-apiserver                        4.12.0    True        False         False      93m
openshift-controller-manager               4.12.0    True        False         False      93m
operator-lifecycle-manager                 4.12.0    True        False         False      97m
operator-lifecycle-manager-catalog         4.12.0    True        False         False      98m
operator-lifecycle-manager-packageserver   4.12.0    True        False         False      92m
service-ca                                 4.12.0    True        False         False      98m
storage                                    4.12.0    True        False         False      97m


You can also check if any MachineConfigPools (MCP) are paused. An MCP associates MachineConfigs with Nodes. Pausing an MCP prevents the MachineConfigOperator (MCO) from updating the nodes associated with the MCP.

$ oc get mcp <pool-id> -ojsonpath='{.spec.pasused}' 
$ oc get mcp <pool-id> -o yaml | yq '.spec.paused'


Sometimes, the MCP is paused for an EUS-to-EUS Update or Canary update. If neither is underway, then unpause the MCP with the following command:

$ oc patch mcp <pool-id> -p '{"spec": {"paused": false}}' --type=merge


The  maxUnavailable is another parameter in MachineConfigPool (MCP) that must be configured properly. This parameter allows users to define the maximum number or percentage of machines that can be unavailable simultaneously during the update process. This setting controls the number of unavailable machines that can occur during the update process of a MachineConfig. When updates to a MachineConfig need to be applied across the cluster, they are rolled out incrementally to avoid service disruptions. During this update process, some machines may become unavailable temporarily as the new configuration is applied. The maxUnavailable parameter verifies enough machines are available to handle the cluster's workload.

Check whether the cluster uses Pod Disruption Budgets (PDB). A PDB specifies the minimum number of replicas that must be up at a time. If they are used in the cluster, be sure they don't stop the pod from draining. Look at the Minavailable and MaxAvailable values to be sure that a Minavailable=1 configuration is not stopping the pod from draining.

$ oc get pdb
$ oc get pdb -n <namespace>

# get all pdb with Minavailable=1

$ oc get pdb -A -o json | jq -r '.items[] | select(.spec.minAvailable >= 1)  | [ , .metadata.namespace, .spec.minAvailable]


If pods take longer to drain from the nodes, the update can take longer, or updates may be paused until the disruption is resolved.

Refer to the OpenShift documentation to calculate an approximate update time.

Use the following commands to identify the nodes that take more time to drain. If possible, you can force drain the node.

# find the node which is taking longer to drain
$ oc get co machine-config -o yaml
# see which nodes are cordoned
$ oc get nodes
# find the machine-config-daemon which is running on that cordoned node
$ oc get pods -n openshift-machine-config-operator -o wide
# look in that container's logs to check why the drain could be stalled - like unable to unmount a PVC or an issue with a PDB
$ oc logs machine-config-daemon-zhd4l -c machine-config-daemon -n openshift-machine-config-operator
# check nodes with more CPU and memory use
$ oc adm top nodes
# find the pods running in those nodes.
$ oc get pods -o wide | grep <node>

# check the logs for the node
# if it is allowed, then force drain the node.
Cordon the node to avoid workloads from getting scheduled.Drain and then uncordon the node.
$ oc adm cordon <node>
$ oc adm drain <node> --grace-period=20 --ignore-daemonsets --force=true --delete-emptydir-data --timeout=60s
$ oc adm uncordon <node>


Checking for Conditional updates

Since OpenShift 4.10, Conditional updates provide guidance on update paths that are not recommended. Suppose you want to update to a new release like 4.12.102 to fix a security CVE. If 4.12.102 is not recommended for your cluster, then check whether that version is a Conditional update. Use the following commands to do this:

$ oc adm upgrade
Cluster version is 4.12.0
Upstream is unset, so the cluster will use an appropriate default.
Channel: stable-4.12 (available channels: candidate-4.12, candidate-4.13, eus-4.12, fast-4.12, fast-4.13, stable-4.12)
Recommended updates:  <----- will also include 'Recommended=True'CONDITIONAL UPDATES


Additional updates which are not recommended based on your cluster configuration are available, to view those re-run the command with --include-not-recommended.


Each Conditional update version is available with a short bug description. The cluster admin needs to decide whether the bug is minor enough to proceed with the update.

$ oc adm upgrade --include-not-recommended
Cluster version is 4.12.0
Upstream is unset, so the cluster will use an appropriate default.
Channel: stable-4.12 (available channels: candidate-4.12, candidate-4.13, eus-4.12, fast-4.12, fast-4.13, stable-4.12)
Recommended updates:


Supported but not recommended updates: <----- not recommended CONDITIONAL UPDATES
  Version: 4.12.102
  Recommended: False
  Reason: LeakedMachineConfigBlocksMCO
  Message: Machine Config Operator stalls when encountering orphaned KubeletConfig or ContainerRuntimeConfig resources.
  Version: 4.12.5
  Recommended: False
  Reason: LeakedMachineConfigBlocksMCO
  Message: Machine Config Operator stalls when encountering orphaned KubeletConfig or ContainerRuntimeConfig resources.


Note: conditional update versions are fully supported.

It is possible that the update issue is unrelated to the update and is something else, like a hardware version or firmware incompatibility issue. In this case, the cluster admin can seek help from Red Hat Support by opening a support case. It is helpful to provide debugging information about your cluster to Red Hat Support when opening a support case.

The oc adm must-gather CLI command collects the information into a directory from your cluster that is needed for debugging issues. Create a compressed file from the must-gather directory and attach the compressed file to your support case on the Red Hat Customer Portal. You can find more information on using the oc adm must-gather command in the OpenShift documentation.


openshift, updates

< Back to the blog