ingress.yaml 1.49 KB
Newer Older
1
{{- if .Values.ingress.enabled -}}
2 3 4
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
apiVersion: networking.k8s.io/v1
{{- else }}
5
apiVersion: networking.k8s.io/v1beta1
6
{{- end }}
7 8
kind: Ingress
metadata:
9
  name: {{ template "chronograf.fullname" . }}
10
  labels:
11
    {{- if eq "true" (include "chronograf.legacyLabels" .) }}
12
    app: {{ template "chronograf.fullname" . }}
13 14 15
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
16 17
    {{- end }}
    {{- include "chronograf.labels" . | nindent 4 }}
18 19 20 21 22
  annotations:
{{ toYaml .Values.ingress.annotations | indent 4 }}
spec:
{{- if .Values.ingress.tls }}
  tls:
23 24
    - hosts:
      - {{ .Values.ingress.hostname | quote }}
25
      secretName: {{ .Values.ingress.secretName | default (printf "%s-tls" (include "chronograf.fullname" .)) }}
26 27 28
{{- end }}
{{- if .Values.ingress.className }}
  ingressClassName: {{ .Values.ingress.className }}
29 30 31 32 33
{{- end }}
  rules:
  - host: {{ .Values.ingress.hostname }}
    http:
      paths:
34
      - path: {{ .Values.ingress.path }}
35 36 37
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
        pathType: Prefix
{{- end }}
38
        backend:
39 40 41 42 43 44
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
          service:
            name: {{ include "chronograf.fullname" . }}
            port:
              number: 80
{{- else }}
45
          serviceName: {{ template "chronograf.fullname" . }}
46
          servicePort: 80
47
{{- end }}
48
{{- end -}}