.PHONY: build-producer build-consumer run dependencies infrastructure-local infrastructure-prod topic-scram topic-ssl consume-topic ACTION=apply build-producer: dependencies go build -o out/kafka-producer ./cmd/producer.go build-consumer: dependencies go built -o out/kafka-consumer ./cmd/consumer.go dependencies: go mod tidy run: ./out/kafka-producer -c ./configuration.yaml infrastructure-local: cd manifest && \ terraform workspace select kind-cluster-dev && \ terraform $(ACTION) infrastructure-prod: cd manifest && \ terraform workspace select default && \ terraform $(ACTION) topic-ssl: kubectl view-secret -n streaming kafka-user user.p12 > user.p12 && \ kubectl view-secret -n streaming cluster-development-cluster-ca-cert ca.crt | kcat -b kafka.127.0.0.1.nip.io:443 -L -J -X 'security.protocol=ssl' -X "ssl.ca.location=/dev/stdin" -X "ssl.keystore.location=user.p12" -X "ssl.keystore.password=$$(kubectl view-secret -n streaming kafka-user user.password)" |jq && \ rm -rf user.p12 topic-scram: kubectl view-secret -n streaming kafka-dev-listener-certificate ca.crt | kcat -b kafka.localdomain:9092 -L -J -X 'security.protocol=sasl_ssl' -X 'sasl.mechanism=SCRAM-SHA-512' -X 'sasl.username=kafka-user' -X "sasl.password=$(kubectl view-secret -n streaming kafka-user password)" -X "ssl.ca.location=/dev/stdin" | jq consume-topic: kubectl view-secret -n streaming admin user.p12 > user.p12 && \ kubectl view-secret -n streaming cluster-development-cluster-ca-cert ca.crt | kcat -b kafka.127.0.0.1.nip.io:443 -X 'security.protocol=ssl' -X "ssl.ca.location=/dev/stdin" -X "ssl.keystore.location=user.p12" -X "ssl.keystore.password=$$(kubectl view-secret -n streaming admin user.password)" -v -G test-group -o beginning dev.emitter.json && \ rm -rf user.p12