kafka/Makefile

35 lines
1.5 KiB
Makefile

.PHONY: build
ACTION=apply
build: dependencies
go build -o out/kafka ./cmd/main.go
dependencies:
go mod tidy
run:
./out/kafka -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