1
0
mirror of https://github.com/coder/code-server.git synced 2024-12-05 07:13:06 +08:00
code-server/ci/helm-chart/templates/ingress.yaml

42 lines
1.0 KiB
YAML
Raw Normal View History

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