-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make a test to show how to use the clusterMetrics feature support the…
… CoreDNS service integration (#1229) * Make a test to show how to use the clusterMetrics feature support the CoreDNS service integration Signed-off-by: Pete Wall <[email protected]> * Handle integration tests inside a subdirectory Signed-off-by: Pete Wall <[email protected]> * Fix integration test action and unit tests Signed-off-by: Pete Wall <[email protected]> * no dir, it's working-directory Signed-off-by: Pete Wall <[email protected]> * Get less clever Signed-off-by: Pete Wall <[email protected]> * Fix job name Signed-off-by: Pete Wall <[email protected]> --------- Signed-off-by: Pete Wall <[email protected]>
- Loading branch information
Showing
31 changed files
with
2,964 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2,794 changes: 2,794 additions & 0 deletions
2,794
charts/k8s-monitoring/tests/integration/service-integrations/coredns/.rendered/output.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
...ts/k8s-monitoring/tests/integration/service-integrations/coredns/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,43 @@ | ||
--- | ||
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: | ||
grafana.ini: | ||
auth.anonymous: | ||
enabled: true | ||
org_role: Admin | ||
datasources: | ||
datasources.yaml: | ||
apiVersion: 1 | ||
datasources: | ||
- name: Prometheus | ||
type: prometheus | ||
url: http://prometheus-server.prometheus.svc:9090 | ||
isDefault: true |
File renamed without changes.
47 changes: 47 additions & 0 deletions
47
...k8s-monitoring/tests/integration/service-integrations/coredns/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,47 @@ | ||
--- | ||
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 | ||
dependsOn: | ||
- name: prometheus | ||
namespace: prometheus | ||
values: | ||
tests: | ||
- env: | ||
CLUSTER: coredns-integration-test | ||
PROMETHEUS_URL: http://prometheus-server.prometheus.svc:9090/api/v1/query | ||
|
||
queries: | ||
# CoreDNS metrics | ||
- query: coredns_build_info{cluster="$CLUSTER", job="integrations/coredns"} | ||
type: promql | ||
|
||
# DPM check | ||
- query: avg(count_over_time(scrape_samples_scraped{cluster="$CLUSTER"}[1m])) | ||
type: promql | ||
expect: | ||
value: 1 | ||
operator: == |
17 changes: 17 additions & 0 deletions
17
charts/k8s-monitoring/tests/integration/service-integrations/coredns/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,17 @@ | ||
--- | ||
cluster: | ||
name: coredns-integration-test | ||
|
||
destinations: | ||
- name: localPrometheus | ||
type: prometheus | ||
url: http://prometheus-server.prometheus.svc:9090/api/v1/write | ||
|
||
clusterMetrics: | ||
enabled: true | ||
kubeDNS: | ||
enabled: true | ||
jobLabel: integrations/coredns | ||
|
||
alloy-metrics: | ||
enabled: true |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
61 changes: 61 additions & 0 deletions
61
...s/k8s-monitoring/tests/integration/service-integrations/mysql/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 |
File renamed without changes.
File renamed without changes.