Add setting for keeping container group pod after job run

Helpful for debugging
This commit is contained in:
Shane McDonald
2021-03-29 13:09:31 -04:00
parent eeb6aaaea9
commit 9d17d40b86
2 changed files with 2 additions and 1 deletions

View File

@@ -3010,7 +3010,7 @@ class AWXReceptorJob:
return self._run_internal(receptor_ctl) return self._run_internal(receptor_ctl)
finally: finally:
# Make sure to always release the work unit if we established it # Make sure to always release the work unit if we established it
if self.unit_id is not None: if self.unit_id is not None and not settings.AWX_CONTAINER_GROUP_KEEP_POD:
receptor_ctl.simple_command(f"work release {self.unit_id}") receptor_ctl.simple_command(f"work release {self.unit_id}")
def _run_internal(self, receptor_ctl): def _run_internal(self, receptor_ctl):

View File

@@ -68,6 +68,7 @@ DATABASES = {
# the K8S cluster where awx itself is running) # the K8S cluster where awx itself is running)
IS_K8S = False IS_K8S = False
AWX_CONTAINER_GROUP_KEEP_POD = True
AWX_CONTAINER_GROUP_K8S_API_TIMEOUT = 10 AWX_CONTAINER_GROUP_K8S_API_TIMEOUT = 10
AWX_CONTAINER_GROUP_POD_LAUNCH_RETRIES = 100 AWX_CONTAINER_GROUP_POD_LAUNCH_RETRIES = 100
AWX_CONTAINER_GROUP_POD_LAUNCH_RETRY_DELAY = 5 AWX_CONTAINER_GROUP_POD_LAUNCH_RETRY_DELAY = 5