Compare commits

..

16 Commits

Author SHA1 Message Date
Michel Hollands
c9295f51e2 Rename agent dashboard file
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-17 09:40:25 +01:00
Michel Hollands
1eafbd4904 Fix linting issues
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 17:19:09 +01:00
Michel Hollands
70312c135d Do local install
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 17:14:44 +01:00
Michel Hollands
1b3b89df42 Increase timeout
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 17:13:15 +01:00
Michel Hollands
419cdede3d Remove hardcoded meta namespace
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 16:59:42 +01:00
Michel Hollands
a3d27c1c3a Add default values in values.yaml
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 16:48:41 +01:00
Michel Hollands
4cf4d13955 Remove prometheus operator
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 16:43:37 +01:00
Michel Hollands
3a59a6bc82 Fix linting issues again 2
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 16:31:48 +01:00
Michel Hollands
e9b05c3856 Fix linting issues again
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 16:29:38 +01:00
Michel Hollands
f9b6ae9b3e Fix linting issues
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 16:15:00 +01:00
Michel Hollands
4534f3eb21 Update chart dependencies
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 16:09:22 +01:00
Michel Hollands
b7dc7212e9 Update path for CI
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 14:38:18 +01:00
Michel Hollands
ed6c6da4a0 Add ct.yaml file
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 14:31:55 +01:00
Michel Hollands
9c67417c02 Fix path again
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 14:11:09 +01:00
Michel Hollands
9e136cdc5e Fix paths
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 14:08:11 +01:00
Michel Hollands
46dd6ffeb3 Add ci steps
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
2023-08-16 14:06:07 +01:00
13 changed files with 109 additions and 103 deletions

View File

@@ -16,51 +16,86 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3
# - name: Check Docs
# run: |
# docker run --rm --volume "$(pwd):/helm-docs" -u "$(id -u)" jnorwood/helm-docs:v1.11.0
# if ! git diff --exit-code; then
# echo "Documentation not up to date. Please run helm-docs and commit changes!" >&2
# exit 1
# fi
- name: Lint Yaml
run: make helm-lint
# call-test:
# name: Test Helm Chart
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Lint Code Base
# uses: docker://github/super-linter:v3.12.0
# env:
# FILTER_REGEX_EXCLUDE: .*(README\.md|Chart\.yaml|NOTES.txt).*
# FILTER_REGEX_INCLUDE: .*charts/meta-monitoring/.*
# VALIDATE_ALL_CODEBASE: false
# VALIDATE_KUBERNETES_KUBEVAL: false
# VALIDATE_YAML: false
# VALIDATE_GO: false
# DEFAULT_BRANCH: main
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
call-test:
name: Test Helm Chart
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# - name: Set up Helm
# uses: azure/setup-helm@v3
# with:
# version: v3.8.2
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.8.2
# # Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# # yamllint (https://github.com/adrienverge/yamllint) which require Python
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: 3.7
# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# yamllint (https://github.com/adrienverge/yamllint) which require Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
# - name: Set up chart-testing
# uses: helm/chart-testing-action@v2.4.0
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.4.0
# - name: Run chart-testing (list-changed)
# id: list-changed
# run: |
# changed=$(ct list-changed --config "${CT_CONFIGFILE}")
# if [[ -n "$changed" ]]; then
# echo "changed=true" >> $GITHUB_OUTPUT
# fi
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config "${CT_CONFIGFILE}")
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
# - name: Run chart-testing (lint)
# run: ct lint --config "${CT_CONFIGFILE}" --check-version-increment=false
- name: Run chart-testing (lint)
run: ct lint --config "${CT_CONFIGFILE}" --check-version-increment=false
# - name: Create kind cluster
# uses: helm/kind-action@v1.8.0
# if: steps.list-changed.outputs.changed == 'true'
# with:
# config: tools/kind.config
- name: Create kind cluster
uses: helm/kind-action@v1.8.0
if: steps.list-changed.outputs.changed == 'true'
# - name: Run chart-testing (install)
# run: |
# changed=$(ct list-changed --config "${CT_CONFIGFILE}")
# ct install --config "${CT_CONFIGFILE}"
# - name: Install prometheus operator
# id: install-prometheus
# if: steps.list-changed.outputs.changed == 'true'
# run: |
# kubectl create namespace prometheus
# helm install prometheus prometheus-community/kube-prometheus-stack \
# --namespace prometheus \
# --set grafana.enabled=false \
# --set prometheus.prometheusSpec.serviceMonitorSelector.matchLabels.release=prometheus
# kubectl --namespace prometheus get pods -l "release=prometheus"
# kubectl --namespace prometheus get services -l "release=prometheus"
- name: Run chart-testing (install)
run: |
changed=$(ct list-changed --config "${CT_CONFIGFILE}")
if [[ "$changed" == "charts/enterprise-metrics" ]]; then
# Do not run `ct install` for enterprise-metrics
exit 0
fi
ct install --config "${CT_CONFIGFILE}"

View File

@@ -6,5 +6,5 @@ help:
.PHONY: helm-lint
helm-lint: ## Run helm linter
helm-lint: ## run helm linter
$(MAKE) -BC charts/meta-monitoring lint

View File

@@ -15,4 +15,4 @@ dependencies:
repository: https://charts.min.io
version: 5.0.11
digest: sha256:da0e744b5046eb7972e0bf82d1d0ba4786e9600af63b65f35b16118105248074
generated: "2023-08-18T10:58:08.978123+01:00"
generated: "2023-08-16T16:08:36.406791+01:00"

View File

@@ -1,4 +1,4 @@
.DEFAULT_GOAL := lint
.DEFAULT_GOAL := all
.PHONY: lint lint-yaml
lint: lint-yaml

View File

@@ -8,4 +8,4 @@ chart-repos:
- minio=https://charts.min.io
helm-extra-args: --timeout 1200s
check-version-increment: false
validate-maintainers: false
validate-maintainers: false

View File

@@ -18,10 +18,10 @@
{{- end }}
{{- define "agent.loki_process_targets" -}}
{{- if and (empty .Values.logs.piiRegexes) (empty .Values.logs.retain) }}
{{- if empty .Values.logs.piiRegexes }}
{{- include "agent.loki_write_targets" . }}
{{- else }}
{{- printf "loki.process.filter.receiver" }}
{{- printf "loki.process.PII.receiver" }}
{{- end }}
{{- end }}

View File

@@ -45,18 +45,10 @@ data:
forward_to = [ {{ include "agent.loki_process_targets" . }} ]
}
{{- if or (not (empty .Values.logs.retain)) (not (empty .Values.logs.piiRegexes)) }}
loki.process "filter" {
{{- if not (empty .Values.logs.piiRegexes) }}
loki.process "PII" {
forward_to = [ {{ include "agent.loki_write_targets" . }} ]
{{- if not (empty .Values.logs.retain) }}
stage.match {
selector = "{cluster=\"{{- .Values.clusterName -}}\"} !~ \"{{ join "|" .Values.logs.retain }}\""
action = "drop"
}
{{- end }}
{{- if not (empty .Values.logs.piiRegexes) }}
{{- range .Values.logs.piiRegexes }}
stage.replace {
expression = "{{ .expression }}"
@@ -64,7 +56,6 @@ data:
replace = "{{ .replace }}"
}
{{- end }}
{{- end }}
}
{{- end }}
{{- end }}

View File

@@ -14,6 +14,6 @@ data:
{{ $.Files.Get "src/dashboards/agent-remote-write.json" | fromJson | toJson }}
"agent-tracing-pipeline.json": |
{{ $.Files.Get "src/dashboards/agent-tracing-pipeline.json" | fromJson | toJson }}
"agent.json": |
"agent-overview.json": |
{{ $.Files.Get "src/dashboards/agent.json" | fromJson | toJson }}
{{- end }}

View File

@@ -1,4 +1,3 @@
{{- if .Values.local.metrics.enabled }}
{{- if or (or .Values.dashboards.logs.enabled .Values.dashboards.metrics.enabled) .Values.dashboards.traces.enabled }}
apiVersion: apps/v1
kind: Deployment
@@ -92,6 +91,8 @@ spec:
runAsUser: 10001
seccompProfile:
type: RuntimeDefault
serviceAccount: meta-mimir
serviceAccountName: meta-mimir
terminationGracePeriodSeconds: 180
topologySpreadConstraints:
- labelSelector:
@@ -123,4 +124,3 @@ spec:
name: rules
name: rules
{{- end }}
{{- end }}

View File

@@ -1,4 +1,3 @@
{{- if .Values.local.metrics.enabled }}
{{- if or (or .Values.dashboards.logs.enabled .Values.dashboards.metrics.enabled) .Values.dashboards.traces.enabled }}
---
apiVersion: v1
@@ -17,4 +16,3 @@ data:
{{ ($.Files.Glob "src/rules/tempo-rules.yaml").AsConfig | indent 2 }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -6,53 +6,44 @@ namespacesToMonitor:
# The name of the cluster where this will be installed
clusterName: "meta-monitoring"
# Set to true to write logs, metrics or traces to Grafana Cloud
cloud:
logs:
enabled: true
endpoint: to_be_changed
username: to_be_changed
password: to_be_changed
metrics:
enabled: true
endpoint: to_be_changed
username: to_be_changed
password: to_be_changed
traces:
enabled: true
endpoint: to_be_changed
username: to_be_changed
password: to_be_changed
# Set to true for a local version of logs, metrics or traces
local:
logs:
enabled: true
metrics:
enabled: true
traces:
enabled: true
minio:
enabled: true # This should be set to true if any of the previous is enabled
# Set to true to write logs, metrics or traces to Grafana Cloud
cloud:
logs:
enabled: false
endpoint:
username:
password:
metrics:
enabled: false
endpoint:
username:
password:
traces:
enabled: false
minio:
enabled: false # This should be set to true if any of the previous is enabled
endpoint:
username:
password:
# Adding regexes here will add a stage.replace block for logs. For more information see
# https://grafana.com/docs/agent/latest/flow/reference/components/loki.process/#stagereplace-block
logs:
# Adding regexes here will add a stage.replace block for logs. For more information see
# https://grafana.com/docs/agent/latest/flow/reference/components/loki.process/#stagereplace-block
piiRegexes:
# This example replaces the word after password with *****
# - expression: "password (\\\\S+)"
# source: "" # Empty uses the log message
# replace: "*****""
# The lines matching these will be kept in Loki
retain:
# This shows the queries
- caller=metrics.go
# This shows any errors
- level=error
# This shows the ingest requests and is very noisy. Uncomment to include.
# - caller=push.go
# Set enabled = true to add the default logs/metrics/traces dashboards to the local Grafana
dashboards:
logs:
@@ -99,7 +90,7 @@ loki:
compactor:
retention_enabled: true
limits_config:
retention_period: 30d
retention_period: 24h
monitoring:
dashboards:
enabled: false
@@ -151,7 +142,7 @@ mimir-distributed:
secret_access_key: "{{ .Values.global.minio.rootPassword }}"
insecure: true
limits:
compactor_blocks_retention_period: 30d
compactor_blocks_retention_period: 24h
tempo-distributed:
tempo:
@@ -167,7 +158,7 @@ tempo-distributed:
insecure: true
compactor:
compaction:
block_retention: 30d
block_retention: 24h
traces:
otlp:
http:

View File

@@ -1,9 +0,0 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: meta
nodes:
- role: control-plane
- role: worker
- role: worker
- role: worker