Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 59 additions & 47 deletions charts/citylens/README.md

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions charts/citylens/templates/helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,49 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
{{- end -}}

{{/*
Citylens Rotues connectionString builder
*/}}

{{- define "routes-api.connectionString" -}}
{{- printf "Server=%s;Port=%d;Database=%s;UID=%s;Pooling=True;Minimum Pool Size=%d;Maximum Pool Size=%d;Timeout=%d;Command Timeout=%d;Connection Idle Lifetime=30;KeepAlive=5;"
(.Values.postgres.host | required "A valid .Values.postgres.host required!")
(.Values.postgres.port | required "A valid .Values.postgres.port entry required!" | int)
(.Values.routes.postgres.api.database | required "A valid .Values.routes.postgres.api.database entry required!")
(.Values.postgres.username | required "A valid .Values.postgres.username entry required!")
((.Values.routes.postgres.api.poolSize).min | int | default 1)
((.Values.routes.postgres.api.poolSize).max | int | default 10)
(.Values.routes.postgres.api.timeout | int | default 15)
(.Values.routes.postgres.api.commandTimeout | int | default 30)
-}}
{{- end -}}

{{- define "routes-hangfire.connectionString" -}}
{{- printf "Server=%s;Port=%d;Database=%s;UID=%s;Pooling=True;Minimum Pool Size=%d;Maximum Pool Size=%d;Timeout=%d;Command Timeout=%d;Connection Idle Lifetime=30;KeepAlive=5;"
(.Values.postgres.host | required "A valid .Values.postgres.host required!")
(.Values.postgres.port | required "A valid .Values.postgres.port entry required!" | int)
(.Values.routes.postgres.hangfire.database | required "A valid .Values.routes.postgres.hangfire.database entry required!")
(.Values.postgres.username | required "A valid .Values.postgres.username entry required!")
((.Values.routes.postgres.hangfire.poolSize).min | int | default 1)
((.Values.routes.postgres.hangfire.poolSize).max | int | default 10)
(.Values.routes.postgres.hangfire.timeout | int | default 15)
(.Values.routes.postgres.hangfire.commandTimeout | int | default 30)
-}}
{{- end -}}

{{- define "routes-realtime-data-api.connectionString" -}}
{{- printf "Server=%s;Port=%d;Database=%s;UID=%s;Pooling=True;Minimum Pool Size=%d;Maximum Pool Size=%d;Timeout=%d;Command Timeout=%d;Connection Idle Lifetime=30;KeepAlive=5;"
(.Values.postgres.host | required "A valid .Values.postgres.host required!")
(.Values.postgres.port | required "A valid .Values.postgres.port entry required!" | int)
(.Values.routes.postgres.realtimeDataApi.database | required "A valid .Values.routes.postgres.realtimeDataApi.database entry required!")
(.Values.postgres.username | required "A valid .Values.postgres.username entry required!")
((.Values.routes.postgres.realtimeDataApi.poolSize).min | int | default 1)
((.Values.routes.postgres.realtimeDataApi.poolSize).max | int | default 10)
(.Values.routes.postgres.realtimeDataApi.timeout | int | default 15)
(.Values.routes.postgres.realtimeDataApi.commandTimeout | int | default 30)
-}}
{{- end -}}

{{/*
Manifest name
*/}}
Expand Down
77 changes: 35 additions & 42 deletions charts/citylens/templates/routes-api/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,29 @@ spec:
httpGet:
path: /health/live
port: http
failureThreshold: 5
initialDelaySeconds: 5
periodSeconds: 15
successThreshold: 1
initialDelaySeconds: 10
periodSeconds: 20
timeoutSeconds: 5
failureThreshold: 3
successThreshold: 1
readinessProbe:
httpGet:
path: /health/ready
port: http
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 5
failureThreshold: 3
successThreshold: 1
startupProbe:
httpGet:
path: /health/live
port: http
failureThreshold: 20
initialDelaySeconds: 5
periodSeconds: 5
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
resources:
{{- toYaml .Values.routes.api.resources | nindent 12 }}
lifecycle:
Expand All @@ -102,43 +103,35 @@ spec:
value: {{ .Values.routes.api.tempPath | quote }}

- name: Common__Logging__LogLevel
value: {{ .Values.routes.api.logging.level | quote }}
- name: Common__Logging__Extended
value: {{ .Values.routes.api.logging.extended | quote }}
value: "{{ .Values.routes.api.logging.level }}"
- name: Common__Logging__ExtendedRestLogging
value: "{{ .Values.routes.api.logging.extendedRestLogging }}"
- name: Common__Logging__ExtendedSqlLogging
value: "{{ .Values.routes.api.logging.extendedSqlLogging }}"

- name: PgSettings__Host
value: {{ required "A valid .Values.postgres.host entry required" $.Values.postgres.host | quote }}
- name: PgSettings__Port
value: {{ required "A valid .Values.postgres.port entry required" $.Values.postgres.port | quote }}
- name: PgSettings__UserName
value: {{ required "A valid .Values.postgres.username entry required" $.Values.postgres.username | quote }}
- name: PgSettings__Password
- name: Postgres__ReadWrite__ConnectionString
value: {{ include "routes-api.connectionString" . }}
- name: Postgres__ReadWrite__Password
valueFrom:
secretKeyRef:
key: postgresPassword
name: {{ include "citylens.routes.api.name" . }}-secret

- name: PgSettings__Api__Database
value: {{ required "A valid .Values.routes.postgres.database entry required" $.Values.routes.postgres.database | quote }}
- name: PgSettings__Api__Timeout
value: {{ $.Values.routes.postgres.timeout | quote }}
- name: PgSettings__Api__CommandTimeout
value: {{ $.Values.routes.postgres.commandTimeout | quote }}
- name: PgSettings__Api__MaxPoolSize
value: {{ $.Values.routes.postgres.maxPoolSize | quote }}
- name: PgSettings__Api__Pooling
value: {{ $.Values.routes.postgres.pooling | quote }}
- name: Postgres__ReadOnly__ConnectionString
value: {{ include "routes-api.connectionString" . }}
- name: Postgres__ReadOnly__Password
valueFrom:
secretKeyRef:
key: postgresPassword
name: {{ include "citylens.routes.api.name" . }}-secret

- name: PgSettings__Hangfire__Database
value: {{ required "A valid .Values.routes.hangfire.postgres.database entry required" $.Values.routes.hangfire.postgres.database | quote }}
- name: PgSettings__Hangfire__Timeout
value: {{ $.Values.routes.hangfire.postgres.timeout | quote }}
- name: PgSettings__Hangfire__CommandTimeout
value: {{ $.Values.routes.hangfire.postgres.commandTimeout | quote }}
- name: PgSettings__Hangfire__MaxPoolSize
value: {{ $.Values.routes.hangfire.postgres.maxPoolSize | quote }}
- name: PgSettings__Hangfire__Pooling
value: {{ $.Values.routes.hangfire.postgres.pooling | quote }}
- name: Hangfire__Postgres__ConnectionString
value: {{ include "routes-hangfire.connectionString" . }}
- name: Hangfire__Postgres__Password
valueFrom:
secretKeyRef:
key: postgresPassword
name: {{ include "citylens.routes.api.name" . }}-secret

- name: S3__BucketPrefix
value: {{ required "A valid .Values.s3.bucketPrefix entry required" $.Values.s3.bucketPrefix | quote }}
Expand All @@ -160,7 +153,7 @@ spec:
- name: Clients__Navigation__Enabled
value: "true"
- name: Clients__Navigation__Url
value: {{ required "A valid .Values.routes.navi.url entry required" $.Values.routes.navi.url | quote }}
value: "{{ required "A valid .Values.routes.navi.url entry required" $.Values.routes.navi.url }}"
- name: Clients__Navigation__TimeoutSeconds
value: {{ $.Values.routes.navi.timeout | quote }}
- name: Clients__Navigation__ApiKey
Expand All @@ -183,12 +176,12 @@ spec:
- name: Clients__RealTimeData__Enabled
value: "true"
- name: Clients__RealTimeData__Url
value: {{ required "A valid .Values.routes.realtimeData.url entry required" $.Values.routes.realtimeData.url | quote }}
value: "{{ required "A valid .Values.routes.realtimeData.url entry required" $.Values.routes.realtimeData.url }}"

- name: Features__AuthorizationEnabled
value: {{ $.Values.routes.features.authorizationEnabled | quote }}
- name: Features__OidcMobileAuthorizationEnabled
value: {{ $.Values.routes.features.oidcMobileAuthorizationEnabled | quote }}
value: "{{ $.Values.routes.features.oidcMobileAuthorizationEnabled }}"
- name: Features__CoverageRatioEnabled
value: {{ $.Values.routes.features.coverageRatioEnabled | quote }}

Expand All @@ -197,4 +190,4 @@ spec:
- name: TasksAssetSettings__PlannedTasksAssetId
value: {{ $.Values.routes.tasksAssetSettings.plannedTasksAssetId | quote }}
- name: TasksAssetSettings__CompletedTasksAssetId
value: {{ $.Values.routes.tasksAssetSettings.completedTasksAssetId | quote }}
value: "{{ $.Values.routes.tasksAssetSettings.completedTasksAssetId }}"
Loading