add Dockerfile and kubernetes example
This commit is contained in:
parent
34f34794c5
commit
dca94666ec
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
from golang:1.10 as builder
|
||||||
|
arg CMD
|
||||||
|
run wget -o/dev/null -O/usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 && \
|
||||||
|
chmod +x /usr/local/bin/dep
|
||||||
|
workdir ${GOPATH}/src/github.com/czerwonk/bird_exporter
|
||||||
|
copy . .
|
||||||
|
run make deps build && cp bird_exporter /bird_exporter
|
||||||
|
|
||||||
|
from golang:1.10
|
||||||
|
copy --from=builder /bird_exporter /bird_exporter
|
||||||
|
entrypoint ["/bird_exporter"]
|
40
examples/kubernetes/daemonset.yaml
Normal file
40
examples/kubernetes/daemonset.yaml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: DaemonSet
|
||||||
|
metadata:
|
||||||
|
name: bird-exporter
|
||||||
|
namespace: kube-system
|
||||||
|
labels:
|
||||||
|
app: bird-exporter
|
||||||
|
spec:
|
||||||
|
updateStrategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: bird-exporter
|
||||||
|
spec:
|
||||||
|
tolerations:
|
||||||
|
- key: node-role.kubernetes.io/master
|
||||||
|
effect: NoSchedule
|
||||||
|
containers:
|
||||||
|
- name: bird-exporter
|
||||||
|
image: bird_exporter:latest
|
||||||
|
args: ["-format.new=true", "-bird.socket=/var/run/bird/bird.ctl"]
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 32Mi
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 32Mi
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /var/run/bird/
|
||||||
|
name: bird-socket
|
||||||
|
readOnly: true
|
||||||
|
ports:
|
||||||
|
- containerPort: 9324
|
||||||
|
name: metrics
|
||||||
|
volumes:
|
||||||
|
- name: bird-socket
|
||||||
|
hostPath:
|
||||||
|
path: /var/run/bird/
|
Loading…
x
Reference in New Issue
Block a user