operator
operator copied to clipboard
VMSingle with storageDataPath and external PVC doesn't create any Pod
if I use following VMSingle CR. it doesn't create any VMSingle pod.
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMSingle
spec:
storageDataPath: /data
volumeMounts:
- mountPath: /data
name: data
volumes:
- name: data
persistentVolumeClaim:
claimName: pvc-vmsingle-data
{"level":"error","ts":1640666777.92905,"logger":"controller.vmsingle","msg":"Reconciler error","reconciler group":"operator.victoriametrics.com","reconciler kind":"VMSingle","name":"demo","namespace":"gravity-observability-system","error":"cannot create new vmsingle deploy: Deployment.apps \"vmsingle-demo\" is invalid: spec.template.spec.containers[0].volumeMounts[1].mountPath: Invalid value: \"/data\": must be unique","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:214"}
https://github.com/VictoriaMetrics/operator/blob/53b34c6dfe35efbd158e0844afe2b6cdd1d98de6/controllers/factory/vmsingle.go#L207-L214
https://github.com/VictoriaMetrics/operator/blob/53b34c6dfe35efbd158e0844afe2b6cdd1d98de6/controllers/factory/vmsingle.go#L235-L240
when storageSpec == nil, empty dir volume source is set which is causing this issue.
It's really uneven, need to fix it and make it more simple.
Can you try this one example:
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMSingle
spec:
storage: {}
storageDataPath: /data
volumes:
- name: data
persistentVolumeClaim:
claimName: pvc-vmsingle-data
@f41gh7 tried, works, seems operator will create a volumeMounts with the storageDataPath