Skip to content

Commit 6f2396e

Browse files
Add a new mimir.alerts.kubernetes component (#3448)
* Add a new mimir.alerts.kubernetes component * Sync Mimir periodically, test the case of a CRD deletion * Add TODOs * Longer test timeout * Check if pods are running * Apply suggestions from code review Co-authored-by: Clayton Cornell <[email protected]> * Fix metric doc * Fix changelog --------- Co-authored-by: Clayton Cornell <[email protected]>
1 parent 10b5d99 commit 6f2396e

File tree

87 files changed

+3442
-93
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+3442
-93
lines changed

.github/ISSUE_TEMPLATE/blank.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ body:
7878
- loki.source.syslog
7979
- loki.source.windowsevent
8080
- loki.write
81+
- mimir.alerts.kubernetes
8182
- mimir.rules.kubernetes
8283
- otelcol.auth.basic
8384
- otelcol.auth.bearer

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ body:
7878
- loki.source.syslog
7979
- loki.source.windowsevent
8080
- loki.write
81+
- mimir.alerts.kubernetes
8182
- mimir.rules.kubernetes
8283
- otelcol.auth.basic
8384
- otelcol.auth.bearer

.github/ISSUE_TEMPLATE/docs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ body:
8181
- loki.source.syslog
8282
- loki.source.windowsevent
8383
- loki.write
84+
- mimir.alerts.kubernetes
8485
- mimir.rules.kubernetes
8586
- otelcol.auth.basic
8687
- otelcol.auth.bearer

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ body:
7878
- loki.source.syslog
7979
- loki.source.windowsevent
8080
- loki.write
81+
- mimir.alerts.kubernetes
8182
- mimir.rules.kubernetes
8283
- otelcol.auth.basic
8384
- otelcol.auth.bearer

.github/ISSUE_TEMPLATE/proposal.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ body:
7878
- loki.source.syslog
7979
- loki.source.windowsevent
8080
- loki.write
81+
- mimir.alerts.kubernetes
8182
- mimir.rules.kubernetes
8283
- otelcol.auth.basic
8384
- otelcol.auth.bearer
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Integration Tests on Kubernetes
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
run_tests:
13+
runs-on:
14+
labels: github-hosted-ubuntu-x64-large
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
- name: Setup Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version-file: go.mod
22+
- name: Run tests
23+
run: make integration-test-k8s

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ internal API changes are not present.
1010
Main (unreleased)
1111
-----------------
1212

13+
### Features
14+
15+
- A new `mimir.alerts.kubernetes` component which discovers `AlertmanagerConfig` Kubernetes resources and loads them into a Mimir instance. (@ptodev)
16+
1317
### Enhancements
1418

1519
- update promtail converter to use `file_match` block for `loki.source.file` instead of going through `local.file_match`. (@kalleep)

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ run-alloylint: alloylint
158158
# more for packages that exclude tests via //go:build !race due to known race detection issues. The
159159
# final command runs tests for syntax module.
160160
test:
161-
$(GO_ENV) go test $(GO_FLAGS) -race $(shell go list ./... | grep -v /integration-tests/)
161+
$(GO_ENV) go test $(GO_FLAGS) -race $(shell go list ./... | grep -v -E '/integration-tests/|/integration-tests-k8s/')
162162
$(GO_ENV) go test $(GO_FLAGS) ./internal/static/integrations/node_exporter
163163
$(GO_ENV) cd ./syntax && go test -race ./...
164164

@@ -180,6 +180,11 @@ test-pyroscope:
180180
cd ./internal/component/pyroscope/util/internal/cmd/playground/ && \
181181
$(GO_ENV) go build .
182182

183+
.PHONY: integration-test-k8s
184+
integration-test-k8s: alloy-image
185+
cd ./internal/cmd/integration-tests-k8s/ && \
186+
$(GO_ENV) go test -timeout 10m ./...
187+
183188
#
184189
# Targets for building binaries
185190
#

0 commit comments

Comments
 (0)