-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement rootfs usage metrics * Fix names in metric table
- Loading branch information
1 parent
c80e0e4
commit 427b138
Showing
7 changed files
with
1,022 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
kind: pipeline | ||
type: kubernetes | ||
name: default | ||
|
||
steps: | ||
- name: fetch | ||
image: docker:git | ||
commands: | ||
- git fetch --tags | ||
|
||
- name: docker-tag | ||
image: alpine | ||
commands: | ||
- test "${DRONE_BRANCH}" == "master" && echo -n "latest," > .tags || true | ||
- test -n "${DRONE_BRANCH}" && test "${DRONE_BRANCH}" != "master" && echo -n "${DRONE_BRANCH}," > .tags || true | ||
- test -n "${DRONE_TAG}" && echo -n "${DRONE_TAG}," >> .tags || true | ||
- sed -i "s/,$//" .tags | ||
|
||
- name: docker-publish | ||
image: plugins/docker | ||
settings: | ||
username: | ||
from_secret: docker_username | ||
password: | ||
from_secret: docker_password | ||
repo: quay.io/utilitywarehouse/kube-summary-exporter | ||
registry: quay.io | ||
|
||
trigger: | ||
event: | ||
exclude: | ||
- pull_request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
kube-summary-exporter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM golang:1.15-alpine AS build | ||
WORKDIR /go/src/github.com/utilitywarehouse/kube-summary-exporter | ||
COPY . /go/src/github.com/utilitywarehouse/kube-summary-exporter | ||
ENV CGO_ENABLED 0 | ||
RUN apk --no-cache add git &&\ | ||
go get -t ./... &&\ | ||
go test ./... &&\ | ||
go build -o /kube-summary-exporter . | ||
|
||
FROM alpine:3.12 | ||
COPY --from=build /kube-summary-exporter /kube-summary-exporter | ||
|
||
ENTRYPOINT [ "/kube-summary-exporter"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,38 @@ | ||
# kube-stats-exporter | ||
# kube-summary-exporter | ||
|
||
[![Build Status](https://drone.prod.merit.uw.systems/api/badges/utilitywarehouse/kube-summary-exporter/status.svg)](https://drone.prod.merit.uw.systems/utilitywarehouse/kube-summary-exporter) | ||
|
||
Exports prometheus metrics for the Kubernetes Summary API. | ||
|
||
## Usage | ||
|
||
Visiting http://localhost:9779/node/example-node will return metrics for the | ||
node 'example-node'. | ||
|
||
Here's an example scrape config. This assumes that the exporter is available at `kube-summary-exporter:9779`. | ||
|
||
``` | ||
- job_name: "kubernetes-summary" | ||
kubernetes_sd_configs: | ||
- role: node | ||
relabel_configs: | ||
- action: labelmap | ||
regex: __meta_kubernetes_node_label_(.+) | ||
- source_labels: [__meta_kubernetes_node_name] | ||
regex: (.+) | ||
target_label: __metrics_path__ | ||
replacement: /node/${1} | ||
- target_label: __address__ | ||
replacement: kube-summary-exporter:9779 | ||
``` | ||
|
||
## Metrics | ||
|
||
| Metric | Description | Labels | | ||
| -------------------------------- | ----------------------------------------------------- | -------------------- | | ||
| container_rootfs_inodes_free | Number of available Inodes | pod, namespace, name | | ||
| container_rootfs_inodes | Number of Inodes | pod, namespace, name | | ||
| container_rootfs_inodes_used | Number of used Inodes | pod, namespace, name | | ||
| container_rootfs_available_bytes | Number of bytes that aren't consumed by the container | pod, namespace, name | | ||
| container_rootfs_capacity_bytes | Number of bytes that can be consumed by the container | pod, namespace, name | | ||
| container_rootfs_used_bytes | Number of bytes that are consumed by the container | pod, namespace, name | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module github.com/utilitywarehouse/kube-summary-exporter | ||
|
||
go 1.15 | ||
|
||
require ( | ||
github.com/gorilla/mux v1.8.0 | ||
github.com/prometheus/client_golang v1.9.0 | ||
k8s.io/client-go v0.20.1 | ||
k8s.io/kubelet v0.20.1 | ||
) | ||
|
||
replace ( | ||
k8s.io/api => k8s.io/api v0.20.1 | ||
k8s.io/apimachinery => k8s.io/apimachinery v0.20.1 | ||
k8s.io/client-go => k8s.io/client-go v0.20.1 | ||
k8s.io/kubelet => k8s.io/kubelet v0.20.1 | ||
) |
Oops, something went wrong.