3333 REANA_INGRESS_HOST ,
3434 REANA_DATASTORE_SECRET ,
3535 REANA_DATASTORE_IMAGE ,
36+ REANA_DATASTORE_ENABLED ,
3637)
3738
3839
@@ -87,11 +88,15 @@ def __init__(
8788 self ._session_container = client .V1Container (
8889 name = self .deployment_name , image = self .image , env = [], volume_mounts = [], ports = [client .V1ContainerPort (container_port = self .port )]
8990 )
90- self ._s3_container = client .V1Container (
91- name = "datastore" , image = REANA_DATASTORE_IMAGE , env = [], volume_mounts = [], ports = [], image_pull_policy = "Always" , lifecycle = []
92- )
91+ containers = [self ._session_container ]
92+ if (REANA_DATASTORE_ENABLED ):
93+ self ._s3_container = client .V1Container (
94+ name = "datastore" , image = REANA_DATASTORE_IMAGE , env = [], volume_mounts = [], ports = [], image_pull_policy = "Always" , lifecycle = []
95+ )
96+ containers .append (self ._s3_container )
97+
9398 self ._pod_spec = client .V1PodSpec (
94- containers = [ self . _session_container , self . _s3_container ] ,
99+ containers = containers ,
95100 volumes = [],
96101 node_selector = REANA_RUNTIME_SESSIONS_KUBERNETES_NODE_LABEL ,
97102 # Disable service discovery with env variables, so that the environment is
@@ -319,7 +324,7 @@ def add_user_secrets(self):
319324 all_env = user_secrets .get_env_secrets_as_k8s_spec ()
320325 s3_env = []
321326 session_env = []
322-
327+
323328 # Single for loop to split secrets
324329 for secret in all_env :
325330 secret_name = secret .get ("name" , "" )
@@ -332,7 +337,8 @@ def add_user_secrets(self):
332337 self ._session_container .env = session_env
333338
334339 # mount s3 secretes
335- self ._s3_container .env = s3_env
340+ if (REANA_DATASTORE_ENABLED ):
341+ self ._s3_container .env = s3_env
336342
337343 def get_deployment_objects (self ):
338344 """Return the alrady built Kubernetes objects."""
@@ -391,8 +397,9 @@ def build_interactive_jupyter_deployment_k8s_objects(
391397 deployment_builder .add_command_arguments (command_args )
392398 deployment_builder .add_reana_shared_storage ()
393399 deployment_builder .add_image_pull_secrets ()
394- deployment_builder .setup_s3_sidecar ()
395- deployment_builder .setup_s3_storage ()
400+ if (REANA_DATASTORE_ENABLED ):
401+ deployment_builder .setup_s3_sidecar ()
402+ deployment_builder .setup_s3_storage ()
396403 if cvmfs_repos :
397404 deployment_builder .add_cvmfs_repo_mounts (cvmfs_repos )
398405 if expose_secrets :
0 commit comments