Skip to content

Commit 13d1c5d

Browse files
committed
feat(k8s): set custom ingressClassName for interactive sessions (#581)
Closes reanahub/reana#742
1 parent 1d027ff commit 13d1c5d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

reana_workflow_controller/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ def _env_vars_dict_to_k8s_list(env_vars):
197197
REANA_INGRESS_ANNOTATIONS = json.loads(os.getenv("REANA_INGRESS_ANNOTATIONS", "{}"))
198198
"""REANA Ingress annotations defined by the administrator."""
199199

200+
REANA_INGRESS_CLASS_NAME = os.getenv("REANA_INGRESS_CLASS_NAME")
201+
"""REANA Ingress class name defined by the administrator to be used for interactive sessions."""
202+
200203
IMAGE_PULL_SECRETS = os.getenv("IMAGE_PULL_SECRETS", "").split(",")
201204
"""Docker image pull secrets which allow the usage of private images."""
202205

reana_workflow_controller/k8s.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is part of REANA.
2-
# Copyright (C) 2019, 2020, 2021, 2022 CERN.
2+
# Copyright (C) 2019, 2020, 2021, 2022, 2024 CERN.
33
#
44
# REANA is free software; you can redistribute it and/or modify it
55
# under the terms of the MIT License; see LICENSE file for more details.
@@ -26,6 +26,7 @@
2626
JUPYTER_INTERACTIVE_SESSION_DEFAULT_IMAGE,
2727
JUPYTER_INTERACTIVE_SESSION_DEFAULT_PORT,
2828
REANA_INGRESS_ANNOTATIONS,
29+
REANA_INGRESS_CLASS_NAME,
2930
)
3031

3132

@@ -105,6 +106,8 @@ def _build_ingress(self):
105106
spec = client.V1IngressSpec(
106107
rules=[client.V1IngressRule(http=ingress_rule_value)]
107108
)
109+
if REANA_INGRESS_CLASS_NAME:
110+
spec.ingress_class_name = REANA_INGRESS_CLASS_NAME
108111
ingress = client.V1Ingress(
109112
api_version="networking.k8s.io/v1",
110113
kind="Ingress",

0 commit comments

Comments
 (0)