Skip to content

Commit

Permalink
updated urls and naming
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk committed Sep 12, 2024
1 parent c1ae336 commit dc04aef
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 19 deletions.
14 changes: 0 additions & 14 deletions charts/victoria-metrics-distributed/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
{{/*
Create the name for global ingest vmauth
*/}}
{{- define "victoria-metrics-distributed.vmauthIngestGlobalName" -}}
{{- include "vm.service" (dict "helm" . "appKey" (list "write" "global" "vmauth") "style" "managed") -}}
{{- end }}

{{/*
Create the name for global query vmauth
*/}}
{{- define "victoria-metrics-distributed.vmauthQueryGlobalName" -}}
{{- include "vm.service" (dict "helm" . "appKey" (list "read" "global" "vmauth") "style" "managed") -}}
{{- end }}

{{/*
Common labels
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ metadata:
{{- end }}
{{- end }}
{{- $_ := set $spec "remoteWrite" (concat $remoteWrites ($spec.remoteWrites | default list)) }}
spec: {{ toYaml (omit $spec "remoteWrite") | nindent 2 }}
spec: {{ toYaml $spec | nindent 2 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ spec: {{ toYaml (omit $spec "unauthorizedAccessConfig") | nindent 2 }}
- src_paths:
- "/select/.+"
{{- $_ := set $ctx "appKey" (list "availabilityZones" $i "vmcluster" "spec" "vmselect") }}
{{- $_ := set $ctx "style" "managed" }}
url_prefix:
- {{ include "vm.url" $ctx }}
{{- $_ := unset $ctx "style" }}
{{- end }}
{{- end }}

Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,22 @@ spec: {{ toYaml (omit $spec "unauthorizedAccessConfig") | nindent 2 }}
load_balancing_policy: first_available
retry_status_codes:
- 503
{{- $_ := set $ctx "style" "managed" }}
{{- $urls := default list }}
{{- if $zone.read.allow }}
{{- $_ := set $ctx "prefix" "read-balancer" }}
{{- $_ := set $ctx "appKey" (list "availabilityZones" $i "read" "perZone" "vmauth") }}
{{- $urls = append $urls (include "vm.url" $ctx) }}
{{- end }}
{{- range $j, $cross := $.Values.availabilityZone }}
{{- $_ := set $ctx "prefix" "read-proxy" }}
{{- range $j, $cross := $.Values.availabilityZones }}
{{- if and (ne $j $i) $cross.read.allow }}
{{- $_ := set $ctx "appKey" (list "availabilityZones" $j "read" "crossZone" "vmauth") }}
{{- $urls = append $urls (include "vm.url" )}}
{{- $_ := set $ctx "appKey" (list "availabilityZones" $j "read" "perZone" "vmauth") }}
{{- $urls = append $urls (include "vm.url" $ctx)}}
{{- end }}
{{- end }}
url_prefix: {{ toYaml $urls | nindent 4 }}
{{- $_ := unset $ctx "style" }}
{{- $_ := unset $ctx "prefix" }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ metadata:
{{- $spec := $zone.spec | default dict }}
{{- $spec = merge (deepCopy $spec) (deepCopy $zone.write.vmauth.spec) }}
spec: {{ toYaml (omit $spec "unauthorizedAccessConfig") | nindent 2 }}
{{- $_ := set $ctx "style" "managed" }}
{{- $_ := set $ctx "appKey" (list "availabilityZones" $i "vmcluster" "spec" "vminsert") }}
unauthorizedAccessConfig:
- src_paths:
- "/insert/.+"
url_prefix:
- {{ include "vm.url" $ctx }}
{{- $_ := unset $ctx "style" }}
{{- end }}
{{- 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
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ spec:
- src_paths:
- "/select/.+"
load_balancing_policy: first_available
{{- $_ := set $ctx "style" "managed" }}
{{- $_ := set $ctx "prefix" "read-proxy" }}
{{- $urls := default list }}
{{- range $i, $zone := $.Values.availabilityZones }}
{{- $_ := set $ctx "appKey" (list "availabilityZones" $i "read" "crossZone" "vmauth") }}
{{- $urls = append $urls (include "vm.url" $ctx) }}
{{- end }}
{{- $_ := unset $ctx "style" }}
url_prefix: {{ toYaml $urls | nindent 4 }}
{{- end }}

Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ spec:
- "/write"
- "/api/v1/import"
- "/api/v1/import/.+"
{{- $_ := set $ctx "style" "managed" }}
{{- $urls := default list }}
{{- range $i, $zone := $.Values.availabilityZones }}
{{- $_ := set $ctx "appKey" (list "availabilityZones" $i "vmagent") }}
{{- $urls = append $urls (include "vm.url" $ctx) }}
{{- end }}
{{- $_ := unset $ctx "style" }}
url_prefix: {{ toYaml $urls | nindent 4 }}
{{- end }}

0 comments on commit dc04aef

Please sign in to comment.