Lets say we have 2 zones: zone-a and zone-b. Separate cluster must be deploy to the both zones with commands:
helm upgrade -i zone-a vm/victoria-metrics-cluster -f zone.yaml
helm upgrade -i zone-b vm/victoria-metrics-cluster -f zone.yaml
configuration file simillar for both zones:
# zone.yaml
vmselect:
affinity: {}
extraArgs:
# accept connections from global vmselects
clusternativeListenAddr: ":8401"
vminsert:
affinity: {}
extraArgs:
replicationFactor: "2"
# accept connections from global vminsert
clusternativeListenAddr: ":8400"
vmstorage:
affinity: {}
On top of it global vminsert
and vmselect
must be deployed:
helm upgrade -i global vm/victoria-metrics-cluster -f global.yaml
config for global chart:
# global.yaml
vmselect:
suppresStorageFQDNsRender: true
extraArgs:
# manually render storageNode arg based on the service name for zonal vmselects. command hint`kubectl get svc | grep vmselect | grep zone`
storageNode: "zone-a-victoria-metrics-cluster-vmselect:8401,zone-b-victoria-metrics-cluster-vmselect:8401"
vminsert:
suppresStorageFQDNsRender: true
extraArgs:
# manually render storageNode arg based on the service name for zonal vminserts. command hint `kubectl get svc | grep vminsert | grep zone`
storageNode: "zone-a-victoria-metrics-cluster-vminsert:8400,zone-b-victoria-metrics-cluster-vminsert:8400"
vmstorage:
# disable vmstorage since only vmselect and vminsert needed for global view
enabled: false