Skip to content

Commit 3b4ffa4

Browse files
authored
k8s-monitoring 2.0 alpha (#757)
Signed-off-by: Pete Wall <pete.wall@grafana.com>
1 parent aa95a65 commit 3b4ffa4

File tree

359 files changed

+25962
-157
lines changed

Some content is hidden

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

359 files changed

+25962
-157
lines changed

.configs/certificates.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: prometheus
6+
---
7+
apiVersion: secretgen.k14s.io/v1alpha1
8+
kind: Certificate
9+
metadata:
10+
name: ca-cert
11+
namespace: prometheus
12+
spec:
13+
isCA: true
14+
---
15+
apiVersion: secretgen.k14s.io/v1alpha1
16+
kind: Certificate
17+
metadata:
18+
name: prometheus-ssl
19+
namespace: prometheus
20+
spec:
21+
alternativeNames:
22+
- prometheus-server.prometheus.svc.cluster.local
23+
caRef:
24+
name: ca-cert
25+
---
26+
apiVersion: secretgen.k14s.io/v1alpha1
27+
kind: Certificate
28+
metadata:
29+
name: prometheus-workload-ssl
30+
namespace: prometheus
31+
spec:
32+
alternativeNames:
33+
- prometheus-workload-server.prometheus.svc.cluster.local
34+
caRef:
35+
name: ca-cert
File renamed without changes.

.configs/loki.yaml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
loki:
3+
commonConfig:
4+
replication_factor: 1
5+
schemaConfig:
6+
configs:
7+
- from: 2024-04-01
8+
store: tsdb
9+
object_store: s3
10+
schema: v13
11+
index:
12+
prefix: loki_index_
13+
period: 24h
14+
ingester:
15+
chunk_encoding: snappy
16+
querier:
17+
# Default is 4, if you have enough memory and CPU you can increase, reduce if OOMing
18+
max_concurrent: 2
19+
20+
test:
21+
enabled: false
22+
23+
lokiCanary:
24+
enabled: false
25+
26+
gateway:
27+
basicAuth:
28+
enabled: true
29+
username: loki
30+
password: lokipassword
31+
service:
32+
port: 8080
33+
34+
deploymentMode: SingleBinary
35+
singleBinary:
36+
replicas: 1
37+
# resources:
38+
# limits:
39+
# cpu: 3
40+
# memory: 4Gi
41+
# requests:
42+
# cpu: 2
43+
# memory: 2Gi
44+
# extraEnv:
45+
# # Keep a little bit lower than memory limits
46+
# - name: GOMEMLIMIT
47+
# value: 3750MiB
48+
49+
# Enable minio for storage
50+
minio:
51+
enabled: true
52+
53+
# Zero out replica counts of other deployment modes
54+
backend:
55+
replicas: 0
56+
read:
57+
replicas: 0
58+
write:
59+
replicas: 0
60+
61+
ingester:
62+
replicas: 0
63+
querier:
64+
replicas: 0
65+
queryFrontend:
66+
replicas: 0
67+
queryScheduler:
68+
replicas: 0
69+
distributor:
70+
replicas: 0
71+
compactor:
72+
replicas: 0
73+
indexGateway:
74+
replicas: 0
75+
bloomCompactor:
76+
replicas: 0
77+
bloomGateway:
78+
replicas: 0
79+
resultsCache:
80+
enabled: false
81+
chunksCache:
82+
enabled: false
83+
84+
monitoring:
85+
selfMonitoring:
86+
enabled: false
87+
grafanaAgent:
88+
installOperator: false
89+
serviceMonitor:
90+
enabled: true
91+
# This actually isn't recommended by Loki, the default is 15s for a reason, but we don't want to upset
92+
# our DPM test calculations.
93+
interval: 1m

.configs/prometheus.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
server:
3+
extraFlags:
4+
- enable-feature=otlp-write-receiver
5+
- enable-feature=remote-write-receiver
6+
- web.config.file=/etc/config/web.yml
7+
8+
extraSecretMounts:
9+
- name: prometheus-ssl
10+
mountPath: /etc/prometheus-ssl
11+
secretName: prometheus-ssl
12+
readOnly: true
13+
14+
persistentVolume:
15+
enabled: false
16+
17+
probeHeaders:
18+
- name: "Authorization"
19+
value: "Basic cHJvbXVzZXI6cHJvbWV0aGV1c3Bhc3N3b3Jk"
20+
probeScheme: HTTPS
21+
22+
service:
23+
servicePort: 9090
24+
25+
serverFiles:
26+
prometheus.yml:
27+
scrape_configs: []
28+
web.yml:
29+
basic_auth_users:
30+
promuser: $2a$12$1UJsAG4QnhjjDzqcSVkZmeDxxjgIFOAmzfuVTybTuhhDnYgfuAbAq # "prometheuspassword"
31+
tls_server_config:
32+
cert_file: /etc/prometheus-ssl/crt.pem
33+
key_file: /etc/prometheus-ssl/key.pem
34+
35+
configmapReload:
36+
prometheus:
37+
enabled: false
38+
39+
alertmanager:
40+
enabled: false
41+
42+
kube-state-metrics:
43+
enabled: false
44+
45+
prometheus-node-exporter:
46+
enabled: false
47+
48+
prometheus-pushgateway:
49+
enabled: false

.github/CODEOWNERS

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is used to define the owners of the code in this repository.
2+
# https://help.github.com/articles/about-codeowners/
3+
4+
# Global owners
5+
* @petewall
6+
7+
# Chart owners
8+
charts/feature-annotation-autodiscovery @grafana/k8s-monitoring-dev
9+
charts/feature-application-observability @rlankfo
10+
charts/feature-cluster-events @grafana/k8s-monitoring-dev
11+
charts/feature-cluster-metrics @grafana/k8s-monitoring-dev
12+
charts/feature-frontend-observability @rlankfo
13+
charts/feature-pod-logs @grafana/k8s-monitoring-dev
14+
charts/feature-profiling @simonswine
15+
charts/feature-prometheus-operator-objects @grafana/k8s-monitoring-dev
16+
charts/k8s-monitoring-v1 @grafana/k8s-monitoring-dev

.github/workflows/helm-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515

1616
env:
1717
CT_CONFIGFILE: "${{ github.workspace }}/.github/configs/ct.yaml"
18-
LINT_CONFIGFILE: "${{ github.workspace }}/.github/configs/lintconf.yaml"
18+
LINT_CONFIGFILE: "${{ github.workspace }}/.configs/lintconf.yaml"
1919
GRAFANA_ALLOY_VALUES: "${{ github.workspace }}/.github/configs/alloy-config.yaml"
2020
GRAFANA_ALLOY_LOKI_OTLP_VALUES: "${{ github.workspace }}/.github/configs/alloy-config-loki-otlp.yaml"
2121
GRAFANA_ALLOY_RECEIVER_SERVICE: "${{ github.workspace }}/.github/configs/receiver-service.yaml"
@@ -212,4 +212,4 @@ jobs:
212212
if: (steps.list-changed.outputs.changed == 'true') || (contains(github.event.pull_request.labels.*.name, 'full_test_required'))
213213
run: |
214214
latestRelease=$(git describe --abbrev=0 --tags)
215-
ct install --all --config "${CT_CONFIGFILE}" --since "${latestRelease}" --helm-extra-args "--timeout 10m"
215+
ct install --config "${CT_CONFIGFILE}" --since "${latestRelease}" --helm-extra-args "--timeout 10m" --charts charts/k8s-monitoring-v1
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: Integration Test
3+
# yamllint disable-line rule:truthy
4+
on:
5+
push:
6+
branches: ["main"]
7+
paths:
8+
- 'charts/**'
9+
- '!charts/k8s-monitoring-v1/**'
10+
pull_request:
11+
paths:
12+
- 'charts/**'
13+
- '!charts/k8s-monitoring-v1/**'
14+
15+
# Allows you to run this workflow manually from the Actions tab
16+
workflow_dispatch:
17+
18+
jobs:
19+
list-tests:
20+
name: List tests
21+
runs-on: ubuntu-latest
22+
outputs:
23+
tests: ${{ steps.list_tests.outputs.tests }}
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: List tests
29+
id: list_tests
30+
run: |
31+
tests=$(ls charts/k8s-monitoring/tests/integration)
32+
echo "Tests: ${tests}"
33+
echo "tests=$(echo "${tests}" | jq --raw-input --slurp --compact-output 'split("\n") | map(select(. != ""))')" >> "${GITHUB_OUTPUT}"
34+
35+
run-tests:
36+
name: Integration Test
37+
needs: list-tests
38+
runs-on: ubuntu-latest
39+
strategy:
40+
matrix:
41+
test: ${{ fromJson(needs.list-tests.outputs.tests) }}
42+
fail-fast: false
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
47+
- name: Set up Helm
48+
uses: azure/setup-helm@v4
49+
50+
- name: Create kind cluster
51+
uses: helm/kind-action@v1
52+
53+
- name: Run test
54+
run: |
55+
echo "Testing ${{ matrix.test }}"
56+
CREATE_CLUSTER=false ./scripts/integration-test.sh "charts/k8s-monitoring/tests/integration/${{ matrix.test }}"

.github/workflows/reviewdog.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
name: ReviewDog
33
# yamllint disable-line rule:truthy
44
on:
5-
pull_request:
5+
push:
66
branches: ["main"]
77

8+
pull_request:
9+
10+
workflow_dispatch:
11+
812
jobs:
913
markdownlint:
1014
name: runner / markdownlint
@@ -117,16 +121,6 @@ jobs:
117121
github_token: ${{ secrets.github_token }}
118122
reporter: github-check
119123

120-
eclint:
121-
name: runner / eclint
122-
runs-on: ubuntu-latest
123-
steps:
124-
- uses: actions/checkout@v4
125-
- uses: reviewdog/action-eclint@v1
126-
with:
127-
github_token: ${{ secrets.github_token }}
128-
reporter: github-check
129-
130124
textlint:
131125
name: runner / textlint
132126
runs-on: ubuntu-latest
@@ -137,7 +131,7 @@ jobs:
137131
- env:
138132
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
139133
run: |
140-
npx textlint --format checkstyle --config ./.textlintrc --ignore-path ./.textlintignore $(find . -type f -name "*.md" -not \( -path "./node_modules/*" -o -path "./data-alloy/*" \)) | \
134+
npx textlint --format checkstyle --config ./.textlintrc --ignore-path ./.textlintignore "$(find . -type f -name "*.md" -not \( -path "./node_modules/*" -o -path "./data-alloy/*" \))" | \
141135
reviewdog -f=checkstyle -name="textlint" -reporter=github-check -level=info
142136
143137
alloy:

0 commit comments

Comments
 (0)