From fbef626abfce339fd7e2eb41f8d234223fe0fabe Mon Sep 17 00:00:00 2001 From: Alexander Voronkov Date: Mon, 23 Oct 2023 15:39:08 +0300 Subject: [PATCH] Fixed formating after running pre-commit hooks --- .pre-commit-config.yaml | 28 +++++++ charts/citylens/templates/helpers.tpl | 2 - charts/floors-api/templates/configmap.yaml | 1 - charts/floors-api/templates/deployment.yaml | 2 +- .../gis-platform-config/layer/2gis.json | 2 +- charts/keycloak/configs/citylens.tpl | 1 - .../templates/configmap-env-vars.yaml | 5 +- charts/keycloak/templates/tls-secret.yaml | 1 - charts/keys/templates/helpers.tpl | 4 +- charts/navi-back/templates/configmap.yaml | 20 ++--- charts/navi-back/templates/deployment.yaml | 4 +- .../navi-castle/templates/configmapnginx.yaml | 1 - charts/navi-castle/templates/cronjob.yaml | 16 ++-- charts/navi-castle/templates/statefulset.yaml | 10 +-- charts/navi-front/templates/_helpers.tpl | 6 +- .../navi-front/templates/configmap-extra.yaml | 1 - charts/navi-front/templates/deployment.yaml | 6 +- .../navi-restrictions/templates/cronjob.yaml | 2 +- charts/navi-router/templates/deployment.yaml | 6 +- charts/navi-splitter/templates/ingress.yaml | 2 +- charts/pro-api/templates/deployment.yaml | 2 +- .../templates/permissions-api-deployment.yaml | 2 +- .../templates/user-asset-importer.yaml | 2 +- charts/pro-ui/templates/NOTES.txt | 2 +- charts/search-api/templates/ingress.yaml | 1 - charts/stat-receiver/topics-config.md | 2 +- charts/traffic-proxy/README.md | 1 - helmfile/CHANGELOG.md | 2 +- helmfile/README.md | 10 +-- helmfile/deploy/navi/navi-async-grpc.yaml | 6 +- helmfile/deploy/navi/navi-async-matrix.yaml | 22 +++--- helmfile/deploy/navi/navi-back-custom.yaml | 74 +++++++++---------- helmfile/deploy/navi/navi-castle.yaml | 4 +- helmfile/deploy/navi/navi-front.yaml | 11 +-- helmfile/deploy/navi/navi-router.yaml | 4 +- helmfile/deploy/navi/navi-splitter.yaml | 7 +- helmfile/deploy/tests/navi-async-service.sh | 2 +- helmfile/deploy/tests/navi-front.sh | 44 +++++------ helmfile/deploy/tests/points/moscow_cr.json | 1 - .../deploy/tests/points/moscow_is_cr.json | 1 - helmfile/deploy/tests/points/moscow_tx.json | 2 +- helmfile/helmfile_values/base.yaml | 27 ++++--- .../navi/navi-async-grpc-proxy/_common.gotmpl | 2 +- .../navi/navi-async-matrix/_common.gotmpl | 5 +- .../services/navi/navi-async-matrix/test.yaml | 5 +- .../services/navi/navi-back/_common.gotmpl | 18 ++--- .../navi/navi-back/_common_dma.gotmpl | 2 +- .../helmfile_values/templates/dgctl.gotmpl | 2 +- .../helmfile_values/templates/ingress.gotmpl | 2 +- .../templates/optionalEnv.gotmpl | 1 - .../templates/optionalEnvDMA.gotmpl | 1 - styleguide.md | 31 ++++---- 52 files changed, 214 insertions(+), 204 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..7cb4f2d56 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,28 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +# Using pip: +# pip install pre-commit +# exclude: '^collections/' +# +# To install, run the project in the root: +# pre-commit install +# To uninstall, run the project in the root: +# pre-commit uninstall + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + - id: end-of-file-fixer + - id: check-added-large-files + - id: check-symlinks + - id: debug-statements + # - id: check-yaml + # # exclude: '^(old)/|log.yml' + # args: [--unsafe] + # - repo: https://github.com/executablebooks/mdformat + # rev: 0.7.17 + # hooks: + # - id: mdformat diff --git a/charts/citylens/templates/helpers.tpl b/charts/citylens/templates/helpers.tpl index 7871fc8ef..1fac577b7 100644 --- a/charts/citylens/templates/helpers.tpl +++ b/charts/citylens/templates/helpers.tpl @@ -108,5 +108,3 @@ app.kubernetes.io/name: {{ include "citylens.api.name" . }} app.kubernetes.io/instance: {{ .Chart.Name }}-db-migration app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} - - diff --git a/charts/floors-api/templates/configmap.yaml b/charts/floors-api/templates/configmap.yaml index cd51501fa..47991cac2 100644 --- a/charts/floors-api/templates/configmap.yaml +++ b/charts/floors-api/templates/configmap.yaml @@ -79,4 +79,3 @@ data: return 200 'OK'; } } - diff --git a/charts/floors-api/templates/deployment.yaml b/charts/floors-api/templates/deployment.yaml index ec13664fa..bf4327f3f 100644 --- a/charts/floors-api/templates/deployment.yaml +++ b/charts/floors-api/templates/deployment.yaml @@ -40,7 +40,7 @@ spec: - name: import image: {{ required "A valid .Values.dgctlDockerRegistry entry required" .Values.dgctlDockerRegistry }}/{{ .Values.import.image.repository }}:{{ .Values.import.image.tag }} imagePullPolicy: {{ .Values.import.imagePullPolicy }} - securityContext: + securityContext: {{- toYaml .Values.securityContext | nindent 12 }} env: - name: IMPORTER_S3_ENDPOINT diff --git a/charts/gis-platform/gis-platform-config/layer/2gis.json b/charts/gis-platform/gis-platform-config/layer/2gis.json index cdbca645f..6c61ba7d8 100644 --- a/charts/gis-platform/gis-platform-config/layer/2gis.json +++ b/charts/gis-platform/gis-platform-config/layer/2gis.json @@ -94,7 +94,7 @@ }, "urlFormat": "https://tile1.maps.2gis.com/tiles?x={2}&y={3}&z={1}&v=1.5&ts=online_sd_ar&layerType=nc", "subDomains": [ - + ], "copyrightText": "", "allowDirectAccess": true, diff --git a/charts/keycloak/configs/citylens.tpl b/charts/keycloak/configs/citylens.tpl index 673e82518..b358896ce 100644 --- a/charts/keycloak/configs/citylens.tpl +++ b/charts/keycloak/configs/citylens.tpl @@ -2167,4 +2167,3 @@ "users": [] {{- end }} } - diff --git a/charts/keycloak/templates/configmap-env-vars.yaml b/charts/keycloak/templates/configmap-env-vars.yaml index 526abbfbb..9f82003ed 100644 --- a/charts/keycloak/templates/configmap-env-vars.yaml +++ b/charts/keycloak/templates/configmap-env-vars.yaml @@ -35,10 +35,10 @@ data: {{- if .Values.cache.enabled }} KEYCLOAK_CACHE_TYPE: "ispn" {{- if .Values.cache.stackName }} - KEYCLOAK_CACHE_STACK: {{ .Values.cache.stackName | quote }} + KEYCLOAK_CACHE_STACK: {{ .Values.cache.stackName | quote }} {{- end }} {{- if .Values.cache.stackFile }} - KEYCLOAK_CACHE_CONFIG_FILE: {{ .Values.cache.stackFile | quote }} + KEYCLOAK_CACHE_CONFIG_FILE: {{ .Values.cache.stackFile | quote }} {{- end }} JAVA_OPTS_APPEND: {{ printf "-Djgroups.dns.query=%s-headless.%s.svc" (include "keycloak.fullname" .) (include "keycloak.names.namespace" .) | quote }} {{- else }} @@ -48,4 +48,3 @@ data: KEYCLOAK_LOG_OUTPUT: {{ .Values.logging.output | quote }} KC_LOG_LEVEL: {{ .Values.logging.level | quote }} {{- end }} - diff --git a/charts/keycloak/templates/tls-secret.yaml b/charts/keycloak/templates/tls-secret.yaml index 5f3f43828..70cd66318 100644 --- a/charts/keycloak/templates/tls-secret.yaml +++ b/charts/keycloak/templates/tls-secret.yaml @@ -20,4 +20,3 @@ data: tls.key: {{ include "keycloak.secrets.lookup" (dict "secret" $secretName "key" "tls.key" "defaultValue" $cert.Key "context" $) }} ca.crt: {{ include "keycloak.secrets.lookup" (dict "secret" $secretName "key" "ca.crt" "defaultValue" $ca.Cert "context" $) }} {{- end }} - diff --git a/charts/keys/templates/helpers.tpl b/charts/keys/templates/helpers.tpl index 10ad3ff41..bfa94b527 100644 --- a/charts/keys/templates/helpers.tpl +++ b/charts/keys/templates/helpers.tpl @@ -240,11 +240,11 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{ range $service, $key := .Values.predefined.service.keys }} - name: KEYS_PREDEF_SERVICE_KEY_{{ $service | upper }} value: {{ $key }} -{{ end }} +{{ end }} {{ range $service, $key := .Values.predefined.service.aliases }} - name: KEYS_PREDEF_SERVICE_ALIAS_{{ $service | upper }} value: {{ $key }} -{{ end }} +{{ end }} {{- end }} {{/* diff --git a/charts/navi-back/templates/configmap.yaml b/charts/navi-back/templates/configmap.yaml index 1337f718f..4b89bc04e 100644 --- a/charts/navi-back/templates/configmap.yaml +++ b/charts/navi-back/templates/configmap.yaml @@ -96,7 +96,7 @@ data: [ "http://{REMOTE_FORECAST}/index.json" ], - "timeout_seconds": + "timeout_seconds": { "count": 30 } @@ -110,7 +110,7 @@ data: [ "http://{REMOTE_FORECAST}/" ], - "timeout_seconds": + "timeout_seconds": { "count": 30 } @@ -124,7 +124,7 @@ data: [ "http://{REMOTE_PATH}/" ], - "timeout_seconds": + "timeout_seconds": { "count": 60 } @@ -138,7 +138,7 @@ data: [ "http://{REMOTE_PATH}/options/taxi_referers.json" ], - "timeout_seconds": + "timeout_seconds": { "count": 360 } @@ -153,7 +153,7 @@ data: [ "http://{REMOTE_PATH}/" ], - "timeout_seconds": + "timeout_seconds": { "count": 10 } @@ -167,7 +167,7 @@ data: [ "http://{REMOTE_PATH}/" ], - "timeout_seconds": + "timeout_seconds": { "count": 10 } @@ -287,7 +287,7 @@ data: [ "http://{REMOTE_PATH}/tugc_users.json.zip" ], - "timeout_seconds": + "timeout_seconds": { "count": 30 } @@ -301,7 +301,7 @@ data: [ "http://{REMOTE_PATH}/" ], - "timeout_seconds": + "timeout_seconds": { "count": 30 } @@ -315,7 +315,7 @@ data: [ "http://{REMOTE_PATH}/tugc_2gis.json.zip" ], - "timeout_seconds": + "timeout_seconds": { "count": 30 } @@ -329,7 +329,7 @@ data: [ "http://{REMOTE_PATH}/" ], - "timeout_seconds": + "timeout_seconds": { "count": 30 } diff --git a/charts/navi-back/templates/deployment.yaml b/charts/navi-back/templates/deployment.yaml index cc3fe4d27..35882a2e0 100644 --- a/charts/navi-back/templates/deployment.yaml +++ b/charts/navi-back/templates/deployment.yaml @@ -26,7 +26,7 @@ spec: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "naviback.selectorLabels" . | nindent 8 }} @@ -38,7 +38,7 @@ spec: serviceAccountName: {{ include "naviback.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} - volumes: + volumes: - name: {{ include "naviback.fullname" . }}-configmap configMap: name: {{ include "naviback.fullname" . }}-configmap diff --git a/charts/navi-castle/templates/configmapnginx.yaml b/charts/navi-castle/templates/configmapnginx.yaml index ddd60aff2..d6144b519 100644 --- a/charts/navi-castle/templates/configmapnginx.yaml +++ b/charts/navi-castle/templates/configmapnginx.yaml @@ -17,4 +17,3 @@ data: return 200 "Ok!"; } } - diff --git a/charts/navi-castle/templates/cronjob.yaml b/charts/navi-castle/templates/cronjob.yaml index 50b3163b5..2687b933a 100644 --- a/charts/navi-castle/templates/cronjob.yaml +++ b/charts/navi-castle/templates/cronjob.yaml @@ -28,23 +28,23 @@ spec: - key: statefulset.kubernetes.io/pod-name operator: In values: - - {{ include "castle.fullname" $ }}-{{ $i }} + - {{ include "castle.fullname" $ }}-{{ $i }} topologyKey: "kubernetes.io/hostname" restartPolicy: OnFailure - volumes: + volumes: - name: {{ include "castle.fullname" $ }}-pvc persistentVolumeClaim: - claimName: {{ include "castle.fullname" $ }}-pvc-{{ include "castle.fullname" $ }}-{{ $i }} + claimName: {{ include "castle.fullname" $ }}-pvc-{{ include "castle.fullname" $ }}-{{ $i }} - name: {{ include "castle.fullname" $ }}-builder-config configMap: - name: {{ include "castle.fullname" $ }}-builder-config + name: {{ include "castle.fullname" $ }}-builder-config containers: - name: castle-cron image: {{ required "A valid .Values.dgctlDockerRegistry entry required" $.Values.dgctlDockerRegistry }}/{{ $.Values.castle.image.repository }}:{{ $.Values.castle.image.tag | default $.Chart.AppVersion }} - imagePullPolicy: {{ $.Values.castle.image.pullPolicy }} + imagePullPolicy: {{ $.Values.castle.image.pullPolicy }} command: [ "/opt/configuration_builder" ] - args: - - --config + args: + - --config - /opt/config_builder.conf - --service={{ $flavor }} - --jobs={{ $.Values.castle.jobs | default 1 | int }} @@ -54,7 +54,7 @@ spec: subPath: config_builder.conf - name: {{ include "castle.fullname" $ }}-builder-config mountPath: {{ $.Values.castle.castleDataPath }}/cities_template - subPath: cities_template + subPath: cities_template - name: {{ include "castle.fullname" $ }}-pvc mountPath: {{ $.Values.castle.castleDataPath }} resources: diff --git a/charts/navi-castle/templates/statefulset.yaml b/charts/navi-castle/templates/statefulset.yaml index f0f40422d..b806838f8 100644 --- a/charts/navi-castle/templates/statefulset.yaml +++ b/charts/navi-castle/templates/statefulset.yaml @@ -25,7 +25,7 @@ spec: checksum/configbuilder: {{ include (print $.Template.BasePath "/configmapbuilder.yaml") . | sha256sum }} checksum/confignginx: {{ include (print $.Template.BasePath "/configmapnginx.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "castle.selectorLabels" . | nindent 8 }} @@ -51,9 +51,9 @@ spec: - name: castle-{{ $flavor }}-init image: {{ required "A valid $.Values.dgctlDockerRegistry entry required" $.Values.dgctlDockerRegistry }}/{{ $.Values.castle.image.repository }}:{{ $.Values.castle.image.tag }} command: [ "/opt/configuration_builder" ] - args: - - --config - - /opt/config_builder.conf + args: + - --config + - /opt/config_builder.conf - --service={{ $flavor }} - --jobs={{ $.Values.castle.jobs | default 1 | int }} volumeMounts: @@ -152,7 +152,7 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} - {{- if .Values.persistentVolume.enabled }} + {{- if .Values.persistentVolume.enabled }} volumeClaimTemplates: - metadata: name: {{ include "castle.fullname" . }}-pvc diff --git a/charts/navi-front/templates/_helpers.tpl b/charts/navi-front/templates/_helpers.tpl index 7cf74b2ab..3d9d8ed48 100644 --- a/charts/navi-front/templates/_helpers.tpl +++ b/charts/navi-front/templates/_helpers.tpl @@ -95,11 +95,11 @@ Checking that the back service is valid {{- $service := .service -}} {{- $is_valid := false -}} {{- $navigroup := default "" .context.Values.navigroup -}} - {{/* Supported back implementations: navi-back, mock, splitter */}} - {{- if + {{/* Supported back implementations: navi-back, mock, splitter */}} + {{- if and (has (get $service.metadata.labels "app.kubernetes.io/name") (list "navi-back" "mock" "splitter" "navi-splitter")) - (eq (get $service.metadata.labels "navigroup") $navigroup) + (eq (get $service.metadata.labels "navigroup") $navigroup) (not (get $service.metadata.labels "behindSplitter")) -}} {{- $is_valid = true -}} diff --git a/charts/navi-front/templates/configmap-extra.yaml b/charts/navi-front/templates/configmap-extra.yaml index 42541f978..7eab54da2 100644 --- a/charts/navi-front/templates/configmap-extra.yaml +++ b/charts/navi-front/templates/configmap-extra.yaml @@ -11,4 +11,3 @@ data: locations-block.conf: |- {{ include "tplvalues.render" ( dict "value" .Values.locationsBlock "context" $ ) | indent 4 }} {{- end }} - diff --git a/charts/navi-front/templates/deployment.yaml b/charts/navi-front/templates/deployment.yaml index f0fa7d7ab..30e89bd4f 100644 --- a/charts/navi-front/templates/deployment.yaml +++ b/charts/navi-front/templates/deployment.yaml @@ -17,7 +17,7 @@ spec: checksum/configBase: {{ include (print $.Template.BasePath "/configmap-base.yaml") . | sha256sum }} checksum/configExtra: {{ include (print $.Template.BasePath "/configmap-extra.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "front.selectorLabels" . | nindent 8 }} @@ -29,7 +29,7 @@ spec: serviceAccountName: {{ include "front.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} - volumes: + volumes: - name: {{ include "front.fullname" . }}-base configMap: name: {{ include "front.fullname" . }}-base @@ -77,7 +77,7 @@ spec: httpGet: path: /healthcheck port: http - + resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/charts/navi-restrictions/templates/cronjob.yaml b/charts/navi-restrictions/templates/cronjob.yaml index 849064abc..1a316c507 100644 --- a/charts/navi-restrictions/templates/cronjob.yaml +++ b/charts/navi-restrictions/templates/cronjob.yaml @@ -60,7 +60,7 @@ spec: containers: - name: navi-restrictions-cron image: '{{ required "A valid .Values.dgctlDockerRegistry entry required" .Values.dgctlDockerRegistry }}/{{ .Values.cron.image.repository }}:{{ .Values.cron.image.tag | default .Chart.AppVersion }}' - imagePullPolicy: {{ .Values.cron.image.pullPolicy }} + imagePullPolicy: {{ .Values.cron.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.cron.containerPort }} diff --git a/charts/navi-router/templates/deployment.yaml b/charts/navi-router/templates/deployment.yaml index 9056806ae..46e16dd67 100644 --- a/charts/navi-router/templates/deployment.yaml +++ b/charts/navi-router/templates/deployment.yaml @@ -21,7 +21,7 @@ spec: annotations: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "router.selectorLabels" . | nindent 8 }} @@ -33,7 +33,7 @@ spec: serviceAccountName: {{ include "router.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} - volumes: + volumes: - name: {{ include "router.fullname" . }}-configmap configMap: name: {{ include "router.fullname" . }}-configmap @@ -71,7 +71,7 @@ spec: timeoutSeconds: 3 failureThreshold: 3 resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml .Values.resources | nindent 12 }} terminationGracePeriodSeconds: {{ .Values.termination_grace_period_seconds | default 60 }} {{- with .Values.nodeSelector }} nodeSelector: diff --git a/charts/navi-splitter/templates/ingress.yaml b/charts/navi-splitter/templates/ingress.yaml index d10c1d7bd..578db1db6 100644 --- a/charts/navi-splitter/templates/ingress.yaml +++ b/charts/navi-splitter/templates/ingress.yaml @@ -39,4 +39,4 @@ spec: number: {{ $svcPort }} {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/pro-api/templates/deployment.yaml b/charts/pro-api/templates/deployment.yaml index 025040b76..923d00486 100644 --- a/charts/pro-api/templates/deployment.yaml +++ b/charts/pro-api/templates/deployment.yaml @@ -259,7 +259,7 @@ spec: - name: Redis__Username value: {{ $.Values.redis.username }} {{ if .Values.redis.password }} - - name: Redis__Password + - name: Redis__Password valueFrom: secretKeyRef: key: redisPassword diff --git a/charts/pro-api/templates/permissions-api-deployment.yaml b/charts/pro-api/templates/permissions-api-deployment.yaml index cfca5816c..43e1b24c3 100644 --- a/charts/pro-api/templates/permissions-api-deployment.yaml +++ b/charts/pro-api/templates/permissions-api-deployment.yaml @@ -145,7 +145,7 @@ spec: - name: Redis__Username value: {{ $.Values.redis.username }} {{ if .Values.redis.password }} - - name: Redis__Password + - name: Redis__Password valueFrom: secretKeyRef: key: redisPassword diff --git a/charts/pro-api/templates/user-asset-importer.yaml b/charts/pro-api/templates/user-asset-importer.yaml index 7cc7401fa..5b196c0ff 100755 --- a/charts/pro-api/templates/user-asset-importer.yaml +++ b/charts/pro-api/templates/user-asset-importer.yaml @@ -90,5 +90,5 @@ spec: - name: Common__Logging__Targets value: "{{ .Values.api.logging.targets }}" - name: Common__SuppressImportFailure - value: "true" + value: "true" {{ end }} diff --git a/charts/pro-ui/templates/NOTES.txt b/charts/pro-ui/templates/NOTES.txt index 760de33f6..9d8ac2d5f 100644 --- a/charts/pro-ui/templates/NOTES.txt +++ b/charts/pro-ui/templates/NOTES.txt @@ -7,4 +7,4 @@ You can check service using curl {{- end }} {{- else }} You should publish the service in your preferred way (ingress, balancer, etc). -{{ end }} \ No newline at end of file +{{ end }} diff --git a/charts/search-api/templates/ingress.yaml b/charts/search-api/templates/ingress.yaml index fe01fba67..c988712df 100644 --- a/charts/search-api/templates/ingress.yaml +++ b/charts/search-api/templates/ingress.yaml @@ -39,4 +39,3 @@ spec: {{- end }} {{- end }} {{- end }} - diff --git a/charts/stat-receiver/topics-config.md b/charts/stat-receiver/topics-config.md index 647cb9ba3..3b822ac2b 100644 --- a/charts/stat-receiver/topics-config.md +++ b/charts/stat-receiver/topics-config.md @@ -1,4 +1,4 @@ -```yaml +```yaml - topic: "{{ topic-name-prefix }}input" partitions: {{ partitions }} replica-factor: {{ replica-factor }} diff --git a/charts/traffic-proxy/README.md b/charts/traffic-proxy/README.md index f19c0f488..0dcdb073b 100644 --- a/charts/traffic-proxy/README.md +++ b/charts/traffic-proxy/README.md @@ -110,4 +110,3 @@ See the [documentation](https://docs.2gis.com/en/on-premise/traffic-proxy) to le | Name | Email | Url | | ---- | ------ | --- | | 2gis | | | - diff --git a/helmfile/CHANGELOG.md b/helmfile/CHANGELOG.md index 1e10ee50a..abd42ddaf 100644 --- a/helmfile/CHANGELOG.md +++ b/helmfile/CHANGELOG.md @@ -32,5 +32,5 @@ router: queries: ["get_dist_matrix"] routing: ["ctx"] ``` -#### Добавлен деплой [splitter для Distance Matrix API Public Transport (до 10х10)](README.md) +#### Добавлен деплой [splitter для Distance Matrix API Public Transport (до 10х10)](README.md) - добавлены values *helmfile_values/services/navi/navi-splitter* diff --git a/helmfile/README.md b/helmfile/README.md index 5af36483c..d4203b401 100644 --- a/helmfile/README.md +++ b/helmfile/README.md @@ -9,9 +9,9 @@ [Деплой бэкенда Pairs Directions API](#pairs-directions) [Деплой бэкенда Public Transport](#public-transport) [Деплой бэкенда Distance Matrix API (до 25х25)](#distance-matrix) -[Деплой бэкенда Distance Matrix API Async (более 25х25)](#async) -[Деплой бэкенда Distance Matrix API Public Transport (до 10х10)](#distance-matrix-ctx) -[Деплой GRPC-proxy для Distance Matrix API Async (более 25х25)](#grpc) +[Деплой бэкенда Distance Matrix API Async (более 25х25)](#async) +[Деплой бэкенда Distance Matrix API Public Transport (до 10х10)](#distance-matrix-ctx) +[Деплой GRPC-proxy для Distance Matrix API Async (более 25х25)](#grpc) [Деплой фронтенда для Distance Matrix API Async (более 25х25)](#async-front) [Деплой splitter для Distance Matrix API Public Transport (до 10х10)](#splitter) [Деплой navi-router](#navi-router) @@ -32,7 +32,7 @@ on-premise-helm-charts Проходимся по файлам в директории helmfile_values и заполняем актуальными значениями -Выставляем нужные значения в base.yaml. +Выставляем нужные значения в base.yaml. Перед разворачиванием сервисов навигации должен быть задеплоен keys service @@ -45,7 +45,7 @@ helmfile -e test -f ../on-premise-helm-charts/helmfile/deploy/navi/navi-castle.y

Деплой бэкенда Directions API авто

``` -helmfile -e test -f ../on-premise-helm-charts/helmfile/deploy/navi/navi-back-custom.yaml -l service=directions-car sync +helmfile -e test -f ../on-premise-helm-charts/helmfile/deploy/navi/navi-back-custom.yaml -l service=directions-car sync ```

Деплой бэкенда Directions API пешеходы

diff --git a/helmfile/deploy/navi/navi-async-grpc.yaml b/helmfile/deploy/navi/navi-async-grpc.yaml index 41858f1ce..4554887d8 100644 --- a/helmfile/deploy/navi/navi-async-grpc.yaml +++ b/helmfile/deploy/navi/navi-async-grpc.yaml @@ -13,15 +13,15 @@ releases: - name: navi-async-grpc-proxy {{- if eq .Values.remoteCharts true }} chart: 2gis-on-premise/navi-async-grpc-proxy - {{- else}} + {{- else}} chart: ../../../charts/navi-async-grpc-proxy - {{- end }} + {{- end }} namespace: {{ .Values.namespace }} kubeContext: {{ .Values.kubeContext }} version: "{{ .Values.version }}" labels: chart: navi-async-grpc-proxy - values: + values: - {{ $path_values }}/templates/dgctl.gotmpl - {{ $path_values }}/services/navi/navi-async-grpc-proxy/_common.gotmpl - {{ $path_values }}/templates/optionalEnv.gotmpl diff --git a/helmfile/deploy/navi/navi-async-matrix.yaml b/helmfile/deploy/navi/navi-async-matrix.yaml index 1c4b31b84..eca2aa17b 100644 --- a/helmfile/deploy/navi/navi-async-matrix.yaml +++ b/helmfile/deploy/navi/navi-async-matrix.yaml @@ -13,15 +13,15 @@ releases: - name: navi-async-matrix {{- if eq .Values.remoteCharts true }} chart: 2gis-on-premise/navi-async-matrix - {{- else}} + {{- else}} chart: ../../../charts/navi-async-matrix - {{- end }} + {{- end }} namespace: {{ .Values.namespace }} kubeContext: {{ .Values.kubeContext }} version: "{{ .Values.version }}" labels: chart: navi-async-matrix - values: + values: - {{ $path_values }}/templates/dgctl.gotmpl - {{ $path_values }}/services/navi/navi-async-matrix/{{ .Environment.Name }}-kafka.yaml - {{ $path_values }}/services/navi/navi-async-matrix/_common.gotmpl @@ -38,26 +38,26 @@ releases: value: {{ .Values.s3.secretKey }} {{- if or .Values.kafka.authCert .Values.kafka.authLogin }} {{- if .Values.kafka.authCert }} # kafka аутентификация по сертификату - {{- if .Values.kafka.authCert.pathCert }} #windows + {{- if .Values.kafka.authCert.pathCert }} #windows - name: kafka.fileProperties.ssl\.cafile file: {{ .Values.kafka.authCert.pathCert }}\\{{ .Values.kafka.authCert.sslCA }} - - name: kafka.fileProperties.ssl\.certfile + - name: kafka.fileProperties.ssl\.certfile file: {{ .Values.kafka.authCert.pathCert }}\\{{ .Values.kafka.authCert.sslCertificate }} - - name: kafka.fileProperties.ssl\.keyfile + - name: kafka.fileProperties.ssl\.keyfile file: {{ .Values.kafka.authCert.pathCert }}\\{{ .Values.kafka.authCert.sslKey }} {{ else }} - name: kafka.fileProperties.ssl\.cafile file: {{ $path_values }}/ssl/{{ .Values.kafka.authCert.sslCA }} - - name: kafka.fileProperties.ssl\.certfile + - name: kafka.fileProperties.ssl\.certfile file: {{ $path_values }}/ssl/{{ .Values.kafka.authCert.sslCertificate }} - - name: kafka.fileProperties.ssl\.keyfile + - name: kafka.fileProperties.ssl\.keyfile file: {{ $path_values }}/ssl/{{ .Values.kafka.authCert.sslKey }} {{ end }} - - name: kafka.properties.ssl\.check\.hostname + - name: kafka.properties.ssl\.check\.hostname value: '' {{- if .Values.kafka.authCert.sslPassword }} - name: kafka.sensitiveProperties.ssl\.password - value: {{ .Values.kafka.authCert.sslPassword }} + value: {{ .Values.kafka.authCert.sslPassword }} {{ end }} {{ else }} # kafka аутентификация по логину и паролю - name: kafka.properties.sasl\.plain\.username @@ -67,7 +67,7 @@ releases: {{ end }} {{ end }} {{- if .Values.ingress.enabled }} - hooks: + hooks: - events: ["postsync"] showlogs: true command: "../tests/navi-async-service.sh" diff --git a/helmfile/deploy/navi/navi-back-custom.yaml b/helmfile/deploy/navi/navi-back-custom.yaml index ded9cb78a..3460c35a9 100644 --- a/helmfile/deploy/navi/navi-back-custom.yaml +++ b/helmfile/deploy/navi/navi-back-custom.yaml @@ -2,7 +2,7 @@ bases: - {{ env "HELMFILE_VALUES" | default "../../../../helmfile_values" }}/base.yaml --- -{{ if eq .Values.naviCustomResources true }} +{{ if eq .Values.naviCustomResources true }} environments: {{- printf "%s%s" .Environment.Name ":" | nindent 2 }} values: @@ -27,7 +27,7 @@ templates: kubeContext: {{ .Values.kubeContext }} version: "{{ .Values.version }}" timeout: 3600 - values: + values: - {{ $path_values }}/templates/dgctl.gotmpl - {{ $path_values }}/services/navi/navi-back/_common.gotmpl - {{ $path_values }}/templates/optionalEnv.gotmpl @@ -45,7 +45,7 @@ releases: value: {{ $type }} {{ if eq .Values.naviCustomResources true }} - name: replicaCount - value: {{ .Values.carrouting.replicaCount }} + value: {{ .Values.carrouting.replicaCount }} - name: resources.limits.cpu value: {{ .Values.carrouting.limits.cpu }} - name: resources.limits.memory @@ -69,7 +69,7 @@ releases: value: {{ $type }} {{ if eq .Values.naviCustomResources true }} - name: replicaCount - value: {{ .Values.pedestrian.replicaCount }} + value: {{ .Values.pedestrian.replicaCount }} - name: resources.limits.cpu value: {{ .Values.pedestrian.limits.cpu }} - name: resources.limits.memory @@ -93,7 +93,7 @@ releases: value: {{ $type }} {{ if eq .Values.naviCustomResources true }} - name: replicaCount - value: {{ .Values.bicycle.replicaCount }} + value: {{ .Values.bicycle.replicaCount }} - name: resources.limits.cpu value: {{ .Values.bicycle.limits.cpu }} - name: resources.limits.memory @@ -117,7 +117,7 @@ releases: value: {{ $type }} {{ if eq .Values.naviCustomResources true }} - name: replicaCount - value: {{ .Values.taxi.replicaCount }} + value: {{ .Values.taxi.replicaCount }} - name: resources.limits.cpu value: {{ .Values.taxi.limits.cpu }} - name: resources.limits.memory @@ -140,10 +140,10 @@ releases: - name: naviback.type value: {{ $type }} - name: naviback.simpleNetwork.emergency - value: true + value: true {{ if eq .Values.naviCustomResources true }} - name: replicaCount - value: {{ .Values.emergency.replicaCount }} + value: {{ .Values.emergency.replicaCount }} - name: resources.limits.cpu value: {{ .Values.emergency.limits.cpu }} - name: resources.limits.memory @@ -152,7 +152,7 @@ releases: value: {{ .Values.emergency.requests.cpu }} - name: resources.requests.memory value: {{ .Values.emergency.requests.memory }} - {{- end }} + {{- end }} {{ $API := "distance-matrix" }}{{ $type := "dm"}} - name: navi-back-{{ $API }} @@ -164,10 +164,10 @@ releases: - name: naviback.app_rule value: {{ $API }} - name: naviback.type - value: {{ $type }} + value: {{ $type }} {{ if eq .Values.naviCustomResources true }} - name: replicaCount - value: {{ .Values.dm.replicaCount }} + value: {{ .Values.dm.replicaCount }} - name: resources.limits.cpu value: {{ .Values.dm.limits.cpu }} - name: resources.limits.memory @@ -176,7 +176,7 @@ releases: value: {{ .Values.dm.requests.cpu }} - name: resources.requests.memory value: {{ .Values.dm.requests.memory }} - {{- end }} + {{- end }} {{ $API := "public-transport" }}{{ $type := "ctx"}} - name: navi-back-{{ $API }} @@ -188,10 +188,10 @@ releases: - name: naviback.app_rule value: {{ $API }} - name: naviback.type - value: {{ $type }} + value: {{ $type }} {{ if eq .Values.naviCustomResources true }} - name: replicaCount - value: {{ .Values.ctx.replicaCount }} + value: {{ .Values.ctx.replicaCount }} - name: resources.limits.cpu value: {{ .Values.ctx.limits.cpu }} - name: resources.limits.memory @@ -200,7 +200,7 @@ releases: value: {{ .Values.ctx.requests.cpu }} - name: resources.requests.memory value: {{ .Values.ctx.requests.memory }} - {{- end }} + {{- end }} {{ $API := "pairs-directions" }}{{ $type := "pairs"}} - name: navi-back-{{ $API }} @@ -212,10 +212,10 @@ releases: - name: naviback.app_rule value: {{ $API }} - name: naviback.type - value: {{ $type }} + value: {{ $type }} {{ if eq .Values.naviCustomResources true }} - name: replicaCount - value: {{ .Values.pairs.replicaCount }} + value: {{ .Values.pairs.replicaCount }} - name: resources.limits.cpu value: {{ .Values.pairs.limits.cpu }} - name: resources.limits.memory @@ -224,7 +224,7 @@ releases: value: {{ .Values.pairs.requests.cpu }} - name: resources.requests.memory value: {{ .Values.pairs.requests.memory }} - {{- end }} + {{- end }} {{ $API := "directions-truck" }}{{ $type := "truck"}} - name: navi-back-{{ $API }} @@ -236,10 +236,10 @@ releases: - name: naviback.app_rule value: {{ $API }} - name: naviback.type - value: {{ $type }} + value: {{ $type }} {{ if eq .Values.naviCustomResources true }} - name: replicaCount - value: {{ .Values.truck.replicaCount }} + value: {{ .Values.truck.replicaCount }} - name: resources.limits.cpu value: {{ .Values.truck.limits.cpu }} - name: resources.limits.memory @@ -248,7 +248,7 @@ releases: value: {{ .Values.truck.requests.cpu }} - name: resources.requests.memory value: {{ .Values.truck.requests.memory }} - {{- end }} + {{- end }} {{ $API := "isochrone-car" }}{{ $type := "carrouting"}} - name: navi-back-{{ $API }} @@ -260,10 +260,10 @@ releases: - name: naviback.app_rule value: {{ $API }} - name: naviback.type - value: {{ $type }} + value: {{ $type }} {{ if eq .Values.naviCustomResources true }} - name: replicaCount - value: {{ .Values.carrouting.replicaCount }} + value: {{ .Values.carrouting.replicaCount }} - name: resources.limits.cpu value: {{ .Values.carrouting.limits.cpu }} - name: resources.limits.memory @@ -272,7 +272,7 @@ releases: value: {{ .Values.carrouting.requests.cpu }} - name: resources.requests.memory value: {{ .Values.carrouting.requests.memory }} - {{- end }} + {{- end }} {{ $API := "isochrone-pedestrian" }}{{ $type := "pedestrian"}} - name: navi-back-{{ $API }} @@ -284,10 +284,10 @@ releases: - name: naviback.app_rule value: {{ $API }} - name: naviback.type - value: {{ $type }} + value: {{ $type }} {{ if eq .Values.naviCustomResources true }} - name: replicaCount - value: {{ .Values.pedestrian.replicaCount }} + value: {{ .Values.pedestrian.replicaCount }} - name: resources.limits.cpu value: {{ .Values.pedestrian.limits.cpu }} - name: resources.limits.memory @@ -308,12 +308,12 @@ releases: - name: naviback.app_rule value: {{ $API }} - name: naviback.type - value: {{ $type }} + value: {{ $type }} - name: naviback.behindSplitter value: true {{ if eq .Values.naviCustomResources true }} - name: replicaCount - value: {{ .Values.matrixCtx.replicaCount }} + value: {{ .Values.matrixCtx.replicaCount }} - name: resources.limits.cpu value: {{ .Values.matrixCtx.limits.cpu }} - name: resources.limits.memory @@ -330,7 +330,7 @@ releases: labels: service: {{ $API }} chart: navi-back - values: + values: - {{ $path_values }}/templates/dgctl.gotmpl - {{ $path_values }}/services/navi/navi-async-matrix/{{ .Environment.Name }}-kafka.yaml - {{ $path_values }}/services/navi/navi-back/_common_dma.gotmpl @@ -339,34 +339,34 @@ releases: - name: naviback.app_rule value: dma - name: naviback.type - value: {{ $type }} + value: {{ $type }} - name: s3.host value: {{ .Values.s3.citiesUrl }} - name: s3.accessKey value: {{ .Values.s3.accessKey }} - name: s3.secretKey value: {{ .Values.s3.secretKey }} -{{- if or .Values.kafka.authCert .Values.kafka.authLogin }} - {{- if .Values.kafka.authCert }} +{{- if or .Values.kafka.authCert .Values.kafka.authLogin }} + {{- if .Values.kafka.authCert }} {{- if .Values.kafka.authCert.pathCert }} #windows - name: kafka.fileProperties.ssl\.ca\.location file: {{ .Values.kafka.authCert.pathCert }}\\{{ .Values.kafka.authCert.sslCA }} - name: kafka.fileProperties.ssl\.certificate\.location file: {{ .Values.kafka.authCert.pathCert }}\\{{ .Values.kafka.authCert.sslCertificate }} - name: kafka.fileProperties.ssl\.key\.location - file: {{ .Values.kafka.authCert.pathCert }}\\{{ .Values.kafka.authCert.sslKey }} + file: {{ .Values.kafka.authCert.pathCert }}\\{{ .Values.kafka.authCert.sslKey }} {{ else }} - name: kafka.fileProperties.ssl\.ca\.location file: {{ $path_values }}/ssl/{{ .Values.kafka.authCert.sslCA }} - name: kafka.fileProperties.ssl\.certificate\.location file: {{ $path_values }}/ssl/{{ .Values.kafka.authCert.sslCertificate }} - name: kafka.fileProperties.ssl\.key\.location - file: {{ $path_values }}/ssl/{{ .Values.kafka.authCert.sslKey }} - {{ end }} + file: {{ $path_values }}/ssl/{{ .Values.kafka.authCert.sslKey }} + {{ end }} {{- if .Values.kafka.authCert.sslPassword }} - name: kafka.properties.ssl\.key\.password - value: {{ .Values.kafka.authCert.sslPassword }} - {{ end }} + value: {{ .Values.kafka.authCert.sslPassword }} + {{ end }} {{ else }} # kafka аутентификация по логину и паролю - name: kafka.properties.sasl\.username value: {{ .Values.kafka.authLogin.username }} diff --git a/helmfile/deploy/navi/navi-castle.yaml b/helmfile/deploy/navi/navi-castle.yaml index 0327f6f2c..dd1f5143d 100644 --- a/helmfile/deploy/navi/navi-castle.yaml +++ b/helmfile/deploy/navi/navi-castle.yaml @@ -13,9 +13,9 @@ releases: - name: navi-castle {{- if eq .Values.remoteCharts true }} chart: 2gis-on-premise/navi-castle - {{- else}} + {{- else}} chart: ../../../charts/navi-castle - {{- end }} + {{- end }} namespace: {{ .Values.namespace }} kubeContext: {{ .Values.kubeContext }} version: "{{ .Values.version }}" diff --git a/helmfile/deploy/navi/navi-front.yaml b/helmfile/deploy/navi/navi-front.yaml index acc888ef2..9b344efba 100644 --- a/helmfile/deploy/navi/navi-front.yaml +++ b/helmfile/deploy/navi/navi-front.yaml @@ -13,26 +13,23 @@ releases: - name: navi-front {{- if eq .Values.remoteCharts true }} chart: 2gis-on-premise/navi-front - {{- else}} + {{- else}} chart: ../../../charts/navi-front - {{- end }} + {{- end }} namespace: {{ .Values.namespace }} kubeContext: {{ .Values.kubeContext }} version: "{{ .Values.version }}" labels: chart: navi-front - values: + values: - {{ $path_values }}/templates/dgctl.gotmpl - {{ $path_values }}/services/navi/navi-front/_common.gotmpl - {{ $path_values }}/templates/optionalEnv.gotmpl {{- if .Values.ingress.enabled }} - {{ $path_values }}/templates/ingress.gotmpl - hooks: + hooks: - events: ["postsync"] showlogs: true command: "../tests/navi-front.sh" args: ["{{ .Values.ingress.protocol }}://navi-front.{{ .Values.ingress.domain }}", "{{ .Values.apiKey }}", '{{`{{ .Release.Name }}`}}'] {{ end }} - - - diff --git a/helmfile/deploy/navi/navi-router.yaml b/helmfile/deploy/navi/navi-router.yaml index 52122e1a6..7aca4b7ac 100644 --- a/helmfile/deploy/navi/navi-router.yaml +++ b/helmfile/deploy/navi/navi-router.yaml @@ -13,9 +13,9 @@ releases: - name: navi-router {{- if eq .Values.remoteCharts true }} chart: 2gis-on-premise/navi-router - {{- else}} + {{- else}} chart: ../../../charts/navi-router - {{- end }} + {{- end }} namespace: {{ .Values.namespace }} kubeContext: {{ .Values.kubeContext }} version: "{{ .Values.version }}" diff --git a/helmfile/deploy/navi/navi-splitter.yaml b/helmfile/deploy/navi/navi-splitter.yaml index b312e159d..338dc5ede 100644 --- a/helmfile/deploy/navi/navi-splitter.yaml +++ b/helmfile/deploy/navi/navi-splitter.yaml @@ -13,16 +13,15 @@ releases: - name: navi-splitter {{- if eq .Values.remoteCharts true }} chart: 2gis-on-premise/navi-splitter - {{- else}} + {{- else}} chart: ../../../charts/navi-splitter - {{- end }} + {{- end }} namespace: {{ .Values.namespace }} kubeContext: {{ .Values.kubeContext }} version: "{{ .Values.version }}" labels: chart: navi-splitter - values: + values: - {{ $path_values }}/templates/dgctl.gotmpl - {{ $path_values }}/services/navi/navi-splitter/_common.gotmpl - {{ $path_values }}/templates/optionalEnv.gotmpl - diff --git a/helmfile/deploy/tests/navi-async-service.sh b/helmfile/deploy/tests/navi-async-service.sh index 36e01f7fa..9b4341e50 100755 --- a/helmfile/deploy/tests/navi-async-service.sh +++ b/helmfile/deploy/tests/navi-async-service.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e -set -u +set -u set -o pipefail SCRIPTPATH=$(dirname `readlink -f "$0"`) diff --git a/helmfile/deploy/tests/navi-front.sh b/helmfile/deploy/tests/navi-front.sh index 8f2528002..311c10d82 100755 --- a/helmfile/deploy/tests/navi-front.sh +++ b/helmfile/deploy/tests/navi-front.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e -set -u +set -u set -o pipefail URL=$1 @@ -21,57 +21,57 @@ for service in $UPSTREAM; do case $service in "directions-bicycle") echo "Create routing for Directions API bicycle:" - echo + echo echo `curl -s $URL/carrouting/6.0.1/global?key=$KEY --header 'Content-Type: application/json' -d @moscow_bc.json` - echo + echo ;; "directions-car") echo "Create routing for Directions API car:" - echo + echo echo `curl -s $URL/carrouting/6.0.1/global?key=$KEY --header 'Content-Type: application/json' -d @moscow_сr.json` - echo + echo ;; "distance-matrix") echo "Create routing for Distance Matrix API:" - echo + echo echo `curl -s $URL/get_dist_matrix/2.0?key=$KEY --header 'Content-Type: application/json' -d @moscow_dm.json` - echo + echo ;; "directions-pedestrian") echo "Create routing for Directions API pedestrian:" - echo + echo echo `curl -s $URL/carrouting/6.0.1/global?key=$KEY --header 'Content-Type: application/json' -d @moscow_pd.json` - echo + echo ;; "public-transport") echo "Create routing for Public Transport API:" - echo + echo echo `curl -s $URL/public_transport/2.0?key=$KEY --header 'Content-Type: application/json' -d @moscow_pt.json` - echo + echo ;; "directions-taxi") echo "Create routing for Directions API taxi:" - echo + echo echo `curl -s $URL/carrouting/6.0.1/global?key=$KEY --header 'Content-Type: application/json' -d @moscow_tx.json` - echo + echo ;; "directions-emergency") echo "Create routing for Directions API emergency:" - echo + echo echo `curl -s $URL/carrouting/6.0.1/global?key=$KEY --header 'Content-Type: application/json' -d @moscow_em.json` - echo + echo ;; "directions-truck") echo "Create routing for Directions API truck:" - echo + echo echo `curl -s $URL/carrouting/6.0.1/global?key=$KEY --header 'Content-Type: application/json' -d @moscow_tr.json` - echo - ;; + echo + ;; "isochrone-car") echo "Create routing for Isochrone API car:" - echo + echo echo `curl -s $URL/get_hull?key=$KEY --header 'Content-Type: application/json' -d @moscow_is_cr.json` - echo - ;; - esac + echo + ;; + esac done diff --git a/helmfile/deploy/tests/points/moscow_cr.json b/helmfile/deploy/tests/points/moscow_cr.json index f460886c9..893b1c2dc 100644 --- a/helmfile/deploy/tests/points/moscow_cr.json +++ b/helmfile/deploy/tests/points/moscow_cr.json @@ -14,4 +14,3 @@ } ] } - \ No newline at end of file diff --git a/helmfile/deploy/tests/points/moscow_is_cr.json b/helmfile/deploy/tests/points/moscow_is_cr.json index c1cc02229..ad61a0449 100644 --- a/helmfile/deploy/tests/points/moscow_is_cr.json +++ b/helmfile/deploy/tests/points/moscow_is_cr.json @@ -6,4 +6,3 @@ "durations": [600, 1200], "mode": "driving" } - \ No newline at end of file diff --git a/helmfile/deploy/tests/points/moscow_tx.json b/helmfile/deploy/tests/points/moscow_tx.json index 1af817a7f..c549df4e9 100644 --- a/helmfile/deploy/tests/points/moscow_tx.json +++ b/helmfile/deploy/tests/points/moscow_tx.json @@ -1,4 +1,4 @@ -{ +{ "type": "taxi_jam", "points": [ { diff --git a/helmfile/helmfile_values/base.yaml b/helmfile/helmfile_values/base.yaml index 7cf468b47..430196859 100644 --- a/helmfile/helmfile_values/base.yaml +++ b/helmfile/helmfile_values/base.yaml @@ -3,7 +3,7 @@ helmDefaults: atomic: true wait: true - + environments: test: values: @@ -41,26 +41,25 @@ environments: prod: values: - - version: 1.7.0 + - version: 1.7.0 remoteCharts: true - manifest: manifests/1675328936.json - namespace: 2gis-on-premise - kubeContext: prod-cluster + manifest: manifests/1675328936.json + namespace: 2gis-on-premise + kubeContext: prod-cluster dockerRegistry: docker.storage.example.local s3: citiesUrl: http://artifacts.example.com - bucket: onpremise-artifacts + bucket: onpremise-artifacts accessKey: AKIAIOSFODNN7EXAMPLE secretKey: wJalrXUtnFEMIK7MDENGbPxRfiCYEXAMPLEKEY ingress: - enabled: true - domain: example.com - protocol: https - secretName: secret_tls - customProjectNavi: false - kafka: - authCert: + enabled: true + domain: example.com + protocol: https + secretName: secret_tls + customProjectNavi: false + kafka: + authCert: sslCA: CAcert.pem sslCertificate: Cert.crt sslKey: Private.key - diff --git a/helmfile/helmfile_values/services/navi/navi-async-grpc-proxy/_common.gotmpl b/helmfile/helmfile_values/services/navi/navi-async-grpc-proxy/_common.gotmpl index 00b18e74c..fa596f099 100644 --- a/helmfile/helmfile_values/services/navi/navi-async-grpc-proxy/_common.gotmpl +++ b/helmfile/helmfile_values/services/navi/navi-async-grpc-proxy/_common.gotmpl @@ -1,5 +1,5 @@ replicaCount: 1 - + dm: url: http://navi-async-matrix diff --git a/helmfile/helmfile_values/services/navi/navi-async-matrix/_common.gotmpl b/helmfile/helmfile_values/services/navi/navi-async-matrix/_common.gotmpl index 375af2b45..a7a05ff35 100644 --- a/helmfile/helmfile_values/services/navi/navi-async-matrix/_common.gotmpl +++ b/helmfile/helmfile_values/services/navi/navi-async-matrix/_common.gotmpl @@ -1,8 +1,8 @@ replicaCount: 1 - + dm: citiesUrl: http://navi-castle/cities.conf - + keys: host: http://keys-api/service/v1/keys @@ -13,4 +13,3 @@ resources: requests: cpu: 2000m memory: 4Gi - diff --git a/helmfile/helmfile_values/services/navi/navi-async-matrix/test.yaml b/helmfile/helmfile_values/services/navi/navi-async-matrix/test.yaml index a634ec208..ebe3b9f0a 100644 --- a/helmfile/helmfile_values/services/navi/navi-async-matrix/test.yaml +++ b/helmfile/helmfile_values/services/navi/navi-async-matrix/test.yaml @@ -1,12 +1,11 @@ replicaCount: 1 - + keys: token: 16564b03-8185-472f-ad99-cad94e972e97 - + db: host: navi-async-matrix-postgresql.storage.example.local port: 5432 name: onpremise_navi_async_matrix user: navi-async-matrix-user password: navi-async-matrix-password - \ No newline at end of file diff --git a/helmfile/helmfile_values/services/navi/navi-back/_common.gotmpl b/helmfile/helmfile_values/services/navi/navi-back/_common.gotmpl index 1e618f624..a44b08f16 100644 --- a/helmfile/helmfile_values/services/navi/navi-back/_common.gotmpl +++ b/helmfile/helmfile_values/services/navi/navi-back/_common.gotmpl @@ -4,11 +4,11 @@ navigroup: navi naviback: castleHost: navi-castle # #имя сервиса navi-castle в k8s - dmSourcesLimit: 25 - dmTargetsLimit: 25 + dmSourcesLimit: 25 + dmTargetsLimit: 25 #дефолтные ресурсы -resources: +resources: limits: cpu: 4 memory: 8Gi @@ -17,28 +17,28 @@ resources: memory: 4Gi rules: - - name: directions-car # авто + - name: directions-car # авто queries: ["routing"] routing: ["driving"] - - name: directions-pedestrian # пешеходы + - name: directions-pedestrian # пешеходы queries: ["routing"] routing: ["pedestrian"] - - name: directions-bicycle # велосипедисты + - name: directions-bicycle # велосипедисты queries: ["routing"] routing: ["bicycle"] - - name: directions-taxi # taxi + - name: directions-taxi # taxi queries: ["routing"] routing: ["taxi"] - name: distance-matrix # distance-matrix queries: ["get_dist_matrix"] routing: ["driving"] - - name: public-transport # общественный транспорт + - name: public-transport # общественный транспорт queries: ["public_transport"] routing: ["public_transport"] - name: directions-truck # грузовики truck queries: ["routing"] routing: ["truck"] - - name: pairs-directions # pairs + - name: pairs-directions # pairs queries: ["get_pairs"] routing: ["driving"] - name: isochrone-car # isochrone diff --git a/helmfile/helmfile_values/services/navi/navi-back/_common_dma.gotmpl b/helmfile/helmfile_values/services/navi/navi-back/_common_dma.gotmpl index ced80a21c..4aebb8aa8 100644 --- a/helmfile/helmfile_values/services/navi/navi-back/_common_dma.gotmpl +++ b/helmfile/helmfile_values/services/navi/navi-back/_common_dma.gotmpl @@ -6,7 +6,7 @@ naviback: castleHost: navi-castle # #имя сервиса navi-castle в k8s dmSourcesLimit: 12000 # ограничение на размер матриц dmTargetsLimit: 12000 # ограничение на размер матриц - app_rule: dma + app_rule: dma type: dm resources: diff --git a/helmfile/helmfile_values/templates/dgctl.gotmpl b/helmfile/helmfile_values/templates/dgctl.gotmpl index 757fd2c66..3ee83735c 100644 --- a/helmfile/helmfile_values/templates/dgctl.gotmpl +++ b/helmfile/helmfile_values/templates/dgctl.gotmpl @@ -1,6 +1,6 @@ {{ $host := .Values.s3.citiesUrl }} {{ $protocol := trunc 5 .Values.s3.citiesUrl }} -{{ if eq $protocol "https" }} +{{ if eq $protocol "https" }} {{ $host = trimPrefix "https://" .Values.s3.citiesUrl }} {{ else }} {{ $host = trimPrefix "http://" .Values.s3.citiesUrl }} diff --git a/helmfile/helmfile_values/templates/ingress.gotmpl b/helmfile/helmfile_values/templates/ingress.gotmpl index 48ca3993b..f82b26c3f 100644 --- a/helmfile/helmfile_values/templates/ingress.gotmpl +++ b/helmfile/helmfile_values/templates/ingress.gotmpl @@ -1,5 +1,5 @@ {{- if .Values.ingress.enabled }} -ingress: +ingress: className: nginx enabled: true hosts: diff --git a/helmfile/helmfile_values/templates/optionalEnv.gotmpl b/helmfile/helmfile_values/templates/optionalEnv.gotmpl index fccce8085..302a7daa8 100644 --- a/helmfile/helmfile_values/templates/optionalEnv.gotmpl +++ b/helmfile/helmfile_values/templates/optionalEnv.gotmpl @@ -3,4 +3,3 @@ {{ readFile $envVal }} {{- end }} {{- end }} - \ No newline at end of file diff --git a/helmfile/helmfile_values/templates/optionalEnvDMA.gotmpl b/helmfile/helmfile_values/templates/optionalEnvDMA.gotmpl index 6f128936c..e3c0379e7 100644 --- a/helmfile/helmfile_values/templates/optionalEnvDMA.gotmpl +++ b/helmfile/helmfile_values/templates/optionalEnvDMA.gotmpl @@ -3,4 +3,3 @@ {{ readFile $envVal }} {{- end }} {{- end }} - \ No newline at end of file diff --git a/styleguide.md b/styleguide.md index b967d04c2..81b558b29 100644 --- a/styleguide.md +++ b/styleguide.md @@ -12,7 +12,7 @@ Генератор можно запускать напрямую или с помощью [`Makefile`](Makefile), например: -``` +```sh make prepare make charts/navi-back ``` @@ -27,7 +27,7 @@ make charts/navi-back # @param imagePullPolicy Pull policy. # @param ui.image.repository UI service image repository. # @param ui.image.tag UI service image tag. - + dgctlDockerRegistry: '' imagePullSecrets: [] imagePullPolicy: IfNotPresent @@ -37,10 +37,10 @@ make charts/navi-back ```yaml # @section Kubernetes [Pod Disruption Budget](https://kubernetes.io/docs/concepts/workloads/pods/disruptions/#pod-disruption-budgets) settings - + # @param pdb.enabled If PDB is enabled for the service. # @param pdb.maxUnavailable How many pods can be unavailable after the eviction. - + pdb: enabled: false maxUnavailable: 1 @@ -54,7 +54,7 @@ make charts/navi-back ``` - Константы или переменные, которые никогда не меняются при типовом использовании сервиса, следует скрывать из `README.md` при помощи тэга `@skip`. - + Обратите внимание, что из-за особенностей генератора описание не может начинаться со ссылки (любая конструкция в квадратных скобках в начале описания будет принята за декларацию типа). Формулируйте описания настроек и секций так, чтобы ссылки были не в начале. - Во всех случаях, где в значениях по умолчанию должен фигурировать какой-либо город, используем Москву. @@ -64,9 +64,9 @@ make charts/navi-back - В названиях настроек используем camelCase. Названия начинаем с маленькой буквы. Например: `accessKey`, `dgctlDockerRegistry`. - Одинаковые настройки называем везде одинаково. - + Примеры: - + - Не `serviceAccount.create`, а `serviceAccount.enabled`. - [Настройки Kafka](https://github.com/documentat-alibaev/on-premise-helm-charts/blob/1f7b7d269aec9c6e265c41da3718bfc9135125a1/charts/navi-back/values.yaml#L185). - Настройки S3: `host`, `bucket`, `accessKey`, `secretKey`. @@ -98,10 +98,10 @@ make charts/navi-back Пример для чарта `pro-api`: не `repository: 2gis-on-premise/urbigeo-importer`, а `repository: 2gis-on-premise/pro-api-importer`. -- Настройки, связанные с подключением к другим сервисам On-Premise, должны группироваться в блоки, названные -в соответствии с сервисом. Адрес сервиса должен указываться в настройке `url`. -Ключ для авторизации должен указываться в настройке `key`. Приложение, желательно, должно уметь обрабатывать url -в виде hostname, scheme://hostname, scheme://hostname:port. Если url является шаблоном, то это можно отразить в названии, +- Настройки, связанные с подключением к другим сервисам On-Premise, должны группироваться в блоки, названные +в соответствии с сервисом. Адрес сервиса должен указываться в настройке `url`. +Ключ для авторизации должен указываться в настройке `key`. Приложение, желательно, должно уметь обрабатывать url +в виде hostname, scheme://hostname, scheme://hostname:port. Если url является шаблоном, то это можно отразить в названии, например `urlTemplate: http://service-name.svc/{project}/{date_str}_{hour}.json` Примеры: @@ -125,8 +125,10 @@ make charts/navi-back ``` ## Дефолтные значения -Для каждой обязательной настройки **не должно** быть дефолтного значения (адрес базы, адрес сервиса ключей), + +Для каждой обязательной настройки **не должно** быть дефолтного значения (адрес базы, адрес сервиса ключей), а в шаблоне настройка должна проверятся через required функцию. Пример: + ```yaml --- values.yaml dgctlStorage: @@ -134,7 +136,8 @@ dgctlStorage: --- deployment.yaml host: {{ required "Valid .Values.dgctlStorage.host required!" .Values.dgctlStorage.host }} -``` + +```text Сюда же входят настройки, которые критично повлияют на сервис при неправильном указании. Пример: суффикс в касандре для Tiles API. Если выставить дефолт, то клиент про него не узнает или забудет и в конечном итоге себе что-нибудь сломает, т.к. суффикс служит защитой от перетирания кейспейсов, @@ -153,6 +156,7 @@ host: {{ required "Valid .Values.dgctlStorage.host required!" .Values.dgctlStora - `{service-name}.host` - если сервис может находится где угодно Примеры: + ```yaml # @param search.url URL of the Search service. Ex: http://search-api.svc. This URL should be accessible from all the pods within your Kubernetes cluster search: @@ -167,7 +171,6 @@ db: host: '' ``` - ## Стиль кода - Непустые строковые значения пишем без кавычек.