-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
50 lines (38 loc) · 1.19 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.PHONY: all test
define DEPLOY_SUCCEDED_MESSAGE
===============================================================
Deploy complete!
Check the logs to verify the pod is up and speaking to the ServiceMonitor,
with e.g.:
```
kubectl -n monitoring logs --selector app=unifi-exporter
```
You can also navigate to your Prometheus service in your browser and verifying
that unifi-exporter now appears as active under the `/targets` page. Try
querying some metrics — they're all prefixed with the `unifi_` keyword.
===============================================================
endef
NAMESPACE ?= monitoring
.PHONY: build
build:
cd unifi_exporter
go build ./cmd/unifi_exporter -o unifi_exporter
.PHONY: docker
docker:
docker build -t jessestuart/unifi_exporter .
.PHONY: clean
clean:
go clean
rm -f unifi_exporter
# You can replace namespace with whatever you want; but make sure
# it matches the namespaces you'll be deploying to.
generate-secret:
kubectl create secret generic unifi-exporter-credentials \
--namespace $(NAMESPACE) \
--from-file config.yml
export DEPLOY_SUCCEDED_MESSAGE
deploy:
kubectl apply -f manifests/
@echo "$$DEPLOY_SUCCEDED_MESSAGE"
destroy:
kubectl delete -f manifests/