From 55e88eb1e0dce76df159ea3f650f94684b4be52f Mon Sep 17 00:00:00 2001 From: Pierre Bastianelli Date: Thu, 19 Sep 2024 13:37:26 -0700 Subject: [PATCH] chore: allowed_hosts --- estimation/estimation/settings.py | 7 +++++- .../templates/network_policy.yaml | 22 ++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/estimation/estimation/settings.py b/estimation/estimation/settings.py index 367206d..58e79f3 100644 --- a/estimation/estimation/settings.py +++ b/estimation/estimation/settings.py @@ -29,7 +29,12 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ["0.0.0.0", "localhost", "127.0.0.1"] +ALLOWED_HOSTS = [ + "0.0.0.0", + "localhost", + "127.0.0.1", + "cas-estimation-tool.apps.silver.devops.gov.bc.ca", +] # Application definition diff --git a/helm/cas-estimation-tool/templates/network_policy.yaml b/helm/cas-estimation-tool/templates/network_policy.yaml index 50b7a3e..497c0ea 100644 --- a/helm/cas-estimation-tool/templates/network_policy.yaml +++ b/helm/cas-estimation-tool/templates/network_policy.yaml @@ -14,4 +14,24 @@ spec: release: {{ include "cas-estimation-tool.name" . }} - podSelector: matchLabels: - app.kubernetes.io/instance: {{ include "cas-estimation-tool.name" . }} \ No newline at end of file + app.kubernetes.io/instance: {{ include "cas-estimation-tool.name" . }} + +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: {{ include "cas-estimation-tool.fullname" . }}-allow-from-openshift-ingress +spec: + # This policy allows any pod with a route & service combination + # to accept traffic from the OpenShift router pods. This is + # required for things outside of OpenShift (like the Internet) + # to reach your pods. + ingress: + - from: + - namespaceSelector: + matchLabels: + network.openshift.io/policy-group: ingress + podSelector: {} + policyTypes: + - Ingress + \ No newline at end of file