From 0032c236b3cb5c72ce029436cff3e2a8b9d8ab2d Mon Sep 17 00:00:00 2001 From: Andrii Chubatiuk Date: Thu, 12 Sep 2024 17:27:33 +0300 Subject: [PATCH] configurable replicas and services on singles (#1480) * configurable replicas and services on singles * release OCI charts --- .github/workflows/release.yaml | 10 ++++++++++ charts/victoria-logs-single/CHANGELOG.md | 2 ++ charts/victoria-logs-single/Chart.lock | 6 +++--- charts/victoria-logs-single/Chart.yaml | 2 +- .../templates/server-deployment.yaml | 2 +- .../templates/server-service.yaml | 20 +++++++++++-------- .../templates/server-statefulset.yaml | 2 +- charts/victoria-logs-single/values.yaml | 2 ++ charts/victoria-metrics-agent/Chart.lock | 6 +++--- charts/victoria-metrics-alert/Chart.lock | 6 +++--- charts/victoria-metrics-anomaly/Chart.lock | 6 +++--- charts/victoria-metrics-auth/Chart.lock | 6 +++--- charts/victoria-metrics-cluster/Chart.lock | 6 +++--- charts/victoria-metrics-cluster/Chart.yaml | 2 +- charts/victoria-metrics-gateway/Chart.lock | 6 +++--- charts/victoria-metrics-k8s-stack/Chart.lock | 6 +++--- charts/victoria-metrics-single/CHANGELOG.md | 2 ++ charts/victoria-metrics-single/Chart.lock | 6 +++--- charts/victoria-metrics-single/Chart.yaml | 2 +- .../templates/server-deployment.yaml | 2 +- .../templates/server-service.yaml | 20 +++++++++++-------- .../templates/server-statefulset.yaml | 2 +- charts/victoria-metrics-single/values.yaml | 2 ++ 23 files changed, 76 insertions(+), 50 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1f5327c15..da1b38812 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -127,6 +127,16 @@ jobs: with: config: .github/ci/cr.yaml + - name: Release OCI + run: | + helm registry login \ + -u ${{ github.actor }} \ + -p ${{ github.token }} \ + ghcr.io + for package in $(find **/.cr-release-packages -name "*.tgz"); do + helm push $package oci://ghcr.io/${{ github.repository_owner }}/charts/; + done + - name: Automatic update changelogs and readme run: | rm charts/*/RELEASE_NOTES.md diff --git a/charts/victoria-logs-single/CHANGELOG.md b/charts/victoria-logs-single/CHANGELOG.md index 0ccafa1b1..0a3bf79df 100644 --- a/charts/victoria-logs-single/CHANGELOG.md +++ b/charts/victoria-logs-single/CHANGELOG.md @@ -3,6 +3,8 @@ ## Next release - Added ability to override deployment namespace using `namespaceOverride` and `global.namespaceOverride` variables +- Made replicas configurable +- Allow override default for statefulset headless service ## 0.6.1 diff --git a/charts/victoria-logs-single/Chart.lock b/charts/victoria-logs-single/Chart.lock index fde1dac9b..09fcc2aa2 100644 --- a/charts/victoria-logs-single/Chart.lock +++ b/charts/victoria-logs-single/Chart.lock @@ -4,6 +4,6 @@ dependencies: version: 0.46.7 - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.10 -digest: sha256:297e416771da041cc4b4a607eccd6128abaf0a81977ff97b30f37b73d956f992 -generated: "2024-09-10T06:09:32.743794014Z" + version: 0.0.11 +digest: sha256:9065392de66fea380e81caff20894ff361e462c66461d19a787aec28e2737a1c +generated: "2024-09-12T11:50:32.588982509Z" diff --git a/charts/victoria-logs-single/Chart.yaml b/charts/victoria-logs-single/Chart.yaml index ea8e96140..db95b86e8 100644 --- a/charts/victoria-logs-single/Chart.yaml +++ b/charts/victoria-logs-single/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: v0.28.0 description: Victoria Logs Single version - high-performance, cost-effective and scalable logs storage name: victoria-logs-single -version: 0.6.1 +version: 0.6.2 sources: - https://github.com/VictoriaMetrics/helm-charts icon: https://avatars.githubusercontent.com/u/43720803?s=200&v=4 diff --git a/charts/victoria-logs-single/templates/server-deployment.yaml b/charts/victoria-logs-single/templates/server-deployment.yaml index 3bda6bd36..e97b986cb 100644 --- a/charts/victoria-logs-single/templates/server-deployment.yaml +++ b/charts/victoria-logs-single/templates/server-deployment.yaml @@ -15,7 +15,7 @@ metadata: spec: selector: matchLabels: {{ include "victoria-logs.server.matchLabels" . | nindent 6 }} - replicas: 1 + replicas: {{ $app.replicaCount }} {{- if $app.persistentVolume.enabled }} strategy: # Must be "Recreate" when we have a persistent volume diff --git a/charts/victoria-logs-single/templates/server-service.yaml b/charts/victoria-logs-single/templates/server-service.yaml index b93829fd3..619beba6a 100644 --- a/charts/victoria-logs-single/templates/server-service.yaml +++ b/charts/victoria-logs-single/templates/server-service.yaml @@ -11,23 +11,27 @@ metadata: labels: {{ include "victoria-logs.server.labels" $ctx | nindent 4 }} name: {{ include "victoria-logs.server.fullname" . }} spec: - {{- $clusterIP := ternary "None" $app.service.clusterIP $app.statefulSet.enabled }} + {{- $clusterIP := $app.service.clusterIP }} + {{- if and (not $clusterIP) $app.statefulSet.enabled }} + {{- $clusterIP = "None" }} + {{- end }} {{- with $clusterIP }} clusterIP: {{ . }} {{- end }} - {{- $externalIPs := ternary (default list) $app.service.externalIPs $app.statefulSet.enabled }} - {{- with $externalIPs }} + {{- with $app.service.externalIPs }} externalIPs: {{ toYaml . | nindent 4 }} {{- end }} - {{- $loadBalancerIP := ternary "" $app.service.loadBalancerIP $app.statefulSet.enabled }} - {{- with $loadBalancerIP }} + {{- with $app.service.loadBalancerIP }} loadBalancerIP: {{ . }} {{- end }} - {{- $loadBalancerSourceRanges := ternary (default list) $app.service.loadBalancerSourceRanges $app.statefulSet.enabled }} - {{- with $loadBalancerSourceRanges }} + {{- with $app.service.loadBalancerSourceRanges }} loadBalancerSourceRanges: {{ toYaml . | nindent 4 }} {{- end }} - type: {{ ternary "ClusterIP" $app.service.type $app.statefulSet.enabled }} + {{- $type := $app.service.type }} + {{- if and (not $type) $app.statefulSet.enabled }} + {{- $type = "ClusterIP" }} + {{- end }} + type: {{ $type }} {{- with $app.service.healthCheckNodePort }} healthCheckNodePort: {{ . }} {{- end }} diff --git a/charts/victoria-logs-single/templates/server-statefulset.yaml b/charts/victoria-logs-single/templates/server-statefulset.yaml index 37d3e80b4..afa1361ce 100644 --- a/charts/victoria-logs-single/templates/server-statefulset.yaml +++ b/charts/victoria-logs-single/templates/server-statefulset.yaml @@ -16,7 +16,7 @@ spec: serviceName: {{ $fullname }} selector: matchLabels: {{ include "victoria-logs.server.matchLabels" . | nindent 6 }} - replicas: 1 + replicas: {{ $app.replicaCount }} podManagementPolicy: {{ $app.podManagementPolicy }} template: metadata: diff --git a/charts/victoria-logs-single/values.yaml b/charts/victoria-logs-single/values.yaml index f7b73dd08..2058ffafd 100644 --- a/charts/victoria-logs-single/values.yaml +++ b/charts/victoria-logs-single/values.yaml @@ -42,6 +42,8 @@ server: pullPolicy: IfNotPresent # -- Image pull secrets imagePullSecrets: [] + # -- Replica count + replicaCount: 1 # -- Name of Priority Class priorityClassName: "" # -- Data retention period in month diff --git a/charts/victoria-metrics-agent/Chart.lock b/charts/victoria-metrics-agent/Chart.lock index 3d8530741..3a238a692 100644 --- a/charts/victoria-metrics-agent/Chart.lock +++ b/charts/victoria-metrics-agent/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.10 -digest: sha256:94b062240fbfc242acafcd180a5e74ac6ff5d37778af8dcc5e3ff209004e18ed -generated: "2024-09-10T06:09:35.800836709Z" + version: 0.0.11 +digest: sha256:d91f2afa5ae37158f11b1c6601cf8265b08dad62ec4eefd36064b32946e215a6 +generated: "2024-09-12T11:50:35.502691843Z" diff --git a/charts/victoria-metrics-alert/Chart.lock b/charts/victoria-metrics-alert/Chart.lock index 23456c9c3..4f44fb46b 100644 --- a/charts/victoria-metrics-alert/Chart.lock +++ b/charts/victoria-metrics-alert/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.10 -digest: sha256:94b062240fbfc242acafcd180a5e74ac6ff5d37778af8dcc5e3ff209004e18ed -generated: "2024-09-10T06:09:39.518487503Z" + version: 0.0.11 +digest: sha256:d91f2afa5ae37158f11b1c6601cf8265b08dad62ec4eefd36064b32946e215a6 +generated: "2024-09-12T11:50:39.261032678Z" diff --git a/charts/victoria-metrics-anomaly/Chart.lock b/charts/victoria-metrics-anomaly/Chart.lock index c495821d7..5b3c30aa8 100644 --- a/charts/victoria-metrics-anomaly/Chart.lock +++ b/charts/victoria-metrics-anomaly/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.10 -digest: sha256:94b062240fbfc242acafcd180a5e74ac6ff5d37778af8dcc5e3ff209004e18ed -generated: "2024-09-10T06:09:43.531705588Z" + version: 0.0.11 +digest: sha256:d91f2afa5ae37158f11b1c6601cf8265b08dad62ec4eefd36064b32946e215a6 +generated: "2024-09-12T11:50:43.125797222Z" diff --git a/charts/victoria-metrics-auth/Chart.lock b/charts/victoria-metrics-auth/Chart.lock index 037b6624e..68b2de964 100644 --- a/charts/victoria-metrics-auth/Chart.lock +++ b/charts/victoria-metrics-auth/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.10 -digest: sha256:94b062240fbfc242acafcd180a5e74ac6ff5d37778af8dcc5e3ff209004e18ed -generated: "2024-09-10T06:09:45.576248422Z" + version: 0.0.11 +digest: sha256:d91f2afa5ae37158f11b1c6601cf8265b08dad62ec4eefd36064b32946e215a6 +generated: "2024-09-12T11:50:45.212388959Z" diff --git a/charts/victoria-metrics-cluster/Chart.lock b/charts/victoria-metrics-cluster/Chart.lock index 309a3fafa..b257fc06f 100644 --- a/charts/victoria-metrics-cluster/Chart.lock +++ b/charts/victoria-metrics-cluster/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.10 -digest: sha256:94b062240fbfc242acafcd180a5e74ac6ff5d37778af8dcc5e3ff209004e18ed -generated: "2024-09-10T06:09:47.574843548Z" + version: 0.0.11 +digest: sha256:d91f2afa5ae37158f11b1c6601cf8265b08dad62ec4eefd36064b32946e215a6 +generated: "2024-09-12T11:50:47.039315126Z" diff --git a/charts/victoria-metrics-cluster/Chart.yaml b/charts/victoria-metrics-cluster/Chart.yaml index 28ac57c54..c9b973068 100644 --- a/charts/victoria-metrics-cluster/Chart.yaml +++ b/charts/victoria-metrics-cluster/Chart.yaml @@ -3,7 +3,7 @@ type: application appVersion: v1.103.0 description: Victoria Metrics Cluster version - high-performance, cost-effective and scalable TSDB, long-term remote storage for Prometheus name: victoria-metrics-cluster -version: 0.13.6 +version: 0.13.7 sources: - https://github.com/VictoriaMetrics/helm-charts icon: https://avatars.githubusercontent.com/u/43720803?s=200&v=4 diff --git a/charts/victoria-metrics-gateway/Chart.lock b/charts/victoria-metrics-gateway/Chart.lock index 8290e90b9..bbb3f34d7 100644 --- a/charts/victoria-metrics-gateway/Chart.lock +++ b/charts/victoria-metrics-gateway/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.10 -digest: sha256:94b062240fbfc242acafcd180a5e74ac6ff5d37778af8dcc5e3ff209004e18ed -generated: "2024-09-10T06:09:49.409038091Z" + version: 0.0.11 +digest: sha256:d91f2afa5ae37158f11b1c6601cf8265b08dad62ec4eefd36064b32946e215a6 +generated: "2024-09-12T11:50:49.115872835Z" diff --git a/charts/victoria-metrics-k8s-stack/Chart.lock b/charts/victoria-metrics-k8s-stack/Chart.lock index f51bc879f..c059a99ca 100644 --- a/charts/victoria-metrics-k8s-stack/Chart.lock +++ b/charts/victoria-metrics-k8s-stack/Chart.lock @@ -1,7 +1,7 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.10 + version: 0.0.11 - name: victoria-metrics-operator repository: https://victoriametrics.github.io/helm-charts version: 0.34.8 @@ -20,5 +20,5 @@ dependencies: - name: prometheus-operator-crds repository: https://prometheus-community.github.io/helm-charts version: 11.0.0 -digest: sha256:a392bf24c36349f4d3cae18d460dbfae13188d4c63c3081870965462c0391f8c -generated: "2024-09-10T06:09:52.148152592Z" +digest: sha256:11b119ebabf4ff0ea2951e7c72f51d0223dc3f50fb061a43b01fe7856491b836 +generated: "2024-09-12T11:50:51.935071545Z" diff --git a/charts/victoria-metrics-single/CHANGELOG.md b/charts/victoria-metrics-single/CHANGELOG.md index 93a4f7176..d56d22753 100644 --- a/charts/victoria-metrics-single/CHANGELOG.md +++ b/charts/victoria-metrics-single/CHANGELOG.md @@ -4,6 +4,8 @@ - Added ability to override deployment namespace using `namespaceOverride` and `global.namespaceOverride` variables - Removed deprecated API from RBAC. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1438) +- Made replicas configurable +- Allow override default for statefulset headless service ## 0.11.1 diff --git a/charts/victoria-metrics-single/Chart.lock b/charts/victoria-metrics-single/Chart.lock index 8883f0609..b359eb076 100644 --- a/charts/victoria-metrics-single/Chart.lock +++ b/charts/victoria-metrics-single/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.10 -digest: sha256:94b062240fbfc242acafcd180a5e74ac6ff5d37778af8dcc5e3ff209004e18ed -generated: "2024-09-10T06:09:59.34163897Z" + version: 0.0.11 +digest: sha256:d91f2afa5ae37158f11b1c6601cf8265b08dad62ec4eefd36064b32946e215a6 +generated: "2024-09-12T11:50:58.52997534Z" diff --git a/charts/victoria-metrics-single/Chart.yaml b/charts/victoria-metrics-single/Chart.yaml index d19e47042..faf89a7e0 100644 --- a/charts/victoria-metrics-single/Chart.yaml +++ b/charts/victoria-metrics-single/Chart.yaml @@ -3,7 +3,7 @@ type: application appVersion: v1.103.0 description: Victoria Metrics Single version - high-performance, cost-effective and scalable TSDB, long-term remote storage for Prometheus name: victoria-metrics-single -version: 0.11.1 +version: 0.11.2 sources: - https://github.com/VictoriaMetrics/helm-charts kubeVersion: ">=1.25.0-0" diff --git a/charts/victoria-metrics-single/templates/server-deployment.yaml b/charts/victoria-metrics-single/templates/server-deployment.yaml index 1606e47be..992f99591 100644 --- a/charts/victoria-metrics-single/templates/server-deployment.yaml +++ b/charts/victoria-metrics-single/templates/server-deployment.yaml @@ -15,7 +15,7 @@ metadata: spec: selector: matchLabels: {{ include "victoria-metrics.server.matchLabels" . | nindent 6 }} - replicas: 1 + replicas: {{ $app.replicaCount }} {{- if $app.persistentVolume.enabled }} strategy: # Must be "Recreate" when we have a persistent volume diff --git a/charts/victoria-metrics-single/templates/server-service.yaml b/charts/victoria-metrics-single/templates/server-service.yaml index 2f817d41f..34c802366 100644 --- a/charts/victoria-metrics-single/templates/server-service.yaml +++ b/charts/victoria-metrics-single/templates/server-service.yaml @@ -11,23 +11,27 @@ metadata: labels: {{ include "victoria-metrics.server.labels" $ctx | nindent 4 }} name: {{ include "victoria-metrics.server.fullname" . }} spec: - {{- $clusterIP := ternary "None" $app.service.clusterIP $app.statefulSet.enabled }} + {{- $clusterIP := $app.service.clusterIP }} + {{- if and (not $clusterIP) $app.statefulSet.enabled }} + {{- $clusterIP = "None" }} + {{- end }} {{- with $clusterIP }} clusterIP: {{ . }} {{- end }} - {{- $externalIPs := ternary (default list) $app.service.externalIPs $app.statefulSet.enabled }} - {{- with $externalIPs }} + {{- with $app.service.externalIPs }} externalIPs: {{ toYaml . | nindent 4 }} {{- end }} - {{- $loadBalancerIP := ternary "" $app.service.loadBalancerIP $app.statefulSet.enabled }} - {{- with $loadBalancerIP }} + {{- with $app.service.loadBalancerIP }} loadBalancerIP: {{ . }} {{- end }} - {{- $loadBalancerSourceRanges := ternary (default list) $app.service.loadBalancerSourceRanges $app.statefulSet.enabled }} - {{- with $loadBalancerSourceRanges }} + {{- with $app.service.loadBalancerSourceRanges }} loadBalancerSourceRanges: {{ toYaml . | nindent 4 }} {{- end }} - type: {{ ternary "ClusterIP" $app.service.type $app.statefulSet.enabled }} + {{- $type := $app.service.type }} + {{- if and (not $type) $app.statefulSet.enabled }} + {{- $type = "ClusterIP" }} + {{- end }} + type: {{ $type }} {{- with $app.service.healthCheckNodePort }} healthCheckNodePort: {{ . }} {{- end }} diff --git a/charts/victoria-metrics-single/templates/server-statefulset.yaml b/charts/victoria-metrics-single/templates/server-statefulset.yaml index 95acbc108..5016be1eb 100644 --- a/charts/victoria-metrics-single/templates/server-statefulset.yaml +++ b/charts/victoria-metrics-single/templates/server-statefulset.yaml @@ -15,7 +15,7 @@ spec: serviceName: {{ include "victoria-metrics.server.fullname" . }} selector: matchLabels: {{ include "victoria-metrics.server.matchLabels" . | nindent 6 }} - replicas: 1 + replicas: {{ $app.replicaCount }} podManagementPolicy: {{ $app.podManagementPolicy }} template: metadata: diff --git a/charts/victoria-metrics-single/values.yaml b/charts/victoria-metrics-single/values.yaml index 21cb12f84..9ae5de6f3 100644 --- a/charts/victoria-metrics-single/values.yaml +++ b/charts/victoria-metrics-single/values.yaml @@ -54,6 +54,8 @@ server: # -- Image pull policy pullPolicy: IfNotPresent imagePullSecrets: [] + # -- Replica count + replicaCount: 1 # -- Name of Priority Class priorityClassName: "" # -- Overrides the full name of server component