aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/authentication/components/oauth2-proxy/templates/redis-secret.yaml
blob: 202e9243e37d2c9e6841befd1de336d0680f0709 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{{- $name := include "oauth2-proxy.name" .  -}}
{{- $fullName := include "oauth2-proxy.fullname" .  -}}
{{- $labels := include "oauth2-proxy.labels" . -}}
{{- with .Values.sessionStorage }}
{{- if and (eq .type "redis") (not .redis.existingSecret) (or .redis.password .redis.sentinel.password) }}
apiVersion: v1
kind: Secret
metadata:
  labels:
    app: {{ $name }}
    {{- $labels | indent 4 }}
  name: {{ $fullName }}-redis-access
  namespace: {{ template "oauth2-proxy.namespace" $ }}
type: Opaque
data:
  {{- if and .redis.password (not .redis.existingSecret) }}
  {{ .redis.passwordKey }}: {{ .redis.password | b64enc | quote }}
  {{- end }}
  {{- if and .redis.sentinel.password (not .redis.sentinel.existingSecret) (ne .redis.sentinel.passwordKey .redis.passwordKey) }}
  {{ .redis.sentinel.passwordKey }}: {{ .redis.sentinel.password | b64enc | quote }}
  {{- end }}
{{- end }}
{{- end }}