Skip to content

Commit

Permalink
feat(operator): add namespace to grafanaDashboard (#168)
Browse files Browse the repository at this point in the history
* 馃殌 feat(operator): add namespace to grafanaDashboard
The `namespace` field has been added to the `grafanaDashboard` section of the `values.yaml` file. This allows the Grafana dashboard to be deployed to a specific namespace, which improves organization and separation of concerns.

Signed-off-by: MateSousa <matessousa@outlook.com>

* 馃殌 feat(grafana-k8sgpt-dashboard.yaml): add namespace field to metadata
The namespace field is added to the metadata section of the Grafana dashboard YAML file. This allows the dashboard to be created in the specified namespace, which improves organization and management of the dashboard.

Signed-off-by: MateSousa <matessousa@outlook.com>

* 馃殌 feat(grafana-k8sgpt-dashboard.yaml): add namespaceSelector to k8sgpt-overview dashboard
The namespaceSelector is added to the k8sgpt-overview dashboard to allow it to be displayed in the namespace specified in the values.yaml file. This improves the flexibility of the dashboard as it can now be displayed in any namespace specified in the values.yaml file.

Signed-off-by: MateSousa <matessousa@outlook.com>

* 馃敡 chore(operator): remove unnecessary namespace field from grafanaDashboard in values.yaml
The namespace field in the grafanaDashboard section of the values.yaml file is not needed as it is commented out and has no value. Removing it improves the readability of the file.

Signed-off-by: MateSousa <matessousa@outlook.com>

* 馃敡 chore(grafana-k8sgpt-dashboard.yaml): simplify namespace configuration
The namespace configuration for the Grafana dashboard has been simplified by removing the unnecessary namespaceSelector block. Instead, the namespace is directly set using the .Values.grafanaDashboard.namespace value, falling back to the default namespace if not provided. This change improves readability and reduces complexity in the configuration file.

Signed-off-by: MateSousa <matessousa@outlook.com>

---------

Signed-off-by: MateSousa <matessousa@outlook.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
  • Loading branch information
MateSousa and AlexsJones committed Jun 29, 2023
1 parent 6b383e6 commit 9c31c92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions chart/operator/templates/grafana-k8sgpt-dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ metadata:
app.kubernetes.io/part-of: k8sgpt-operator
{{- include "chart.labels" . | nindent 4 }}
name: k8sgpt-overview
namespace: {{ .Values.grafanaDashboard.namespace | default (include "k8sgpt-operator.namespace" .) }}
data:
k8sgpt-overview.json: |
{{ .Files.Get "dashboards/k8sgpt-overview.json" | indent 4}}
Expand Down
2 changes: 2 additions & 0 deletions chart/operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ serviceMonitor:
# namespace: ""
grafanaDashboard:
enabled: false
# The namespace where Grafana expects to find the dashboard
# namespace: ""
folder:
annotation: grafana_folder
name: ai
Expand Down

0 comments on commit 9c31c92

Please sign in to comment.