Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
feat: Upgrade to Keptn 0.17 (#345)
Browse files Browse the repository at this point in the history
* feat: Upgrade to Keptn 0.17

Signed-off-by: TannerGabriel <gabrieltanner.code@gmail.com>

* Reverse README formatting changes

Signed-off-by: TannerGabriel <gabrieltanner.code@gmail.com>
  • Loading branch information
TannerGabriel committed Jul 18, 2022
1 parent 0d4da6d commit d83a956
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 36 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
keptn-version: ["0.14.2", "0.15.1", "0.16.0"] # https://github.com/keptn/keptn/releases
keptn-version: ["0.14.2", "0.15.1", "0.16.0", "0.17.0"] # https://github.com/keptn/keptn/releases
prometheus-version: ["15.10.1"]
env:
GO_VERSION: 1.17
Expand Down Expand Up @@ -123,6 +123,13 @@ jobs:
with:
KEPTN_VERSION: ${{ matrix.keptn-version }}
HELM_VALUES: |
# Keptn 0.17 and newer
apiGatewayNginx:
type: LoadBalancer
features:
automaticProvisioning:
serviceURL: http://keptn-gitea-provisioner-service.default
# Keptn 0.16 compatibility
control-plane:
apiGatewayNginx:
type: LoadBalancer
Expand Down
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Prometheus Service

![GitHub release (latest by date)](https://img.shields.io/github/v/release/keptn-contrib/prometheus-service)
[![Go Report Card](https://goreportcard.com/badge/github.com/keptn-contrib/prometheus-service)](https://goreportcard.com/report/github.com/keptn-contrib/prometheus-service)

The *prometheus-service* is a [Keptn](https://keptn.sh) integration responsible for:

1. configuring Prometheus for monitoring services managed by Keptn,
2. receiving alerts (on port 8080) from Prometheus Alertmanager and translating the alert payload to a cloud event (remediation.triggered) that is sent to the Keptn API,
3. retrieving Service Level Indicators (SLIs) from a Prometheus API endpoint.
1. configuring Prometheus for monitoring services managed by Keptn,
2. receiving alerts (on port 8080) from Prometheus Alertmanager and translating the alert payload to a cloud event (
remediation.triggered) that is sent to the Keptn API,
3. retrieving Service Level Indicators (SLIs) from a Prometheus API endpoint.

## Compatibility Matrix

Please always double-check the version of Keptn you are using compared to the version of this service, and follow the compatibility matrix below.
Please always double-check the version of Keptn you are using compared to the version of this service, and follow the
compatibility matrix below.

| Keptn Version\* | [Prometheus Service Image](https://hub.docker.com/r/keptncontrib/prometheus-service/tags) |
|:---------------:|:-----------------------------------------------------------------------------------------:|
Expand All @@ -23,14 +26,17 @@ Please always double-check the version of Keptn you are using compared to the ve
| 0.15.1 | keptncontrib/prometheus-service:0.8.1\*** |
| 0.16.0 | keptncontrib/prometheus-service:0.8.2\*** |
| 0.16.0 | keptncontrib/prometheus-service:0.8.3 |
| 0.17.0 | keptncontrib/prometheus-service:0.8.4 |

\* This is the Keptn version we aim to be compatible with. Other versions should work too, but there is no guarantee.

\** This version is only compatible with Keptn 0.14.2 and potentially newer releases of Keptn 0.14.x due to a breaking change in NATS cluster name.
\** This version is only compatible with Keptn 0.14.2 and potentially newer releases of Keptn 0.14.x due to a breaking
change in NATS cluster name.

\*** These versions are not compatible with Prometheus Alertmanager <= 0.24

You can find more information and older releases on the [Releases](https://github.com/keptn-contrib/prometheus-service/releases) page.
You can find more information and older releases on
the [Releases](https://github.com/keptn-contrib/prometheus-service/releases) page.

## Installation instructions

Expand Down Expand Up @@ -79,7 +85,7 @@ Once this is done, you can go ahead and install prometheus-service:
--reuse-values
```

* (Optional) If you want to customize the namespaces of Keptn or the Prometheus installation, replace the environment
* (Optional) If you want to customize the namespaces of Keptn or the Prometheus installation, replace the environment
variable values according to the use case and apply the manifest:

```bash
Expand Down Expand Up @@ -180,7 +186,7 @@ Note: This creates an actual Kubernetes secret, with some Kubernetes labels (`ap
### User-defined Service Level Indicators (SLIs)
Users can override the predefined queries, as well as add custom queries by creating a SLI configuration.
Users can override the predefined queries, as well as add custom queries by creating a SLI configuration.
* A SLI configuration is a yaml file as shown below:
Expand All @@ -191,7 +197,7 @@ Users can override the predefined queries, as well as add custom queries by crea
cpu_usage: avg(rate(container_cpu_usage_seconds_total{namespace="$PROJECT-$STAGE",pod_name=~"$SERVICE-primary-.*"}[5m]))
response_time_p95: histogram_quantile(0.95, sum by(le) (rate(http_response_time_milliseconds_bucket{handler="ItemsController.addToCart",job="$SERVICE-$PROJECT-$STAGE-canary"}[$DURATION_SECONDS])))
```
This file contains a list of keys (e.g., `cpu_usage`) and a prometheus metric expressions (e.g., `avg(rate(...{filters}[timeframe]))`).
This file contains a list of keys (e.g., `cpu_usage`) and a prometheus metric expressions (e.g., `avg(rate(...{filters}[timeframe]))`).
* To store this configuration, you need to add this file to a Keptn's configuration store, e.g., using the [keptn add-resource](https://keptn.sh/docs/0.14.x/reference/cli/commands/keptn_add-resource/) command:

Expand Down
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ distributor:
image:
repository: docker.io/keptn/distributor # Container Image Name
pullPolicy: IfNotPresent # Kubernetes Image Pull Policy
tag: "0.16.0" # Container Tag
tag: "0.17.0" # Container Tag
config:
queueGroup:
enabled: true # Enable connection via Nats queue group to support exactly-once message processing
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/golang/mock v1.6.0
github.com/google/uuid v1.3.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/keptn/go-utils v0.16.1-0.20220624075633-4d49101f88b4
github.com/keptn/go-utils v0.17.0
github.com/mitchellh/mapstructure v1.5.0
github.com/prometheus/alertmanager v0.24.0
github.com/prometheus/client_golang v1.12.2
Expand All @@ -35,7 +35,8 @@ require (
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/go-kit/log v0.2.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.2.2 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
Expand All @@ -61,16 +62,15 @@ require (
github.com/prometheus/common/sigv4 v0.1.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.27.0 // indirect
go.opentelemetry.io/otel v1.2.0 // indirect
go.opentelemetry.io/otel/internal/metric v0.25.0 // indirect
go.opentelemetry.io/otel/metric v0.25.0 // indirect
go.opentelemetry.io/otel/trace v1.2.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 // indirect
go.opentelemetry.io/otel v1.7.0 // indirect
go.opentelemetry.io/otel/metric v0.30.0 // indirect
go.opentelemetry.io/otel/trace v1.7.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.0 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb // indirect
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
Expand Down
Loading

0 comments on commit d83a956

Please sign in to comment.