From 3149f4df9beb2e919221c8100c92189118ab1f6f Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 10:22:14 +0100 Subject: [PATCH 01/18] Add install step Signed-off-by: Michel Hollands --- .github/workflows/helm-ci.yml | 40 +++++++++++++++++++++++++++++++++++ tools/kind.config | 8 +++++++ 2 files changed, 48 insertions(+) create mode 100644 tools/kind.config diff --git a/.github/workflows/helm-ci.yml b/.github/workflows/helm-ci.yml index e5ab883..67d13a0 100644 --- a/.github/workflows/helm-ci.yml +++ b/.github/workflows/helm-ci.yml @@ -18,3 +18,43 @@ jobs: - 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: 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 + + - 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 (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 \ No newline at end of file diff --git a/tools/kind.config b/tools/kind.config new file mode 100644 index 0000000..9cd42f2 --- /dev/null +++ b/tools/kind.config @@ -0,0 +1,8 @@ +ikind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +nodes: +- role: control-plane +- role: worker +- role: worker +- role: worker + From e3708ce3fe1fdfb120fa4e3f2c1cda661ac63fc8 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 10:44:43 +0100 Subject: [PATCH 02/18] Add ct.yaml Signed-off-by: Michel Hollands --- charts/meta-monitoring/ct.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 charts/meta-monitoring/ct.yaml diff --git a/charts/meta-monitoring/ct.yaml b/charts/meta-monitoring/ct.yaml new file mode 100644 index 0000000..cf3f213 --- /dev/null +++ b/charts/meta-monitoring/ct.yaml @@ -0,0 +1,11 @@ +--- +remote: origin +target-branch: main +chart-dirs: + - charts +chart-repos: + - grafana=https://grafana.github.io/helm-charts + - minio=https://charts.min.io +helm-extra-args: --timeout 600s +check-version-increment: false +validate-maintainers: false From ffe220590d6fd392ae94a5ea73c591a1cc3bb54b Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 10:58:54 +0100 Subject: [PATCH 03/18] Update dependencies Signed-off-by: Michel Hollands --- charts/meta-monitoring/Chart.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/meta-monitoring/Chart.lock b/charts/meta-monitoring/Chart.lock index 94afcbb..aebffcb 100644 --- a/charts/meta-monitoring/Chart.lock +++ b/charts/meta-monitoring/Chart.lock @@ -14,5 +14,5 @@ dependencies: - name: minio repository: https://charts.min.io version: 5.0.11 -digest: sha256:4b04084e6fe821c4d481017b2430f7c8cd782a5d60830dd3a24eb8f10a9ece09 -generated: "2023-06-29T14:25:07.247853+01:00" +digest: sha256:da0e744b5046eb7972e0bf82d1d0ba4786e9600af63b65f35b16118105248074 +generated: "2023-08-18T10:58:08.978123+01:00" From 9c92e18efec9abdf3fab2e98da10d61afb1a33b4 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 11:02:07 +0100 Subject: [PATCH 04/18] Apply linting Signed-off-by: Michel Hollands --- charts/meta-monitoring/Chart.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/meta-monitoring/Chart.yaml b/charts/meta-monitoring/Chart.yaml index bf3052c..22823e0 100644 --- a/charts/meta-monitoring/Chart.yaml +++ b/charts/meta-monitoring/Chart.yaml @@ -25,21 +25,21 @@ appVersion: "0.0.1" dependencies: - name: loki - repository: https://grafana.github.io/helm-charts + repository: https://grafana.github.io/helm-charts version: "5.8.0" condition: local.logs.enabled - name: grafana-agent - repository: https://grafana.github.io/helm-charts + repository: https://grafana.github.io/helm-charts version: "0.15.0" - name: mimir-distributed - repository: https://grafana.github.io/helm-charts + repository: https://grafana.github.io/helm-charts version: "4.4.1" condition: local.metrics.enabled - name: tempo-distributed - repository: https://grafana.github.io/helm-charts + repository: https://grafana.github.io/helm-charts version: "1.4.7" condition: local.traces.enabled - name: minio repository: https://charts.min.io version: "5.0.11" - condition: local.minio.enabled \ No newline at end of file + condition: local.minio.enabled From 7a5358b322619735a391736ce0bb8bab956d62fe Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 11:03:29 +0100 Subject: [PATCH 05/18] Apply linting 2 Signed-off-by: Michel Hollands --- charts/meta-monitoring/Chart.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/meta-monitoring/Chart.yaml b/charts/meta-monitoring/Chart.yaml index 22823e0..a2f3994 100644 --- a/charts/meta-monitoring/Chart.yaml +++ b/charts/meta-monitoring/Chart.yaml @@ -43,3 +43,4 @@ dependencies: repository: https://charts.min.io version: "5.0.11" condition: local.minio.enabled + From fb3e3ece1b6291b3eb7c56e7985774c7ab858f1c Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 11:05:21 +0100 Subject: [PATCH 06/18] Apply linting 3 Signed-off-by: Michel Hollands --- charts/meta-monitoring/Chart.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/meta-monitoring/Chart.yaml b/charts/meta-monitoring/Chart.yaml index a2f3994..22823e0 100644 --- a/charts/meta-monitoring/Chart.yaml +++ b/charts/meta-monitoring/Chart.yaml @@ -43,4 +43,3 @@ dependencies: repository: https://charts.min.io version: "5.0.11" condition: local.minio.enabled - From 26ff679cbbc42e1123871b66e2875ef6e8144efd Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 11:06:52 +0100 Subject: [PATCH 07/18] Apply linting 4 Signed-off-by: Michel Hollands --- charts/meta-monitoring/values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/meta-monitoring/values.yaml b/charts/meta-monitoring/values.yaml index 9d64f4c..15ab997 100644 --- a/charts/meta-monitoring/values.yaml +++ b/charts/meta-monitoring/values.yaml @@ -193,4 +193,5 @@ minio: cpu: 100m memory: 128Mi # Changed the mc config path to '/tmp' from '/etc' as '/etc' is only writable by root and OpenShift will not permit this. - configPathmc: "/tmp/minio/mc/" \ No newline at end of file + configPathmc: "/tmp/minio/mc/" + From 99bb8f13c217374ef9b80e6de5e4e97d07593390 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 11:10:36 +0100 Subject: [PATCH 08/18] Apply linting 5 Signed-off-by: Michel Hollands --- charts/meta-monitoring/values.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/meta-monitoring/values.yaml b/charts/meta-monitoring/values.yaml index 15ab997..735164b 100644 --- a/charts/meta-monitoring/values.yaml +++ b/charts/meta-monitoring/values.yaml @@ -194,4 +194,3 @@ minio: memory: 128Mi # Changed the mc config path to '/tmp' from '/etc' as '/etc' is only writable by root and OpenShift will not permit this. configPathmc: "/tmp/minio/mc/" - From 8c0b68fe021e6657528bc4859013cadb022ace45 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 11:13:16 +0100 Subject: [PATCH 09/18] Fix kind.config Signed-off-by: Michel Hollands --- tools/kind.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kind.config b/tools/kind.config index 9cd42f2..a1d327a 100644 --- a/tools/kind.config +++ b/tools/kind.config @@ -1,4 +1,4 @@ -ikind: Cluster +kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane From d804da13f18eecbf517af148807c6e4893c42e5e Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 11:20:20 +0100 Subject: [PATCH 10/18] Add test install Signed-off-by: Michel Hollands --- .github/workflows/helm-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/helm-ci.yml b/.github/workflows/helm-ci.yml index 67d13a0..f961c0e 100644 --- a/.github/workflows/helm-ci.yml +++ b/.github/workflows/helm-ci.yml @@ -57,4 +57,9 @@ jobs: uses: helm/kind-action@v1.8.0 if: steps.list-changed.outputs.changed == 'true' with: - config: tools/kind.config \ No newline at end of file + config: tools/kind.config + + - name: Run chart-testing (install) + run: | + changed=$(ct list-changed --config "${CT_CONFIGFILE}") + ct install --config "${CT_CONFIGFILE}" From 53416e042c82ff786b8cb191e43808fc50f8709c Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 11:26:35 +0100 Subject: [PATCH 11/18] Use correct namespace Signed-off-by: Michel Hollands --- charts/meta-monitoring/templates/ruler/ruler.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/meta-monitoring/templates/ruler/ruler.yaml b/charts/meta-monitoring/templates/ruler/ruler.yaml index 9fae6e4..2f805e3 100644 --- a/charts/meta-monitoring/templates/ruler/ruler.yaml +++ b/charts/meta-monitoring/templates/ruler/ruler.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: meta-mimir-ruler-for-dashboards - namespace: meta + namespace: {{ $.Release.Namespace }} spec: progressDeadlineSeconds: 600 replicas: 1 @@ -24,7 +24,7 @@ spec: app.kubernetes.io/component: ruler-for-dashboards app.kubernetes.io/instance: meta app.kubernetes.io/name: mimir - namespace: meta + namespace: {{ $.Release.Namespace }} spec: containers: - args: From faa0015c11d739a6c0334635e6e26d7154a00429 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 11:28:47 +0100 Subject: [PATCH 12/18] Install locally by default Signed-off-by: Michel Hollands --- charts/meta-monitoring/values.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/charts/meta-monitoring/values.yaml b/charts/meta-monitoring/values.yaml index 735164b..53fcd4f 100644 --- a/charts/meta-monitoring/values.yaml +++ b/charts/meta-monitoring/values.yaml @@ -9,28 +9,28 @@ clusterName: "meta-monitoring" # Set to true for a local version of logs, metrics or traces local: logs: - enabled: false + enabled: true metrics: - enabled: false + enabled: true traces: - enabled: false + enabled: true minio: - enabled: false # This should be set to true if any of the previous is enabled + 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: true + enabled: false endpoint: username: password: metrics: - enabled: true + enabled: false endpoint: username: password: traces: - enabled: true + enabled: false endpoint: username: password: From 1ed196299bd21827261d0839b04d1363c765509e Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 11:44:31 +0100 Subject: [PATCH 13/18] Increase timeout Signed-off-by: Michel Hollands --- charts/meta-monitoring/ct.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/meta-monitoring/ct.yaml b/charts/meta-monitoring/ct.yaml index cf3f213..506f060 100644 --- a/charts/meta-monitoring/ct.yaml +++ b/charts/meta-monitoring/ct.yaml @@ -6,6 +6,6 @@ chart-dirs: chart-repos: - grafana=https://grafana.github.io/helm-charts - minio=https://charts.min.io -helm-extra-args: --timeout 600s +helm-extra-args: --timeout 1200s check-version-increment: false validate-maintainers: false From 1093e91741a91995ecbb0a8521cb57562d004aa8 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Fri, 18 Aug 2023 11:45:57 +0100 Subject: [PATCH 14/18] Change namespace name Signed-off-by: Michel Hollands --- tools/kind.config | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/kind.config b/tools/kind.config index a1d327a..8a842ce 100644 --- a/tools/kind.config +++ b/tools/kind.config @@ -1,5 +1,6 @@ kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 +name: meta nodes: - role: control-plane - role: worker From f4934d60075a4be97cd39036cc642ff80b2488e1 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Wed, 18 Oct 2023 11:35:54 +0100 Subject: [PATCH 15/18] Remove space Signed-off-by: Michel Hollands --- .github/workflows/helm-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/helm-ci.yml b/.github/workflows/helm-ci.yml index f961c0e..4666047 100644 --- a/.github/workflows/helm-ci.yml +++ b/.github/workflows/helm-ci.yml @@ -50,6 +50,7 @@ jobs: 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 From 687c77c0f60981d95a35d92330a6f54129c4bb44 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Thu, 19 Oct 2023 09:31:59 +0100 Subject: [PATCH 16/18] Use cloud Signed-off-by: Michel Hollands --- charts/meta-monitoring/values.yaml | 42 +++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/charts/meta-monitoring/values.yaml b/charts/meta-monitoring/values.yaml index 53fcd4f..814a671 100644 --- a/charts/meta-monitoring/values.yaml +++ b/charts/meta-monitoring/values.yaml @@ -6,34 +6,34 @@ namespacesToMonitor: # The name of the cluster where this will be installed clusterName: "meta-monitoring" -# 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: + enabled: true + endpoint: to_be_changed + username: to_be_changed + password: to_be_changed metrics: enabled: false - endpoint: - username: - password: + endpoint: to_be_changed + username: to_be_changed + password: to_be_changed traces: enabled: false - endpoint: - username: - password: + 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: false + metrics: + enabled: false + traces: + enabled: false + minio: + enabled: false # This should be set to true if any of the previous is enabled # 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 From bc5cdadb9fff84a2fbf43e86cd7f43682df5b695 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Thu, 19 Oct 2023 10:28:59 +0100 Subject: [PATCH 17/18] Rename file and do not run ruler when no mimir Signed-off-by: Michel Hollands --- .../{mimir-dahboards-5.yaml => mimir-dashboards-5.yaml} | 0 charts/meta-monitoring/templates/ruler/ruler.yaml | 4 ++-- charts/meta-monitoring/templates/ruler/rules-configmap.yaml | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) rename charts/meta-monitoring/templates/grafana/{mimir-dahboards-5.yaml => mimir-dashboards-5.yaml} (100%) diff --git a/charts/meta-monitoring/templates/grafana/mimir-dahboards-5.yaml b/charts/meta-monitoring/templates/grafana/mimir-dashboards-5.yaml similarity index 100% rename from charts/meta-monitoring/templates/grafana/mimir-dahboards-5.yaml rename to charts/meta-monitoring/templates/grafana/mimir-dashboards-5.yaml diff --git a/charts/meta-monitoring/templates/ruler/ruler.yaml b/charts/meta-monitoring/templates/ruler/ruler.yaml index 2f805e3..99fafb8 100644 --- a/charts/meta-monitoring/templates/ruler/ruler.yaml +++ b/charts/meta-monitoring/templates/ruler/ruler.yaml @@ -1,3 +1,4 @@ +{{- 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 @@ -91,8 +92,6 @@ spec: runAsUser: 10001 seccompProfile: type: RuntimeDefault - serviceAccount: meta-mimir - serviceAccountName: meta-mimir terminationGracePeriodSeconds: 180 topologySpreadConstraints: - labelSelector: @@ -124,3 +123,4 @@ spec: name: rules name: rules {{- end }} +{{- end }} diff --git a/charts/meta-monitoring/templates/ruler/rules-configmap.yaml b/charts/meta-monitoring/templates/ruler/rules-configmap.yaml index c3396ef..c2cb34a 100644 --- a/charts/meta-monitoring/templates/ruler/rules-configmap.yaml +++ b/charts/meta-monitoring/templates/ruler/rules-configmap.yaml @@ -1,3 +1,4 @@ +{{- if .Values.local.metrics.enabled }} {{- if or (or .Values.dashboards.logs.enabled .Values.dashboards.metrics.enabled) .Values.dashboards.traces.enabled }} --- apiVersion: v1 @@ -16,3 +17,4 @@ data: {{ ($.Files.Glob "src/rules/tempo-rules.yaml").AsConfig | indent 2 }} {{- end }} {{- end }} +{{- end }} From 76908c1e9e459c14634b90f717eb089c855279aa Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Thu, 19 Oct 2023 10:47:12 +0100 Subject: [PATCH 18/18] Turn on cloud metrics and traces by default Signed-off-by: Michel Hollands --- charts/meta-monitoring/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/meta-monitoring/values.yaml b/charts/meta-monitoring/values.yaml index 814a671..17d2dde 100644 --- a/charts/meta-monitoring/values.yaml +++ b/charts/meta-monitoring/values.yaml @@ -14,12 +14,12 @@ cloud: username: to_be_changed password: to_be_changed metrics: - enabled: false + enabled: true endpoint: to_be_changed username: to_be_changed password: to_be_changed traces: - enabled: false + enabled: true endpoint: to_be_changed username: to_be_changed password: to_be_changed