Skip to content

Instantly share code, notes, and snippets.

@nyrahul
Last active August 4, 2024 04:46
Show Gist options
  • Save nyrahul/b099e8df77ac9d83eec5bad21b27f1cf to your computer and use it in GitHub Desktop.
Save nyrahul/b099e8df77ac9d83eec5bad21b27f1cf to your computer and use it in GitHub Desktop.
Check cluster kueue job status
# Show all workloads/jobs
kubectl get workload -A -o json | jq '.items[] | "\(.metadata.namespace) \(.metadata.name) \(.status.conditions[-1].type)"'
# Show Admitted workloads/jobs
kubectl get workload -A -o json | jq -c '.items[] | select(.status.conditions[-1].type == "Admitted") | [.metadata.namespace,.metadata.name]'
# Get all jobs across all namespaces in Pending state ... AccuKnox executes the jobs in init containers
kubectl get pods -A --selector job-type=accuknox-jobs --field-selector=status.phase==Pending
# list k8s-jobs queue
kubectl get jobs -A -l "kueue.x-k8s.io/queue-name=jobs-queue"
kubectl get jobs -A --sort-by .status.startTime -l "kueue.x-k8s.io/queue-name=jobs-queue"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment