From 65995dce4f5bde9ae652fd43460d019988e0874a Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Tue, 14 May 2024 10:54:40 +0100 Subject: [PATCH 01/15] Empty change to provoke CI Signed-off-by: Michel Hollands --- charts/meta-monitoring/templates/validate.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/meta-monitoring/templates/validate.yaml b/charts/meta-monitoring/templates/validate.yaml index d775438..a9ee062 100644 --- a/charts/meta-monitoring/templates/validate.yaml +++ b/charts/meta-monitoring/templates/validate.yaml @@ -41,3 +41,4 @@ {{- if empty .Values.metrics.retain -}} {{- fail "All metrics will be collected, please specify some in metrics.retain" -}} {{- end -}} + From 8cff0e0e7563de24d565ad458839244321bca302 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Tue, 14 May 2024 10:57:14 +0100 Subject: [PATCH 02/15] Fix lint issues Signed-off-by: Michel Hollands --- charts/meta-monitoring/values.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/meta-monitoring/values.yaml b/charts/meta-monitoring/values.yaml index a030128..eaccb7b 100644 --- a/charts/meta-monitoring/values.yaml +++ b/charts/meta-monitoring/values.yaml @@ -26,7 +26,7 @@ local: traces: enabled: false minio: - enabled: false # This should be set to true if any of the previous is enabled + enabled: false # This should be set to true if any of the previous is enabled grafana: version: 10.4.2 # Gateway ingress configuration @@ -52,14 +52,14 @@ grafana: # port: # number: TODO # -- TLS configuration for the gateway ingress. Hosts passed through the `tpl` function to allow templating - #tls: + # tls: # - secretName: grafana-tls # hosts: # - monitoring.example.com 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: null # This example replaces the word after password with ***** + piiRegexes: null # This example replaces the word after password with ***** # - expression: "password (\\\\S+)" # source: "" # Empty uses the log message # replace: "*****"" From 0418d16a1b15495ae7d17441b47d079550c10c69 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Tue, 14 May 2024 10:58:27 +0100 Subject: [PATCH 03/15] Fix lint issues Signed-off-by: Michel Hollands --- charts/meta-monitoring/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/meta-monitoring/values.yaml b/charts/meta-monitoring/values.yaml index eaccb7b..e363acd 100644 --- a/charts/meta-monitoring/values.yaml +++ b/charts/meta-monitoring/values.yaml @@ -59,7 +59,7 @@ grafana: 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: null # This example replaces the word after password with ***** + piiRegexes: null # This example replaces the word after password with ***** # - expression: "password (\\\\S+)" # source: "" # Empty uses the log message # replace: "*****"" From ce216cd558fdbecac52c47ca04138e06f306e450 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Tue, 14 May 2024 11:03:05 +0100 Subject: [PATCH 04/15] Remove unused parameter Signed-off-by: Michel Hollands --- charts/meta-monitoring/ct.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/meta-monitoring/ct.yaml b/charts/meta-monitoring/ct.yaml index 506f060..fc15965 100644 --- a/charts/meta-monitoring/ct.yaml +++ b/charts/meta-monitoring/ct.yaml @@ -6,6 +6,5 @@ chart-dirs: chart-repos: - grafana=https://grafana.github.io/helm-charts - minio=https://charts.min.io -helm-extra-args: --timeout 1200s check-version-increment: false validate-maintainers: false From 844708681fb871177b0e9852c0b4bb3db0df0794 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Tue, 14 May 2024 11:14:36 +0100 Subject: [PATCH 05/15] Add ci dir to chart with local values Signed-off-by: Michel Hollands --- charts/meta-monitoring/ci/local.values | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 charts/meta-monitoring/ci/local.values diff --git a/charts/meta-monitoring/ci/local.values b/charts/meta-monitoring/ci/local.values new file mode 100644 index 0000000..ed20085 --- /dev/null +++ b/charts/meta-monitoring/ci/local.values @@ -0,0 +1,34 @@ +namespacesToMonitor: +- loki + +local: + grafana: + enabled: true + logs: + enabled: true + metrics: + enabled: true + traces: + enabled: true + minio: + enabled: true + +cloud: + logs: + enabled: false + secret: logs + metrics: + enabled: false + secret: metrics + traces: + enabled: false + secret: traces + +grafana: + ingress: + hosts: + - host: monitoring.example.com + paths: + - path: / + pathType: Prefix + From 8b9ed3c9f78cf76a8e5c260f209c2cb7f9357070 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Tue, 14 May 2024 11:22:55 +0100 Subject: [PATCH 06/15] Use correct name for values file Signed-off-by: Michel Hollands --- charts/meta-monitoring/ci/{local.values => local-values.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename charts/meta-monitoring/ci/{local.values => local-values.yaml} (100%) diff --git a/charts/meta-monitoring/ci/local.values b/charts/meta-monitoring/ci/local-values.yaml similarity index 100% rename from charts/meta-monitoring/ci/local.values rename to charts/meta-monitoring/ci/local-values.yaml From e5e13ac51786d218505fb328d0f88d23c7c23659 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Tue, 14 May 2024 11:24:45 +0100 Subject: [PATCH 07/15] Remove empty line Signed-off-by: Michel Hollands --- charts/meta-monitoring/ci/local-values.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/meta-monitoring/ci/local-values.yaml b/charts/meta-monitoring/ci/local-values.yaml index ed20085..9184903 100644 --- a/charts/meta-monitoring/ci/local-values.yaml +++ b/charts/meta-monitoring/ci/local-values.yaml @@ -31,4 +31,3 @@ grafana: paths: - path: / pathType: Prefix - From edc556b074eb0d0f7f2785edae0b2a1dc6616526 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Tue, 14 May 2024 11:38:53 +0100 Subject: [PATCH 08/15] Add default secret for testing Signed-off-by: Michel Hollands --- charts/meta-monitoring/ci/local-values.yaml | 1 + charts/meta-monitoring/templates/minio/secret.yaml | 10 ++++++++++ charts/meta-monitoring/values.yaml | 1 + 3 files changed, 12 insertions(+) create mode 100644 charts/meta-monitoring/templates/minio/secret.yaml diff --git a/charts/meta-monitoring/ci/local-values.yaml b/charts/meta-monitoring/ci/local-values.yaml index 9184903..1b72d99 100644 --- a/charts/meta-monitoring/ci/local-values.yaml +++ b/charts/meta-monitoring/ci/local-values.yaml @@ -12,6 +12,7 @@ local: enabled: true minio: enabled: true + createSecret: true cloud: logs: diff --git a/charts/meta-monitoring/templates/minio/secret.yaml b/charts/meta-monitoring/templates/minio/secret.yaml new file mode 100644 index 0000000..9eece43 --- /dev/null +++ b/charts/meta-monitoring/templates/minio/secret.yaml @@ -0,0 +1,10 @@ +{{- if .Values.local.minio.createSecret }} +apiVersion: v1 +kind: Secret +metadata: + name: minio + namespace: {{ $.Release.Namespace }} +data: + rootUser: dmFsdWUtMg0KDQo= + rootPassword: dmFsdWUtMg0KDQo= +{{- end }} \ No newline at end of file diff --git a/charts/meta-monitoring/values.yaml b/charts/meta-monitoring/values.yaml index e363acd..fdfaf8e 100644 --- a/charts/meta-monitoring/values.yaml +++ b/charts/meta-monitoring/values.yaml @@ -27,6 +27,7 @@ local: enabled: false minio: enabled: false # This should be set to true if any of the previous is enabled + createSecret: false # This is used for testing, do not use in production grafana: version: 10.4.2 # Gateway ingress configuration From 76c8884a3c172e292ebd2978a678047d6ac3af84 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Wed, 22 May 2024 16:49:02 +0100 Subject: [PATCH 09/15] Add pre-install hook Signed-off-by: Michel Hollands --- charts/meta-monitoring/templates/minio/secret.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/meta-monitoring/templates/minio/secret.yaml b/charts/meta-monitoring/templates/minio/secret.yaml index 9eece43..fe812ae 100644 --- a/charts/meta-monitoring/templates/minio/secret.yaml +++ b/charts/meta-monitoring/templates/minio/secret.yaml @@ -4,6 +4,9 @@ kind: Secret metadata: name: minio namespace: {{ $.Release.Namespace }} +annotations: + "helm.sh/hook": pre-install + "helm.sh/hook-weight": "-5" data: rootUser: dmFsdWUtMg0KDQo= rootPassword: dmFsdWUtMg0KDQo= From 2939c3cd63bec2e58037a3b0e356160f3658c6e5 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Tue, 14 May 2024 11:14:36 +0100 Subject: [PATCH 10/15] Add ci dir to chart with local values Signed-off-by: Michel Hollands --- charts/meta-monitoring/ci/local.values | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 charts/meta-monitoring/ci/local.values diff --git a/charts/meta-monitoring/ci/local.values b/charts/meta-monitoring/ci/local.values new file mode 100644 index 0000000..ed20085 --- /dev/null +++ b/charts/meta-monitoring/ci/local.values @@ -0,0 +1,34 @@ +namespacesToMonitor: +- loki + +local: + grafana: + enabled: true + logs: + enabled: true + metrics: + enabled: true + traces: + enabled: true + minio: + enabled: true + +cloud: + logs: + enabled: false + secret: logs + metrics: + enabled: false + secret: metrics + traces: + enabled: false + secret: traces + +grafana: + ingress: + hosts: + - host: monitoring.example.com + paths: + - path: / + pathType: Prefix + From f5b0477a2d60022b48e71b4d362ff8b0408a0470 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Tue, 14 May 2024 11:22:55 +0100 Subject: [PATCH 11/15] Use correct name for values file Signed-off-by: Michel Hollands --- charts/meta-monitoring/ci/local.values | 34 -------------------------- 1 file changed, 34 deletions(-) delete mode 100644 charts/meta-monitoring/ci/local.values diff --git a/charts/meta-monitoring/ci/local.values b/charts/meta-monitoring/ci/local.values deleted file mode 100644 index ed20085..0000000 --- a/charts/meta-monitoring/ci/local.values +++ /dev/null @@ -1,34 +0,0 @@ -namespacesToMonitor: -- loki - -local: - grafana: - enabled: true - logs: - enabled: true - metrics: - enabled: true - traces: - enabled: true - minio: - enabled: true - -cloud: - logs: - enabled: false - secret: logs - metrics: - enabled: false - secret: metrics - traces: - enabled: false - secret: traces - -grafana: - ingress: - hosts: - - host: monitoring.example.com - paths: - - path: / - pathType: Prefix - From 0e95fcc5cb12ec56bc2d1e99e5f673d2fcfe129e Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Tue, 14 May 2024 11:38:53 +0100 Subject: [PATCH 12/15] Add default secret for testing Signed-off-by: Michel Hollands --- charts/meta-monitoring/templates/minio/secret.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/meta-monitoring/templates/minio/secret.yaml b/charts/meta-monitoring/templates/minio/secret.yaml index fe812ae..dd1cb97 100644 --- a/charts/meta-monitoring/templates/minio/secret.yaml +++ b/charts/meta-monitoring/templates/minio/secret.yaml @@ -10,4 +10,4 @@ annotations: data: rootUser: dmFsdWUtMg0KDQo= rootPassword: dmFsdWUtMg0KDQo= -{{- end }} \ No newline at end of file +{{- end }} From 1a33ef0d2bd7db22642425dc506a97d0edffd41a Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Wed, 22 May 2024 17:06:01 +0100 Subject: [PATCH 13/15] Turn on ci Signed-off-by: Michel Hollands --- .github/workflows/helm-ci.yml | 76 +++++++++++++++++------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/workflows/helm-ci.yml b/.github/workflows/helm-ci.yml index 1d64100..0e79660 100644 --- a/.github/workflows/helm-ci.yml +++ b/.github/workflows/helm-ci.yml @@ -20,48 +20,48 @@ jobs: - name: Lint Yaml run: make helm-lint - # call-test: - # name: Test Helm Chart - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 + call-test: + name: Test Helm Chart + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + 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.14.0 - # # 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.9 + # 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.9 - # - name: Set up chart-testing - # uses: helm/chart-testing-action@v2 + - name: Set up chart-testing + uses: helm/chart-testing-action@v2 - # - 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 - # if: steps.list-changed.outputs.changed == 'true' - # with: - # config: "${{ github.workspace }}/.github/configs/cluster-config.yaml" + - name: Create kind cluster + uses: helm/kind-action@v1 + if: steps.list-changed.outputs.changed == 'true' + with: + config: "${{ github.workspace }}/.github/configs/cluster-config.yaml" - # - name: Run chart-testing (install) - # run: | - # changed=$(ct list-changed --config "${CT_CONFIGFILE}") - # ct install --config "${CT_CONFIGFILE}" + - name: Run chart-testing (install) + run: | + changed=$(ct list-changed --config "${CT_CONFIGFILE}") + ct install --config "${CT_CONFIGFILE}" From e6db102da85edd7ff5b4a43feec23e8a0d1837b2 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Wed, 22 May 2024 17:14:59 +0100 Subject: [PATCH 14/15] Put the annotations in the right place Signed-off-by: Michel Hollands --- charts/meta-monitoring/templates/minio/secret.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/meta-monitoring/templates/minio/secret.yaml b/charts/meta-monitoring/templates/minio/secret.yaml index dd1cb97..43f3cb0 100644 --- a/charts/meta-monitoring/templates/minio/secret.yaml +++ b/charts/meta-monitoring/templates/minio/secret.yaml @@ -4,9 +4,9 @@ kind: Secret metadata: name: minio namespace: {{ $.Release.Namespace }} -annotations: - "helm.sh/hook": pre-install - "helm.sh/hook-weight": "-5" + annotations: + "helm.sh/hook": pre-install + "helm.sh/hook-weight": "-5" data: rootUser: dmFsdWUtMg0KDQo= rootPassword: dmFsdWUtMg0KDQo= From cb31d42f57bc0d86defe8a4ae34dc2db151c2ad2 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 31 May 2024 13:54:18 +0100 Subject: [PATCH 15/15] Temp check in Signed-off-by: Michel Hollands --- charts/meta-monitoring/ci/local-values.yaml | 84 ++++++++++++++++++- .../templates/ruler/ruler.yaml | 4 + 2 files changed, 87 insertions(+), 1 deletion(-) diff --git a/charts/meta-monitoring/ci/local-values.yaml b/charts/meta-monitoring/ci/local-values.yaml index 1b72d99..d7f66d1 100644 --- a/charts/meta-monitoring/ci/local-values.yaml +++ b/charts/meta-monitoring/ci/local-values.yaml @@ -12,7 +12,7 @@ local: enabled: true minio: enabled: true - createSecret: true + createSecret: false cloud: logs: @@ -32,3 +32,85 @@ grafana: paths: - path: / pathType: Prefix + +minio: + existingSecret: "" + rootUser: "abcdefghi" + rootPassword: "defghijkl" + +loki: + deploymentMode: SingleBinary + singleBinary: + replicas: 1 + resources: + limits: + cpu: 3 + memory: 4Gi + requests: + cpu: 2 + memory: 2Gi + extraEnv: + # Keep a little bit lower than memory limits + - name: GOMEMLIMIT + value: 3750MiB + + chunksCache: + # default is 500MB, with limited memory keep this smaller + writebackSizeLimit: 10MB + + # Zero out replica counts of other deployment modes + backend: + replicas: 0 + read: + replicas: 0 + write: + replicas: 0 + + ingester: + replicas: 0 + querier: + replicas: 0 + queryFrontend: + replicas: 0 + queryScheduler: + replicas: 0 + distributor: + replicas: 0 + compactor: + replicas: 0 + indexGateway: + replicas: 0 + bloomCompactor: + replicas: 0 + bloomGateway: + replicas: 0 + +mimir-distributed: + minio: + enabled: false + global: + extraEnvFrom: + - secretRef: + name: "meta-minio" + +tempo-distributed: + distributor: + extraEnvFrom: + - secretRef: + name: "meta-minio" + ingester: + extraEnvFrom: + - secretRef: + name: "meta-minio" + compactor: + extraEnvFrom: + - secretRef: + name: "meta-minio" + querier: + extraEnvFrom: + - secretRef: + name: "meta-minio" + queryFrontend: + extraEnvFrom: + - secretRef: + name: "meta-minio" \ No newline at end of file diff --git a/charts/meta-monitoring/templates/ruler/ruler.yaml b/charts/meta-monitoring/templates/ruler/ruler.yaml index 215e29d..e72701c 100644 --- a/charts/meta-monitoring/templates/ruler/ruler.yaml +++ b/charts/meta-monitoring/templates/ruler/ruler.yaml @@ -51,7 +51,11 @@ spec: protocol: TCP envFrom: - secretRef: +{{- if .Values.local.minio.enabled }} + name: {{ $.Release.Namespace }}-minio +{{- else }} name: minio +{{- end }} readinessProbe: failureThreshold: 3 httpGet: