Skip to content

Commit

Permalink
Fix image, readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jknipper committed Sep 3, 2021
1 parent 9d24ac8 commit cc59711
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
FROM golang:1.11 AS builder
FROM golang:1.16-alpine3.13 AS builder

WORKDIR /go/src/github.com/sapcc/kuberntes-oomkill-exporter
ENV GO111MODULE=on \
CGOENABLED=0
ADD go.mod go.sum ./
RUN go mod download
ADD cache/main.go .
RUN go build -v -o /dev/null
ADD . .
RUN go build -v -o /kubernetes-oomkill-exporter
RUN go test -v
RUN go vet
RUN CGOENABLED=0 go build -v -o /kubernetes-oomkill-exporter

FROM alpine:3.8
FROM alpine:3.13
LABEL maintainer="[email protected]"
LABEL source_repository="https://github.com/sapcc/kubernetes-oomkill-exporter"

RUN apk --no-cache add ca-certificates
COPY --from=builder /kubernetes-oomkill-exporter /kubernetes-oomkill-exporter
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
TARGET = kubernetes-oomkill-exporter
GOTARGET = github.com/sapcc/$(TARGET)
REGISTRY ?= sapcc
VERSION ?= 0.3.0
VERSION ?= 0.3.1
IMAGE = $(REGISTRY)/$(BIN)
DOCKER ?= docker

all: container

container:
$(DOCKER) build -t $(REGISTRY)/$(TARGET):latest -t $(REGISTRY)/$(TARGET):$(VERSION) .
$(DOCKER) build --network=host -t $(REGISTRY)/$(TARGET):latest -t $(REGISTRY)/$(TARGET):$(VERSION) .

push:
$(DOCKER) push $(REGISTRY)/$(TARGET):latest
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

----

kubernetes-oomkill-exporter is parsing kernel log for killed pods, collects information like namespace from docker and exposes them in a metric.
kubernetes-oomkill-exporter is parsing kernel log for killed pods, collects information like namespace from docker and exposes them in a metric. It can be deployed as a `DaemonSet` to run on every node in your cluster, see [here for an example](yaml/oomkill-exporter.yaml). Exported metric is called `klog_pod_oomkill` and counts the amount of oomkills of a certain pod.



## License
This project is licensed under the Apache2 License - see the [LICENSE](LICENSE) file for details
7 changes: 5 additions & 2 deletions yaml/oomkill-exporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ spec:
spec:
containers:
- name: oomkill-exporter
image: sapcc/kubernetes-oomkill-exporter:latest
imagePullPolicy: Always
image: sapcc/kubernetes-oomkill-exporter:0.3.1
imagePullPolicy: IfNotPresent
args:
- -logtostderr
- -v=5
Expand All @@ -44,10 +44,13 @@ spec:
ports:
- name: metrics
containerPort: 9102
tolerations:
- operator: Exists
volumes:
- name: kmsg
hostPath:
path: /dev/kmsg
- name: docker
hostPath:
path: /var/run/docker.sock

0 comments on commit cc59711

Please sign in to comment.