From 3a7a351e50579f0e2cdef87c80958b4005022eaf Mon Sep 17 00:00:00 2001 From: Yifan Xiong Date: Mon, 18 Nov 2019 11:28:23 +0800 Subject: [PATCH] [Rest Server] Update restart policy to avoid stuck pending pods (#3856) * Update restart policy to avoid stuck pending pods Update restart policy to avoid stuck pending pods #3760 * Add comments Add comments --- src/rest-server/src/models/v2/job/k8s.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rest-server/src/models/v2/job/k8s.js b/src/rest-server/src/models/v2/job/k8s.js index f35cd6cc0e..cd82828ae0 100644 --- a/src/rest-server/src/models/v2/job/k8s.js +++ b/src/rest-server/src/models/v2/job/k8s.js @@ -319,7 +319,9 @@ const generateTaskRole = (taskRole, labels, config) => { }, spec: { privileged: false, - restartPolicy: 'Never', + // workaround for pending pods due to no ready sandbox before the fix + // https://github.com/kubernetes/kubernetes/commit/3fac48f8 + restartPolicy: gangAllocation === 'true' ? 'Never' : 'OnFailure', serviceAccountName: 'frameworkbarrier-account', initContainers: [ {