yugabyte / yugabyte-operator

Kubernetes Operator for YugabyteDB (legacy)
65 stars 29 forks source link

Unable to override default storageClass in deployed YB cluster #4

Closed ybnelson closed 6 months ago

ybnelson commented 4 years ago

Given cluster deploy intended for "faster" SSD storage class: apiVersion: yugabyte.com/v1alpha1 kind: YBCluster metadata: name: example-ybcluster namespace: yb-operator spec: replicationFactor: 3 master: replicas: 3 storage: storageClass: faster size: 1Gi tserver: replicas: 3 storage: storageClass: faster count: 1 size: 1Gi

Cluster fails to bind to new storageClass for volumes and defaults to standard storageclass. kubectl describe pod <...> Events: Type Reason Age From Message


Warning FailedScheduling 2m37s (x4 over 2m40s) default-scheduler pod has unbound immediate PersistentVolumeClaims (repeated 3 times) Normal Scheduled 2m37s default-scheduler Successfully assigned yb-operator/yb-tserver-0 to gke-yb-operator-test-default-pool-46c7083c-4wgl Normal SuccessfulAttachVolume 2m27s attachdetach-controller AttachVolume.Attach succeeded for volume "pvc-dc55ad65-1c9a-11ea-a20c-42010af0005a" Normal Pulling 2m5s kubelet, gke-yb-operator-test-default-pool-46c7083c-4wgl pulling image "yugabytedb/yugabyte:1.3.2.0-b19" Normal Pulled 2m4s kubelet, gke-yb-operator-test-default-pool-46c7083c-4wgl Successfully pulled image "yugabytedb/yugabyte:1.3.2.0-b19" Normal Created 2m4s kubelet, gke-yb-operator-test-default-pool-46c7083c-4wgl Created container Normal Started 2m4s kubelet, gke-yb-operator-test-default-pool-46c7083c-4wgl Started container (base) dsqln:yugabyte-operator andrewnelson$ kubectl get pvc -n yb-operator NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE datadir0-yb-master-0 Bound pvc-dc3ce53a-1c9a-11ea-a20c-42010af0005a 1Gi RWO standard 3m16s datadir0-yb-master-1 Bound pvc-dc427473-1c9a-11ea-a20c-42010af0005a 1Gi RWO standard 3m16s datadir0-yb-master-2 Bound pvc-dc492e47-1c9a-11ea-a20c-42010af0005a 1Gi RWO standard 3m16s datadir0-yb-tserver-0 Bound pvc-dc55ad65-1c9a-11ea-a20c-42010af0005a 1Gi RWO standard 3m16s datadir0-yb-tserver-1 Bound pvc-dc5eef8b-1c9a-11ea-a20c-42010af0005a 1Gi RWO standard 3m16s datadir0-yb-tserver-2 Bound pvc-dc6644d9-1c9a-11ea-a20c-42010af0005a 1Gi RWO standard 3m16s

paolodedios commented 4 years ago

When creating a YBCluster using the latest yugabytedb/yugabyte:2.0.7.0-b9 image with the example deployment featured in the repository, k8s 1.15 reports the same error message:

FailedScheduling  31s (x2 over 31s)  default-scheduler  pod has unbound immediate PersistentVolumeClaims (repeated 2 times)

But the cluster reports the PersistentVolumeClaim as not having the storageClass, accessModes, and capacity information configured with the PVC.

$ kubectl get pvc --all-namespaces
NAMESPACE                  NAME                    STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
sitewide-dev-application   datadir0-yb-master-0    Pending                                                     19s
sitewide-dev-application   datadir0-yb-master-1    Pending                                                     19s
sitewide-dev-application   datadir0-yb-master-2    Pending                                                     19s
sitewide-dev-application   datadir0-yb-tserver-0   Pending                                                     19s
sitewide-dev-application   datadir0-yb-tserver-1   Pending                                                     19s
sitewide-dev-application   datadir0-yb-tserver-2   Pending                                                     19s

The operator does not seem to apply the configured overrides nor apply the default standard storage class for v2 of YugabyteDB.

paolodedios commented 4 years ago

After poking around the yugabyte-operator repository I did notice that in the controller implementation, the getVolumeTemplates function fills out the volume mount name and storage size request but does not override the storage class or access mode properties.

https://github.com/yugabyte/yugabyte-operator/blob/a1b1cb7b09134a3a6d12218321afa58dc9f7680a/pkg/controller/ybcluster/ybcluster_create_controller.go#L236

rkarthik007 commented 4 years ago

cc @Arnav15 @ramkumarvs @iSignal

stelb commented 1 year ago

This is still not working in 2022 :-(

meherkumar13 commented 6 months ago

This is still not working in 2024 :-(

bhavin192 commented 6 months ago

@meherkumar13 the note from README:

NOTE: This repository contains code and example Custom Resources for the Kubernetes Operator (legacy) for YugabyteDB v0.0.1. This operator is no longer maintained. We recommend using the actively maintained helm charts for YugabyteDB to install yugabyte on Kubernetes.

There is also a new operator being developed, you will get more details in upcoming release(s).