|
14 | 14 | {{- with $.Values.ingress }} |
15 | 15 | publicHost: {{ ternary "https" "http" .tls }}://{{ .hostname }}{{ trimSuffix "/" .path }} |
16 | 16 | {{- end }} |
17 | | - mongodb: |
18 | 17 | # if `appConfig.mongodb` is set, it overrides the config from `mongodb`. |
19 | 18 | {{- if and $.Values.mongodb.deploy (not (kindIs "map" $.Values.appConfig.mongodb)) }} |
20 | | - {{- with $.Values.mongodb }} |
21 | | - {{- if .auth.existingSecret }} |
22 | | - connection: |
23 | | - type: Split |
24 | | - srv: {{ eq .architecture "replicaset" }} |
25 | | - host: {{ .service.nameOverride }}.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }} |
26 | | - port: {{ .service.ports.mongodb }} |
27 | | - database: {{ index .auth.databases 0 }} |
28 | | - additionalOptions: tls={{ .tls.enabled }}&ssl={{ .tls.enabled }} |
29 | | - authentication: |
30 | | - username: {{ index .auth.usernames 0 }} |
31 | | - authDatabase: {{ index .auth.databases 0 }} |
32 | | - # password is loaded from existingSecret |
33 | | - {{- else }} |
34 | | - connection: |
35 | | - # does not support architecture=replicaset, prefer using externalSecret |
36 | | - type: ConnectionString |
37 | | - connectionString: mongodb://{{ index .auth.usernames 0 }}:{{ index .auth.passwords 0 }}@{{ $.Release.Name }}-mongodb/{{ index .auth.databases 0 }} |
38 | | - {{- end }} |
39 | | - {{- end }} |
| 19 | + database: |
| 20 | + type: mongodb |
| 21 | + {{- with $.Values.mongodb }} |
| 22 | + {{- if .auth.existingSecret }} |
| 23 | + mongodb: |
| 24 | + connection: |
| 25 | + type: Split |
| 26 | + srv: {{ eq .architecture "replicaset" }} |
| 27 | + host: {{ .service.nameOverride }}.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }} |
| 28 | + port: {{ .service.ports.mongodb }} |
| 29 | + database: {{ index .auth.databases 0 }} |
| 30 | + additionalOptions: tls={{ .tls.enabled }}&ssl={{ .tls.enabled }} |
| 31 | + authentication: |
| 32 | + username: {{ index .auth.usernames 0 }} |
| 33 | + authDatabase: {{ index .auth.databases 0 }} |
| 34 | + # password is loaded from existingSecret |
| 35 | + {{- else }} |
| 36 | + connection: |
| 37 | + # does not support architecture=replicaset, prefer using externalSecret |
| 38 | + type: ConnectionString |
| 39 | + connectionString: mongodb://{{ index .auth.usernames 0 }}:{{ index .auth.passwords 0 }}@{{ $.Release.Name }}-mongodb/{{ index .auth.databases 0 }} |
| 40 | + {{- end }} |
| 41 | + {{- end }} |
40 | 42 | {{- else }} |
41 | 43 | {{- with $.Values.appConfig.mongodb }} |
42 | 44 | {{- if kindIs "string" .connectionString }} |
|
82 | 84 | '-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend={{ .Values.appConfig.jvmDebug.suspend | ternary "y" "n" }}' |
83 | 85 | {{ end }} |
84 | 86 |
|
85 | | -{{ if kindIs "map" .Values.mongodb.auth }} |
| 87 | +{{ if and (.Values.mongodb.deploy) (kindIs "map" .Values.mongodb.auth) }} |
86 | 88 | {{- with .Values.mongodb.auth -}} |
87 | 89 | {{- if .existingSecret -}} |
88 | 90 | - name: mongodb.authentication.password |
|
110 | 112 | key: {{ .clientSecret.secretKey | default "clientSecret" }} |
111 | 113 | {{- end -}} |
112 | 114 | {{- end -}} |
| 115 | +{{- if kindIs "map" .sql }} |
| 116 | +- name: database.type |
| 117 | + value: sql |
113 | 118 | {{- with .sql -}} |
114 | 119 | {{- if kindIs "map" .username }} |
115 | 120 | - name: sql.username |
|
135 | 140 | {{- end -}} |
136 | 141 | {{- end -}} |
137 | 142 | {{- end -}} |
| 143 | +{{- end -}} |
0 commit comments