feat: record last state transition times #2053
Merged
+157
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Problem Statement
My ML platform team runs the kuberay ray-operator. We want to measure the time
it takes for RayCluster's to transition from their initial "unhealthy" state to
some other state. This metric is important for us because our users want their
RayClusters to start in a timely manner. It seems like neither the ray-operator
nor RayClusters provide this info currently.
Design
Add a new
.status.stateTransitionTimes
field to theRayCluster
customresource. This field is a
map[ClusterState]*metav1.Time
that indicates thetime of the last state transition for each state. This field is updated
whenever the
.status.state
changes.manual testing steps:
make manifests generate
kubectl config use-context CONTEXT
make docker-build docker-push deploy IMG=europe-west4-docker.pkg.dev/spotify-workbench/images/operator:$USER-$(git rev-parse --short=7 HEAD)
kubectl --context CONTEXT apply -f /path/to/raycluster.yaml
.status.stateTransitionTimes
in the output ofkubectl --context CONTEXT -n NAMESPACE get rayclusters NAME -o yaml
Related issue number
Checks