Upgrade deployments

If there is an error or interruption during upgrade, the operator will apply the desired state defined in the PulsarCluster custom resource until the resource matches the actual state.

The KAAP Operator follows a fixed schema to upgrade the cluster:

    zk: Zookeeper Statefulset
    zkinit: Zookeeper Metadata Initialization Job
    bk: BookKeeper
    broker: Broker
    brokertxn: Broker Transactions Initialization Job
    ar: Autorecovery
    proxy: Proxy
    ba: Bastion
    fn: Functions Worker
    [*] --> zk
    zk --> zkinit : Ready
    zkinit --> bk : Completed
    bk --> broker : Ready
    bk --> proxy : Ready
    bk --> ba : Ready
    bk --> ar : Ready
    broker --> brokertxn : Ready
    brokertxn --> fn : Completed
    fn --> [*] : Ready
    proxy --> [*] : Ready
    ba --> [*] : Ready
    ar --> [*] : Ready


For example, if you’ve installed the operator and a Pulsar cluster with this yaml file:

  • Helm

  • Result

helm install pulsar helm/pulsar-operator -f helm/examples/bookie-autoscaling/values.yaml
NAME: pulsar
LAST DEPLOYED: Fri May 12 12:36:13 2023
NAMESPACE: pulsar-cluster
STATUS: deployed
  1. While looking over your configuration, you decide you also need more brokers to handle requests. Edit the helm/examples/bookie-autoscaling/values.yaml file to change the number of Brokers from 1 to 3:

          replicas: 3
            managedLedgerDefaultAckQuorum: 3
            managedLedgerDefaultEnsembleSize: 3
            managedLedgerDefaultWriteQuorum: 3
              cpu: "0.1"
              memory: "128Mi"
  2. Upgrade the cluster with the new values.yaml file:

    • Helm

    • Result

    helm upgrade pulsar helm/pulsar-operator -f helm/examples/bookie-autoscaling/values.yaml
    Release "pulsar" has been upgraded. Happy Helming!
    NAME: pulsar
    LAST DEPLOYED: Fri May 12 15:11:51 2023
    NAMESPACE: pulsar-cluster
    STATUS: deployed
    TEST SUITE: None
  3. The operator will upgrade the cluster to the new desired state. In this case, the operator adds two more broker pods, and touches nothing else.

    • Kubectl

    • Result

    kubectl get pods -A
    pulsar-cluster   pulsar-autorecovery-57cfc8b84d-xvchb                       1/1     Running     0          150m
    pulsar-cluster   pulsar-bastion-74777cbbf9-pcq5x                            1/1     Running     0          150m
    pulsar-cluster   pulsar-bookkeeper-0                                        1/1     Running     0          152m
    pulsar-cluster   pulsar-broker-0                                            1/1     Running     0          150m
    pulsar-cluster   pulsar-broker-1                                            1/1     Running     0          8m9s
    pulsar-cluster   pulsar-broker-2                                            1/1     Running     0          7m36s
    pulsar-cluster   pulsar-operator-7d8cc69df5-ncs5j                           1/1     Running     0          163m
    pulsar-cluster   pulsar-proxy-5bd5cc4fb6-9pnl7                              1/1     Running     0          150m
    pulsar-cluster   pulsar-zookeeper-0                                         1/1     Running     0          155m
    pulsar-cluster   pulsar-zookeeper-metadata-zgfn4                            0/1     Completed   0          153m
  4. You’ve successfully upgraded your deployment by just managing a single .yaml file. Thanks, KAAP Operator!

Upgrade CRDs

To upgrade CRDs:

  • Helm

  • Result

kubectl replace -f helm/pulsar-operator/crds
customresourcedefinition.apiextensions.k8s.io/autorecoveries.pulsar.oss.datastax.com replaced
customresourcedefinition.apiextensions.k8s.io/bastions.pulsar.oss.datastax.com replaced
customresourcedefinition.apiextensions.k8s.io/bookkeepers.pulsar.oss.datastax.com replaced
customresourcedefinition.apiextensions.k8s.io/brokers.pulsar.oss.datastax.com replaced
customresourcedefinition.apiextensions.k8s.io/functionsworkers.pulsar.oss.datastax.com replaced
customresourcedefinition.apiextensions.k8s.io/proxies.pulsar.oss.datastax.com replaced
customresourcedefinition.apiextensions.k8s.io/pulsarclusters.pulsar.oss.datastax.com replaced
customresourcedefinition.apiextensions.k8s.io/zookeepers.pulsar.oss.datastax.com replaced

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com