In a Tanzu Kubernetes Grid (TKGm) 2.5.1 environment, the RabbitMQ cluster pods were stuck in a NotReady state. The pods were unable to pull the required container image, resulting in ImagePullBackOff errors. This blocked successful deployment of the RabbitMQ cluster.
The root cause was an improperly configured imagePullSecret. Although the secret was present, it either contained an incorrect or missing authentication token. This resulted in the following error from the kubelet:
failed to authorize: failed to fetch oauth token: unexpected status from GET request ... 401
This indicates that the registry authentication failed when Kubernetes attempted to pull the image from:
rabbitmq-kubernetes.packages.broadcom.com/tanzu-rabbitmq-package-repo
To resolve the issue, the imagePullSecret was corrected to include proper authentication details, including the "auth" field (base64 encoded string of username:password). The corrected secret looks like the following: