operator icon indicating copy to clipboard operation
operator copied to clipboard

allowed override vmagent volume

Open wenerme opened this issue 3 years ago • 3 comments
trafficstars

want to prevent vmagent data lost by mount

  volumes:
  - name: persistent-queue-data
    hostPath:
      path: /data/var/vmagent/persistent-queue-data

operator should merge volume by name.

https://github.com/VictoriaMetrics/operator/blob/10a53e58c8dcb388e7dda62db836513fb0618e90/controllers/factory/vmagent.go#L246-L251

wenerme avatar Mar 12 '22 07:03 wenerme

I think, that it can be achieved with statefulset instead of deployment. Deployment in case of persistent volume claim mount must has upgradeStrategy: ReCreate and replicas: 1.

Related issue https://github.com/VictoriaMetrics/operator/issues/219

I hope, soon it will be added.

f41gh7 avatar Mar 12 '22 17:03 f41gh7

Some provider seems do not need to recreate, like openebs zfs, allowed multi mount.

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: openebs-local-zfs-testing-shared
parameters:
  # allowed multi mount
  shared: "yes"

wenerme avatar Mar 12 '22 17:03 wenerme

FYI, v0.25.0 release supports StatefulMode for VMAgent. Will update docs soon.

f41gh7 avatar May 19 '22 00:05 f41gh7

@f41gh7 can we have docs updated accordingly?

hagen1778 avatar Jul 14 '23 13:07 hagen1778

Added an example https://github.com/VictoriaMetrics/operator/blob/master/config/examples/vmagent_stateful_with_sharding.yaml

f41gh7 avatar Jul 17 '23 05:07 f41gh7