effective-creation-timeout & new metrics for use by dependency-watchdog#1104
effective-creation-timeout & new metrics for use by dependency-watchdog#1104elankath wants to merge 17 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Test Log-1Testing done with virtual provider. Real provider test logs will be attached to PR's raised for the specific providers. Effective Machine Creation Timeout1. Check MCD2. Add effective-creation-timeout annotation to MCD2. Check annotation propagated to MachineSet2. Increase replicas & check annotation propagated to new Machine object3. Case: Creation Success MetricsMachines should be created and new Node joins the cluster. From local prometheus http://127.0.0.1:9090/prometheus 4. Case: Machine Join Failure
Machine object From Prometheus |
|
/assign |
Co-authored-by: Aaron Francis Fernandes <79958509+aaronfern@users.noreply.github.com>
Co-authored-by: Aaron Francis Fernandes <79958509+aaronfern@users.noreply.github.com>
aaronfern
left a comment
There was a problem hiding this comment.
Just a few minor commits from me. In general lgtm once the comments are resolved.
| // AnnotationKeyMachineEffectiveCreationTimeout is the annotation key set on the MachineDeployment that indicates | ||
| // the effective creation timeout for all Machine's belonging to this MachineDeployment. If specified, the value for this | ||
| // annotation takes precedence over the MachineDeployment.Spec.Template.Spec.MachineCreationTimeout. | ||
| AnnotationKeyMachineEffectiveCreationTimeout = "node.machine.sapcloud.io/effective-creation-timeout" |
There was a problem hiding this comment.
Consider writing an faq for this value.
You could title it such as "How to override a MachineDeployment.Spec.Template.Spec.MachineCreationTimeout?" and over there you can explain any limitations too.
Could be helpful for ops.
| // MachineNumFailedJoin is the Prometheus counter metric rpresenting the number of machines that | ||
| // failed to join the cluster for a MachineDeployment. |
|
|
||
| // GetEffectiveMachineCreationTimeoutFromRuntimeObject gets the value of the annotation [v1alpha1.AnnotationKeyMachineEffectiveCreationTimeout] | ||
| // as a [metav1.Duration] if present. | ||
| func GetEffectiveMachineCreationTimeoutFromRuntimeObject(object runtime.Object) (*metav1.Duration, error) { |
There was a problem hiding this comment.
Would it be possible to add some unit tests for this function?
|
|
||
| // GetEffectiveMachineCreationTimeoutFromRuntimeObject gets the value of the annotation [v1alpha1.AnnotationKeyMachineEffectiveCreationTimeout] | ||
| // as a [metav1.Duration] if present. | ||
| func GetEffectiveMachineCreationTimeoutFromRuntimeObject(object runtime.Object) (*metav1.Duration, error) { |
There was a problem hiding this comment.
Can this be renamed to GetEffectiveMachineCreationTimeout instead i.e. removing the FromRuntimeObject suffix; since that's evident from the function signature.
Co-authored-by: Aaron Francis Fernandes <79958509+aaronfern@users.noreply.github.com>
Co-authored-by: Aaron Francis Fernandes <79958509+aaronfern@users.noreply.github.com>
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #1103
Fixes #1098
Special notes for your reviewer:
Release note: