Skip to content

Instantly share code, notes, and snippets.

@lusoal
Created September 27, 2023 22:55
Show Gist options
  • Select an option

  • Save lusoal/607e87085be374856a6a74e28b6d9574 to your computer and use it in GitHub Desktop.

Select an option

Save lusoal/607e87085be374856a6a74e28b6d9574 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Creating cluster for tenant-1
echo "Creating Kafka cluster"
kubectl apply -f ./kafka_cluster.yaml
echo "Veryfing if the cluster is created or not"
kubectl wait kafka/<YOUR_CLUSTER_NAME> -nstrimzi-kafka-operator --for=condition=Ready --timeout=100s
# create a conditional to failure based on command output above using if statement
if [ $? -eq 0 ]
then
echo "Cluster is created/updated"
exit 0
else
echo "Cluster creation failed"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment