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

[BUG] Setting spec.dataStore.supportsAutoResize to true does not enable auto resizing #919

Open
hoyhbx opened this issue Jun 17, 2022 · 0 comments

Comments

@hoyhbx
Copy link

hoyhbx commented Jun 17, 2022

What version of operator are you using?
commit 561cf47 (HEAD -> master)

What operating system and processor architecture are you using (kubectl version)?
Ubuntu. 20.04

kubectl version Output
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.0", GitCommit:"4ce5a8954017644c5420bae81d72b09b735c21f0", GitTreeState:"clean", BuildDate:"2022-05-03T13:46:05Z", GoVersion:"go1.18.1", Compiler:"gc", Platform:"darwin/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.9", GitCommit:"6df4433e288edc9c40c2e344eb336f63fad45cd2", GitTreeState:"clean", BuildDate:"2022-05-19T19:53:08Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.24) and server (1.22) exceeds the supported minor version skew of +/-1

What did you do?

We are trying to enable the auto resizing feature for the PVC so that we do not need to restart the cluster to resize the PVC.
But it seems this field supportsAutoResize is a no-op. We changed the PVC size from 1Gi to 2Gi, but the PVC is not automatically resized to 2Gi.

Reproduce

  1. We first applied the operator yaml file and crd yaml file.
  2. Then we applied the following cr file to deploy the initial cockroachdb-operator:
apiVersion: crdb.cockroachlabs.com/v1alpha1
kind: CrdbCluster
metadata:
  name: test-cluster
spec:
  additionalLabels:
    crdb: is-cool
  dataStore:
    pvc:
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
        volumeMode: Filesystem
  image:
    name: cockroachdb/cockroach:v21.2.10
  nodes: 3
  resources:
    limits:
      cpu: 2
      memory: 2Gi
    requests:
      cpu: 100m
      memory: 1Gi
  tlsEnabled: true

(All files were applied using kubectl apply -f <filename> -n cockroach-operator-system)

  1. Then we changed the PVC's size from 1Gi to 2Gi, at the same time changed the field spec.dataStore.supportsAutoResize to true, but the PVC size is not changed.
apiVersion: crdb.cockroachlabs.com/v1alpha1
kind: CrdbCluster
metadata:
  name: test-cluster
spec:
  additionalLabels:
    crdb: is-cool
  dataStore:
    pvc:
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 2Gi
        volumeMode: Filesystem
    supportsAutoResize: true
  image:
    name: cockroachdb/cockroach:v21.2.10
  nodes: 3
  resources:
    limits:
      cpu: 2
      memory: 2Gi
    requests:
      cpu: 100m
      memory: 1Gi
  tlsEnabled: true

What did you expect to see and what did you see instead?

We expect to see PVC resizing is automated after setting the field spec.dataStore.supportsAutoResize to true. However, the field spec.dataStore.supportsAutoResize has no effect.

Possible cause
We do not find any relevant functioning code in cockroach operator codebase that handles spec.dataStore.supportsAutoResize. The field supportsAutoResize is defined in cluster_types.go, but the only possible code handling it in resize_pvc.go is commented.

@hoyhbx hoyhbx changed the title Setting spec.dataStore.supportsAutoResize to true does not enable auto resizing [BUG] Setting spec.dataStore.supportsAutoResize to true does not enable auto resizing Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant