'How to set multiple passwords to a redis container version 6.2

I'd like to know if it's possible to set multiple passwords to a single redis container. I can create two secrets (which are the passwords) in the redis container, but how can I specify to the database that I can login to those two passwords?

containers:
        - name: {{ .Chart.Name }}
          securityContext:
            {{- toYaml .Values.redis.securityContext | nindent 12 }}
          image: "{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag | default .Chart.AppVersion }}"
          imagePullPolicy: {{ .Values.redis.image.pullPolicy }}
          env:
            - name: REDIS_SECRET1
              valueFrom:
                secretKeyRef:
                  name: "container1"
                  key: "REDIS_SECRET1"
            - name: REDIS_SECRET2              
              valueFrom:
                secretKeyRef:
                  name: "container1"
                  key: "REDIS_SECRET2"
          readinessProbe:
            exec:
              command:
              - bash
              - "-c"
              - |
                redis-cli -a $REDIS_SECRET1 ping
            initialDelaySeconds: 5
          resources:
            {{- toYaml .Values.redis.resources | nindent 12 }}
          args: ["--save", "''", "--requirepass", "$(REDIS_SECRET1)"] 

Thanks!!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source