-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(charts): allow using existing secrets #947
Changes from all commits
a154323
f852a8d
7ea1f8c
0a67d77
913f4ca
75c4489
6ca40a4
2d4fced
9f0b040
b6612e6
bf67e6f
7e01279
0ca9a36
ae686de
1b69ac4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,14 +216,6 @@ example: | |
{{- end -}} | ||
|
||
|
||
{{- define "substra-backend.database.secret-name" -}} | ||
{{- if .Values.database.auth.credentialsSecretName -}} | ||
{{- .Values.database.auth.credentialsSecretName }} | ||
{{- else -}} | ||
{{- template "substra.fullname" . }}-database | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
The hostname we should connect to (external is defined, otherwise integrated) | ||
*/}} | ||
|
@@ -331,7 +323,7 @@ The hostname we should connect to (external is defined, otherwise integrated) | |
- configMapRef: | ||
name: {{ include "substra.fullname" . }}-settings | ||
- secretRef: | ||
name: {{ include "substra-backend.database.secret-name" . }} | ||
name: {{ include "substra-backend.database.secretName" . }} | ||
env: | ||
- name: DJANGO_SETTINGS_MODULE | ||
value: backend.settings.{{ .Values.settings }} | ||
|
@@ -371,7 +363,6 @@ Define service port based on MinIO or LocalStack enablement | |
{{- end -}} | ||
{{- end -}} | ||
|
||
|
||
{{/* | ||
Define objectstore access key based on MinIO or LocalStack enablement | ||
*/}} | ||
|
@@ -408,3 +399,47 @@ Retrieve AWS environment variable value | |
{{- end -}} | ||
{{- $value -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Define database secret name | ||
*/}} | ||
{{- define "substra-backend.database.secretName" -}} | ||
{{- if .Values.database.auth.existingSecretName -}} | ||
{{- .Values.database.auth.existingSecretName }} | ||
{{- else -}} | ||
{{ include "substra.fullname" . }}-database | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Define redis secret name | ||
*/}} | ||
{{- define "substra-backend.redis.secretName" -}} | ||
{{- if .Values.redis.auth.existingSecretName -}} | ||
{{- .Values.database.auth.existingSecretName }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also, the new redis value has not been documented There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The redis section has: ## @skip redis |
||
{{- else -}} | ||
{{ include "substra.fullname" . }}-redis | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Define account operators secret name | ||
*/}} | ||
{{- define "substra-backend.accountOperator.secretName" -}} | ||
{{- if .Values.addAccountOperator.existingSecretName -}} | ||
{{- .Values.database.auth.existingSecretName }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😇 |
||
{{- else -}} | ||
{{ include "substra.fullname" . }}-add-account | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Define object store secret name | ||
*/}} | ||
{{- define "substra-backend.objectStore.secretName" -}} | ||
{{- if .Values.redis.auth.existingSecretName -}} | ||
{{- .Values.database.auth.existingSecretName }} | ||
Comment on lines
+440
to
+441
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🕵️ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤦 |
||
{{- else -}} | ||
{{ include "substra.fullname" . }}-objectstore | ||
{{- end -}} | ||
{{- end -}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
{{- if not .Values.addAccountOperator.existingSecretName }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "substra.fullname" . }}-add-account | ||
name: {{ template "substra-backend.accountOperator.secretName" . }} | ||
labels: | ||
{{ include "substra.labels" . | nindent 4 }} | ||
app.kubernetes.io/name: {{ include "substra.name" . }}-add-account | ||
data: | ||
users: {{ include "common.users" .Values.addAccountOperator.users | b64enc | quote }} | ||
incoming_organizations: {{ include "common.users" .Values.addAccountOperator.incomingOrganizations | b64enc | quote }} | ||
outgoing_organizations: {{ include "common.users" .Values.addAccountOperator.outgoingOrganizations | b64enc | quote }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{{- if not .Values.database.auth.credentialsSecretName }} | ||
{{- if not .Values.database.auth.existingSecretName }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ template "substra.fullname" . }}-database | ||
name: {{ template "substra-backend.database.secretName" . }} | ||
labels: | ||
{{- include "substra.labels" . | nindent 4 }} | ||
type: Opaque | ||
stringData: | ||
DATABASE_PASSWORD: {{ .Values.database.auth.password | quote }} | ||
DATABASE_USERNAME: {{ .Values.database.auth.username | quote }} | ||
{{- end }} | ||
data: | ||
DATABASE_PASSWORD: {{ .Values.database.auth.password | b64enc | quote }} | ||
DATABASE_USERNAME: {{ .Values.database.auth.username | b64enc | quote }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
{{- if or (not .Values.minio.auth.existingSecretName) .Values.localstack.enabled }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "substra.fullname" . }}-objectstore | ||
name: {{ template "substra-backend.objectStore.secretName" . }} | ||
labels: | ||
{{ include "substra.labels" . | nindent 4 }} | ||
app.kubernetes.io/name: {{ include "substra.name" . }} | ||
type: Opaque | ||
data: | ||
OBJECTSTORE_ACCESSKEY: {{ include "substra-backend.objectStore.accessKey" . | b64enc }} | ||
OBJECTSTORE_SECRETKEY: {{ include "substra-backend.objectStore.secretKey" . | b64enc }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
{{- if not .Values.redis.auth.existingSecretName }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ template "substra.fullname" . }}-redis | ||
name: {{ template "substra-backend.redis.secretName" . }} | ||
labels: | ||
{{- include "substra.labels" . | nindent 4 }} | ||
type: Opaque | ||
data: | ||
CELERY_BROKER_PASSWORD: {{ .Values.redis.auth.password | b64enc | quote }} | ||
{{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This key is duplicated 🤔