Skip to content

Commit 1e28c1c

Browse files
vcarluerjreynard-code
authored andcommitted
multi tenant in helm chart
1 parent c92014b commit 1e28c1c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

api/kubernetes/helm-chart/templates/_helpers.tpl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,20 @@ Create Docker secrets so Argo Workflows can pull images from a private container
7979
{{/*
8080
Default Ingress path
8181
*/}}
82+
{{- define "cosmotech-api.ingressTenantPath" -}}
83+
{{- if .Values.api.multiTenant }}
84+
{{- printf "%s/%s/" (printf "%s" .Values.api.servletContextPath | trimSuffix "/" ) .Release.Namespace }}
85+
{{- else }}
86+
{{- printf "%s/" (printf "%s" .Values.api.servletContextPath | trimSuffix "/" ) }}
87+
{{- end }}
88+
{{- end }}
89+
90+
{{/*
8291
{{- define "cosmotech-api.apiBasePath" -}}
8392
{{- if eq .Values.api.version "latest" }}
84-
{{- printf "%s/" (printf "%s" .Values.api.servletContextPath | trimSuffix "/" ) }}
93+
{{- printf "%s/" (include "cosmotech-api.ingressTenantPath" . | trimSuffix "/" ) }}
8594
{{- else }}
86-
{{- printf "%s/%s/" (printf "%s" .Values.api.servletContextPath | trimSuffix "/" ) (printf "%s" .Values.api.version | trimSuffix "/" ) }}
95+
{{- printf "%s/%s/" (include "cosmotech-api.ingressTenantPath" . | trimSuffix "/" ) (printf "%s" .Values.api.version | trimSuffix "/" ) }}
8796
{{- end }}
8897
{{- end }}
8998

api/kubernetes/helm-chart/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ api:
8484
servletContextPath: /
8585
# Examples: latest, v1, v2
8686
version: latest
87+
# Whether or not the API is multi-tenant and should expose the tenant in the URL
88+
multiTenant: false
8789
# Configure probes failure thresholds to higher values if you are in debug mode to avoid pod restart
8890
probes:
8991
startup:

0 commit comments

Comments
 (0)