Commit bf73cd83 authored by Daniel Czerwonk's avatar Daniel Czerwonk Committed by GitHub

Merge pull request #20 from ottoyiu/docker-k8s

Add Dockerfile and kubernetes daemonset example
parents 34f34794 dca94666
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"]
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/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment