60 lines
1.8 KiB
Plaintext
60 lines
1.8 KiB
Plaintext
# skill_digest: 651e129c7e0478c097161a76655c9f54e3566f5510368426e68d88fbbceb77b9
|
|
Based on the debugging guide, here's how to systematically debug your ImagePullBackOff issue:
|
|
|
|
## Immediate Steps
|
|
|
|
**1. Find the failing pod and check events:**
|
|
|
|
```bash
|
|
# Find your PipelineRun
|
|
kubectl get pipelinerun -n <namespace>
|
|
|
|
# Get the failed TaskRun
|
|
kubectl get taskruns -l tekton.dev/pipelineRun=<pr-name> -n <namespace>
|
|
|
|
# Find the pod
|
|
kubectl get pods -l tekton.dev/taskRun=<tr-name> -n <namespace>
|
|
|
|
# Check pod events - this will show the ImagePullBackOff details
|
|
kubectl describe pod <pod-name> -n <namespace> | grep -A10 "Events"
|
|
```
|
|
|
|
**2. The events will reveal the specific image problem. Common causes:**
|
|
|
|
- **Typo in image name/tag** - Check the exact image reference
|
|
- **Image doesn't exist** - Verify the image exists in the registry
|
|
- **Registry authentication** - Missing or incorrect imagePullSecrets
|
|
- **Private registry access** - Network policies blocking access
|
|
|
|
**3. Verify the image:**
|
|
|
|
```bash
|
|
# Check what image is being pulled (look in TaskRun spec)
|
|
kubectl get taskrun <tr-name> -n <namespace> -o yaml | grep -i image
|
|
|
|
# Check ServiceAccount has imagePullSecrets
|
|
kubectl get sa <sa-name> -n <namespace> -o yaml
|
|
```
|
|
|
|
## Quick Fixes
|
|
|
|
**If it's an authentication issue:**
|
|
```bash
|
|
# Check if imagePullSecret exists
|
|
kubectl get secrets -n <namespace>
|
|
|
|
# Add imagePullSecret to ServiceAccount if missing
|
|
kubectl patch serviceaccount <sa-name> -n <namespace> -p '{"imagePullSecrets": [{"name": "<secret-name>"}]}'
|
|
```
|
|
|
|
**If it's a typo:**
|
|
- Correct the image name/tag in your Task or Pipeline definition
|
|
|
|
**If the image doesn't exist:**
|
|
- Build and push the image first
|
|
- Or use the correct tag that exists
|
|
|
|
Would you like me to help you run these commands? I'll need:
|
|
1. Your namespace name
|
|
2. The PipelineRun name (or we can list them to find it)
|