kafka-operator icon indicating copy to clipboard operation
kafka-operator copied to clipboard

storageClass spec value is ignored

Open ankon opened this issue 7 years ago • 2 comments

The value for the storageClass spec option is completely ignored, and instead the operator produces PVCs with a 'standard' storage class.

kind: Kafkacluster
apiVersion: krallistic.github.com/v1
metadata:
  name: kafka
spec:
  brokerCount: 3
  zookeeperConnect: zookeeper.default.svc.cluster.local
  storageClass: slow

I'm suspecting this patch will fix that, but I cannot even get dep ensure to work, and removing the constraints leads to build failures.

diff --git a/util/util.go b/util/util.go
--- a/util/util.go
+++ b/util/util.go
@@ -391,7 +391,7 @@ func (c *ClientUtil) createStsFromSpec(cluster spec.Kafkacluster) *appsv1Beta1.S
 	replicas := cluster.Spec.BrokerCount
 	image := cluster.Spec.Image
 
-	storageClass := "standard"
+	storageClass := cluster.Spec.StorageClass
 
 	//TODO error handling, default value?
 	cpus, err := resource.ParseQuantity(cluster.Spec.Resources.CPU)

ankon avatar Oct 26 '17 14:10 ankon

Thanks for the patch.

Unfortunately, I am currently on Vacation and have only Internet through my phone (which makes it impossible to do dep ensure (That would blow up my limit :) ). I will look into the dep problems next week when iam back.

krallistic avatar Oct 26 '17 16:10 krallistic

any update? Maybe you can merge this change

citywander avatar Nov 08 '17 06:11 citywander