Skip to content

Commit

Permalink
feat(k8s): set custom ingressClassName for interactive sessions (rean…
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonadoni committed May 3, 2024
1 parent 1d027ff commit 13d1c5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions reana_workflow_controller/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ def _env_vars_dict_to_k8s_list(env_vars):
REANA_INGRESS_ANNOTATIONS = json.loads(os.getenv("REANA_INGRESS_ANNOTATIONS", "{}"))
"""REANA Ingress annotations defined by the administrator."""

REANA_INGRESS_CLASS_NAME = os.getenv("REANA_INGRESS_CLASS_NAME")
"""REANA Ingress class name defined by the administrator to be used for interactive sessions."""

IMAGE_PULL_SECRETS = os.getenv("IMAGE_PULL_SECRETS", "").split(",")
"""Docker image pull secrets which allow the usage of private images."""

Expand Down
5 changes: 4 additions & 1 deletion reana_workflow_controller/k8s.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of REANA.
# Copyright (C) 2019, 2020, 2021, 2022 CERN.
# Copyright (C) 2019, 2020, 2021, 2022, 2024 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand All @@ -26,6 +26,7 @@
JUPYTER_INTERACTIVE_SESSION_DEFAULT_IMAGE,
JUPYTER_INTERACTIVE_SESSION_DEFAULT_PORT,
REANA_INGRESS_ANNOTATIONS,
REANA_INGRESS_CLASS_NAME,
)


Expand Down Expand Up @@ -105,6 +106,8 @@ def _build_ingress(self):
spec = client.V1IngressSpec(
rules=[client.V1IngressRule(http=ingress_rule_value)]
)
if REANA_INGRESS_CLASS_NAME:
spec.ingress_class_name = REANA_INGRESS_CLASS_NAME
ingress = client.V1Ingress(
api_version="networking.k8s.io/v1",
kind="Ingress",
Expand Down

0 comments on commit 13d1c5d

Please sign in to comment.