Common Issues
This section documents common issues I've encountered in my homelab and their solutions.
Container Registry Issues
Harbor Login Failures
Problem: docker login 192.168.1.206:30002 fails with authentication error
Solutions:
- Verify Harbor service is running:
- Check if the registry URL is accessible:
- Verify credentials in Harbor web UI first
Image Push Failures
Problem: docker push fails with "denied: requested access to the resource is denied"
Solutions:
- Ensure you're logged in:
docker login 192.168.1.206:30002 - Verify project exists in Harbor
- Check if user has push permissions to the project
- Ensure image is tagged correctly with full registry path
Kubernetes Deployment Issues
ImagePullBackOff Errors
Problem: Pods stuck in ImagePullBackOff state
Diagnosis:
Common Solutions:
- Missing Pull Secret:
kubectl create secret docker-registry harbor-secret \
--docker-server=192.168.1.206:30002 \
--docker-username=<username> \
--docker-password=<password> \
--namespace=<namespace>
-
Wrong Image Path: Verify the image exists in Harbor and path is correct
-
Network Issues: Check if cluster can reach Harbor registry
Persistent Volume Issues
Problem: Pods can't mount persistent volumes
Solutions:
- Check if PV and PVC are bound:
- Verify storage class exists:
- Check node permissions for local storage
Network Connectivity Issues
Service Not Accessible
Problem: Can't access services via NodePort or LoadBalancer
Diagnosis:
Solutions:
- NodePort Issues:
- Check if port is in valid NodePort range (30000-32767)
- Verify firewall rules allow the port
-
Test from within cluster first
-
LoadBalancer Issues:
- Verify LoadBalancer controller is installed
-
Check external IP assignment
-
Ingress Issues:
- Verify Ingress controller is running
- Check DNS resolution
- Validate TLS certificates if using HTTPS
Resource Constraints
Pod Evictions
Problem: Pods getting evicted due to resource pressure
Diagnosis:
Solutions:
- Increase resource limits in deployments
- Add more worker nodes
- Optimize resource requests
- Clean up unused images and containers
General Debugging Commands
Pod Issues
# Check pod status and events
kubectl get pods -n <namespace>
kubectl describe pod <pod-name> -n <namespace>
kubectl logs <pod-name> -n <namespace>
# Get shell access to pod
kubectl exec -it <pod-name> -n <namespace> -- /bin/bash
Service Issues
# Test service connectivity
kubectl port-forward svc/<service-name> <local-port>:<service-port> -n <namespace>
# Check endpoints
kubectl get endpoints <service-name> -n <namespace>
Network Debugging
# Run network debug pod
kubectl run tmp-shell --rm -i --tty --image nicolaka/netshoot -- /bin/bash
# DNS testing
nslookup <service-name>.<namespace>.svc.cluster.local
When All Else Fails
- Check cluster events:
kubectl get events --sort-by=.metadata.creationTimestamp - Restart problematic pods:
kubectl delete pod <pod-name> -n <namespace> - Check cluster logs: Look at kubelet and container runtime logs on nodes
- Community help: Search GitHub issues, Stack Overflow, or Kubernetes Slack
Prevention Tips
- Always use resource limits and requests
- Implement health checks (liveness/readiness probes)
- Monitor resource usage regularly
- Keep cluster and applications updated
- Use proper secrets management
- Document your configurations