Pod fails to run using UBI image in RHOCP 4

Solution Verified - Updated -

Environment

  • Red Hat OpenShift Container Platform 4.x

Issue

  • Pod created with UBI image goes into CrashLoopBackOff state.
$ oc get pods
NAME              READY   STATUS             RESTARTS     AGE
pod/ubitest-xxx   0/1     CrashLoopBackOff   1 (6s ago)   10s

Resolution

  • The pod goes into CrashLoopBackOff state when no parameter/option is passed along the command to create the deployment.

  • The command needs a parameter to run the pod with UBI image.

  • For Example:
    Deployment with UBI image by passing a sleep parameter.

$ oc create deployment ubitest --image=registry.access.redhat.com/ubi8/ubi:latest -- sleep infinity

$ oc get pods
NAME                               READY   STATUS    RESTARTS   AGE
ingress-operator-f9b89c8d6-zj7qz   2/2     Running   0          35d
ubitest-658c7d7f5b-qfk7f           1/1     Running   0          10m

Root Cause

  • UBI image is very small which makes it hard to test a demon unless any parameter is added along the command which is creating the pod using this image.

Diagnostic Steps

  • Create a deployment using ubi image
$ oc create deployment ubitest --image=registry.access.redhat.com/ubi8/ubi:8.8-1032.1692772289
  • Check the status of the pods
$ oc get pods
NAME                       READY   STATUS             RESTARTS      AGE
ubitest-5b6ccb8b99-dv8sz   0/1     CrashLoopBackOff   3 (30s ago)   73s

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments