Skip to content

Commit

Permalink
[PRO-API] Add for skip ".Values.postgres.tasks" (#566)
Browse files Browse the repository at this point in the history
* [PRO-API] Add for skip ".Values.postgres.tasks"
  • Loading branch information
mprudnikov3 authored Dec 27, 2024
1 parent 20fb89c commit d323ab9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/pro-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
| `postgres.api.rw.name` | PostgreSQL database name. **Required** | `""` |
| `postgres.api.rw.username` | PostgreSQL username. **Required** | `""` |
| `postgres.api.rw.password` | PostgreSQL password. **Required** | `""` |
| `postgres.api.ro` | Settings for the read-only access. | `nil` |
| `postgres.api.ro` | Settings for the read-only access. | `[]` |

### Kafka settings (supported version 2.7)

Expand Down
4 changes: 4 additions & 0 deletions charts/pro-api/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{- define "pro-tasks.connectionString" -}}
{{- if .Values.tasks.settings.enabled -}}
{{- printf "Server=%s;Port=%d;Database=%s;UID=%s;Pooling=True;Minimum Pool Size=%d;Maximum Pool Size=%d;Timeout=%d;Connection Idle Lifetime=30;KeepAlive=5;"
(.Values.postgres.tasks.rw.host | required "A valid .Values.postgres.tasks.rw.host entry required!")
(.Values.postgres.tasks.rw.port | required "A valid .Values.postgres.tasks.rw.port entry required!" | int)
Expand All @@ -143,4 +144,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
((.Values.postgres.tasks.rw.poolSize).max | int | default 5)
(.Values.postgres.tasks.rw.timeout | int | default 15)
-}}
{{- else -}}
{{ print "" }}
{{- end -}}
{{- end -}}
2 changes: 2 additions & 0 deletions charts/pro-api/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ data:
catalogApi2gisKey: {{ required "Valid .Values.catalog.key required!" .Values.catalog.key | b64enc }}
routingApi2gisKey: {{ required "Valid .Values.navi.key required!" .Values.navi.key | b64enc }}
dbConnectionPwd: {{ required "Valid .Values.postgres.api.rw.password required!" .Values.postgres.api.rw.password | b64enc }}
{{ if .Values.tasks.settings.enabled }}
tasksDbConnectionPwd: {{ required "Valid .Values.postgres.tasks.rw.password required!" .Values.postgres.tasks.rw.password | b64enc }}
{{ end }}
s3AccessKey: {{ required "Valid .Values.dgctlStorage.accessKey required!" .Values.dgctlStorage.accessKey | b64enc }}
s3SecretKey: {{ required "Valid .Values.dgctlStorage.secretKey required!" .Values.dgctlStorage.secretKey | b64enc }}
{{ if .Values.digger.password }}
Expand Down
4 changes: 2 additions & 2 deletions charts/pro-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ postgres:
name: ''
username: ''
password: ''
ro: null
ro: []

# @skip postgres.tasks
tasks:
Expand All @@ -514,7 +514,7 @@ postgres:
name: ''
username: ''
password: ''
ro: null
ro: []

# @section Kafka settings (supported version 2.7)

Expand Down

0 comments on commit d323ab9

Please sign in to comment.