{{- if and .Values.ingressRoute.create .Values.service.enabled -}} apiVersion: traefik.io/v1alpha1 kind: IngressRoute metadata: name: {{ printf "%s-route" (include "code-server.fullname" . ) }} labels: {{- include "code-server.labels" . | nindent 4 }} {{- with .Values.ingressRoute.labels }} {{- toYaml . | nindent 4 }} {{- end }} {{- with .Values.ingressRoute.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: {{- with .Values.ingressRoute.entryPoints }} entryPoints: {{- toYaml . | nindent 4 }} {{- end }} routes: - kind: Rule match: {{ required "Mandatory field \".ingressRoute.rule\" is empty!" .Values.ingressRoute.rule }} services: - kind: Service name: {{ include "code-server.fullname" . }} namespace: {{ .Release.Namespace }} port: {{ .Values.ports.http.port }} {{- with .Values.ingressRoute.middlewares }} middlewares: {{- toYaml . | nindent 8 }} {{- end }} {{- with (include "code-server.ingressRoute.tlsSecretName" .) }} tls: secretName: {{ . }} {{- end }} {{- end }}