Skip to content

Commit cfa0728

Browse files
committed
Merge branch 'issue/3473' into release/v2.2.5-alpha.1
2 parents 135e920 + 9a10b05 commit cfa0728

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

deploy/helm/internal-charts/cloud-sql-proxy/templates/deployment.yaml

+21-10
Original file line numberDiff line numberDiff line change
@@ -30,47 +30,58 @@ spec:
3030
{{- include "magda.imagePullSecrets" . | indent 6 }}
3131
containers:
3232
- name: cloud-sql-proxy
33+
ports:
34+
- containerPort: 5432
35+
name: db
36+
protocol: TCP
3337
image: {{ include "magda.image" . | quote }}
3438
imagePullPolicy: {{ include "magda.imagePullPolicy" . | quote }}
35-
command: ["/cloud_sql_proxy",
36-
"-instances={{ .Values.instanceConnectionName }}=tcp:0.0.0.0:5432",
39+
command:
40+
- "/cloud_sql_proxy"
41+
- "-instances={{ .Values.instanceConnectionName }}=tcp:0.0.0.0:5432"
3742
{{- if .Values.enableIamLogin }}
38-
"-enable_iam_login={{ .Values.enableIamLogin }}",
43+
- "-enable_iam_login"
3944
{{- end }}
4045
{{- if .Values.maxConnections }}
41-
"-max_connections={{ .Values.maxConnections }}",
46+
- "-max_connections={{ .Values.maxConnections }}"
4247
{{- end }}
4348
{{- if .Values.ipAddressTypes }}
44-
"-ip_address_types={{ .Values.ipAddressTypes }}",
49+
- "-ip_address_types={{ .Values.ipAddressTypes }}"
4550
{{- end }}
4651
{{- if .Values.termTimeout }}
47-
"-term_timeout={{ .Values.termTimeout }}s",
52+
- "-term_timeout={{ .Values.termTimeout }}s"
4853
{{- end }}
4954
{{- if .Values.skipFailedInstanceConfig }}
50-
"-skip_failed_instance_config={{ .Values.skipFailedInstanceConfig }}",
55+
- "-skip_failed_instance_config={{ .Values.skipFailedInstanceConfig }}"
5156
{{- end }}
5257
{{- if .Values.logDebugStdout }}
53-
"-log_debug_stdout={{ .Values.logDebugStdout }}",
58+
- "-log_debug_stdout={{ .Values.logDebugStdout }}"
5459
{{- end }}
5560
{{- if .Values.structuredLogs }}
56-
"-structured_logs={{ .Values.structuredLogs }}",
61+
- "-structured_logs={{ .Values.structuredLogs }}"
62+
{{- end }}
63+
{{- if empty .Values.enableIamLogin }}
64+
- "-credential_file=/secrets/cloudsql/credentials.json"
5765
{{- end }}
58-
"-credential_file=/secrets/cloudsql/credentials.json"]
5966
{{- if .Values.global.enableLivenessProbes }}
6067
livenessProbe:
6168
exec:
6269
command: ["nc", "-z", "127.0.0.1", "5432"]
6370
{{- end }}
6471
resources:
6572
{{ toYaml .Values.resources | indent 10 }}
73+
{{- if empty .Values.enableIamLogin }}
6674
volumeMounts:
6775
- name: cloudsql-instance-credentials
6876
mountPath: /secrets/cloudsql
6977
readOnly: true
78+
{{- end }}
7079
volumes:
80+
{{- if empty .Values.enableIamLogin }}
7181
- name: cloudsql-instance-credentials
7282
secret:
7383
secretName: cloudsql-instance-credentials
84+
{{- end }}
7485
- name: cloudsql
7586
emptyDir:
7687
{{- end }}

deploy/helm/magda-core/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ A complete solution for managing, publishing and discovering government data, pr
6565
| global.postgresql.existingSecret | string | `"db-main-account-secret"` | the secret that contains privileged PostgreSQL account password. The password will be loaded from key "postgresql-password" of the secret data. Previously (before v1.0.0), we used to load the password from "cloudsql-db-credentials" secret `password` field when use cloud provider DB services. Since v1.0.0, our helm chart can auto-create the secret and copy the content of "cloudsql-db-credentials" secret when: <ul> <li> "autoCreateSecret" is set to true</li> <li> "cloudsql-db-credentials" exists </li> </ul> for backward compatibility purposes. |
6666
| global.postgresql.postgresqlUsername | string | `"postgres"` | PostgreSQL username For in-k8s PostgreSQL, a user account will be auto-created with superuser privileges when username is `postgres`. It's recommended use superuser `postgres` for both in-k8s PostgreSQL or cloud provider DB services (e.g. CloudSQL or AWS RDS). This user will only be used for DB schema migrators to cerate DB schema and restricted DB accounts that are used by Magda internal services to access DB. If you have to use a user account rather than `postgres`, the user account needs to have sufficient permissions to run all DB migration scripts ([e.g. here](https://github.com/magda-io/magda/tree/master/magda-migrator-registry-db/sql)). Note: Until the ticket #3126 is fixed, using a DB username rather than `postgres` will trigger an error when content DB migrate runs. |
6767
| global.rollingUpdate.maxUnavailable | int | `0` | |
68-
| global.useAwsRdsDb | bool | `false` | whether to use AWS RDS DB config. When this option is on, all other database type e.g. `useCombinedDb` & `useCloudSql` must be turned off. |
69-
| global.useCloudSql | bool | `false` | whether to use Google Cloud SQL database. When this option is on, all other database type e.g. `useCombinedDb` & `useAwsRdsDb` must be turned off. |
68+
| global.useAwsRdsDb | bool | `false` | whether to use AWS RDS DB config. When this option is on, all other database type e.g. `useCombinedDb` & `useCloudSql` must be turned off. When this option is on and you want to set `autoCreateSecret` = true in order to auto create DB client password secret, you need to make sure magda.combined-db chart is selected (i.e. tags.combined-db = true). Otherwise, there will be no DB client password secret to be created (although `autoCreateSecret` = true ) |
69+
| global.useCloudSql | bool | `false` | whether to use Google Cloud SQL database. When this option is on, all other database type e.g. `useCombinedDb` & `useAwsRdsDb` must be turned off. When this option is on and you want to set `autoCreateSecret` = true in order to auto create DB client password secret, you need to make sure magda.combined-db chart is selected (i.e. tags.combined-db = true). Otherwise, there will be no DB client password secret to be created (although `autoCreateSecret` = true ) |
7070
| global.useCombinedDb | bool | `true` | |
7171
| global.useInK8sDbInstance | object | `{"authorization-db":false,"content-db":false,"registry-db":false,"session-db":false,"tenant-db":false}` | When `useCombinedDb` = false, setting any key to true will create an in-k8s DB instance for the particular database. Please note: you must set `useCombinedDb` = false before set any of the field to `true`. Otherwise, all db requests will still be forwarded to the combined DB instance other than each individual database instance. |
7272
| tags | object | see default value of each individual tag below. | (object) Control on/ off of each modules. To turn on/off openfaas, please set value to `global.openfaas.enabled` |

deploy/helm/magda-core/values.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,16 @@ global:
3939

4040
# -- whether to use Google Cloud SQL database.
4141
# When this option is on, all other database type e.g. `useCombinedDb` & `useAwsRdsDb` must be turned off.
42+
# When this option is on and you want to set `autoCreateSecret` = true in order to auto create DB client password secret,
43+
# you need to make sure magda.combined-db chart is selected (i.e. tags.combined-db = true).
44+
# Otherwise, there will be no DB client password secret to be created (although `autoCreateSecret` = true )
4245
useCloudSql: false
4346

4447
# -- whether to use AWS RDS DB config.
4548
# When this option is on, all other database type e.g. `useCombinedDb` & `useCloudSql` must be turned off.
49+
# When this option is on and you want to set `autoCreateSecret` = true in order to auto create DB client password secret,
50+
# you need to make sure magda.combined-db chart is selected (i.e. tags.combined-db = true).
51+
# Otherwise, there will be no DB client password secret to be created (although `autoCreateSecret` = true )
4652
useAwsRdsDb: false
4753

4854
# -- AWS RDS DB instance access endpoint. e.g. xxxx.xxxx.ap-southeast-2.rds.amazonaws.com.

0 commit comments

Comments
 (0)