Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pick up dashboards (as ConfigMaps) from all namespaces #3618

Closed
jbertran opened this issue Nov 30, 2021 · 0 comments · Fixed by #3620
Closed

Pick up dashboards (as ConfigMaps) from all namespaces #3618

jbertran opened this issue Nov 30, 2021 · 0 comments · Fixed by #3620
Assignees
Labels
complexity:easy Something that requires less than a day to fix topic:deployment Bugs in or enhancements to deployment stages topic:salt Everything related to SaltStack in our product topic:solutions Anything related to external "Solutions" integration with the platform

Comments

@jbertran
Copy link
Contributor

Component: charts,salt

Why this is needed: Currently, the deployed Grafana pod is configured to pick up any ConfigMap with the grafana_dashboard label available in its own namespace, i.e. metalk8s-monitoring.

For external solutions, we want:

  • to be able to deploy dashboard ConfigMaps with the grafana_dashboard label in a solution's namespace and have them show up in the metalk8s-monitoring Grafana.
  • to be able to control which folders a solution's dashboards are stored into

What should be done: modify chart values for grafana, re-render the salt state.

Test plan: E2E confirmation to be provided.

@jbertran jbertran added topic:deployment Bugs in or enhancements to deployment stages topic:solutions Anything related to external "Solutions" integration with the platform complexity:easy Something that requires less than a day to fix topic:salt Everything related to SaltStack in our product labels Nov 30, 2021
@jbertran jbertran self-assigned this Nov 30, 2021
jbertran pushed a commit that referenced this issue Dec 3, 2021
Configure k8s-sidecar in Grafana deployment:

* to search in `ALL` namespaces
* to place dashboards in folders according to
  `metalk8s.scality.com/grafana-folder-name` annotation
* to create Grafana folders from dashboard directory structure

Re-render chart to salt state using

```
./charts/render.py prometheus-operator \
  charts/kube-prometheus-stack.yaml \
  charts/kube-prometheus-stack/ \
  --namespace metalk8s-monitoring \
  --service-config grafana \
  metalk8s-grafana-config \
  metalk8s/addons/prometheus-operator/config/grafana.yaml \
  metalk8s-monitoring \
  --service-config prometheus \
  metalk8s-prometheus-config \
  metalk8s/addons/prometheus-operator/config/prometheus.yaml \
  metalk8s-monitoring \
  --service-config alertmanager \
  metalk8s-alertmanager-config \
  metalk8s/addons/prometheus-operator/config/alertmanager.yaml \
  metalk8s-monitoring \
  --service-config dex \
  metalk8s-dex-config \
  metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \
  --drop-prometheus-rules charts/drop-prometheus-rules.yaml \
  > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls
```

Fixes: #3618
jbertran pushed a commit that referenced this issue Dec 3, 2021
Configure k8s-sidecar in Grafana deployment:

* to search in `ALL` namespaces
* to place dashboards in folders according to
  `metalk8s.scality.com/grafana-folder-name` annotation
* to create Grafana folders from dashboard directory structure

Re-render chart to salt state using

```
./charts/render.py prometheus-operator \
  charts/kube-prometheus-stack.yaml \
  charts/kube-prometheus-stack/ \
  --namespace metalk8s-monitoring \
  --service-config grafana \
  metalk8s-grafana-config \
  metalk8s/addons/prometheus-operator/config/grafana.yaml \
  metalk8s-monitoring \
  --service-config prometheus \
  metalk8s-prometheus-config \
  metalk8s/addons/prometheus-operator/config/prometheus.yaml \
  metalk8s-monitoring \
  --service-config alertmanager \
  metalk8s-alertmanager-config \
  metalk8s/addons/prometheus-operator/config/alertmanager.yaml \
  metalk8s-monitoring \
  --service-config dex \
  metalk8s-dex-config \
  metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \
  --drop-prometheus-rules charts/drop-prometheus-rules.yaml \
  > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls
```

Fixes: #3618
jbertran pushed a commit that referenced this issue Dec 3, 2021
Configure k8s-sidecar in Grafana deployment:

* to search in `ALL` namespaces
* to place dashboards in folders according to
  `metalk8s.scality.com/grafana-folder-name` annotation
* to create Grafana folders from dashboard directory structure

Re-render chart to salt state using

```
./charts/render.py prometheus-operator \
  charts/kube-prometheus-stack.yaml \
  charts/kube-prometheus-stack/ \
  --namespace metalk8s-monitoring \
  --service-config grafana \
  metalk8s-grafana-config \
  metalk8s/addons/prometheus-operator/config/grafana.yaml \
  metalk8s-monitoring \
  --service-config prometheus \
  metalk8s-prometheus-config \
  metalk8s/addons/prometheus-operator/config/prometheus.yaml \
  metalk8s-monitoring \
  --service-config alertmanager \
  metalk8s-alertmanager-config \
  metalk8s/addons/prometheus-operator/config/alertmanager.yaml \
  metalk8s-monitoring \
  --service-config dex \
  metalk8s-dex-config \
  metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \
  --drop-prometheus-rules charts/drop-prometheus-rules.yaml \
  > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls
```

Fixes: #3618
jbertran pushed a commit that referenced this issue Dec 3, 2021
Configure k8s-sidecar in Grafana deployment:

* to search in `ALL` namespaces
* to place dashboards in folders according to
  `metalk8s.scality.com/grafana-folder-name` annotation
* to create Grafana folders from dashboard directory structure

Re-render chart to salt state using

```
./charts/render.py prometheus-operator \
  charts/kube-prometheus-stack.yaml \
  charts/kube-prometheus-stack/ \
  --namespace metalk8s-monitoring \
  --service-config grafana \
  metalk8s-grafana-config \
  metalk8s/addons/prometheus-operator/config/grafana.yaml \
  metalk8s-monitoring \
  --service-config prometheus \
  metalk8s-prometheus-config \
  metalk8s/addons/prometheus-operator/config/prometheus.yaml \
  metalk8s-monitoring \
  --service-config alertmanager \
  metalk8s-alertmanager-config \
  metalk8s/addons/prometheus-operator/config/alertmanager.yaml \
  metalk8s-monitoring \
  --service-config dex \
  metalk8s-dex-config \
  metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \
  --drop-prometheus-rules charts/drop-prometheus-rules.yaml \
  > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls
```

Fixes: #3618
jbertran pushed a commit that referenced this issue Dec 3, 2021
Configure k8s-sidecar in Grafana deployment:

* to search in `ALL` namespaces
* to place dashboards in folders according to
  `metalk8s.scality.com/grafana-folder-name` annotation
* to create Grafana folders from dashboard directory structure

Re-render chart to salt state using

```
./charts/render.py prometheus-operator \
  charts/kube-prometheus-stack.yaml \
  charts/kube-prometheus-stack/ \
  --namespace metalk8s-monitoring \
  --service-config grafana \
  metalk8s-grafana-config \
  metalk8s/addons/prometheus-operator/config/grafana.yaml \
  metalk8s-monitoring \
  --service-config prometheus \
  metalk8s-prometheus-config \
  metalk8s/addons/prometheus-operator/config/prometheus.yaml \
  metalk8s-monitoring \
  --service-config alertmanager \
  metalk8s-alertmanager-config \
  metalk8s/addons/prometheus-operator/config/alertmanager.yaml \
  metalk8s-monitoring \
  --service-config dex \
  metalk8s-dex-config \
  metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \
  --drop-prometheus-rules charts/drop-prometheus-rules.yaml \
  > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls
```

Fixes: #3618
jbertran pushed a commit that referenced this issue Dec 3, 2021
Configure k8s-sidecar in Grafana deployment:

* to search in `ALL` namespaces
* to place dashboards in folders according to
  `metalk8s.scality.com/grafana-folder-name` annotation
* to create Grafana folders from dashboard directory structure

Re-render chart to salt state using

```
./charts/render.py prometheus-operator \
  charts/kube-prometheus-stack.yaml \
  charts/kube-prometheus-stack/ \
  --namespace metalk8s-monitoring \
  --service-config grafana \
  metalk8s-grafana-config \
  metalk8s/addons/prometheus-operator/config/grafana.yaml \
  metalk8s-monitoring \
  --service-config prometheus \
  metalk8s-prometheus-config \
  metalk8s/addons/prometheus-operator/config/prometheus.yaml \
  metalk8s-monitoring \
  --service-config alertmanager \
  metalk8s-alertmanager-config \
  metalk8s/addons/prometheus-operator/config/alertmanager.yaml \
  metalk8s-monitoring \
  --service-config dex \
  metalk8s-dex-config \
  metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \
  --drop-prometheus-rules charts/drop-prometheus-rules.yaml \
  --patch 'PrometheusRule,metalk8s-monitoring,prometheus-operator-kubernetes-system-kubelet,spec:groups:0:rules:1:for,"5m"' \
  > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls
```

Fixes: #3618
jbertran pushed a commit that referenced this issue Dec 6, 2021
Configure k8s-sidecar in Grafana deployment:

* to search in `ALL` namespaces
* to place dashboards in folders according to
  `metalk8s.scality.com/grafana-folder-name` annotation
* to create Grafana folders from dashboard directory structure

Re-render chart to salt state using

```
./charts/render.py prometheus-operator \
  charts/kube-prometheus-stack.yaml \
  charts/kube-prometheus-stack/ \
  --namespace metalk8s-monitoring \
  --service-config grafana \
  metalk8s-grafana-config \
  metalk8s/addons/prometheus-operator/config/grafana.yaml \
  metalk8s-monitoring \
  --service-config prometheus \
  metalk8s-prometheus-config \
  metalk8s/addons/prometheus-operator/config/prometheus.yaml \
  metalk8s-monitoring \
  --service-config alertmanager \
  metalk8s-alertmanager-config \
  metalk8s/addons/prometheus-operator/config/alertmanager.yaml \
  metalk8s-monitoring \
  --service-config dex \
  metalk8s-dex-config \
  metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \
  --drop-prometheus-rules charts/drop-prometheus-rules.yaml \
  --patch 'PrometheusRule,metalk8s-monitoring,prometheus-operator-kubernetes-system-kubelet,spec:groups:0:rules:1:for,"5m"' \
  > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls
```

Fixes: #3618
jbertran pushed a commit that referenced this issue Dec 6, 2021
Configure k8s-sidecar in Grafana deployment:

* to search in `ALL` namespaces
* to place dashboards in folders according to
  `metalk8s.scality.com/grafana-folder-name` annotation
* to create Grafana folders from dashboard directory structure

Re-render chart to salt state using

```
./charts/render.py prometheus-operator \
  charts/kube-prometheus-stack.yaml \
  charts/kube-prometheus-stack/ \
  --namespace metalk8s-monitoring \
  --service-config grafana \
  metalk8s-grafana-config \
  metalk8s/addons/prometheus-operator/config/grafana.yaml \
  metalk8s-monitoring \
  --service-config prometheus \
  metalk8s-prometheus-config \
  metalk8s/addons/prometheus-operator/config/prometheus.yaml \
  metalk8s-monitoring \
  --service-config alertmanager \
  metalk8s-alertmanager-config \
  metalk8s/addons/prometheus-operator/config/alertmanager.yaml \
  metalk8s-monitoring \
  --service-config dex \
  metalk8s-dex-config \
  metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \
  --drop-prometheus-rules charts/drop-prometheus-rules.yaml \
  --patch 'PrometheusRule,metalk8s-monitoring,prometheus-operator-kubernetes-system-kubelet,spec:groups:0:rules:1:for,"5m"' \
  > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls
```

Fixes: #3618
jbertran pushed a commit that referenced this issue Dec 6, 2021
Configure k8s-sidecar in Grafana deployment:

* to search in `ALL` namespaces
* to place dashboards in folders according to
  `metalk8s.scality.com/grafana-folder-name` annotation
* to create Grafana folders from dashboard directory structure

Re-render chart to salt state using

```
./charts/render.py prometheus-operator \
  charts/kube-prometheus-stack.yaml \
  charts/kube-prometheus-stack/ \
  --namespace metalk8s-monitoring \
  --service-config grafana \
  metalk8s-grafana-config \
  metalk8s/addons/prometheus-operator/config/grafana.yaml \
  metalk8s-monitoring \
  --service-config prometheus \
  metalk8s-prometheus-config \
  metalk8s/addons/prometheus-operator/config/prometheus.yaml \
  metalk8s-monitoring \
  --service-config alertmanager \
  metalk8s-alertmanager-config \
  metalk8s/addons/prometheus-operator/config/alertmanager.yaml \
  metalk8s-monitoring \
  --service-config dex \
  metalk8s-dex-config \
  metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \
  --drop-prometheus-rules charts/drop-prometheus-rules.yaml \
  --patch 'PrometheusRule,metalk8s-monitoring,prometheus-operator-kubernetes-system-kubelet,spec:groups:0:rules:1:for,"5m"' \
  > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls
```

Fixes: #3618
jbertran pushed a commit that referenced this issue Dec 15, 2021
Configure k8s-sidecar in Grafana deployment:

* to search in `ALL` namespaces
* to place dashboards in folders according to
  `metalk8s.scality.com/grafana-folder-name` annotation
* to create Grafana folders from dashboard directory structure

Re-render chart to salt state using

```
./charts/render.py prometheus-operator \
  charts/kube-prometheus-stack.yaml \
  charts/kube-prometheus-stack/ \
  --namespace metalk8s-monitoring \
  --service-config grafana \
  metalk8s-grafana-config \
  metalk8s/addons/prometheus-operator/config/grafana.yaml \
  metalk8s-monitoring \
  --service-config prometheus \
  metalk8s-prometheus-config \
  metalk8s/addons/prometheus-operator/config/prometheus.yaml \
  metalk8s-monitoring \
  --service-config alertmanager \
  metalk8s-alertmanager-config \
  metalk8s/addons/prometheus-operator/config/alertmanager.yaml \
  metalk8s-monitoring \
  --service-config dex \
  metalk8s-dex-config \
  metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \
  --drop-prometheus-rules charts/drop-prometheus-rules.yaml \
  --patch 'PrometheusRule,metalk8s-monitoring,prometheus-operator-kubernetes-system-kubelet,spec:groups:0:rules:1:for,"5m"' \
  > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls
```

Fixes: #3618
jbertran pushed a commit that referenced this issue Dec 22, 2021
Configure k8s-sidecar in Grafana deployment:

* to search in `ALL` namespaces
* to place dashboards in folders according to
  `metalk8s.scality.com/grafana-folder-name` annotation
* to create Grafana folders from dashboard directory structure

Re-render chart to salt state using

```
./charts/render.py prometheus-operator \
  charts/kube-prometheus-stack.yaml \
  charts/kube-prometheus-stack/ \
  --namespace metalk8s-monitoring \
  --service-config grafana \
  metalk8s-grafana-config \
  metalk8s/addons/prometheus-operator/config/grafana.yaml \
  metalk8s-monitoring \
  --service-config prometheus \
  metalk8s-prometheus-config \
  metalk8s/addons/prometheus-operator/config/prometheus.yaml \
  metalk8s-monitoring \
  --service-config alertmanager \
  metalk8s-alertmanager-config \
  metalk8s/addons/prometheus-operator/config/alertmanager.yaml \
  metalk8s-monitoring \
  --service-config dex \
  metalk8s-dex-config \
  metalk8s/addons/dex/config/dex.yaml.j2 metalk8s-auth \
  --drop-prometheus-rules charts/drop-prometheus-rules.yaml \
  --patch 'PrometheusRule,metalk8s-monitoring,prometheus-operator-kubernetes-system-kubelet,spec:groups:0:rules:1:for,"5m"' \
  > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls
```

Fixes: #3618
@bert-e bert-e closed this as completed in 4926145 Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity:easy Something that requires less than a day to fix topic:deployment Bugs in or enhancements to deployment stages topic:salt Everything related to SaltStack in our product topic:solutions Anything related to external "Solutions" integration with the platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant