Upgrade to KAAP v0.2.0
KAAP 0.2.0 is a major release that includes a new version of the CRDs. This means that you must migrate your existing v0.1.0 CRDs to v0.2.0 CRDs.
The CRDs specs are fully compatible, but you must change the existing custom resource definition version to |
This process ensures no downtime during the upgrade. One full cluster upgrade is required to complete the migration, and it’s done automatically.
Use these steps to upgrade to Kaap v0.2.0:
-
Apply the new CRD versions.
This process will update the CRD by adding a new version
v1beta1
.kubectl apply -f https://github.com/datastax/kaap/releases/download/operator-0.2.0/autorecoveries.kaap.oss.datastax.com-v1-migration.yml --server-side --force-conflicts kubectl apply -f https://github.com/datastax/kaap/releases/download/operator-0.2.0/bastions.kaap.oss.datastax.com-v1-migration.yml --server-side --force-conflicts kubectl apply -f https://github.com/datastax/kaap/releases/download/operator-0.2.0/bookkeepers.kaap.oss.datastax.com-v1-migration.yml --server-side --force-conflicts kubectl apply -f https://github.com/datastax/kaap/releases/download/operator-0.2.0/brokers.kaap.oss.datastax.com-v1-migration.yml --server-side --force-conflicts kubectl apply -f https://github.com/datastax/kaap/releases/download/operator-0.2.0/functionsworkers.kaap.oss.datastax.com-v1-migration.yml --server-side --force-conflicts kubectl apply -f https://github.com/datastax/kaap/releases/download/operator-0.2.0/proxies.kaap.oss.datastax.com-v1-migration.yml --server-side --force-conflicts kubectl apply -f https://github.com/datastax/kaap/releases/download/operator-0.2.0/zookeepers.kaap.oss.datastax.com-v1-migration.yml --server-side --force-conflicts kubectl apply -f https://github.com/datastax/kaap/releases/download/operator-0.2.0/pulsarclusters.kaap.oss.datastax.com-v1-migration.yml --server-side --force-conflicts
Result
customresourcedefinition.apiextensions.k8s.io/autorecoveries.kaap.oss.datastax.com serverside-applied customresourcedefinition.apiextensions.k8s.io/bastions.kaap.oss.datastax.com serverside-applied customresourcedefinition.apiextensions.k8s.io/bookkeepers.kaap.oss.datastax.com serverside-applied customresourcedefinition.apiextensions.k8s.io/brokers.kaap.oss.datastax.com serverside-applied customresourcedefinition.apiextensions.k8s.io/functionsworkers.kaap.oss.datastax.com serverside-applied customresourcedefinition.apiextensions.k8s.io/proxies.kaap.oss.datastax.com serverside-applied customresourcedefinition.apiextensions.k8s.io/zookeepers.kaap.oss.datastax.com serverside-applied customresourcedefinition.apiextensions.k8s.io/autorecoveries.kaap.oss.datastax.com serverside-applied customresourcedefinition.apiextensions.k8s.io/bastions.kaap.oss.datastax.com serverside-applied customresourcedefinition.apiextensions.k8s.io/bookkeepers.kaap.oss.datastax.com serverside-applied customresourcedefinition.apiextensions.k8s.io/brokers.kaap.oss.datastax.com serverside-applied customresourcedefinition.apiextensions.k8s.io/functionsworkers.kaap.oss.datastax.com serverside-applied customresourcedefinition.apiextensions.k8s.io/proxies.kaap.oss.datastax.com serverside-applied customresourcedefinition.apiextensions.k8s.io/zookeepers.kaap.oss.datastax.com serverside-applied
-
Copy the KAAP custom resources and move them to
v1beta1
:namespace=default # change this according to your kaap namespace name=pulsar # change this according to your pulsar cluster name kubectl get -n $namespace autorecoveries $name-autorecovery -o yaml | sed 's/apiVersion: kaap.oss.datastax.com\/v1alpha1/apiVersion: kaap.oss.datastax.com\/v1beta1/' | kubectl apply -f - kubectl get -n $namespace bastions $name-bastion -o yaml | sed 's/apiVersion: kaap.oss.datastax.com\/v1alpha1/apiVersion: kaap.oss.datastax.com\/v1beta1/' | kubectl apply -f - kubectl get -n $namespace bookkeepers $name-bookkeeper -o yaml | sed 's/apiVersion: kaap.oss.datastax.com\/v1alpha1/apiVersion: kaap.oss.datastax.com\/v1beta1/' | kubectl apply -f - kubectl get -n $namespace brokers $name-broker -o yaml | sed 's/apiVersion: kaap.oss.datastax.com\/v1alpha1/apiVersion: kaap.oss.datastax.com\/v1beta1/' | kubectl apply -f - kubectl get -n $namespace functionsworkers $name-functionsworker -o yaml | sed 's/apiVersion: kaap.oss.datastax.com\/v1alpha1/apiVersion: kaap.oss.datastax.com\/v1beta1/' | kubectl apply -f - kubectl get -n $namespace proxies $name-proxy -o yaml | sed 's/apiVersion: kaap.oss.datastax.com\/v1alpha1/apiVersion: kaap.oss.datastax.com\/v1beta1/' | kubectl apply -f - kubectl get -n $namespace zookeepers $name-zookeeper -o yaml | sed 's/apiVersion: kaap.oss.datastax.com\/v1alpha1/apiVersion: kaap.oss.datastax.com\/v1beta1/' | kubectl apply -f - kubectl get -n $namespace pulsarclusters $name -o yaml | sed 's/apiVersion: kaap.oss.datastax.com\/v1alpha1/apiVersion: kaap.oss.datastax.com\/v1beta1/' | kubectl apply -f -
Result
autorecovery.kaap.oss.datastax.com/pulsar-autorecovery configured bastion.kaap.oss.datastax.com/pulsar-bastion configured bookkeeper.kaap.oss.datastax.com/pulsar-bookkeeper configured broker.kaap.oss.datastax.com/pulsar-broker configured functionsworker.kaap.oss.datastax.com/pulsar-functionsworker configured proxy.kaap.oss.datastax.com/pulsar-proxy configured zookeeper.kaap.oss.datastax.com/pulsar-zookeeper configured pulsarcluster.kaap.oss.datastax.com/pulsar configured
-
Ensure the resources exist:
kubectl get -n $namespace pulsarclusters.v1beta1.kaap.oss.datastax.com $name
Result
NAME AGE pulsar 12m
-
Upgrade the Helm chart to version 0.2.0:
helm repo update helm pull https://datastax.github.io/kaap helm upgrade kaap --version 0.2.0 -n $namespace kaap/kaap-stack -f helm/examples/dev-cluster/values.yaml
Result
...Successfully got an update from the "kaap" chart repository Update Complete. ⎈Happy Helming!⎈ Release "pulsar" has been upgraded. Happy Helming! NAME: pulsar LAST DEPLOYED: Wed Aug 30 13:43:11 2023 NAMESPACE: default STATUS: deployed REVISION: 2 TEST SUITE: None
-
Ensure everything is working correctly.
The KAAP pod should now be watching the
v1beta1
resources, and you can expect each component to be restarted.Run the following command until it returns only one or two matches, depending on your configuration. The one match should be the ZooKeeper job, unless the broker has transactions enabled, in which case you’ll see two matches.
kubectl get -n $namespace all -o yaml | grep kaap.oss.datastax.com/v1alpha1
You’ve now successfully upgraded to KAAP v0.2.0.