-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add support for loading dashboards in orgs #173
base: main
Are you sure you want to change the base?
Conversation
beae65d
to
9dc12d5
Compare
b3a2637
to
3ba75a3
Compare
809a0c1
to
61ce280
Compare
61ce280
to
135ff9d
Compare
a0bc613
to
b7bfbdc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job, sorry for all the remarks 🙈
Thanks! Then I'll keep going on with the remaining remarks. |
Did a round of review on the reviews, closed a couple and commented where needed |
49ea5e2
to
618382d
Compare
000d49e
to
3bf3865
Compare
3bf3865
to
22bdcb8
Compare
Added dashboards deletion and a bit of rework:
|
@@ -7,6 +7,18 @@ This operator is in charge of handling the setup and configuration of the Giant | |||
It reconciles `cluster.cluster.x-k8s.io` objects and makes sure each `Cluster` is provided with: | |||
- TODO(atlas) update this section | |||
|
|||
## Features | |||
|
|||
### Grafan dashboards provisioning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Grafan dashboards provisioning | |
### Grafana dashboards provisioning |
|
||
It will look for kubernetes `ConfigMaps` and use them as dashboards if they meet these criteria: | ||
- a label `app.giantswarm.io/kind: "dashboard"` | ||
- an annotation or label `giantswarm.io/organization` set to the organization the dasboard should be loaded in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we use this label for giant swarm organizations so we probably should not use this but smth like observability.giantswarm.io/organization instead. WDYT?
Cert: conf.Environment.GrafanaTLSCertFile, | ||
Key: conf.Environment.GrafanaTLSKeyFile, | ||
} | ||
grafanaAPI, err := grafanaclient.GenerateGrafanaClient(conf.GrafanaURL, grafanaAdminCredentials, grafanaTLSConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have the same code here
// Get grafana admin-password and admin-user |
} | ||
|
||
func getDashboardUID(dashboard map[string]interface{}) (string, error) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick but I don't think we need those blank lines :)
} | ||
|
||
// Create or update dashboard | ||
_, err = r.GrafanaAPI.Dashboards.PostDashboard(&models.SaveDashboardCommand{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we move that to the grafana pkg and not the controller?
What this PR does / why we need it
Towards giantswarm/roadmap#3696
Support loading dashboards in organizations.
Extract from README telling about this feature:
Checklist