add Dockerfile and kubernetes example

This commit is contained in:
Otto Yiu 2018-06-27 14:56:45 -07:00
parent 34f34794c5
commit dca94666ec
2 changed files with 51 additions and 0 deletions

11
Dockerfile Normal file
View 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"]

View 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/