Skip to content

Commit

Permalink
victoria-metrics-distributed: support overriding the default name for…
Browse files Browse the repository at this point in the history
… extra vmagent and vmcluster per zone (#1512)
  • Loading branch information
Haleygo authored Sep 19, 2024
1 parent 8f41dcd commit 68ee908
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/victoria-logs-single/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

![Version: 0.6.3](https://img.shields.io/badge/Version-0.6.3-informational?style=flat-square)
![Version: 0.6.3](https://img.shields.io/badge/Version-0.6.3-informational?style=flat-square)
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/helm/victoriametrics/victoria-logs-single)
[![Slack](https://img.shields.io/badge/join%20slack-%23victoriametrics-brightgreen.svg)](https://slack.victoriametrics.com/)

Expand Down
2 changes: 2 additions & 0 deletions charts/victoria-metrics-distributed/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Next release

- Do not truncate datasource name
- Support customizing vmauthQueryGlobal spec. Thanks to @olivierbouffet for [the pull request](https://github.com/VictoriaMetrics/helm-charts/pull/1511).
- Support overriding the default name for extra vmagent and vmcluster per zone.

## 0.3.0

Expand Down
8 changes: 4 additions & 4 deletions charts/victoria-metrics-distributed/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: victoria-metrics-common
repository: https://victoriametrics.github.io/helm-charts
version: 0.0.9
version: 0.0.13
- name: victoria-metrics-k8s-stack
repository: https://victoriametrics.github.io/helm-charts
version: 0.25.15
digest: sha256:e3de52694b1f4f429343d301af18f8c8b1a6674323c2f5bf1757874752c81a6e
generated: "2024-09-07T09:10:18.966418+03:00"
version: 0.25.16
digest: sha256:70b3cd33db0ca6256a8abc353dbaa0deae4264d8b9664a3ceab5ab7225ab8a99
generated: "2024-09-19T12:53:54.22191+08:00"
2 changes: 1 addition & 1 deletion charts/victoria-metrics-distributed/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: victoria-metrics-distributed
description: A Helm chart for Running VMCluster on Multiple Availability Zones
type: application
version: 0.3.0
version: 0.3.1
appVersion: "v1.103.0"
sources:
- https://github.com/VictoriaMetrics/helm-charts
Expand Down
23 changes: 22 additions & 1 deletion charts/victoria-metrics-distributed/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square)
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.3.1](https://img.shields.io/badge/Version-0.3.1-informational?style=flat-square)
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/victoriametrics)](https://artifacthub.io/packages/helm/victoriametrics/victoria-metrics-distributed)
[![Slack](https://img.shields.io/badge/join%20slack-%23victoriametrics-brightgreen.svg)](https://slack.victoriametrics.com/)

Expand Down Expand Up @@ -403,6 +403,16 @@ spec: {}
</pre>
</td>
<td><p>override the name of the vmauth object</p>
</td>
</tr>
<tr>
<td>availabilityZones[0].vmcluster.name</td>
<td>string</td>
<td><pre lang="">
""
</pre>
</td>
<td><p>override the name of the vmcluster, by default is vmcluster-<zoneName></p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -491,6 +501,16 @@ spec: {}
</pre>
</td>
<td><p>vmagent only meant to proxy write requests to each az, doesn&rsquo;t support customized remote write address</p>
</td>
</tr>
<tr>
<td>availabilityZones[1].vmcluster.name</td>
<td>string</td>
<td><pre lang="">
""
</pre>
</td>
<td><p>override the name of the vmcluster, by default is vmcluster-<zoneName></p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -531,6 +551,7 @@ false
<td>object</td>
<td><pre lang="plaintext">
enabled: true
name: test-vmagent
spec:
selectAllByDefault: true
</pre>
Expand Down
3 changes: 2 additions & 1 deletion charts/victoria-metrics-distributed/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ Creates vmclusterSpec map, insert zone's nodeselector and topologySpreadConstrai
{{- $newvmclusterSpec := dict "vminsert" $newvminsert "vmstorage" $newvmstorage "vmselect" $newvmselect }}
{{- $vmclusterSpec = mergeOverwrite (deepCopy $vmclusterSpec) $newvmclusterSpec }}
{{- $_ := set $zonesMap $rolloutZone.name $vmclusterSpec -}}
{{- $vmclusterName := default (printf "vmcluster-%s" $rolloutZone.name) $rolloutZone.vmcluster.name }}
{{- $_ := set $zonesMap $vmclusterName $vmclusterSpec -}}
{{- end -}}
{{- $zonesMap | toYaml }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: operator.victoriametrics.com/v1beta1
kind: VMAgent
metadata:
labels: {{ include "victoria-metrics-distributed.labels" . | nindent 4 }}
name: test-vmagent
name: {{ .Values.extraVMAgent.name }}
namespace: {{ include "vm.namespace" . }}
spec: {{ include "victoria-metrics-distributed.extravmagentSpec" . | nindent 2 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
{{- with $rolloutZone.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
name: vmcluster-{{ $zoneName }}
name: {{ $zoneName }}
namespace: {{ include "vm.namespace" $ }}
labels: {{ include "victoria-metrics-distributed.labels" $ | nindent 4 }}
spec:
Expand Down
3 changes: 3 additions & 0 deletions charts/victoria-metrics-distributed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ availabilityZones:
spec: {}
vmcluster:
enabled: true
# -- override the name of the vmcluster, by default is vmcluster-<zoneName>
name: ""
# -- spec for VMCluster crd, see https://docs.victoriametrics.com/operator/api#vmclusterspec
spec:
Expand Down Expand Up @@ -144,6 +145,7 @@ availabilityZones:
spec: {}
vmcluster:
enabled: true
# -- override the name of the vmcluster, by default is vmcluster-<zoneName>
name: ""
# -- spec for VMCluster crd, see https://docs.victoriametrics.com/operator/api#vmclusterspec
spec:
Expand Down Expand Up @@ -220,6 +222,7 @@ availabilityZones:
# and write data to above vmauth-global-ingest endpoint.
extraVMAgent:
enabled: true
name: test-vmagent
spec:
selectAllByDefault: true

Expand Down
18 changes: 18 additions & 0 deletions charts/victoria-metrics-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,15 @@ true
<td><pre lang="plaintext">
[]
</pre>
</td>
<td></td>
</tr>
<tr>
<td>service.servicePort</td>
<td>int</td>
<td><pre lang="">
8080
</pre>
</td>
<td></td>
</tr>
Expand All @@ -808,6 +817,15 @@ true
<td><pre lang="">
ClusterIP
</pre>
</td>
<td></td>
</tr>
<tr>
<td>service.webhookPort</td>
<td>int</td>
<td><pre lang="">
9443
</pre>
</td>
<td></td>
</tr>
Expand Down

0 comments on commit 68ee908

Please sign in to comment.