ingress.yaml 1.37 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
    app: {{ template "chronograf.fullname" . }}
12 13 14
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
15 16 17 18 19
  annotations:
{{ toYaml .Values.ingress.annotations | indent 4 }}
spec:
{{- if .Values.ingress.tls }}
  tls:
20 21
    - hosts:
      - {{ .Values.ingress.hostname | quote }}
22
      secretName: {{ .Values.ingress.secretName | default (printf "%s-tls" (include "chronograf.fullname" .)) }}
23 24 25
{{- end }}
{{- if .Values.ingress.className }}
  ingressClassName: {{ .Values.ingress.className }}
26 27 28 29 30
{{- end }}
  rules:
  - host: {{ .Values.ingress.hostname }}
    http:
      paths:
31
      - path: {{ .Values.ingress.path }}
32 33 34
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
        pathType: Prefix
{{- end }}
35
        backend:
36 37 38 39 40 41
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
          service:
            name: {{ include "chronograf.fullname" . }}
            port:
              number: 80
{{- else }}
42
          serviceName: {{ template "chronograf.fullname" . }}
43
          servicePort: 80
44
{{- end }}
45
{{- end -}}