Remove Bucket Notification Destination

Delete the Kubernetes Object

Bucket notification destinations are removed by deleting the custom Kubernetes object.

[artesca-os@bootstrap ~]$
sudo kubectl --kubeconfig=/etc/kubernetes/admin.conf -n zenko delete ZenkoNotificationTarget <DESTINATION_NAME>

The cluster takes a few minutes to reconcile the changes.

Delete Kafka Queue

Once the destination has been removed, the Kafka queue associated with the destination must be deleted to stop receiving notifications.

  1. List Kafka Consumer Groups.

    Replace <DESTINATION_NAME> with the name of the deleted destination. This command will output the full name of the consumer group(s) associated with the deleted destination.

    [artesca-os@bootstrap ~]$
    
    sudo kubectl --kubeconfig=/etc/kubernetes/admin.conf run -i --tty --rm debug --image=$(sudo crictl images | grep 'kafka ' | grep zenko | sort | tail -1 | awk '{print $1":"$2}') --restart=Never -n zenko -- bash -c '/opt/kafka/bin/kafka-consumer-groups.sh --bootstrap-server artesca-data-base-queue-0:9092 --list | grep -E "\.<DESTINATION_NAME>"'
    
  2. Delete the Kafka Consumer Group.

    Replace <COMPLETE_DESTINATION_NAME> with the full name of the consumer group obtained from the previous command.

    [artesca-os@bootstrap ~]$
    
    sudo kubectl --kubeconfig=/etc/kubernetes/admin.conf run -i --tty --rm debug --image=$(sudo crictl images | grep 'kafka ' | grep zenko | sort | tail -1 | awk '{print $1":"$2}') --restart=Never -n zenko -- bash -c '/opt/kafka/bin/kafka-consumer-groups.sh --bootstrap-server artesca-data-base-queue-0:9092 --delete --group <COMPLETE_DESTINATION_NAME>'