Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/ci/helm-chart/templates/ingress.yaml

63 lines
1.7 KiB
YAML
Raw Permalink Normal View History

2020-09-02 21:41:58 +02:00
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "code-server.fullname" . -}}
2020-09-02 22:53:52 +02:00
{{- $svcPort := .Values.service.port -}}
2021-09-25 16:07:06 +02:00
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
2020-09-02 22:53:52 +02:00
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
2020-09-02 21:41:58 +02:00
apiVersion: extensions/v1beta1
2020-09-02 22:53:52 +02:00
{{- end }}
2020-09-02 21:41:58 +02:00
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
2020-09-02 22:53:52 +02:00
{{- include "code-server.labels" . | nindent 4 }}
2020-09-02 21:41:58 +02:00
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
2020-09-02 22:53:52 +02:00
{{- if .Values.ingress.tls }}
2020-09-02 21:41:58 +02:00
tls:
2020-09-02 22:53:52 +02:00
{{- range .Values.ingress.tls }}
2020-09-02 21:41:58 +02:00
- hosts:
2020-09-02 22:53:52 +02:00
{{- range .hosts }}
2020-09-02 21:41:58 +02:00
- {{ . | quote }}
2020-09-02 22:53:52 +02:00
{{- end }}
2020-09-02 21:41:58 +02:00
secretName: {{ .secretName }}
2020-09-02 22:53:52 +02:00
{{- end }}
2020-09-02 21:41:58 +02:00
{{- end }}
rules:
2021-09-25 16:07:06 +02:00
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}}
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}
{{- else -}}
2020-09-02 22:53:52 +02:00
{{- range .Values.ingress.hosts }}
2020-09-02 21:41:58 +02:00
- host: {{ .host | quote }}
http:
paths:
2020-09-02 22:53:52 +02:00
{{- range .paths }}
2020-09-02 21:41:58 +02:00
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
2020-09-02 22:53:52 +02:00
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
2020-09-02 21:41:58 +02:00
{{- end }}
2021-09-25 16:07:06 +02:00
{{- end }}