Skip to content

Instantly share code, notes, and snippets.

@denisgolius
Forked from f41gh7/README.md
Created January 30, 2023 16:54
Show Gist options
  • Save denisgolius/7b879dfce0a6c4713e710442c0ec18ad to your computer and use it in GitHub Desktop.
Save denisgolius/7b879dfce0a6c4713e710442c0ec18ad to your computer and use it in GitHub Desktop.
multi level vmcluster with helm chart

Mutli level cluster setup

doc

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment