Skip to content
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

Operator should emite lifecycle events #127

Closed
ruivieira opened this issue Oct 17, 2023 · 0 comments · Fixed by #139
Closed

Operator should emite lifecycle events #127

ruivieira opened this issue Oct 17, 2023 · 0 comments · Fixed by #139
Assignees
Labels
kind/enhancement New feature or request rhods-2.5

Comments

@ruivieira
Copy link
Member

ruivieira commented Oct 17, 2023

Add Kubernetes events to the TrustyAIService:

PVCCreated
InferenceServiceConfigured
ServiceMonitorCreated

The Ready condition has also been refactored, in order to be set only at the end of a successful (for the Readiness criteria) reconcilition.

By moving the Readiness check as the last step of the reconciliation, this PR also addresses #76.

Validation

Assuming

  • A namespace test
  • A TrustyAIService deployed in test

Running this script

#!/bin/bash

cr_name="trustyai-service"
cr_type="TrustyAIService"
NAMESPACE="test"

# Events
declare -a events=("PVCCreated" "InferenceServiceConfigured" "ServiceMonitorCreated")

for event in "${events[@]}"; do
  event_count=$(kubectl get events -n ${NAMESPACE} --field-selector involvedObject.name="$cr_name",involvedObject.kind="$cr_type" | grep "$event" | wc -l | xargs)
  
  if [ "$event_count" -gt 0 ]; then
      echo "$event: present, count: $event_count"
  else
      echo "$event: MISSING"
  fi
done

Should return whether the events were emited. The result will depend on the deployment status.
e.g. if the TrustyAIService was successfully deployed, but there's still no InferenceService, the result should be:

PVCCreated: present, count: 1
InferenceServiceConfigured: MISSING
ServiceMonitorCreated: present, count: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request rhods-2.5
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant