How to fix pods going to ImagePullBackOff in offline environment with message "failed to pull and unpack image: tls: failed to verify certificate"
Issue Description
Pods are going to ImagePullBackOff in offline environment with the message "failed to pull and unpack image: tls: failed to verify certificate"
Root Cause
The certificate is being verified in the registry while pulling the image - disable the certificate verification.
Resolution
- Check the status of the pod:
# kubectl get pods -A
- For the pod in ImagePullBackOff status, describe the pod:
# kubectl -n describe pod
- In describe pod, you should see a similar error:
- Disable the certificate verification in /etc/rancher/rke2/registries.yaml file by adding the parameter "insecure_skip_verify" to true in tls section:
- In a few minutes, the pod status should change accordingly.