EOX GitLab Instance

ingress.yaml 1.45 KB
Newer Older
Nikola Jankovic's avatar
Nikola Jankovic committed
1
{{- if .Values.ingress.enabled -}}
Nikola Jankovic's avatar
Nikola Jankovic committed
2
3
4
5
6
7
8
9
10
11
12
{{- $fullName := include "vs-client.fullname" . -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
  name: {{ $fullName }}
  labels:
    {{- include "vs-client.labels" . | nindent 4 }}
13
  {{- with .Values.ingress.annotations | default .Values.global.ingress.annotations }}
Nikola Jankovic's avatar
Nikola Jankovic committed
14
15
16
17
18
  annotations:
    {{- toYaml . | nindent 4 }}
    nginx.ingress.kubernetes.io/rewrite-target: /$1
  {{- end }}
spec:
19
  {{- if .Values.ingress.tls | default .Values.global.ingress.tls }}
Nikola Jankovic's avatar
Nikola Jankovic committed
20
  tls:
21
    {{- range .Values.ingress.tls | default .Values.global.ingress.tls }}
Nikola Jankovic's avatar
Nikola Jankovic committed
22
23
24
25
26
27
28
29
    - hosts:
        {{- range .hosts }}
        - {{ . | quote }}
        {{- end }}
      secretName: {{ .secretName }}
    {{- end }}
  {{- end }}
  rules:
30
    {{- range .Values.ingress.hosts | default .Values.global.ingress.hosts }}
Nikola Jankovic's avatar
Nikola Jankovic committed
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
    {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
    - host: {{ .host | quote }}
      http:
        paths:
        - path: /(.*)
          pathType: Prefix
          backend:
            service:
              name: {{ $fullName }}
              port:
                number: 80
    {{- else }}
    - host: {{ .host | quote }}
      http:
        paths:
        - path: /(.*)
          backend:
            serviceName: {{ $fullName }}
            servicePort: http
    {{- end -}}
    {{- end }}
Nikola Jankovic's avatar
Nikola Jankovic committed
52
{{- end -}}