pravega / zookeeper-operator

Kubernetes Operator for Zookeeper
Apache License 2.0
368 stars 206 forks source link

ZooKeeper cluster not found when scaling up/down #505

Open alfonsomunozpomer opened 2 years ago

alfonsomunozpomer commented 2 years ago

I can create, describe or delete ZooKeeper clusters with the operator, but I can’t scale it because kubectl scale says that the resource is not found. Is there anything I’m missing?

Find below my simple cluster YAML and some example output. I’m running this on a GKE Autopilot cluster.

# foo.yaml
apiVersion: "zookeeper.pravega.io/v1beta1"
kind: "ZookeeperCluster"
metadata:
  name: "zookeeper"
spec:
  replicas: 1
$ kubectl create -f foo.yaml 
zookeepercluster.zookeeper.pravega.io/zookeeper created

$ kubectl get zookeepercluster
NAME        REPLICAS   READY REPLICAS   VERSION   DESIRED VERSION   INTERNAL ENDPOINT   EXTERNAL ENDPOINT   AGE
zookeeper   1                                     0.2.13            10.118.2.3:2181     N/A                 6s

$ kubectl scale --replicas=3 zookeepercluster zookeeper
Error from server (NotFound): zookeeperclusters.zookeeper.pravega.io "zookeeper" not found

$ kubectl delete zookeepercluster zookeeper
zookeepercluster.zookeeper.pravega.io "zookeeper" deleted
anishakj commented 2 years ago

You have to scale using kubectl edit zookeepercluster zookeeper and change the replicas

alfonsomunozpomer commented 2 years ago

Are there any plans to add support for kubectl scale?

alfonsomunozpomer commented 2 years ago

I’ve seen similar issues with rollout:

$ kubectl rollout restart zookeepercluster zookeeper
error: no kind "ZookeeperCluster" is registered for version "zookeeper.pravega.io/v1beta1" in scheme "pkg/scheme/scheme.go:28"

Whereas restarting the cluster as a sts works.