To evaluate the services Banzai Cloud Supertubes offers, we recommend to create a test environment and use our demo cluster. This way you can start over any time, and try all the options you are interested in without having to worry about changes made to your existing environment, even if it’s not used in production.
Production installation is very similar, but of course you won’t need to deploy the demo cluster, and you must exactly specify which components you want to use.
Before deploying Supertubes on your cluster, complete the following tasks.
Create a test cluster 🔗︎
You need a Kubernetes cluster to test Supertubes with. If you don’t already have a Kubernetes cluster to work with, create one with one of the following methods:
CAUTION:Make sure that your Kubernetes cluster has sufficient resources. The requirements can be as high as 8 CPUs and 16 GiB of RAM if you try all the features with our demo cluster. The minimum requirements are 6 CPUs and 8 GiB of RAM.
- You can use the self-hosted or the free online version of Banzai Cloud Pipeline to deploy a cluster.
- Deploy a single-node Banzai Cloud PKE cluster on a physical or virtual Linux box.
- Launch a cluster at one of the many cloud providers’ managed offerings at their console.
- Use KinD on your machine (make sure to increase the resource allocation of Docker for Mac).
Note: KinD does not support LoadBalancers, therefore you won’t be able to test external listeners.
Install the Supertubes tool 🔗︎
Install the Supertubes command-line tool. You can use the Supertubes CLI tool to install Supertubes and other components to your cluster.
Note: The Supertubes CLI supports macOS and Linux (x86_64). It may work on Windows natively, but we don’t test it.
The quickest way to install the
supertubes-cli package for your environment is to run the following command:
curl https://getsupertubes.sh | sh
For other options, see the Supertubes CLI Installation Guide.
Set Kubernetes configuration and context 🔗︎
The command-line tool uses your current Kubernetes context, from the file named in the
KUBECONFIG environment variable (
~/.kube/config by default). Check if this is the cluster you plan to deploy the product by running the following command: kubectl config get-contexts
If there are multiple contexts in the Kubeconfig file, specify the one you want to use with the
use-context parameter, for example:
kubectl config use-context <context-to-use>
If the cluster is managed by Banzai Cloud Pipeline, complete the following steps. For more detailed instructions, see the Banzai Cloud Pipeline documentation.
- Login to your Pipeline instance (for example, by running banzai login --endpoint https://beta.banzaicloud.io/pipeline).
- Run banzai cluster shell, and select the cluster to use. A subshell with the correct environment will open automatically.
Deploy Supertubes 🔗︎
After you have completed the Prerequisites, you can install Supertubes on a single cluster.
Run the following command. It will install the Kafka operator and all dependencies (for example, Prometheus).
supertubes install -a
Verify that the Kafka cluster is running:
supertubes cluster get -n kafka --kafka-cluster kafka -c <path-to-k8s-cluster-kubeconfig-file>
Create a topic with one partition and a replication factor of one.
supertubes cluster topic create -n kafka --kafka-cluster kafka -c <path-to-k8s-cluster-kubeconfig-file> -f- <<EOF apiVersion: kafka.banzaicloud.io/v1alpha1 kind: KafkaTopic metadata: name: test-topic spec: name: test-topic partitions: 1 replicationFactor: 1 config: "retention.ms": "28800000" "cleanup.policy": "delete" EOF
Write messages to the new topic.
kubectl apply -n kafka -f- <<EOF apiVersion: v1 kind: Pod metadata: name: kafkacat spec: containers: - name: kafka-test image: "solsson/kafkacat" # Just spin & wait forever command: [ "/bin/bash", "-c", "--" ] args: [ "while true; do sleep 3000; done;" ] EOF kubectl exec -n kafka -it kafkacat bash
kubectl exec -n kafka -it kafkacat bash kafkacat -b kafka-all-broker:29092 -P -t test-topic hello there
Verify that you can read back the messages, and which broker is the partition leader for test-topic.
kafkacat -b kafka-all-broker:29092 -C -t test-topic -c2 hello there
kafkacat -b -L kafka-all-broker:29092 Metadata for test-topic (from broker -1: kafka-all-broker:29092/bootstrap): 3 brokers: broker 0 at kafka-0.kafka.svc.cluster.local:29092 (controller) broker 2 at kafka-2.kafka.svc.cluster.local:29092 broker 1 at kafka-1.kafka.svc.cluster.local:29092 1 topics: topic "test-topic" with 1 partitions: partition 0, leader 2, replicas: 2, isrs: 2
Open the Cruise Control web interface to check the status of your Kafka cluster.
supertubes cluster cruisecontrol show -n kafka --kafka-cluster kafka -c <path-to-k8s-cluster-kubeconfig-file>
The web interface of Cruise Control opens in your browser.