diff --git a/ci/openshift-ci/cluster/install_kata.sh b/ci/openshift-ci/cluster/install_kata.sh index 314fd0d1bb..b7cfa2507a 100755 --- a/ci/openshift-ci/cluster/install_kata.sh +++ b/ci/openshift-ci/cluster/install_kata.sh @@ -43,19 +43,18 @@ WORKAROUND_9206_CRIO=${WORKAROUND_9206_CRIO:-no} # Leverage kata-deploy to install Kata Containers in the cluster. # apply_kata_deploy() { - local deploy_file="tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" - pushd "${katacontainers_repo_dir}" || die - sed -ri "s#(\s+image:) .*#\1 ${KATA_DEPLOY_IMAGE}#" "${deploy_file}" + if ! command -v helm &>/dev/null; then + echo "Helm not installed, installing..." + curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash + fi - info "Applying kata-deploy" - oc apply -f tools/packaging/kata-deploy/kata-rbac/base/kata-rbac.yaml oc label --overwrite ns kube-system pod-security.kubernetes.io/enforce=privileged pod-security.kubernetes.io/warn=baseline pod-security.kubernetes.io/audit=baseline - oc apply -f "${deploy_file}" - oc -n kube-system wait --timeout=10m --for=condition=Ready -l name=kata-deploy pod + local version chart + version=$(curl -sSL https://api.github.com/repos/kata-containers/kata-containers/releases/latest | jq .tag_name | tr -d '"') + chart="oci://ghcr.io/kata-containers/kata-deploy-charts/kata-deploy" - info "Adding the kata runtime classes" - oc apply -f tools/packaging/kata-deploy/runtimeclasses/kata-runtimeClasses.yaml - popd || die + echo "Installing kata using helm ${chart} ${version}" + helm install kata-deploy --wait --namespace kube-system --set "image.reference=${KATA_DEPLOY_IMAGE%%:*},image.tag=${KATA_DEPLOY_IMAGE##*:}" "${chart}" --version "${version}" }