From 8356ebf0975bafb222360807da2de88a4965bba1 Mon Sep 17 00:00:00 2001 From: Simon Morris Date: Wed, 15 Feb 2023 06:49:23 -0800 Subject: [PATCH] Adds APP_URL as base tag href to enable loading via ui via ingress routes (#2195) --- charts/postgres-operator-ui/templates/deployment.yaml | 2 +- charts/postgres-operator-ui/values.yaml | 1 + ui/operator_ui/main.py | 2 +- ui/operator_ui/templates/index.html | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/charts/postgres-operator-ui/templates/deployment.yaml b/charts/postgres-operator-ui/templates/deployment.yaml index 23eb750a7..89f013248 100644 --- a/charts/postgres-operator-ui/templates/deployment.yaml +++ b/charts/postgres-operator-ui/templates/deployment.yaml @@ -46,7 +46,7 @@ spec: {{- toYaml .Values.resources | nindent 12 }} env: - name: "APP_URL" - value: "http://localhost:8081" + value: {{ .Values.envs.appUrl }} - name: "OPERATOR_API_URL" value: {{ .Values.envs.operatorApiUrl | quote }} - name: "OPERATOR_CLUSTER_NAME_LABEL" diff --git a/charts/postgres-operator-ui/values.yaml b/charts/postgres-operator-ui/values.yaml index 31b925c73..55d6dee88 100644 --- a/charts/postgres-operator-ui/values.yaml +++ b/charts/postgres-operator-ui/values.yaml @@ -41,6 +41,7 @@ resources: envs: # IMPORTANT: While operator chart and UI chart are independent, this is the interface between # UI and operator API. Insert the service name of the operator API here! + appUrl: "http://localhost:8081" operatorApiUrl: "http://postgres-operator:8080" operatorClusterNameLabel: "cluster-name" resourcesVisible: "False" diff --git a/ui/operator_ui/main.py b/ui/operator_ui/main.py index 0399f14f8..bec441dca 100644 --- a/ui/operator_ui/main.py +++ b/ui/operator_ui/main.py @@ -311,7 +311,7 @@ def send_js(path): @app.route('/') @authorize def index(): - return render_template('index.html', google_analytics=GOOGLE_ANALYTICS) + return render_template('index.html', google_analytics=GOOGLE_ANALYTICS, app_url=APP_URL) DEFAULT_UI_CONFIG = { diff --git a/ui/operator_ui/templates/index.html b/ui/operator_ui/templates/index.html index 7307c8a3a..021c5c75d 100644 --- a/ui/operator_ui/templates/index.html +++ b/ui/operator_ui/templates/index.html @@ -2,6 +2,7 @@ + PostgreSQL Operator UI