-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DPM checks for control plane integration test and add a test for …
…annotation autodiscovery Signed-off-by: Pete Wall <pete.wall@grafana.com>
- Loading branch information
Showing
9 changed files
with
875 additions
and
39 deletions.
There are no files selected for viewing
618 changes: 618 additions & 0 deletions
618
charts/k8s-monitoring/tests/integration/anntoation-autodiscovery/.rendered/output.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...s/k8s-monitoring/tests/integration/anntoation-autodiscovery/deployments/cert-manager.yaml
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,36 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: cert-manager | ||
--- | ||
apiVersion: source.toolkit.fluxcd.io/v1 | ||
kind: HelmRepository | ||
metadata: | ||
name: cert-manager | ||
namespace: cert-manager | ||
spec: | ||
interval: 1m | ||
url: https://charts.jetstack.io | ||
--- | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: cert-manager | ||
namespace: cert-manager | ||
spec: | ||
interval: 1m | ||
chart: | ||
spec: | ||
chart: cert-manager | ||
sourceRef: | ||
kind: HelmRepository | ||
name: cert-manager | ||
namespace: cert-manager | ||
interval: 1m | ||
values: | ||
installCRDs: true | ||
serviceAnnotations: | ||
k8s.grafana.com/scrape: "true" | ||
k8s.grafana.com/job: "integrations/cert-manager" | ||
k8s.grafana.com/metrics.portNumber: "9402" |
39 changes: 39 additions & 0 deletions
39
charts/k8s-monitoring/tests/integration/anntoation-autodiscovery/deployments/grafana.yaml
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,39 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: grafana | ||
--- | ||
apiVersion: source.toolkit.fluxcd.io/v1 | ||
kind: HelmRepository | ||
metadata: | ||
name: grafana | ||
namespace: grafana | ||
spec: | ||
interval: 1m | ||
url: https://grafana.github.io/helm-charts | ||
--- | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: grafana | ||
namespace: grafana | ||
spec: | ||
interval: 1m | ||
chart: | ||
spec: | ||
chart: grafana | ||
sourceRef: | ||
kind: HelmRepository | ||
name: grafana | ||
namespace: grafana | ||
interval: 1m | ||
values: | ||
datasources: | ||
datasources.yaml: | ||
apiVersion: 1 | ||
datasources: | ||
- name: Prometheus | ||
type: prometheus | ||
url: http://prometheus-server.prometheus.svc:9090 | ||
isDefault: true |
61 changes: 61 additions & 0 deletions
61
charts/k8s-monitoring/tests/integration/anntoation-autodiscovery/deployments/prometheus.yaml
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,61 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: prometheus | ||
--- | ||
apiVersion: source.toolkit.fluxcd.io/v1 | ||
kind: HelmRepository | ||
metadata: | ||
name: prometheus-community | ||
namespace: prometheus | ||
spec: | ||
interval: 1m | ||
url: https://prometheus-community.github.io/helm-charts | ||
--- | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: prometheus | ||
namespace: prometheus | ||
spec: | ||
interval: 1m | ||
chart: | ||
spec: | ||
chart: prometheus | ||
version: "^25" | ||
sourceRef: | ||
kind: HelmRepository | ||
name: prometheus-community | ||
namespace: prometheus | ||
interval: 1m | ||
values: | ||
server: | ||
extraFlags: | ||
- enable-feature=remote-write-receiver | ||
|
||
persistentVolume: | ||
enabled: false | ||
|
||
service: | ||
servicePort: 9090 | ||
|
||
serverFiles: | ||
prometheus.yml: | ||
scrape_configs: [] | ||
|
||
configmapReload: | ||
prometheus: | ||
enabled: false | ||
|
||
alertmanager: | ||
enabled: false | ||
|
||
kube-state-metrics: | ||
enabled: false | ||
|
||
prometheus-node-exporter: | ||
enabled: false | ||
|
||
prometheus-pushgateway: | ||
enabled: false |
49 changes: 49 additions & 0 deletions
49
charts/k8s-monitoring/tests/integration/anntoation-autodiscovery/deployments/query-test.yaml
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,49 @@ | ||
--- | ||
apiVersion: source.toolkit.fluxcd.io/v1 | ||
kind: GitRepository | ||
metadata: | ||
name: k8s-monitoring-test | ||
spec: | ||
interval: 1m | ||
url: https://github.com/grafana/k8s-monitoring-helm | ||
ref: | ||
branch: main | ||
ignore: | | ||
/* | ||
!/charts/k8s-monitoring-test | ||
--- | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: k8s-monitoring-test | ||
spec: | ||
interval: 1m | ||
chart: | ||
spec: | ||
chart: charts/k8s-monitoring-test | ||
sourceRef: | ||
kind: GitRepository | ||
name: k8s-monitoring-test | ||
interval: 1m | ||
values: | ||
tests: | ||
- env: | ||
CLUSTER: annotation-autodiscovery-test | ||
PROMETHEUS_URL: http://prometheus-server.prometheus.svc:9090/api/v1/query | ||
queries: | ||
# Self reporting metrics | ||
- query: grafana_kubernetes_monitoring_build_info{cluster="$CLUSTER"} | ||
type: promql | ||
- query: grafana_kubernetes_monitoring_feature_info{cluster="$CLUSTER", feature="annotationAutodiscovery"} | ||
type: promql | ||
|
||
# Annotation Autodiscovery by Servicell | ||
- query: certmanager_clock_time_seconds{cluster="$CLUSTER", job="integrations/cert-manager"} | ||
type: promql | ||
|
||
# DPM check | ||
- query: avg(count_over_time(scrape_samples_scraped{cluster="$CLUSTER"}[1m])) | ||
type: promql | ||
expect: | ||
value: 1 | ||
operator: == |
18 changes: 18 additions & 0 deletions
18
charts/k8s-monitoring/tests/integration/anntoation-autodiscovery/values.yaml
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,18 @@ | ||
--- | ||
cluster: | ||
name: annotation-autodiscovery-test | ||
|
||
destinations: | ||
- name: prometheus | ||
type: prometheus | ||
url: http://prometheus-server.prometheus.svc:9090/api/v1/write | ||
|
||
annotationAutodiscovery: | ||
enabled: true | ||
|
||
selfReporting: {scrapeInterval: 1m} # Force self-report to be generated within test time | ||
|
||
alloy-metrics: | ||
enabled: true | ||
controller: | ||
replicas: 2 |
Oops, something went wrong.