-
Notifications
You must be signed in to change notification settings - Fork 500
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
UCP: support monitor mount external configuration #2294
Conversation
Thanks for your contribution. If your PR get merged, you will be rewarded 100 points. |
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.
The whole structures seems LGTM. What about prometheus start args?
@Yisaer I think we can put the command configuration in the external configMap too.
What do you think? |
This LGTM. I think we could use a more easy understanding name for user instead of command-config. |
…alConfigMaps � Conflicts: � docs/api-references/docs.md
|
||
// Config is the the desired state of Prometheus Configuration | ||
type Configuration struct { | ||
ExternalConfigMap string `json:"externalConfigMap,omitempty"` |
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.
What about use ConfigMapRef
here?
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.
ok
When this pr is merged, please also update the monitor document to show how to use this feature for community. |
@mikechengwei It seems the document check failed in github action test. Please remove the Recently we have update the document tool. |
@@ -79,6 +79,13 @@ type PrometheusSpec struct { | |||
Service ServiceSpec `json:"service,omitempty"` | |||
// +optional | |||
ReserveDays int `json:"reserveDays,omitempty"` |
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.
@Yisaer Not related to this pr, but I am curious about this field. So we only support retention with unit d
? Not support other time like h
?
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 you are right. Maybe we would create a new proper property for this in the future.
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 have support custom command ,so I think reserveDays
or other time field is not necessary.
"folder": "", | ||
"name": "0", | ||
"options": { | ||
"path": "/grafana-dashboard-definitions/tidb" |
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.
How to support additional dashboards for tidb monitor in this pr? We should support this as well
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.
It seems we could also export grafana config in the configmap.
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.
If we support custom dashboards by configMap , we will need to append extra configMap to volumes and VolumeMounts . reference
tidb-operator/pkg/monitor/monitor/util.go
Line 312 in 7ccb528
VolumeMounts: []core.VolumeMount{ |
And I think users can dynamically add dashboard in Grafana.So, this feature is not important.
} | ||
] | ||
} | ||
start-command: |- |
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.
IMO the start-command
is neither flexible nor scalable. A possible way is to do something like Prometheus-operator https://github.com/coreos/prometheus-operator/blob/87a7bea9f028c62396bef665f2887df326fa97f7/pkg/apis/monitoring/v1/types.go#L244. We can have a containers
field in the tidb monitor spec. Then in the real generating phase, we do a patch to containers like here.
This approach is more recommended since it can help specify something other than the start commands for Prometheus, like env vars, volumes, etc
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 have only support command field patch in container, other field patch I think is not important now.
Any updates @mikechengwei |
Sorry,I am busy recently. Now I will continue . |
/merge @Yisaer can you help me merge this pr? |
@mikechengwei Currently we are releasing the new version. so please update the base branch tonight or tomorrow. or you can enable the maintainer edit so that I can update the base branch myself when newly-releases finished. |
I don't find button which enable the maintainer edit . I think be able to enable it only when creating pr . So you can tell me I will update branch myself. @Yisaer |
/merge |
/run-all-tests |
@mikechengwei merge failed. |
This e2e test error may not be caused by my code. |
/merge |
Your auto merge job has been accepted, waiting for:
|
@mikechengwei could you update the base branch? or you can enable maintainers edit like following. |
@Yisaer I have update base branch |
/merge |
/run-all-tests |
I guess it's the limitation of Github. This feature requires the PR is from a user-owned repo, but your PR is from a team org. |
Maybe we can merge the PR onto the base branch in CI and don't require the PR branch to be up to date before merging. (ref: #396) Because all PRs are merged by sre-bot sequentially, no broken state can happen on the master. |
I agree, frequently up to date is a trouble |
Congratulation! You have awarded a badge for usability challenge program! Please fill the form to get your reward! http://tidbcommunity.mikecrm.com/QMCv4QL |
cherry pick to release-1.1 in PR #2594 |
What problem does this PR solve?
UCP: #2180
Close: #2180
What is changed and how does it work?
support monitor mount external config map.
user can create an external configMap contains prometheus-config and dashboard-config which replace default monitor config.
Check List
Tests
Code changes
Side effects
None