aboutsummaryrefslogtreecommitdiffstats
path: root/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/templates/prometheus/ingressperreplica.yaml
blob: 57283b221f58396a9b07f55e8cb42de3437f39b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{{- if and .Values.prometheus.enabled .Values.prometheus.servicePerReplica.enabled .Values.prometheus.ingressPerReplica.enabled }}
{{- $count := .Values.prometheus.prometheusSpec.replicas | int -}}
{{- $servicePort := .Values.prometheus.servicePerReplica.port -}}
{{- $ingressValues := .Values.prometheus.ingressPerReplica -}}
apiVersion: v1
kind: List
metadata:
  name: {{ include "prometheus-operator.fullname" $ }}-prometheus-ingressperreplica
  namespace: {{ template "prometheus-operator.namespace" . }}
items:
{{ range $i, $e := until $count }}
  - kind: Ingress
    {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
    apiVersion: networking.k8s.io/v1beta1
    {{ else }}
    apiVersion: extensions/v1beta1
    {{ end -}}
    metadata:
      name: {{ include "prometheus-operator.fullname" $ }}-prometheus-{{ $i }}
      namespace: {{ template "prometheus-operator.namespace" . }}
      labels:
        app: {{ include "prometheus-operator.name" $ }}-prometheus
{{ include "prometheus-operator.labels" $ | indent 8 }}
      {{- if $ingressValues.labels }}
      {{ toYaml $ingressValues.labels | indent 8 }}
      {{- end }}
      {{- if $ingressValues.annotations }}
      annotations:
{{ toYaml $ingressValues.annotations | indent 8 }}
      {{- end }}
    spec:
      rules:
        - host: {{ $ingressValues.hostPrefix }}-{{ $i }}.{{ $ingressValues.hostDomain }}
          http:
            paths:
      {{- range $p := $ingressValues.paths }}
              - path: {{ tpl $p $ }}
                backend:
                  serviceName: {{ include "prometheus-operator.fullname" $ }}-prometheus-{{ $i }}
                  servicePort: {{ $servicePort }}
      {{- end -}}
      {{- if or $ingressValues.tlsSecretName $ingressValues.tlsSecretPerReplica.enabled }}
      tls:
        - hosts:
            - {{ $ingressValues.hostPrefix }}-{{ $i }}.{{ $ingressValues.hostDomain }}
          {{- if $ingressValues.tlsSecretPerReplica.enabled }}
          secretName: {{ $ingressValues.tlsSecretPerReplica.prefix }}-{{ $i }}
          {{- else }}
          secretName: {{ $ingressValues.tlsSecretName }}
          {{- end }}
      {{- end }}
{{- end -}}
{{- end -}}