Skip to content

Commit

Permalink
Merge pull request #589 from 2gis/develop
Browse files Browse the repository at this point in the history
Release 1.34.0 (master)
  • Loading branch information
mprudnikov3 authored Jan 27, 2025
2 parents 9d1d2af + bc152b0 commit b1cdfc8
Show file tree
Hide file tree
Showing 65 changed files with 1,228 additions and 168 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/mm-pr-notify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
MATTERMOST_ICON_URL: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/GitHub_Invertocat_Logo.svg/256px-GitHub_Invertocat_Logo.svg.png
TEXT: |
Создан Pull Request [${{ github.event.pull_request.title }}](${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.number }})
Автор: ${{ github.triggering_actor }}
Автор: ${{ github.actor }}
- uses: mattermost/action-mattermost-notify@master
if: ${{ (github.event.pull_request.draft == false && startsWith(github.event.pull_request.title, 'WIP:') == false && github.event.action == 'edited' && startsWith(github.event.changes.title.from, 'WIP:') == true ) || github.event.action == 'ready_for_review'}}
with:
Expand All @@ -31,4 +31,4 @@ jobs:
MATTERMOST_ICON_URL: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/GitHub_Invertocat_Logo.svg/256px-GitHub_Invertocat_Logo.svg.png
TEXT: |
Pull Request готов к проверке [${{ github.event.pull_request.title }}](${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.number }})
Автор: ${{ github.triggering_actor }}
Автор: ${{ github.actor }}
96 changes: 96 additions & 0 deletions .github/workflows/release-oci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Publish Helm Charts to ghcr.io
run-name: "Publish Helm Charts for Tag ${{ inputs.tag || github.event_name }} (Run #${{ github.run_number }})"

on:
push:
tags:
- \d+\.\d+\.\d+
workflow_dispatch: # Также можно вручную запускать workflow.
inputs:
tag:
description: "Tag to process"
required: true
default: "1.0.0"

jobs:
publish-helm-charts:
runs-on: ubuntu-latest
steps:
# ШАГ 1. Узнаем, откуда пришел workflow (пуш тега или ручной запуск)
- name: Determine if workflow is running from tag or input
id: determine_tag
run: |
# Определяем, был ли использован workflow_dispatch
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "Using input tag: ${{ inputs.tag }}"
echo "TAG_VERSION=${{ inputs.tag }}" >> $GITHUB_ENV
else
# Используем тег из события пуша
echo "Using pushed tag: ${GITHUB_REF#refs/tags/}"
echo "TAG_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
fi
# ШАГ 2. Checkout репозитория на указанный тег
- name: Checkout repository at specified tag
uses: actions/checkout@v4
with:
ref: ${{ env.TAG_VERSION }}

# ШАГ 3. Подтверждаем, что переключение на тег прошло успешно
- name: Confirm current tag
run: |
echo "Checked out to tag: ${{ env.TAG_VERSION }}"
git rev-parse HEAD
git describe --tags
# ШАГ 4: Установка Helm
- name: Setup Helm
uses: azure/setup-helm@v3
with:
version: latest # Используем последнюю стабильную версию Helm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# ШАГ 5. Обрабатываем все чарты в директории ./charts
- name: Find and package Helm charts
run: |
echo "Using version: ${{ env.TAG_VERSION }}"
# Создаем директорию для упакованных чартов
mkdir -p ./packaged
# Ищем все Chart.yaml внутри папки ./charts
for chart_path in $(find ./charts -name 'Chart.yaml'); do
chart_dir=$(dirname $chart_path) # Директория чарта
echo "Processing chart in directory: $chart_dir"
# Проверяем, соответствует ли версия в Chart.yaml версии тега
echo "Checking version in Chart.yaml for $chart_path..."
current_version=$(grep '^version:' "$chart_path" | awk '{print $2}') # Извлекаем текущую версию из Chart.yaml
if [ "$current_version" != "${TAG_VERSION}" ]; then
echo "Error: Version mismatch in $chart_path. Expected: ${TAG_VERSION}, Found: ${current_version}"
exit 1
fi
echo "Version in $chart_path matches the expected version: ${TAG_VERSION}"
# Обновляем зависимости чарта
echo "Updating dependencies for chart: $chart_dir"
helm dependency update "$chart_dir"
# Упаковываем чарт
helm package $chart_dir --destination ./packaged
done
# ШАГ 6: Входим в GitHub Container Registry
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

# ШАГ 7. Публикуем чарты
- name: Push packaged Helm charts to ghcr.io
run: |
for chart in ./packaged/*.tgz; do
echo "Pushing chart: $chart -> ghcr.io/${{ github.repository_owner }}/charts"
helm push $chart oci://ghcr.io/${{ github.repository_owner }}/charts
done
13 changes: 12 additions & 1 deletion Breaking-Changes.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# 2GIS On-Premise Breaking-Changes

## [1.34.0]

### keys
- Before upgrading to the next version, make sure to update to the current version (1.34.0).
- Ensure that `keys` service is upgraded prior to upgrading any of the `navi` services.
- A temporary flag, `--migrate-data`, has been added for this release. This flag triggers the data migration required for the Routing API data in the service.

### navi-castle
- `castle.restrictions.host` renamed to `castle.restrictions.url` and empty by default
- `persistentVolume.storageClass` is now empty by default

## [1.33.0]

### pro-api
- permissions.settings.enabled was removed, permissions api is now always mandatory
- permissions.settings.enabled was removed, permissions api is now always mandatory
- postgres.connectionString, postgres.connectionStringReadonly, postgres.password were changed to postgres.api.rw / postgres.api.ro settings


Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# 2GIS On-Premise Changelog

## [1.34.0] (2025-01-27)
#### [Breaking-Changes](Breaking-Changes.md#1340)
#### Images
```
catalog-api
- catalog-api:3.625.0
+ catalog-api:3.641.0
- catalog-importer:1.7.0
+ catalog-importer:1.11.0
keys
- keys-backend:1.89.0
+ keys-backend:1.108.2
navi-back
- navi-back:7.29.2.2
+ navi-back:7.33.0.5
navi-castle
- navi-castle:1.9.2
+ navi-castle:1.9.8
navi-router
- navi-router:6.24.0.3
+ navi-router:6.28.0.3
```

## [1.33.1] (2025-01-09)
#### Images
```
Expand Down
4 changes: 2 additions & 2 deletions charts/catalog-api/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: catalog-api
type: application
description: A Helm chart for Kubernetes to deploy Catalog APIs

version: 1.33.1
appVersion: 3.625.0
version: 1.34.0
appVersion: 3.641.0

maintainers:
- name: 2gis
Expand Down
4 changes: 2 additions & 2 deletions charts/catalog-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ See the [documentation](https://docs.2gis.com/en/on-premise/search) to learn abo
| Name | Description | Value |
| ---------------------- | --------------------------------------------------------------------------------------------- | ----------------------------- |
| `api.image.repository` | Repository | `2gis-on-premise/catalog-api` |
| `api.image.tag` | Tag | `3.625.0` |
| `api.image.tag` | Tag | `3.641.0` |
| `api.image.pullPolicy` | Image [pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) | `IfNotPresent` |

### Kubernetes [Horizontal Pod Autoscaling](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) settings
Expand Down Expand Up @@ -200,7 +200,7 @@ See the [documentation](https://docs.2gis.com/en/on-premise/search) to learn abo
| Name | Description | Value |
| --------------------------- | --------------------------------------------------------------------------------------------- | ---------------------------------- |
| `importer.image.repository` | Repository | `2gis-on-premise/catalog-importer` |
| `importer.image.tag` | Tag | `1.7.0` |
| `importer.image.tag` | Tag | `1.11.0` |
| `importer.image.pullPolicy` | Image [Pull Policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) | `IfNotPresent` |

### importer.postgres **Database settings**
Expand Down
4 changes: 2 additions & 2 deletions charts/catalog-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ api:

image:
repository: 2gis-on-premise/catalog-api
tag: 3.625.0
tag: 3.641.0
pullPolicy: IfNotPresent


Expand Down Expand Up @@ -291,7 +291,7 @@ importer:

image:
repository: 2gis-on-premise/catalog-importer
tag: 1.7.0
tag: 1.11.0
pullPolicy: IfNotPresent

# @section importer.postgres **Database settings**
Expand Down
2 changes: 1 addition & 1 deletion charts/citylens/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: citylens
type: application
description: A Helm chart for Kubernetes to deploy Citylens service

version: 1.33.1
version: 1.34.0
appVersion: 1.16.4

maintainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/dgtt/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: dgtt
description: DGTT Helm chart for Kubernetes
type: application

version: 1.33.1
version: 1.34.0
appVersion: 0.2.27-b188673e09

maintainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/floors-api/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: floors-api
description: Helm for floors service
type: application

version: 1.33.1
version: 1.34.0
appVersion: 1.1.0

maintainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/generic-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Generic library Helm chart for 2Gis
type: library
keywords:
- library
version: 1.33.1
version: 1.34.0
maintainers:
- name: 2gis
url: https://github.com/2gis
Expand Down
49 changes: 31 additions & 18 deletions charts/generic-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,16 @@ Chart is tested using [pipeline](https://gitlab.2gis.ru/traffic/cicd-pipelines/-

#### Kubernetes [Vertical Pod Autoscaling](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/README.md) settings

| Name | Description | Value |
| ----------------------- | ----------------------------------------------------------------------------------------------------------- | ------- |
| `vpa.enabled` | If VPA is enabled for the service | `false` |
| `vpa.updateMode` | VPA [update mode](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler#quick-start) | `Auto` |
| `vpa.containerName` | Name of a container to measure utilization for | `""` |
| `vpa.minAllowed.cpu` | Lower limit for the number of CPUs to which the autoscaler can scale down | |
| `vpa.minAllowed.memory` | Lower limit for the RAM size to which the autoscaler can scale down | |
| `vpa.maxAllowed.cpu` | Upper limit for the number of CPUs to which the autoscaler can scale up | |
| `vpa.maxAllowed.memory` | Upper limit for the RAM size to which the autoscaler can scale up | |
| Name | Description | Value |
| ----------------------- | ----------------------------------------------------------------------------------------------------------- | -------------- |
| `vpa.enabled` | If VPA is enabled for the service | `false` |
| `vpa.updateMode` | VPA [update mode](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler#quick-start) | `Auto` |
| `vpa.containerName` | Name of a container to measure utilization for | `""` |
| `vpa.controlledValues` | Controlled values, one of: RequestsOnly or RequestsAndLimits | `RequestsOnly` |
| `vpa.minAllowed.cpu` | Lower limit for the number of CPUs to which the autoscaler can scale down | |
| `vpa.minAllowed.memory` | Lower limit for the RAM size to which the autoscaler can scale down | |
| `vpa.maxAllowed.cpu` | Upper limit for the number of CPUs to which the autoscaler can scale up | |
| `vpa.maxAllowed.memory` | Upper limit for the RAM size to which the autoscaler can scale up | |

#### Kubernetes [Pod Disruption Budget](https://kubernetes.io/docs/concepts/workloads/pods/disruptions/#pod-disruption-budgets) settings

Expand All @@ -114,6 +115,7 @@ Chart is tested using [pipeline](https://gitlab.2gis.ru/traffic/cicd-pipelines/-
| `service.type` | Kubernetes [service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types). | `ClusterIP` |
| `service.clusterIP` | Controls Service cluster IP allocation. Cannot be changed after resource creation. | `""` |
| `service.port` | Service port. | `80` |
| `service.nodePort` | Node port if type NodePort. | `nil` |

#### [Service account](https://kubernetes.io/docs/concepts/security/service-accounts/) settings

Expand All @@ -136,12 +138,23 @@ Chart is tested using [pipeline](https://gitlab.2gis.ru/traffic/cicd-pipelines/-

#### [Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/) settings

| Name | Description | Value |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----- |
| `job.backoffLimit` | Number of retries before considering a Job as failed. | `""` |
| `job.backoffLimitPerIndex` | Maximal number of pod failures per index. | `""` |
| `job.podFailurePolicy` | Pod failure policy. | `""` |
| `job.completions` | Number of successful pods for completion Job. | `""` |
| `job.completionMode` | Completion mode (NonIndexed or Indexed). | `""` |
| `job.parallelism` | Number of pods running at any instant. | `""` |
| `job.restartPolicy` | Kubernetes pod [restart policy](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy) | `""` |
| Name | Description | Value |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----- |
| `job.activeDeadlineSeconds` | Number of seconds active deadline. | `""` |
| `job.backoffLimit` | Number of retries before considering a Job as failed. | `""` |
| `job.backoffLimitPerIndex` | Maximal number of pod failures per index. | `""` |
| `job.podFailurePolicy` | Pod failure policy. | `""` |
| `job.completions` | Number of successful pods for completion Job. | `""` |
| `job.completionMode` | Completion mode (NonIndexed or Indexed). | `""` |
| `job.parallelism` | Number of pods running at any instant. | `""` |
| `job.restartPolicy` | Kubernetes pod [restart policy](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy) | `""` |

#### Network Policy configuration

| Name | Description | Value |
| -------------------------------------------------- | ------------------------------------------------------------ | ------- |
| `networkPolicy.ingress.enabled` | Enable creation of NetworkPolicy resources for ingress rules | `false` |
| `networkPolicy.ingress.explicitNamespacesSelector` | Explict namespace selector for default rule ingress | `{}` |
| `networkPolicy.ingress.additionalRules` | Array of additional ingress rules | `[]` |
| `networkPolicy.egress.enabled` | Enable creation of NetworkPolicy resources for egress rules | `false` |
| `networkPolicy.egress.config` | Array of egress rules | `[]` |
6 changes: 3 additions & 3 deletions charts/generic-chart/templates/_cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ metadata:
spec:
schedule: {{ required "A valid cronJob.schedule entry required" $cronJob.schedule | quote }}
suspend: {{ ($cronJob).suspend }}
{{- if ($cronJob).startingDeadlineSeconds }}
{{- if quote ($cronJob).startingDeadlineSeconds }}
startingDeadlineSeconds: {{ ($cronJob).startingDeadlineSeconds }}
{{- end }}
{{- if ($cronJob).concurrencyPolicy }}
concurrencyPolicy: {{ ($cronJob).concurrencyPolicy }}
{{- end }}
{{- if ($cronJob).successfulJobsHistoryLimit }}
{{- if quote ($cronJob).successfulJobsHistoryLimit }}
successfulJobsHistoryLimit: {{ ($cronJob).successfulJobsHistoryLimit }}
{{- end }}
{{- if ($cronJob).failedJobsHistoryLimit }}
{{- if quote ($cronJob).failedJobsHistoryLimit }}
failedJobsHistoryLimit: {{ ($cronJob).failedJobsHistoryLimit }}
{{- end }}
jobTemplate:
Expand Down
Loading

0 comments on commit b1cdfc8

Please sign in to comment.