Try some solutions:
Example for resources in your Kubernetes manifest: yaml
resources: requests: memory: "8Gi" cpu: "4" limits: memory: "16Gi" cpu: "8"
Verify Disk Space Ensure adequate disk space is available on the host where the agent runs. Docker builds can generate large temporary files. Use a cleanup strategy for unused images and containers: bash Copy code docker system prune -a --volumes
Check Agent Pod Health Checks Review the livenessProbe and readinessProbe settings for the pod. Misconfigured probes can cause unnecessary restarts. Example: yaml Copy code livenessProbe: httpGet: path: /healthz port: 8080 initialDelaySeconds: 10 periodSeconds: 10
Increase Pipeline Timeout If the pipeline times out before the build completes, increase the timeout in your CI/CD tool settings.
Enable Docker Build Cache Caching can reduce the load on the agent during builds. Use the --cache-from flag when building Docker images: bash Copy code docker build --cache-from=type=local,src=/path/to/cache -t my-image .