Skip to content

Commit

Permalink
refactor: Move ingresses to proper resources directories and move val…
Browse files Browse the repository at this point in the history
…ues to proper sections
  • Loading branch information
Mrkazik99 committed Jul 13, 2024
1 parent df4f1c3 commit 95af942
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 130 deletions.
6 changes: 3 additions & 3 deletions templates/api/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ data:
CONVERSION_URL: http://{{ include "voltaserve-conversion.fullname" . }}.{{.Release.Namespace}}.svc.cluster.local:{{ .Values.conversion.service.port }}
LANGUAGE_URL: http://{{ include "voltaserve-language.fullname" . }}.{{.Release.Namespace}}.svc.cluster.local:{{ .Values.language.service.port }}
MOSAIC_URL: http://{{ include "voltaserve-mosaic.fullname" . }}.{{.Release.Namespace}}.svc.cluster.local:{{ .Values.mosaic.service.port }}
{{- if .Values.voltaserve.ingress.ui }}
PUBLIC_UI_URL: https://{{ .Values.voltaserve.ingress.ui.host }}
SECURITY_CORS_ORIGINS: https://{{ .Values.voltaserve.ingress.ui.host }}
{{- if .Values.ui.ingress.enabled }}
PUBLIC_UI_URL: https://{{ .Values.ui.ingress.host }}
SECURITY_CORS_ORIGINS: https://{{ .Values.ui.ingress.host }}
{{- else }}
PUBLIC_UI_URL: {{ .Values.general.envs.PUBLIC_UI_URL }}
SECURITY_CORS_ORIGINS: {{ .Values.general.envs.PUBLIC_UI_URL }}
Expand Down
8 changes: 4 additions & 4 deletions templates/idp/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ data:
{{- else }}
POSTGRES_URL: {{ .Values.general.envs.POSTGRES_URL }}
{{- end }}
{{- if .Values.voltaserve.ingress.ui.enabled }}
PUBLIC_UI_URL: https://{{ .Values.voltaserve.ingress.ui.host }}
TOKEN_ISSUER: https://{{ .Values.voltaserve.ingress.ui.host }}
SECURITY_CORS_ORIGINS: https://{{ .Values.voltaserve.ingress.ui.host }}
{{- if .Values.ui.ingress.enabled }}
PUBLIC_UI_URL: https://{{ .Values.ui.ingress.host }}
TOKEN_ISSUER: https://{{ .Values.ui.ingress.host }}
SECURITY_CORS_ORIGINS: https://{{ .Values.ui.ingress.host }}
{{- else }}
PUBLIC_UI_URL: {{ .Values.general.envs.PUBLIC_UI_URL }}
SECURITY_CORS_ORIGINS: {{ .Values.general.envs.PUBLIC_UI_URL }}
Expand Down
104 changes: 0 additions & 104 deletions templates/ingress.yaml

This file was deleted.

53 changes: 53 additions & 0 deletions templates/ui/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{{- if .Values.ui.ingress }}
{{- if .Values.ui.ingress.enabled }}
{{- if and .Values.ui.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ui.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ui.ingress.annotations "kubernetes.io/ingress.class" .Values.ui.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: networking.k8s.io/v1beta1
{{- else }}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ include "voltaserve-ui.fullname" . }}
labels:
{{- include "voltaserve.commonLabels" . | nindent 4 }}
{{- with .Values.ui.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ui.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ui.ingress.className }}
{{- end }}
{{- if.Values.ui.ingress.tls }}
tls:
{{- with .Values.voltaserver.ingress.ui.tls}}
{{- . toYaml | nindent 4}}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.ui.ingress.host }}
http:
paths:
- path: /
{{- if and (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: ImplementationSpecific
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ include "voltaserve-ui.fullname" . }}
port:
number: {{ .Values.ui.service.port }}
{{- else }}
serviceName: {{ include "voltaserve-ui.fullname" . }}
servicePort: {{ .Values.ui.service.port }}
{{- end }}
{{- end }}
{{- end }}
53 changes: 53 additions & 0 deletions templates/webdav/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{{- if .Values.webdav.ingress }}
{{- if .Values.webdav.ingress.enabled }}
{{- if and .Values.webdav.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.webdav.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.webdav.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: networking.k8s.io/v1beta1
{{- else }}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ include "voltaserve-webdav.fullname" . }}
labels:
{{- include "voltaserve.commonLabels" . | nindent 4 }}
{{- with .Values.webdav.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.webdav.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.webdav.ingress.className }}
{{- end }}
{{- if .Values.webdav.ingress.tls }}
tls:
{{- with .Values.voltaserver.ingress.ui.tls}}
{{- . toYaml | nindent 4}}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.webdav.host }}
http:
paths:
- path: /
{{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: ImplementationSpecific
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ include "voltaserve-webdav.fullname" . }}
port:
number: {{ .Values.webdav.service.port }}
{{- else }}
serviceName: {{ include "voltaserve-webdav.fullname" . }}
servicePort: {{ .Values.webdav.service.port }}
{{- end }}
{{- end }}
{{- end }}
35 changes: 16 additions & 19 deletions values.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
voltaserve:
ingress:
ui:
enabled: true
host: ui.public.url
annotations:
{}
className: nginx-public
tls:
[]
webdav:
enabled: true
annotations:
{}
host: webdav.public.url
className: nginx-public
tls:
[]

imagePullSecrets: []

general:
Expand Down Expand Up @@ -227,6 +208,14 @@ mosaic:
{}

ui:
ingress:
enabled: true
host: ui.public.url
annotations:
{}
className: nginx-public
tls:
[]
image:
repository: null
tag: null
Expand Down Expand Up @@ -263,6 +252,14 @@ ui:
{}

webdav:
ingress:
enabled: true
annotations:
{}
host: webdav.public.url
className: nginx-public
tls:
[]
image:
repository: null
tag: null
Expand Down

0 comments on commit 95af942

Please sign in to comment.