kata-deploy: Get back to the original kata-deploy.sh

Instead of hacking the original `kata-deploy.sh` script, let's add a
totally new folder where we'll be adding content that's CC related.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2022-07-07 10:57:11 +02:00
parent ec20089c1b
commit 441399df1f

16
tools/packaging/kata-deploy/scripts/kata-deploy.sh Executable file → Normal file
View File

@ -18,7 +18,6 @@ shims=(
"qemu" "qemu"
"clh" "clh"
) )
[ "${CONFIGURE_CC:-}" == "yes" ] && shims+=("cc")
default_shim="qemu" default_shim="qemu"
@ -185,8 +184,7 @@ function configure_containerd_runtime() {
else else
cat <<EOF | tee -a "$containerd_conf_file" cat <<EOF | tee -a "$containerd_conf_file"
[$runtime_table] [$runtime_table]
runtime_type = "${runtime_type}" \ runtime_type = "${runtime_type}"
$([ "$runtime" == "kata-cc" ] && printf '\n cri_handler = "cc"')
privileged_without_host_devices = true privileged_without_host_devices = true
pod_annotations = ["io.katacontainers.*"] pod_annotations = ["io.katacontainers.*"]
EOF EOF
@ -222,17 +220,6 @@ function configure_containerd() {
done done
} }
function configure_kata() {
if [ "${CONFIGURE_CC:-}" == "yes" ]; then
sed -E \
-e 's#^image = .+#initrd = "/opt/kata/share/kata-containers/kata-containers-initrd.img"#' \
-e 's#^(kernel_params = .+)"#\1 agent.config_file=/etc/kata-containers/agent.toml"#' \
-e 's#.*service_offload = .+#service_offload = true#' \
"/opt/kata/share/defaults/kata-containers/configuration-qemu.toml" > \
"/opt/kata/share/defaults/kata-containers/configuration-cc.toml"
fi
}
function remove_artifacts() { function remove_artifacts() {
echo "deleting kata artifacts" echo "deleting kata artifacts"
rm -rf /opt/kata/ rm -rf /opt/kata/
@ -313,7 +300,6 @@ function main() {
install) install)
install_artifacts install_artifacts
configure_cri_runtime "$runtime" configure_cri_runtime "$runtime"
configure_kata
kubectl label node "$NODE_NAME" --overwrite katacontainers.io/kata-runtime=true kubectl label node "$NODE_NAME" --overwrite katacontainers.io/kata-runtime=true
;; ;;
cleanup) cleanup)