Skip to content

Commit

Permalink
victoria-metrics-cluster: allow excluding vmstorage node from vminser…
Browse files Browse the repository at this point in the history
…t's storage node list (#1552)
  • Loading branch information
AndrewChubatiuk authored Oct 3, 2024
1 parent 2c68c4d commit 9474517
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
3 changes: 2 additions & 1 deletion charts/victoria-metrics-cluster/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
## Next release

- Support extra storageNodes. Fail if no storageNodes set
- Support enabling automatic discovery of vmstorage addresses using DNS SRV records in enterprise version.
- Support enabling automatic discovery of vmstorage addresses using DNS SRV records in enterprise version
- Added HPA with scaledown disabled by default
- Allow excluding vmstorage nodes from vminsert. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1549)

## 0.14.0

Expand Down
13 changes: 12 additions & 1 deletion charts/victoria-metrics-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,17 @@ timeoutSeconds: 5
</pre>
</td>
<td><p>Specify alternative source for env variables</p>
</td>
</tr>
<tr>
<td>vminsert.excludeStorageIDs</td>
<td>list</td>
<td><pre class="helm-vars-default-value" language-yaml" lang="plaintext">
<code class="language-yaml">[]
</code>
</pre>
</td>
<td><p>IDs of vmstorage nodes to exclude from writing</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -2374,7 +2385,7 @@ loggerFormat: json
<td>vmselect.name</td>
<td>string</td>
<td><pre class="helm-vars-default-value" language-yaml" lang="">
<code class="language-yaml">vmselect
<code class="language-yaml">""
</code>
</pre>
</td>
Expand Down
8 changes: 5 additions & 3 deletions charts/victoria-metrics-cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ app: {{ $Values.vmauth.name | default "vmauth" }}
{{- else }}
{{- $port := "8400" }}
{{- range $i := until ($storage.replicaCount | int) -}}
{{- $_ := set $ "appIdx" $i }}
{{- $storageNode := include "vm.fqdn" $ -}}
{{- $storageNodes = append $storageNodes (printf "%s:%s" $storageNode $port) -}}
{{- if not (has (float64 $i) $app.excludeStorageIDs) -}}
{{- $_ := set $ "appIdx" $i }}
{{- $storageNode := include "vm.fqdn" $ -}}
{{- $storageNodes = append $storageNodes (printf "%s:%s" $storageNode $port) -}}
{{- end -}}
{{- end -}}
{{- $_ := unset $ "appIdx" }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/victoria-metrics-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ vmselect:
vminsert:
# -- Enable deployment of vminsert component. Deployment is used
enabled: true
# -- IDs of vmstorage nodes to exclude from writing
excludeStorageIDs: []
# -- VMInsert name
name: ""
# -- VMInsert strategy
Expand Down

0 comments on commit 9474517

Please sign in to comment.