This setting controls how agent pods are retained after the Jenkins build completes. The following retention policies are provided:

  1. Never - always delete the agent pod.
  2. On Failure - keep the agent pod if it fails during the build.
  3. Evicted - keep the agent pod only if it was evicted during the build (For example a Node-pressure).
  4. Always - always keep the agent pod.

Note: Kubernetes administrators are responsible for managing any kept agent pod. These will not be deleted by the Jenkins Kubernetes plugin.