-
Notifications
You must be signed in to change notification settings - Fork 0
/
reset.sh
20 lines (19 loc) · 1.46 KB
/
reset.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
microk8s kubectl run kafka-client --restart='Never' --image docker.io/bitnami/kafka:3.4.0-debian-11-r33 --namespace default --command -- sleep infinity
microk8s.kubectl wait pod kafka-client --for=condition=Ready
echo "*******************************"
echo "** Deleating Topics **"
echo "*******************************"
microk8s kubectl exec -i kafka-client --namespace default -- kafka-topics.sh --bootstrap-server kafka-0.kafka-headless.default.svc.cluster.local:9092 --topic inbound --delete
microk8s kubectl exec -i kafka-client --namespace default -- kafka-topics.sh --bootstrap-server kafka-0.kafka-headless.default.svc.cluster.local:9092 --topic outbound --delete
echo "*******************************"
echo "** Creating inbound Topic **"
echo "*******************************"
microk8s kubectl exec -i kafka-client --namespace default -- kafka-topics.sh --bootstrap-server kafka-0.kafka-headless.default.svc.cluster.local:9092 --topic inbound --create --partitions 10 --replication-factor 3
echo "*******************************"
echo "** Creating outbound Topic **"
echo "*******************************"
microk8s kubectl exec -i kafka-client --namespace default -- kafka-topics.sh --bootstrap-server kafka-0.kafka-headless.default.svc.cluster.local:9092 --topic outbound --create --partitions 10 --replication-factor 3
echo "*******************************"
echo "** Deleting kafka client **"
echo "*******************************"
microk8s kubectl delete po kafka-client