rpt
kubectl delete -f "${DIR}/../tools/kserve/cert-manager-test.yaml"
-IS_KSERVE_INSTALLED=$(kubectl get crd inferenceservices.serving.kserve.io 2>&1 | grep "Error from server (NotFound)" | wc -l)
-if [ "$IS_KSERVE_INSTALLED" -eq 1 ]; then
+########## Install Kserve & Kserve Runtimes ##########
+IS_KSERVE_INSTALLED=$(kubectl get crd inferenceservices.serving.kserve.io --ignore-not-found)
+if [ -z "$IS_KSERVE_INSTALLED" ]; then
kubectl apply -f https://raw.githubusercontent.com/kserve/kserve/master/install/${KSERVE_VERSION}/kserve.yaml
- KSERVE_STATEFULSETS="kserve-controller-manager"
- for KSERVE_STATEFULSET in $KSERVE_STATEFULSETS; do
- wait_for_statefulset $KSERVE_STATEFULSET "kserve-system"
+ KSERVE_DEPLOYMENTS="kserve-controller-manager"
+ for KSERVE_DEPLOYMENT in $KSERVE_DEPLOYMENTS; do
+ wait_for_deployment $KSERVE_DEPLOYMENT "kserve"
done
+
+ # Wait for KServe Webhook to be ready by checking kserve-controller-manager logs
+ echo "Waiting for KServe Webhook to be ready..."
+ kubectl wait --for=condition=available --timeout=120s deployment/kserve-controller-manager -n kserve
else
- echo "skip kserve install"
+ echo "KServe already exist, skipping installation"
fi
+
+RUNTIMES_INSTALLED=$(kubectl get clusterservingruntimes.serving.kserve.io --ignore-not-found)
+if [ -z "$RUNTIMES_INSTALLED" ]; then
+ echo "Installing KServe runtimes"
+ kubectl apply -f https://raw.githubusercontent.com/kserve/kserve/master/install/${KSERVE_VERSION}/kserve-runtimes.yaml
+else
+ echo "KServe runtimes already exist, skipping installation"
+fi
\ No newline at end of file
echo
}
-########## Uninstall Kserve ##########
+########## Uninstall Kserve & Kserve Runtimes ##########
+kubectl delete --timeout=10s -f https://raw.githubusercontent.com/kserve/kserve/master/install/${KSERVE_VERSION}/kserve-runtimes.yaml
kubectl delete --timeout=10s -f https://raw.githubusercontent.com/kserve/kserve/master/install/${KSERVE_VERSION}/kserve.yaml
-KSERVE_STATEFULSETS="kserve-controller-manager"
-for KSERVE_STATEFULSET in $KSERVE_STATEFULSETS; do
- wait_for_pods_terminate $KSERVE_STATEFULSET "kserve-system"
+KSERVE_DEPLOYMENTS="kserve-controller-manager"
+for KSERVE_DEPLOYMENT in $KSERVE_DEPLOYMENTS; do
+ wait_for_pods_terminate $KSERVE_DEPLOYMENT "kserve"
done
########## Uninstall Cert Manager ##########
done
set +e
+# TODO: Review and resolve errors from deleting overlapping resources in serving-crds.yaml and serving-core.yaml
+# These errors occur due to overlapping resource definitions but are not expected to affect the installation or functionality
kubectl delete -f https://github.com/knative/serving/releases/download/${KNATIVE_VERSION}/serving-core.yaml
kubectl delete -f https://github.com/knative/serving/releases/download/${KNATIVE_VERSION}/serving-crds.yaml
set -e