Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PVC autoscaling. #867

Closed
0megam opened this issue Feb 8, 2024 · 2 comments
Closed

PVC autoscaling. #867

0megam opened this issue Feb 8, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@0megam
Copy link

0megam commented Feb 8, 2024

Is it feasible to concurrently utilize operators such as https://github.com/DevOps-Nirvana/Kubernetes-Volume-Autoscaler alongside the VM operator?
My understanding is that the Kubernetes volume autoscaler will adjust PVC resources to scale up PV, but I presume the VM operator may revert these changes.

@f41gh7
Copy link
Collaborator

f41gh7 commented Feb 8, 2024

Hello,

I think, it's possible to use PVC autoscaling with operator. Operator checks the actual size of pvc and compares it with claimTemplate defined at statefulset. It it's bigger, operator logs and error and do nothing with this pvc.
It's a case for vmstorage, vmselect, vmagent and vmalertmanager.

For vmsingle, it's possible to use external pvc and operator will ignore it's size.

I think, we could add special annotation for claim template, that we'll delegate PVC resize to the external controller such as volume-auto-scaler.

cc @Haleygo

@f41gh7 f41gh7 added the enhancement New feature or request label Feb 8, 2024
f41gh7 added a commit that referenced this issue Mar 1, 2024
previously each pvc created by sts must be annotated with operator.victoriametrics.com/pvc-allow-volume-expansion
now, it's no longer needed, operator performs a check on sts claim definition itself
it allows to use it for PVC autoscaler or simmilar tool
#867
f41gh7 added a commit that referenced this issue Mar 1, 2024
previously each pvc created by sts must be annotated with operator.victoriametrics.com/pvc-allow-volume-expansion
now, it's no longer needed, operator performs a check on sts claim definition itself
it allows to use it for PVC autoscaler or simmilar tool
#867
@f41gh7
Copy link
Collaborator

f41gh7 commented Apr 18, 2024

Since v0.42.0 release, it's possible to add special annotation operator.victoriametrics.com/pvc-allow-volume-expansion: "false". It prevents operator from scaling persistent volumes and delegates control over it to external tool.

apiVersion: operator.victoriametrics.com/v1beta1
kind: VMCluster
metadata:
  name: example-vmcluster-persistent
spec:
  retentionPeriod: "4"
  replicationFactor: 2
  vmstorage:
    replicaCount: 2
    storageDataPath: "/vm-data"
    storage:
      volumeClaimTemplate:
        metadata:
         annotations:
          operator.victoriametrics.com/pvc-allow-volume-expansion: "false"
        spec:
          storageClassName: sc-immutable
          resources:
            requests:
              storage: 10Gi
  vmselect:
    replicaCount: 2
    cacheMountPath: "/select-cache"
    storage:
      volumeClaimTemplate:
        metadata:
         annotations:
          operator.victoriametrics.com/pvc-allow-volume-expansion: "false"
        spec:
          storageClassName: sc-mutable
          resources:
            requests:
              storage: 2Gi
  vminsert:
    replicaCount: 2

@f41gh7 f41gh7 closed this as completed Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants