add existingSecret option, align postgres PW handling
This commit is contained in:
		
							parent
							
								
									9960f52561
								
							
						
					
					
						commit
						2fc2751d75
					
				
					 4 changed files with 16 additions and 2 deletions
				
			
		| 
						 | 
					@ -47,12 +47,16 @@ spec:
 | 
				
			||||||
            - name: DATABASE_PASSWORD
 | 
					            - name: DATABASE_PASSWORD
 | 
				
			||||||
              valueFrom:
 | 
					              valueFrom:
 | 
				
			||||||
                secretKeyRef:
 | 
					                secretKeyRef:
 | 
				
			||||||
                  name: {{ include "django.postgresql.fullname" . }}
 | 
					                  name: {{ default (include "django.postgresql.fullname" .) .Values.postgresql.auth.existingSecret }}
 | 
				
			||||||
                  key: postgres-password
 | 
					                  key: postgres-password
 | 
				
			||||||
{{- end }}
 | 
					{{- end }}
 | 
				
			||||||
          envFrom:
 | 
					          envFrom:
 | 
				
			||||||
            - secretRef:
 | 
					            - secretRef:
 | 
				
			||||||
                name: {{ include "django.fullname" . }}
 | 
					                name: {{ include "django.fullname" . }}
 | 
				
			||||||
 | 
					            {{- if .Values.existingSecret }}
 | 
				
			||||||
 | 
					            - secretRef:
 | 
				
			||||||
 | 
					                name: {{ .Values.existingSecret }}
 | 
				
			||||||
 | 
					            {{- end }}
 | 
				
			||||||
            - configMapRef:
 | 
					            - configMapRef:
 | 
				
			||||||
                name: {{ include "django.fullname" . }}
 | 
					                name: {{ include "django.fullname" . }}
 | 
				
			||||||
      {{- with .Values.beat.nodeSelector }}
 | 
					      {{- with .Values.beat.nodeSelector }}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -74,6 +74,10 @@ spec:
 | 
				
			||||||
          envFrom:
 | 
					          envFrom:
 | 
				
			||||||
            - secretRef:
 | 
					            - secretRef:
 | 
				
			||||||
                name: {{ include "django.fullname" . }}
 | 
					                name: {{ include "django.fullname" . }}
 | 
				
			||||||
 | 
					            {{- if .Values.existingSecret }}
 | 
				
			||||||
 | 
					            - secretRef:
 | 
				
			||||||
 | 
					                name: {{ .Values.existingSecret }}
 | 
				
			||||||
 | 
					            {{- end }}
 | 
				
			||||||
            - configMapRef:
 | 
					            - configMapRef:
 | 
				
			||||||
                name: {{ include "django.fullname" . }}
 | 
					                name: {{ include "django.fullname" . }}
 | 
				
			||||||
      {{- with .Values.web.nodeSelector }}
 | 
					      {{- with .Values.web.nodeSelector }}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -46,12 +46,16 @@ spec:
 | 
				
			||||||
            - name: DATABASE_PASSWORD
 | 
					            - name: DATABASE_PASSWORD
 | 
				
			||||||
              valueFrom:
 | 
					              valueFrom:
 | 
				
			||||||
                secretKeyRef:
 | 
					                secretKeyRef:
 | 
				
			||||||
                  name: {{ include "django.postgresql.fullname" . }}
 | 
					                  name: {{ default (include "django.postgresql.fullname" .) .Values.postgresql.auth.existingSecret }}
 | 
				
			||||||
                  key: postgres-password
 | 
					                  key: postgres-password
 | 
				
			||||||
{{- end }}
 | 
					{{- end }}
 | 
				
			||||||
          envFrom:
 | 
					          envFrom:
 | 
				
			||||||
            - secretRef:
 | 
					            - secretRef:
 | 
				
			||||||
                name: {{ include "django.fullname" . }}
 | 
					                name: {{ include "django.fullname" . }}
 | 
				
			||||||
 | 
					            {{- if .Values.existingSecret }}
 | 
				
			||||||
 | 
					            - secretRef:
 | 
				
			||||||
 | 
					                name: {{ .Values.existingSecret }}
 | 
				
			||||||
 | 
					            {{- end }}
 | 
				
			||||||
            - configMapRef:
 | 
					            - configMapRef:
 | 
				
			||||||
                name: {{ include "django.fullname" . }}
 | 
					                name: {{ include "django.fullname" . }}
 | 
				
			||||||
      {{- with .Values.worker.nodeSelector }}
 | 
					      {{- with .Values.worker.nodeSelector }}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,6 +18,8 @@ env:
 | 
				
			||||||
    # DATABASE_URL:
 | 
					    # DATABASE_URL:
 | 
				
			||||||
    # REDIS_URL:
 | 
					    # REDIS_URL:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					existingSecret: ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
web:
 | 
					web:
 | 
				
			||||||
  replicaCount: 2
 | 
					  replicaCount: 2
 | 
				
			||||||
  port: 8080
 | 
					  port: 8080
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue