From 148d3131954f7e47ee275837d1d22516215f99d4 Mon Sep 17 00:00:00 2001 From: Navi DevOps Date: Tue, 5 Nov 2024 22:35:06 +0000 Subject: [PATCH] chart/navi-back syncup --- charts/navi-back/Chart.yaml | 2 +- charts/navi-back/README.md | 28 +++++++++++++--------- charts/navi-back/templates/_helpers.tpl | 13 ++++++++++ charts/navi-back/templates/configmap.yaml | 25 ++++++++++++++++++- charts/navi-back/templates/deployment.yaml | 15 +++++++++++- charts/navi-back/values.yaml | 18 +++++++++++++- 6 files changed, 86 insertions(+), 15 deletions(-) diff --git a/charts/navi-back/Chart.yaml b/charts/navi-back/Chart.yaml index e3c83e53c..dc363e968 100644 --- a/charts/navi-back/Chart.yaml +++ b/charts/navi-back/Chart.yaml @@ -7,7 +7,7 @@ keywords: - back - backend version: 1.30.0 -appVersion: 7.27.1.2 +appVersion: 7.29.2.2 dependencies: - name: generic-chart version: '*' diff --git a/charts/navi-back/README.md b/charts/navi-back/README.md index 5fd1d63d5..94732357a 100644 --- a/charts/navi-back/README.md +++ b/charts/navi-back/README.md @@ -78,7 +78,7 @@ See the [documentation](https://docs.2gis.com/en/on-premise/navigation) to learn | Name | Description | Value | | ------------------ | ----------- | --------------------------- | | `image.repository` | Repository | `2gis-on-premise/navi-back` | -| `image.tag` | Tag | `7.27.1.2` | +| `image.tag` | Tag | `7.29.2.2` | | `image.pullPolicy` | Pull Policy | `IfNotPresent` | ### Navi-Back application settings @@ -88,6 +88,8 @@ See the [documentation](https://docs.2gis.com/en/on-premise/navigation) to learn | `naviback.ecaHost` | DEPRECATED: Use naviback.ecaUrl. Domain name of the [Traffic Proxy service](https://docs.2gis.com/en/on-premise/traffic-proxy).
This URL should be accessible from all the pods within your Kubernetes cluster | | | `naviback.ecaUrl` | URL of the [Traffic Proxy service](https://docs.2gis.com/en/on-premise/traffic-proxy).
This URL should be accessible from all the pods within your Kubernetes cluster | | | `naviback.forecastHost` | URL of Traffic forecast service. See the [Traffic Proxy service](https://docs.2gis.com/en/on-premise/traffic-proxy).
This URL should be accessible from all the pods within your Kubernetes cluster | | +| `naviback.walkingUserSpeedsUrl` | URL of walking user speeds | | +| `naviback.routeAsUsualUrl` | URL of route as usual | | | `naviback.dmSourcesLimit` | Size limit for source matrices | `1000` | | `naviback.dmTargetsLimit` | Size limit for target matrices | `1000` | | `naviback.handlersNumber` | Total number of HTTP/GRPC handlers | `1` | @@ -99,6 +101,7 @@ See the [documentation](https://docs.2gis.com/en/on-premise/navigation) to learn | `naviback.timeoutIncrementSec` | Downloading time increment after failures | `140` | | `naviback.totalRetryDurationSec` | Downloading timeout with all failure retries | `2400` | | `naviback.initialRetryIntervalSec` | Initial timeout for a failure retry | `2` | +| `naviback.clearCacheThreshold` | Memory usage percentage threshold to run cache cleanup | `90` | | `naviback.dump.result` | Dump results in logs | `false` | | `naviback.dump.query` | Dump queries in logs | `false` | | `naviback.dump.answer` | Dump answers in logs | `false` | @@ -161,25 +164,28 @@ See the [documentation](https://docs.2gis.com/en/on-premise/navigation) to learn | `naviback.validation.isochrone.requestSchemaName` | Name of isochrone request validation schema | `IsochroneApiRequestModel.json` | | `naviback.validation.isochrone.responseSchemaName` | Name of isochrone response validation schema | `IsochroneApiResponseModel.json` | | `naviback.tilesMetricsThreshold` | The value at which we send tiles metrics (used for internal tests) | `0` | +| `naviback.engineUpdatePeriodSec` | The time interval between engine updates | `30` | | `naviback.hierarchies.enabled` | If SN cache available | `false` | | `naviback.hierarchies.skipPatches` | Skip patches in hierarchies cache, ignored if skipShortcuts set | `false` | | `naviback.hierarchies.skipShortcuts` | Skip shortcuts in SN cache | `false` | | `naviback.hierarchies.s3path` | Hierarchies cache remote location | `""` | +| `naviback.hierarchies.volume` | Hierarchies local cache specification. Leave empty for default emptydir. | `{}` | | `naviback.etaScheduleIndex.enabled` | If Schedule Index available | `false` | | `naviback.etaScheduleIndex.url` | Schedule Index remote url | `""` | ### Envoy settings, ignored if not `transmitter.enabled`. Leave with defaults, FOR FUTURE RELEASE. -| Name | Description | Value | -| --------------------------------- | ------------------------------------------ | ----------------------- | -| `envoy.image.repository` | Repository | `2gis-on-premise/envoy` | -| `envoy.image.tag` | Tag | `v1.27.0` | -| `envoy.image.pullPolicy` | Pull Policy | `IfNotPresent` | -| `envoy.resources` | Container resources requirements structure | `{}` | -| `envoy.resources.requests.cpu` | CPU request, recommended value `100m` | `undefined` | -| `envoy.resources.requests.memory` | Memory request, recommended value `100Mi` | `undefined` | -| `envoy.resources.limits.cpu` | CPU limit, recommended value `100m` | `undefined` | -| `envoy.resources.limits.memory` | Memory limit, recommended value `100Mi` | `undefined` | +| Name | Description | Value | +| --------------------------------- | -------------------------------------------------------------------------------------------- | ----------------------- | +| `envoy.image.repository` | Repository | `2gis-on-premise/envoy` | +| `envoy.image.tag` | Tag | `v1.27.0` | +| `envoy.image.pullPolicy` | Pull Policy | `IfNotPresent` | +| `envoy.concurrency` | The number of worker threads to run. Use `max(1, floor(resources.limits.cpu))` if set to `0` | `""` | +| `envoy.resources` | Container resources requirements structure | `{}` | +| `envoy.resources.requests.cpu` | CPU request, recommended value `100m` | `undefined` | +| `envoy.resources.requests.memory` | Memory request, recommended value `100Mi` | `undefined` | +| `envoy.resources.limits.cpu` | CPU limit, recommended value `100m` | `undefined` | +| `envoy.resources.limits.memory` | Memory limit, recommended value `100Mi` | `undefined` | ### Service account settings diff --git a/charts/navi-back/templates/_helpers.tpl b/charts/navi-back/templates/_helpers.tpl index 4bbe27c71..cfc348374 100644 --- a/charts/navi-back/templates/_helpers.tpl +++ b/charts/navi-back/templates/_helpers.tpl @@ -408,3 +408,16 @@ Usage: {{- define "custom.ca.mountPath" -}} {{ .Values.customCAs.certsPath | default "/usr/local/share/ca-certificates" }} {{- end -}} + +{{/* +Calculate envoy --concurrency value +*/}} +{{- define "envoy.get-concurrency" }} + {{- if ne 0 (.Values.envoy.concurrency | int) }} + {{- max 1 (.Values.envoy.concurrency | int) -}} + {{- else if (.Values.envoy.resources.limits).cpu }} + {{- max 1 (include "generic-chart.parse-resource-quantity" .Values.envoy.resources.limits.cpu | floor | int) }} + {{- else }} + {{- printf "1" -}} + {{- end }} +{{- end }} diff --git a/charts/navi-back/templates/configmap.yaml b/charts/navi-back/templates/configmap.yaml index db82430ab..6aca7d436 100644 --- a/charts/navi-back/templates/configmap.yaml +++ b/charts/navi-back/templates/configmap.yaml @@ -466,6 +466,28 @@ data: } }, {{- end }}{{- /* .Values.naviback.indices.snImport.enabled */}} + {{- if .Values.naviback.indices.routeAsUsual.enabled }} + "route_as_usual": { + "update_period": 0, + "nodes": [ + "{{ .Values.naviback.routeAsUsualUrl }}" + ], + "timeout_seconds": { + "count": 60 + } + }, + {{- end }}{{- /* .Values.naviback.indices.routeAsUsual.enabled */}} + {{- if .Values.naviback.indices.walkingUserSpeeds.enabled }} + "walking_user_speeds": { + "update_period": 0, + "nodes": [ + "{{ .Values.naviback.walkingUserSpeedsUrl }}" + ], + "timeout_seconds": { + "count": 60 + } + }, + {{- end }}{{- /* .Values.naviback.indices.walkingUserSpeeds.enabled */}} {{- if .Values.naviback.indices.geoImport.enabled }} "geo_import": { "update_period": 0, @@ -663,7 +685,8 @@ data: "dump_answer": {{ mustToJson (.Values.naviback.dump).answer }}, "max_parallel_workers": 2, "use_memory_mapped_vfs": true, - "engine_update_period_sec": {{ include "config.setEngineUpdatePeriod" $ | default 30 }}, + "clear_cache_threshold": {{ .Values.naviback.clearCacheThreshold | int }}, + "engine_update_period_sec": {{ include "config.setEngineUpdatePeriod" $ | default .Values.naviback.engineUpdatePeriodSec }}, {{- if .Values.naviback.server_id }} "server_id": "{{- include "tplvalues.render" ( dict "value" .Values.naviback.server_id "context" .) }}", {{- else }} diff --git a/charts/navi-back/templates/deployment.yaml b/charts/navi-back/templates/deployment.yaml index 603a9c44b..3dc27cfba 100644 --- a/charts/navi-back/templates/deployment.yaml +++ b/charts/navi-back/templates/deployment.yaml @@ -71,7 +71,11 @@ spec: {{- end }} {{- if .Values.naviback.hierarchies.enabled }} - name: hierarchies-volume + {{- if .Values.naviback.hierarchies.volume }} + {{- toYaml .Values.naviback.hierarchies.volume | nindent 8 }} + {{- else }} emptyDir: {} + {{- end }}{{- /* if .Values.naviback.hierarchies.volume */}} {{- end }} {{- if .Values.extraVolumes }} {{- include "tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 6 }} @@ -91,6 +95,15 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: {{ required "A valid .Values.dgctlDockerRegistry entry required" .Values.dgctlDockerRegistry }}/{{ .Values.envoy.image.repository }}:{{ .Values.envoy.image.tag }} imagePullPolicy: {{ .Values.envoy.image.pullPolicy }} + args: + - -c + - /etc/envoy/envoy.yaml + {{- if and (kindIs "string" .Values.envoy.concurrency) (eq "" .Values.envoy.concurrency) }} + {{/* envoy.concurrency = '', skip */}} + {{- else }} + - "--concurrency" + - {{ include "envoy.get-concurrency" . | quote }} + {{- end }} volumeMounts: - name: {{ include "generic-chart.fullname" . }}-configmap mountPath: /etc/envoy/envoy.yaml @@ -205,7 +218,7 @@ spec: mountPath: "/tmp/hierarchies" {{- end }} {{- if .Values.extraVolumeMounts }} - {{- include "tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 10 }} + {{- include "tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }} {{- end }} {{- if .Values.customCAs.bundle }} - name: {{ include "generic-chart.fullname" . }}-configmap-ca diff --git a/charts/navi-back/values.yaml b/charts/navi-back/values.yaml index de6f8d3f8..5183949d5 100644 --- a/charts/navi-back/values.yaml +++ b/charts/navi-back/values.yaml @@ -106,7 +106,7 @@ args: [] image: repository: 2gis-on-premise/navi-back pullPolicy: IfNotPresent - tag: 7.27.1.2 + tag: 7.29.2.2 # @section Navi-Back application settings @@ -114,6 +114,8 @@ image: # @extra naviback.ecaHost DEPRECATED: Use naviback.ecaUrl. Domain name of the [Traffic Proxy service](https://docs.2gis.com/en/on-premise/traffic-proxy).
This URL should be accessible from all the pods within your Kubernetes cluster # @extra naviback.ecaUrl URL of the [Traffic Proxy service](https://docs.2gis.com/en/on-premise/traffic-proxy).
This URL should be accessible from all the pods within your Kubernetes cluster # @extra naviback.forecastHost URL of Traffic forecast service. See the [Traffic Proxy service](https://docs.2gis.com/en/on-premise/traffic-proxy).
This URL should be accessible from all the pods within your Kubernetes cluster +# @extra naviback.walkingUserSpeedsUrl URL of walking user speeds +# @extra naviback.routeAsUsualUrl URL of route as usual # @skip naviback.appPort # @param naviback.dmSourcesLimit Size limit for source matrices # @param naviback.dmTargetsLimit Size limit for target matrices @@ -126,6 +128,7 @@ image: # @param naviback.timeoutIncrementSec Downloading time increment after failures # @param naviback.totalRetryDurationSec Downloading timeout with all failure retries # @param naviback.initialRetryIntervalSec Initial timeout for a failure retry +# @param naviback.clearCacheThreshold Memory usage percentage threshold to run cache cleanup # @param naviback.dump.result Dump results in logs # @param naviback.dump.query Dump queries in logs # @param naviback.dump.answer Dump answers in logs @@ -173,6 +176,8 @@ image: # @skip naviback.indices.tugc2gisIndex.enabled # @skip naviback.indices.tugcUsers.enabled # @skip naviback.indices.tugcUsersIndex.enabled +# @skip naviback.indices.routeAsUsual.enabled +# @skip naviback.indices.walkingUserSpeeds.enabled # @extra naviback.additionalSections Optinal JSON block to be added to config file as-is # @skip naviback.simpleNetwork # @extra naviback.simpleNetwork.bicycle Enable simple network for bicycle routing @@ -216,10 +221,12 @@ image: # @param naviback.validation.isochrone.requestSchemaName Name of isochrone request validation schema # @param naviback.validation.isochrone.responseSchemaName Name of isochrone response validation schema # @param naviback.tilesMetricsThreshold The value at which we send tiles metrics (used for internal tests) +# @param naviback.engineUpdatePeriodSec The time interval between engine updates # @param naviback.hierarchies.enabled If SN cache available # @param naviback.hierarchies.skipPatches Skip patches in hierarchies cache, ignored if skipShortcuts set # @param naviback.hierarchies.skipShortcuts Skip shortcuts in SN cache # @param naviback.hierarchies.s3path Hierarchies cache remote location +# @param naviback.hierarchies.volume Hierarchies local cache specification. Leave empty for default emptydir. # @param naviback.etaScheduleIndex.enabled If Schedule Index available # @param naviback.etaScheduleIndex.url Schedule Index remote url # @skip rules @@ -237,6 +244,7 @@ naviback: timeoutIncrementSec: 140 totalRetryDurationSec: 2400 initialRetryIntervalSec: 2 + clearCacheThreshold: 90 dump: result: false query: false @@ -308,6 +316,10 @@ naviback: enabled: false tugcUsersIndex: enabled: false + routeAsUsual: + enabled: false + walkingUserSpeeds: + enabled: false simpleNetwork: emergency: false attractor: {} @@ -345,11 +357,13 @@ naviback: requestSchemaName: IsochroneApiRequestModel.json responseSchemaName: IsochroneApiResponseModel.json tilesMetricsThreshold: 0 + engineUpdatePeriodSec: 30 hierarchies: enabled: false skipPatches: false skipShortcuts: false s3path: '' + volume: {} etaScheduleIndex: enabled: false url: '' @@ -362,6 +376,7 @@ rules: [] # @param envoy.image.repository Repository # @param envoy.image.tag Tag # @param envoy.image.pullPolicy Pull Policy +# @param envoy.concurrency The number of worker threads to run. Use `max(1, floor(resources.limits.cpu))` if set to `0` # @param envoy.resources [nullable] Container resources requirements structure # @param envoy.resources.requests.cpu [nullable] CPU request, recommended value `100m` # @param envoy.resources.requests.memory [nullable] Memory request, recommended value `100Mi` @@ -373,6 +388,7 @@ envoy: repository: 2gis-on-premise/envoy pullPolicy: IfNotPresent tag: v1.27.0 + concurrency: '' resources: {}