Interview Prep/Jenkins/Plugins, JCasC & Kubernetes agents

A `container('kaniko')` step fails: `sh: can't access tty; job control turned off` then `/busybox/sh: kubectl: not found`, or `ERROR: Process exited immediately after creation`

IntermediateTroubleshootingPlugins, JCasC & Kubernetes agents
Answer

Likely causes → The container's main process exits (no sleep/cat command), or a distroless image lacks a shell; the wrong container was targeted.

Diagnose → Check pod status (container terminated), the image entrypoint, and the container name in container().

Fix → Use gcr.io/kaniko-project/executor:debug (includes busybox shell) with command: ["sleep"], args: ["infinity"]; target the correct container for each tool.

Prevent → Reusable templates with a known-good command for each tool image.

All Jenkins questions Roadmap: Jenkins

More on Plugins, JCasC & Kubernetes agents