-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from rebuy-de/initial
Initial
- Loading branch information
Showing
19 changed files
with
916 additions
and
2 deletions.
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,2 @@ | ||
/vendor | ||
/cost-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,29 @@ | ||
sudo: required | ||
|
||
language: go | ||
|
||
services: | ||
- docker | ||
|
||
script: | ||
- docker build -t cost-exporter --target builder --no-cache . | ||
- > | ||
docker run | ||
--name cost-exporter | ||
--entrypoint "sh" | ||
-e CGO_ENABLED=0 | ||
--workdir "/go/src/github.com/rebuy-de/cost-exporter" | ||
cost-exporter | ||
-euxc "make xc && mkdir releases && mv cost-exporter-* releases" | ||
- docker cp -L cost-exporter:/go/src/github.com/rebuy-de/cost-exporter/releases ./releases | ||
- ls -l * | ||
|
||
deploy: | ||
provider: releases | ||
api_key: $GITHUB_TOKEN | ||
file_glob: true | ||
file: releases/* | ||
skip_cleanup: true | ||
on: | ||
repo: rebuy-de/cost-exporter | ||
tags: true |
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,27 @@ | ||
FROM golang:1.10-alpine | ||
FROM golang:1.10-alpine as builder | ||
|
||
RUN apk add --no-cache git make | ||
|
||
# Configure Go | ||
ENV GOPATH /go | ||
ENV PATH /go/bin:$PATH | ||
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin | ||
|
||
# Install Go Tools | ||
RUN go get -u github.com/golang/lint/golint | ||
RUN go get -u github.com/golang/dep/cmd/dep | ||
|
||
COPY . /go/src/github.com/rebuy-de/cost-exporter | ||
WORKDIR /go/src/github.com/rebuy-de/cost-exporter | ||
RUN CGO_ENABLED=0 make install | ||
|
||
FROM alpine:latest | ||
|
||
RUN apk add --no-cache ca-certificates | ||
|
||
COPY --from=builder /go/bin/cost-exporter /usr/local/bin/ | ||
COPY run.sh /run.sh | ||
|
||
RUN chmod +x /run.sh | ||
|
||
ENTRYPOINT ["/run.sh"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,15 @@ | ||
[[constraint]] | ||
name = "github.com/rebuy-de/rebuy-go-sdk" | ||
version = "1.2.0" | ||
|
||
[[constraint]] | ||
name = "github.com/prometheus/client_golang" | ||
version = "0.8.0" | ||
|
||
[[constraint]] | ||
name = "github.com/aws/aws-sdk-go" | ||
version = "1.15.4" | ||
|
||
[[constraint]] | ||
name = "github.com/robfig/cron" | ||
version = "1.1.0" |
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,3 @@ | ||
PACKAGE=github.com/rebuy-de/cost-exporter | ||
|
||
include golang.mk |
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,2 +1,46 @@ | ||
# cost-exporter | ||
Retrieves cost metrics and core counts from the AWS API and exposes this information via a Prometheus /metrics endpoint. | ||
|
||
[![Build Status](https://travis-ci.org/rebuy-de/cost-exporter.svg?branch=master)](https://travis-ci.org/rebuy-de/cost-exporter) | ||
[![license](https://img.shields.io/github/license/rebuy-de/cost-exporter.svg)]() | ||
|
||
Retrieves cost metrics and core counts from the AWS API and exposes this information via a Prometheus `/metrics` endpoint. | ||
|
||
> **Development Status** *cost-exporter* is for internal use only. Feel free to use | ||
> it, but expect big unanounced changes at any time. Furthermore we are very | ||
> restrictive about code changes, therefore you should communicate any changes | ||
> before working on an issue. | ||
|
||
## Installation | ||
|
||
Docker containers are are provided [here](https://quay.io/repository/rebuy/cost-exporter). To obtain the latest docker image run `docker pull quay.io/rebuy/cost-exporter:master`. | ||
|
||
To compile *cost-exporter* from source you need a working | ||
[Golang](https://golang.org/doc/install) development environment. The sources | ||
must be cloned to `$GOPATH/src/github.com/rebuy-de/cost-exporter`. | ||
|
||
Also you need to install [godep](github.com/golang/dep/cmd/dep), | ||
[golint](https://github.com/golang/lint/) and [GNU | ||
Make](https://www.gnu.org/software/make/). | ||
|
||
Then you just need to run `make build` to compile a binary into the project | ||
directory or `make install` to install *cost-exporter* into `$GOPATH/bin`. With | ||
`make xc` you can cross compile *cost-exporter* for other platforms. | ||
|
||
|
||
## Usage | ||
|
||
**node-drainer**'s configuration is done using an configuration file that is pointed to when running the command, as well as a flag that defines the port it should listen on: | ||
``` | ||
cost-exporter --config=/cost-exporter/config.yaml --port=8080 | ||
``` | ||
|
||
For more information, run: | ||
``` | ||
cost-exporter --help | ||
``` | ||
|
||
|
||
### Running in Kubernetes | ||
|
||
Please see the `example/k8s/` directory for an example of how to run `cost-exporter` in Kubernetes. |
Oops, something went wrong.