Skip to content

Commit

Permalink
build(chart): unify gateway values
Browse files Browse the repository at this point in the history
  • Loading branch information
cramakri committed Sep 9, 2022
1 parent 2587215 commit 05e7e1f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion helm-chart/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Provide a basic chart for deploying Renku UI application.
Configuration
-------------

- `baseUrl` define the URL on the application will be available
- `client.url` define the URL on the application will be available
(default: `http://localhost:3000`)
- `gitlabUrl` define the URL of a running GitLab instance
(default: `http://gitlab.renku.build`)
Expand Down
3 changes: 2 additions & 1 deletion helm-chart/minikube-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ global:
clientSecret: "secret"

ui:
baseUrl: "http://localhost:3000"
client:
url: "http://localhost:3000"
ingress:
enabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ spec:
{{- end }}
env:
- name: BASE_URL
value: {{ .Values.baseUrl | default (printf "%s://%s" (include "ui.protocol" .) .Values.global.renku.domain) | quote }}
value: {{ .Values.client.url | default (printf "%s://%s" (include "ui.protocol" .) .Values.global.renku.domain) | quote }}
- name: GATEWAY_URL
value: {{ .Values.gatewayUrl | default (printf "%s://%s/api" (include "ui.protocol" .) .Values.global.renku.domain) | quote }}
value: {{ .Values.gateway.url | default (printf "%s://%s/api" (include "ui.protocol" .) .Values.global.renku.domain) | quote }}
- name: UISERVER_URL
value: {{ .Values.client.uiserverUrl | default (printf "%s://%s/ui-server" (include "ui.protocol" .) .Values.global.renku.domain) | quote }}
value: {{ .Values.server.url | default (printf "%s://%s" (include "ui.protocol" .) .Values.global.renku.domain) | printf "%s/ui-server" | quote }}
- name: WELCOME_PAGE
value: {{ .Values.client.welcomePage.text | b64enc | quote }}
{{- if .Values.client.statuspage }}
Expand Down
14 changes: 6 additions & 8 deletions helm-chart/renku-ui/templates/ui-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,19 @@ spec:
protocol: TCP
env:
- name: SERVER_URL
value: {{ .Values.server.serverData.url | default (printf "https://%s" .Values.global.renku.domain) | quote }}
value: {{ .Values.server.url | default (printf "%s://%s" (include "ui.protocol" .) .Values.global.renku.domain) | quote }}
- name: UI_SERVER_VERSION
value: {{ .Chart.Version | quote }}
- name: SERVER_PORT
value: {{ .Values.server.serverData.port | default (printf "8080") | quote }}
- name: SERVER_PREFIX
value: {{ .Values.server.serverData.prefix | default (printf "/ui-server") | quote }}
value: {{ .Values.server.port | default (printf "8080") | quote }}
- name: GATEWAY_URL
value: {{ .Values.server.gateway.url | default (printf "https://%s/api" .Values.global.renku.domain) | quote }}
value: {{ .Values.gateway.url | default (printf "%s://%s/api" (include "ui.protocol" .) .Values.global.renku.domain) | quote }}
- name: GATEWAY_LOGIN_PATH
value: {{ .Values.server.gateway.loginSuffix | default (printf "/auth/login") | quote }}
value: {{ .Values.gateway.loginSuffix | default (printf "/auth/login") | quote }}
- name: GATEWAY_LOGOUT_PATH
value: {{ .Values.server.gateway.logoutSuffix | default (printf "/auth/logout") | quote }}
value: {{ .Values.gateway.logoutSuffix | default (printf "/auth/logout") | quote }}
- name: AUTH_SERVER_URL
value: {{ .Values.server.authentication.url | default (printf "https://%s/auth/realms/Renku" .Values.global.renku.domain) | quote }}
value: {{ .Values.server.authentication.url | default (printf "%s://%s/auth/realms/Renku" (include "ui.protocol" .) .Values.global.renku.domain) | quote }}
- name: AUTH_CLIENT_ID
value: {{ .Values.server.authentication.id | default (printf "renku-ui") | quote }}
- name: AUTH_CLIENT_SECRET
Expand Down
20 changes: 10 additions & 10 deletions helm-chart/renku-ui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ global:
existingSecret: redis-secret
existingSecretPasswordKey: redis-password

gateway:
url:
loginSuffix: /auth/login
logoutSuffix: /auth/logout

client:
## The URL for the client
url:
replicaCount: 1

image:
Expand Down Expand Up @@ -166,6 +173,9 @@ client:
tag: "0.11.16"

server:
## The URL for the server service; the URL used by the client is the server.url + /ui-server endpoint.
url:
port: 8080
replicaCount: 1

image:
Expand Down Expand Up @@ -228,16 +238,6 @@ server:

affinity: {}

serverData:
url:
port: 8080
prefix: /ui-server

gateway:
url:
loginSuffix: /auth/login
logoutSuffix: /auth/logout

sentry:
enabled: false
dsn: ""
Expand Down
15 changes: 8 additions & 7 deletions server/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,24 @@

import { convertType } from "./utils";


const SERVER = {
url: process.env.SERVER_URL,
port: convertType(process.env.SERVER_PORT) || 8080,
prefix: process.env.SERVER_PREFIX || "/ui-server",
prefix: "/ui-server",
logLevel: process.env.SERVER_LOG_LEVEL || "info",
serverUiVersion: process.env.UI_SERVER_VERSION || "unknown",
proxyTimeout: 600 * 1000, // in milliseconds
wsSuffix: "/ws"
wsSuffix: "/ws",
};

const DEPLOYMENT = {
gatewayUrl: process.env.GATEWAY_URL || SERVER.url + "/api",
gatewayLoginUrl:
(process.env.GATEWAY_URL || SERVER.url + "/api") + (process.env.GATEWAY_LOGIN_PATH || "/auth/login"),
(process.env.GATEWAY_URL || SERVER.url + "/api") +
(process.env.GATEWAY_LOGIN_PATH || "/auth/login"),
gatewayLogoutUrl:
(process.env.GATEWAY_URL || SERVER.url + "/api") + (process.env.GATEWAY_LOGOUT_PATH || "/auth/logout"),
(process.env.GATEWAY_URL || SERVER.url + "/api") +
(process.env.GATEWAY_LOGOUT_PATH || "/auth/logout"),
};

const SENTRY = {
Expand All @@ -43,7 +44,7 @@ const SENTRY = {
namespace: process.env.SENTRY_NAMESPACE || undefined,
telepresence: !!process.env.TELEPRESENCE,
sampleRate: parseFloat(process.env.SENTRY_TRACE_RATE) || 0,
debugMode: [true, "true"].includes(process.env.SENTRY_DEBUG)
debugMode: [true, "true"].includes(process.env.SENTRY_DEBUG),
};

const AUTHENTICATION = {
Expand Down Expand Up @@ -97,7 +98,7 @@ const config = {
routes: ROUTES,
sentry: SENTRY,
server: SERVER,
websocket: WEBSOCKET
websocket: WEBSOCKET,
};

export default config;

0 comments on commit 05e7e1f

Please sign in to comment.