-
Notifications
You must be signed in to change notification settings - Fork 0
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 #118 from promhippie/refactor
Better documentation, updated build tools, improved workflows
- Loading branch information
Showing
14 changed files
with
548 additions
and
120 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
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 |
---|---|---|
|
@@ -86,6 +86,7 @@ jobs: | |
go-version: 1.18.1 | ||
|
||
- name: Generate labels | ||
id: labels | ||
run: make labels | ||
|
||
- name: Commit changes | ||
|
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
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
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,8 @@ | ||
Enhancement: Improve doucmentation and repo structure | ||
|
||
We have improved the available documentation pretty hard and we also added | ||
documentation how to install this service discovery via Helm or Kustomize on | ||
Kubernetes. Beside that we are testing to build the bundled Kustomize manifests | ||
now. | ||
|
||
https://github.com/promhippie/prometheus-scw-sd/pull/118 |
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
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
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
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
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,21 +1,28 @@ | ||
--- | ||
title: "Building" | ||
date: 2020-04-01T00:00:00+00:00 | ||
date: 2022-07-20T00:00:00+00:00 | ||
anchor: "building" | ||
weight: 20 | ||
--- | ||
|
||
As this project is built with Go you need to install Go first. The installation of Go is out of the scope of this document, please follow the [official documentation](https://golang.org/doc/install). After the installation of Go you need to get the sources: | ||
As this project is built with Go you need to install Go first. The installation | ||
of Go is out of the scope of this document, please follow the | ||
[official documentation][golang]. After the installation of Go you need to get | ||
the sources: | ||
|
||
{{< highlight txt >}} | ||
git clone https://github.com/promhippie/prometheus-scw-sd.git | ||
cd prometheus-scw-sd/ | ||
{{< / highlight >}} | ||
|
||
All required tool besides Go itself are bundled by Go modules, all you need is part of the `Makfile`: | ||
All required tool besides Go itself are bundled, all you need is part of the | ||
`Makfile`: | ||
|
||
{{< highlight txt >}} | ||
make generate build | ||
{{< / highlight >}} | ||
|
||
Finally you should have the binary within the `bin/` folder now, give it a try with `./bin/prometheus-scw-sd -h` to see all available options. | ||
Finally you should have the binary within the `bin/` folder now, give it a try | ||
with `./bin/prometheus-scw-sd -h` to see all available options. | ||
|
||
[golang]: https://golang.org/doc/install |
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,113 @@ | ||
--- | ||
title: "Kubernetes" | ||
date: 2022-07-22T00:00:00+00:00 | ||
anchor: "kubernetes" | ||
weight: 20 | ||
--- | ||
|
||
## Kubernetes | ||
|
||
Currently we are covering the most famous installation methods on Kubernetes, | ||
you can choose between [Kustomize][kustomize] and [Helm][helm]. | ||
|
||
### Kustomize | ||
|
||
We won't cover the installation of [Kustomize][kustomize] within this guide, to | ||
get it installed and working please read the upstream documentation. After the | ||
installation of [Kustomize][kustomize] you just need to prepare a | ||
`kustomization.yml` wherever you like similar to this: | ||
|
||
{{< highlight yaml >}} | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
namespace: prometheus-scw-sd | ||
|
||
resources: | ||
- github.com/promhippie/prometheus-scw-sd//deploy/kubernetes?ref=master | ||
|
||
configMapGenerator: | ||
- name: prometheus-scw-sd | ||
behavior: merge | ||
literals: [] | ||
|
||
secretGenerator: | ||
- name: prometheus-scw-sd | ||
behavior: merge | ||
literals: [] | ||
{{< / highlight >}} | ||
|
||
After that you can simply execute `kustomize build | kubectl apply -f -` to get | ||
the manifest applied. Generally it's best to use fixed versions of the container | ||
images, this can be done quite easy, you just need to append this block to your | ||
`kustomization.yml` to use this specific version: | ||
|
||
{{< highlight yaml >}} | ||
images: | ||
- name: quay.io/promhippie/prometheus-scw-sd | ||
newTag: 1.1.0 | ||
{{< / highlight >}} | ||
|
||
After applying this manifest the exporter should be directly visible within your | ||
Prometheus instance if you are using the Prometheus Operator as these manifests | ||
are providing a ServiceMonitor. | ||
|
||
To consume the service discovery within Prometheus you got to configre matching | ||
scrape targets using the HTTP engine, just add a block similar to this one to | ||
your Prometheus configuration: | ||
|
||
{{< highlight yaml >}} | ||
scrape_configs: | ||
- job_name: node | ||
http_sd_configs: | ||
- url: http://scw-sd.prometheus-scw-sd.svc.cluster.local:9000/sd | ||
relabel_configs: | ||
- source_labels: [__meta_scaleway_public_ipv4] | ||
replacement: "${1}:9100" | ||
target_label: __address__ | ||
- source_labels: [__meta_scaleway_zone] | ||
target_label: datacenter | ||
- source_labels: [__meta_scaleway_name] | ||
target_label: instance | ||
{{< / highlight >}} | ||
|
||
### Helm | ||
|
||
We won't cover the installation of [Helm][helm] within this guide, to get it | ||
installed and working please read the upstream documentation. After the | ||
installation of [Helm][helm] you just need to execute the following commands: | ||
|
||
{{< highlight console >}} | ||
helm repo add promhippie https://promhippie.github.io/charts | ||
helm show values promhippie/prometheus-vcd-sd | ||
helm install prometheus-vcd-sd promhippie/prometheus-vcd-sd | ||
{{< / highlight >}} | ||
|
||
You can also watch that available values and generally the details of the chart | ||
provided by us within our [chart][chart] repository. | ||
|
||
After applying this manifest the exporter should be directly visible within your | ||
Prometheus instance depending on your installation if you enabled the | ||
annotations or the service monitor. | ||
|
||
To consume the service discovery within Prometheus you got to configre matching | ||
scrape targets using the HTTP engine, just add a block similar to this one to | ||
your Prometheus configuration: | ||
|
||
{{< highlight yaml >}} | ||
scrape_configs: | ||
- job_name: node | ||
http_sd_configs: | ||
- url: http://scw-sd.prometheus-scw-sd.svc.cluster.local:9000/sd | ||
relabel_configs: | ||
- source_labels: [__meta_scaleway_public_ipv4] | ||
replacement: "${1}:9100" | ||
target_label: __address__ | ||
- source_labels: [__meta_scaleway_zone] | ||
target_label: datacenter | ||
- source_labels: [__meta_scaleway_name] | ||
target_label: instance | ||
{{< / highlight >}} | ||
|
||
[kustomize]: https://github.com/kubernetes-sigs/kustomize | ||
[helm]: https://helm.sh | ||
[chart]: https://github.com/promhippie/charts/tree/master/charts/prometheus-scw-sd |
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,8 +1,11 @@ | ||
--- | ||
title: "License" | ||
date: 2018-05-02T00:00:00+00:00 | ||
date: 2022-07-20T00:00:00+00:00 | ||
anchor: "license" | ||
weight: 30 | ||
weight: 40 | ||
--- | ||
|
||
This project is licensed under the [Apache 2.0](https://github.com/promhippie/prometheus-scw-sd/blob/master/LICENSE) license. For the license of the used libraries you have to check the respective sources. | ||
This project is licensed under the [Apache 2.0][license] license. For the | ||
license of the used libraries you have to check the respective sources. | ||
|
||
[license]: https://github.com/promhippie/prometheus-scw-sd/blob/master/LICENSE |
Oops, something went wrong.