From 57a127cd5ab9f5599d45483563d00ed2f381a71e Mon Sep 17 00:00:00 2001 From: PJ Linebaugh Date: Tue, 26 Sep 2023 15:04:24 -0400 Subject: [PATCH] add feature to specify the init container image and tag --- tycho/model.py | 2 ++ tycho/template/pod.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tycho/model.py b/tycho/model.py index 92ca182..b614576 100644 --- a/tycho/model.py +++ b/tycho/model.py @@ -236,6 +236,8 @@ def __init__(self, config, name, principal, service_account, conn_string, proxy_ """init security context""" self.init_security_context = init_security_context """Resources and limits for the init container""" + self.init_image_repository = os.environ.get("TYCHO_APP_INIT_IMAGE_REPOSITORY", "busybox") + self.init_image_tag = os.environ.get("TYCHO_APP_INIT_IMAGE_TAG", "latest") self.init_cpus = os.environ.get("TYCHO_APP_INIT_CPUS", "250m") self.init_memory = os.environ.get("TYCHO_APP_INIT_MEMORY", "250Mi") self.gpu_resource_name = os.environ.get("TYCHO_APP_GPU_RESOURCE_NAME", "nvidia.com/gpu") diff --git a/tycho/template/pod.yaml b/tycho/template/pod.yaml index 636a1c6..d54e8f3 100644 --- a/tycho/template/pod.yaml +++ b/tycho/template/pod.yaml @@ -48,7 +48,7 @@ spec: {% if (system.enable_init_container == "true") and (system.create_home_dirs == "true") and (system.dev_phase != "test") %} initContainers: - name: volume-tasks - image: busybox:1.28 + image: {{ system.init_image_repository }}:{{ system.init_image_tag }} {% if system.init_security_context.run_as_user or system.init_security_context.run_as_group %} securityContext: {% if system.init_security_context.run_as_user %}