Skip to content

Commit

Permalink
Improve seldon-cli script
Browse files Browse the repository at this point in the history
  • Loading branch information
errordeveloper committed Sep 13, 2017
1 parent 26941b3 commit f07e44f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion kubernetes/bin/seldon-cli
Expand Up @@ -3,4 +3,16 @@
set -o nounset
set -o errexit

kubectl exec -it `kubectl get pods | grep seldon-control | grep Running | cut -d' ' -f1` -- seldon-cli "$@"
get_seldon_control_pod() {
kubectl get pod -l name=seldon-control "$@"
}


seldod_control_pod_ready() {
get_seldon_control_pod -o jsonpath='{range .items[*]}{range @.status.conditions[*]}{@.type}={@.status};{end}{end}' \
| grep -q 'Initialized=True;Ready=True;PodScheduled=True;'
}

until seldod_control_pod_ready ; do sleep 1 ; done

kubectl exec -it "$(get_seldon_control_pod -o jsonpath='{.items..metadata.name}')" -- seldon-cli "$@"

0 comments on commit f07e44f

Please sign in to comment.