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
2 changes: 1 addition & 1 deletion charts/navi-restrictions/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: A Helm chart for Kubernetes to deploy Restrictions backend
type: application

version: 1.37.0
appVersion: 1.0.1
appVersion: 1.0.2

maintainers:
- name: 2gis
Expand Down
30 changes: 16 additions & 14 deletions charts/navi-restrictions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ See the [documentation](https://docs.2gis.com/en/on-premise/restrictions) to lea
| ----------------------- | ------------------------------- | ------------------------------------------ |
| `api.image.repository` | API service image repository | `2gis-on-premise/navi-restrictions-api` |
| `api.image.pullPolicy` | API service pull policy | `IfNotPresent` |
| `api.image.tag` | API service image tag | `1.0.1` |
| `api.image.tag` | API service image tag | `1.0.2` |
| `cron.image.repository` | Syncer service image repository | `2gis-on-premise/navi-restrictions-syncer` |
| `cron.image.pullPolicy` | Syncer service pull policy | `IfNotPresent` |
| `cron.image.tag` | Syncer service image tag | `1.0.1` |
Expand Down Expand Up @@ -90,9 +90,11 @@ See the [documentation](https://docs.2gis.com/en/on-premise/restrictions) to lea
| `naviCastleHost` | Hostname of Navi-Castle service **required** | `""` |
| `naviCastleHostScheme` | Scheme (http/https) to access Navi-Castle service | `http` |
| `api.key` | API key **required** | `""` |
| `api.debug` | If the debug mode is enabled | `false` |
| `api.debug` | If the debug mode is enabled, changes database name if `true`, for testing purposes only | `false` |
| `api.isInitDb` | If `true` and the database does not exist, it will be created | `true` |
| `api.attractorUri` | Attractor URI of Navi-Back service | `attract/1.0.0/global/` |
| `api.logLevel` | Logging level, one of: DEBUG, INFO, WARNING, ERROR, CRITICAL | `INFO` |
| `api.logJson` | Logging in JSON | `true` |
| `api.securityContext` | Kubernetes [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) | `{}` |
| `api.service` | **Service settings.** | |
| `api.service.type` | Kubernetes [service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) | `ClusterIP` |
Expand Down Expand Up @@ -147,18 +149,18 @@ See the [documentation](https://docs.2gis.com/en/on-premise/restrictions) to lea

### Cron job settings

| Name | Description | Value |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| `cron.enabled` | If Cron job is enabled | `false` |
| `cron.schedule` | Cron job schedule | `1 * * * *` |
| `cron.concurrencyPolicy` | Cron job concurrency policy: `Allow` or `Forbid` | `Forbid` |
| `cron.successfulJobsHistoryLimit` | How many completed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits). | `3` |
| `cron.failedJobsHistoryLimit` | How many failed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits). | `3` |
| `cron.containerPort` | Cron container port | `8000` |
| `cron.edgesUriTemplate` | URL template for getting edges | `restrictions_json/{project}/{date_str}_{hour}.json` |
| `cron.edgeAttributesUriTemplate` | URL template for getting an edge's details | `develop/edge?edge_id={edge_id}&offset=200&routing=carrouting` |
| `cron.projects` | List of projects to get data for | `["moscow"]` |
| `cron.maxAttributesFetcherRps` | Maximum amount oif requests to `edgeAttributesUrlTemplate` per second | `25` |
| Name | Description | Value |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| `cron.enabled` | If Cron job is enabled | `false` |
| `cron.schedule` | Cron job schedule | `1 * * * *` |
| `cron.concurrencyPolicy` | Cron job concurrency policy: `Allow` or `Forbid` | `Forbid` |
| `cron.successfulJobsHistoryLimit` | How many completed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits) | `3` |
| `cron.failedJobsHistoryLimit` | How many failed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits) | `3` |
| `cron.containerPort` | Cron container port | `8000` |
| `cron.edgesUriTemplate` | URL template for getting edges | `restrictions_json/{project}/{date_str}_{hour}.json` |
| `cron.edgeAttributesUriTemplate` | URL template for getting an edge's details | `develop/edge?edge_id={edge_id}&offset=200&routing=carrouting` |
| `cron.projects` | List of projects to get data for | `["moscow"]` |
| `cron.maxAttributesFetcherRps` | Maximum amount oif requests to `edgeAttributesUrlTemplate` per second | `25` |

### Limits

Expand Down
2 changes: 1 addition & 1 deletion charts/navi-restrictions/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Check for deprecated values
{{- if .Values.cron.edge_attributes_url_template -}}{{ fail "[after 1.20.2] .Values.cron.edge_attributes_url_template is deprecated, use .Values.naviBackHost and .Values.cron.edgeAttributesUriTemplate" }}{{- end }}
{{- if .Values.cron.max_attributes_fetcher_rps -}}{{ fail "[after 1.20.2] .Values.cron.max_attributes_fetcher_rps is deprecated, use .Values.cron.maxAttributesFetcherRps" }}{{- end }}
{{- if .Values.db -}}{{ fail "[after 1.20.2] .Values.db renamed to .Values.postgres" }}{{- end }}
{{- end }} {{/* 1.20.2 */}}
{{- end -}} {{/* 1.20.2 */}}
{{- end }}

{{/*
Expand Down
8 changes: 6 additions & 2 deletions charts/navi-restrictions/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,13 @@ spec:
{{- end }}
env:
- name: DEBUG
value: "{{ .Values.api.debug | ternary "True" "False" }}"
value: {{ .Values.api.debug | ternary "True" "False" | quote }}
- name: LOG_LEVEL
value: {{ .Values.api.logLevel | quote }}
- name: LOG_JSON
value: {{ .Values.api.logJson | ternary "True" "False" | quote }}
- name: IS_INIT_DB
value: "{{ .Values.api.isInitDb | ternary "True" "False" }}"
value: {{ .Values.api.isInitDb | ternary "True" "False" | quote }}
- name: DB_HOST
value: {{ required "A valid .Values.postgres.host entry required" .Values.postgres.host | quote }}
- name: DB_PORT
Expand Down
12 changes: 8 additions & 4 deletions charts/navi-restrictions/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,27 @@ naviCastleHost: ''
naviCastleHostScheme: http

# @param api.key API key **required**
# @param api.debug If the debug mode is enabled
# @param api.debug If the debug mode is enabled, changes database name if `true`, for testing purposes only
# @param api.isInitDb If `true` and the database does not exist, it will be created
# @param api.attractorUri Attractor URI of Navi-Back service
# @param api.logLevel Logging level, one of: DEBUG, INFO, WARNING, ERROR, CRITICAL
# @param api.logJson Logging in JSON
# @param api.securityContext Kubernetes [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)

api:
key: ''
debug: false
isInitDb: true
attractorUri: attract/1.0.0/global/
logLevel: INFO
logJson: true

securityContext: {}

image:
repository: 2gis-on-premise/navi-restrictions-api
pullPolicy: IfNotPresent
tag: 1.0.1
tag: 1.0.2

resources:
limits:
Expand Down Expand Up @@ -221,8 +225,8 @@ postgres:
# @param cron.enabled If Cron job is enabled
# @param cron.schedule Cron job schedule
# @param cron.concurrencyPolicy Cron job concurrency policy: `Allow` or `Forbid`
# @param cron.successfulJobsHistoryLimit How many completed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits).
# @param cron.failedJobsHistoryLimit How many failed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits).
# @param cron.successfulJobsHistoryLimit How many completed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits)
# @param cron.failedJobsHistoryLimit How many failed jobs should be kept. See [jobs history limits](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits)
# @param cron.containerPort Cron container port
# @param cron.edgesUriTemplate URL template for getting edges
# @param cron.edgeAttributesUriTemplate URL template for getting an edge's details
Expand Down