2023-06-16 05:20:54 +00:00
|
|
|
.PHONY: build
|
|
|
|
|
2023-06-14 05:51:58 +00:00
|
|
|
ACTION=apply
|
|
|
|
|
2023-06-16 05:20:54 +00:00
|
|
|
build: dependencies
|
|
|
|
go build -o out/kafka ./cmd/main.go
|
|
|
|
|
|
|
|
dependencies:
|
|
|
|
go mod tidy
|
|
|
|
|
|
|
|
run:
|
|
|
|
./out/kafka -c ./configuration.yaml
|
|
|
|
|
2023-06-14 05:51:58 +00:00
|
|
|
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:
|
2023-06-16 05:20:54 +00:00
|
|
|
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
|