From c8c984f95f9cc097a1ad09757db3aa0bef3f5220 Mon Sep 17 00:00:00 2001 From: Vitalii Savitskii Date: Tue, 1 Oct 2024 12:53:25 +0200 Subject: [PATCH] Add ability to control minimum number of replicas for Arcane.Ingestion (#23) * Add ability to control minimum number of replicas for Arcane.Ingestion * Update cleanup-repository.yaml * Fixes --- .github/workflows/cleanup-repository.yaml | 8 ++++---- .github/workflows/publish-ecr-public.yaml | 2 +- .helm/templates/hpa-ingestion.yaml | 4 ++-- .helm/values.yaml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cleanup-repository.yaml b/.github/workflows/cleanup-repository.yaml index 5809d6d..41997cf 100644 --- a/.github/workflows/cleanup-repository.yaml +++ b/.github/workflows/cleanup-repository.yaml @@ -1,7 +1,7 @@ name: Remove old artifacts on: -# schedule: -# - cron: '0 12 * * *' # every day at 12:00 UTC + schedule: + - cron: '0 12 * * *' # every day at 12:00 UTC workflow_dispatch: jobs: @@ -23,7 +23,7 @@ jobs: package-type: container token: ${{ secrets.GITHUB_TOKEN }} min-versions-to-keep: 10 - delete-only-pre-release-versions: "true" + ignore-versions: v([0-9]+\.?)+$ - name: Delete old package versions of helm/${{ github.repository }} uses: actions/delete-package-versions@v5.0.0 @@ -32,4 +32,4 @@ jobs: package-type: container token: ${{ secrets.GITHUB_TOKEN }} min-versions-to-keep: 10 - delete-only-pre-release-versions: "true" + ignore-versions: v([0-9]+\.?)+$ diff --git a/.github/workflows/publish-ecr-public.yaml b/.github/workflows/publish-ecr-public.yaml index cdeb469..8e3c3de 100644 --- a/.github/workflows/publish-ecr-public.yaml +++ b/.github/workflows/publish-ecr-public.yaml @@ -20,7 +20,7 @@ jobs: publish_image: name: Publish Docker Image to ECR Public runs-on: ubuntu-latest - # if: ${{ startsWith(github.ref, 'refs/tags') }} + if: ${{ startsWith(github.ref, 'refs/tags') }} permissions: contents: read diff --git a/.helm/templates/hpa-ingestion.yaml b/.helm/templates/hpa-ingestion.yaml index 946bb46..ab47afe 100644 --- a/.helm/templates/hpa-ingestion.yaml +++ b/.helm/templates/hpa-ingestion.yaml @@ -36,8 +36,8 @@ spec: averageUtilization: {{ .Values.hpa.cpuTarget }} type: Utilization type: Resource - minReplicas: 3 + minReplicas: {{ .Values.hpa.minReplicas }} scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ template "app.name" . }}-ingestion \ No newline at end of file + name: {{ template "app.name" . }}-ingestion diff --git a/.helm/values.yaml b/.helm/values.yaml index 2ee539c..930451a 100644 --- a/.helm/values.yaml +++ b/.helm/values.yaml @@ -1,5 +1,4 @@ environment: "Development" -replicaCount: 1 nodes: taint: "kubernetes.sneaksanddata.com/servicenodetype" @@ -27,6 +26,7 @@ hpa: stabilizationWindow: 120 maxReplicas: 10 cpuTarget: 35 + minReplicas: 1 image: repository: arcane-ingestion