github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/keycloak/templates/ingress.yaml (about)

     1  {{- $ingress := .Values.ingress -}}
     2  {{- if $ingress.enabled -}}
     3  {{- $apiVersion := "networking.k8s.io/v1" -}}
     4  apiVersion: {{ $apiVersion }}
     5  kind: Ingress
     6  metadata:
     7    name: {{ include "keycloak.fullname" . }}
     8    namespace: {{ .Release.Namespace }}
     9    {{- with $ingress.annotations }}
    10    annotations:
    11      {{- range $key, $value := . }}
    12      {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
    13      {{- end }}
    14    {{- end }}
    15    labels:
    16      {{- include "keycloak.labels" . | nindent 4 }}
    17      {{- range $key, $value := $ingress.labels }}
    18      {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
    19      {{- end }}
    20  spec:
    21  {{- if $ingress.ingressClassName }}
    22    ingressClassName: {{ $ingress.ingressClassName }}
    23  {{- end }}
    24  {{- if $ingress.tls }}
    25    tls:
    26      {{- range $ingress.tls }}
    27      - hosts:
    28        {{- range .hosts }}
    29          - {{ tpl . $ | quote }}
    30        {{- end }}
    31        {{- with .secretName }}
    32        secretName: {{ tpl . $ }}
    33        {{- end }}
    34      {{- end }}
    35  {{- end }}
    36    rules:
    37      {{- range .Values.ingress.rules }}
    38      - host: {{ tpl .host $ | quote }}
    39        http:
    40          paths:
    41            {{- range .paths }}
    42            - path: {{ tpl .path $ | quote }}
    43              pathType: {{ .pathType }}
    44              backend:
    45                service:
    46                  name: {{ include "keycloak.fullname" $ }}-http
    47                  port:
    48                    name: {{ $ingress.servicePort }}
    49            {{- end }}
    50      {{- end }}
    51  {{- if $ingress.console.enabled }}
    52  ---
    53  apiVersion: {{ $apiVersion }}
    54  kind: Ingress
    55  metadata:
    56    name: {{ include "keycloak.fullname" . }}-console
    57    namespace: {{ .Release.Namespace }}
    58    {{- with $ingress.console.annotations }}
    59    annotations:
    60      {{- range $key, $value := . }}
    61      {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
    62      {{- end }}
    63    {{- end }}
    64    labels:
    65      {{- include "keycloak.labels" . | nindent 4 }}
    66      {{- range $key, $value := $ingress.labels }}
    67      {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
    68      {{- end }}
    69  spec:
    70  {{- if $ingress.console.ingressClassName }}
    71    ingressClassName: {{ $ingress.console.ingressClassName }}
    72  {{- end }}
    73  {{- if $ingress.console.tls }}
    74    tls:
    75      {{- range $ingress.console.tls }}
    76      - hosts:
    77        {{- range .hosts }}
    78          - {{ tpl . $ | quote }}
    79        {{- end }}
    80        {{- with .secretName }}
    81        secretName: {{ tpl . $ }}
    82        {{- end }}
    83      {{- end }}
    84  {{ else if $ingress.tls }}
    85    tls:
    86      {{- range $ingress.tls }}
    87      - hosts:
    88        {{- range .hosts }}
    89          - {{ tpl . $ | quote }}
    90        {{- end }}
    91        {{- with .secretName }}
    92        secretName: {{ tpl . $ }}
    93        {{- end }}
    94      {{- end }}
    95  {{- end }}
    96    rules:
    97      {{- range .Values.ingress.console.rules }}
    98      - host: {{ tpl .host $ | quote }}
    99        http:
   100          paths:
   101            {{- range .paths }}
   102            - path: {{ tpl .path $ | quote }}
   103              pathType: {{ .pathType }}
   104              backend:
   105                service:
   106                  name: {{ include "keycloak.fullname" $ }}-http
   107                  port:
   108                    name: {{ $ingress.servicePort }}
   109            {{- end }}
   110      {{- end }}
   111  {{- end -}}
   112  {{- end -}}