diff --git a/tools/packaging/kata-deploy/helm-chart/kata-deploy/templates/kata-deploy.yaml b/tools/packaging/kata-deploy/helm-chart/kata-deploy/templates/kata-deploy.yaml index 0d3565da38..22b5e13d79 100644 --- a/tools/packaging/kata-deploy/helm-chart/kata-deploy/templates/kata-deploy.yaml +++ b/tools/packaging/kata-deploy/helm-chart/kata-deploy/templates/kata-deploy.yaml @@ -65,8 +65,6 @@ spec: mountPath: /etc/containerd/ - name: kata-artifacts mountPath: /opt/kata/ - - name: local-bin - mountPath: /usr/local/bin/ - name: host mountPath: /host/ volumes: @@ -80,9 +78,6 @@ spec: hostPath: path: /opt/kata/ type: DirectoryOrCreate - - name: local-bin - hostPath: - path: /usr/local/bin/ - name: host hostPath: path: / diff --git a/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml b/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml index 3a154519fb..9bf051fa79 100644 --- a/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml +++ b/tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml @@ -59,8 +59,6 @@ spec: mountPath: /etc/containerd/ - name: kata-artifacts mountPath: /opt/kata/ - - name: local-bin - mountPath: /usr/local/bin/ - name: host mountPath: /host/ volumes: @@ -74,9 +72,6 @@ spec: hostPath: path: /opt/kata/ type: DirectoryOrCreate - - name: local-bin - hostPath: - path: /usr/local/bin/ - name: host hostPath: path: / diff --git a/tools/packaging/kata-deploy/scripts/kata-deploy.sh b/tools/packaging/kata-deploy/scripts/kata-deploy.sh index c65bfc8905..4da9f1375b 100755 --- a/tools/packaging/kata-deploy/scripts/kata-deploy.sh +++ b/tools/packaging/kata-deploy/scripts/kata-deploy.sh @@ -323,8 +323,6 @@ function wait_till_node_is_ready() { } function configure_cri_runtime() { - configure_different_shims_base - case $1 in crio) configure_crio @@ -344,87 +342,6 @@ function configure_cri_runtime() { wait_till_node_is_ready } -function backup_shim() { - local shim_file="$1" - local shim_backup="${shim_file}.bak" - - if [ -f "${shim_file}" ]; then - echo "warning: ${shim_file} already exists" >&2 - if [ ! -f "${shim_backup}" ]; then - mv "${shim_file}" "${shim_backup}" - else - rm -f "${shim_file}" - fi - fi -} - -function configure_different_shims_base() { - # Currently containerd has an assumption on the location of the shimv2 implementation - # This forces kata-deploy to create files in a well-defined location that's part of - # the PATH, pointing to the containerd-shim-kata-v2 binary in /opt/kata/bin - # Issues: - # https://github.com/containerd/containerd/issues/3073 - # https://github.com/containerd/containerd/issues/5006 - - local default_shim_file="/usr/local/bin/containerd-shim-kata-v2" - - mkdir -p /usr/local/bin - - for shim in "${shims[@]}"; do - local shim_binary="containerd-shim-kata-${shim}-v2" - local shim_file="/usr/local/bin/${shim_binary}" - - backup_shim "${shim_file}" - - # Map the runtime shim name to the appropriate - # containerd-shim-kata-v2 binary - case "$shim" in - cloud-hypervisor | dragonball | qemu-runtime-rs) - ln -sf /opt/kata/runtime-rs/bin/containerd-shim-kata-v2 "${shim_file}" ;; - *) - ln -sf /opt/kata/bin/containerd-shim-kata-v2 "${shim_file}" ;; - esac - - chmod +x "$shim_file" - - if [ "${shim}" == "${default_shim}" ]; then - backup_shim "${default_shim_file}" - - echo "Creating the default shim-v2 binary" - ln -sf "${shim_file}" "${default_shim_file}" - fi - done -} - -function restore_shim() { - local shim_file="$1" - local shim_backup="${shim_file}.bak" - - if [ -f "${shim_backup}" ]; then - mv "$shim_backup" "$shim_file" - fi -} - -function cleanup_different_shims_base() { - local default_shim_file="/usr/local/bin/containerd-shim-kata-v2" - - for shim in "${shims[@]}"; do - local shim_binary="containerd-shim-kata-${shim}-v2" - local shim_file="/usr/local/bin/${shim_binary}" - - rm -f "${shim_file}" - - restore_shim "${shim_file}" - done - - rm -f "${default_shim_file}" - restore_shim "${default_shim_file}" - - if [[ "${CREATE_RUNTIMECLASSES}" == "true" ]]; then - delete_runtimeclasses - fi -} - function configure_crio_runtime() { local shim="${1}" local runtime="kata-${shim}" @@ -564,11 +481,13 @@ function configure_containerd() { function remove_artifacts() { echo "deleting kata artifacts" rm -rf /opt/kata/* + + if [[ "${CREATE_RUNTIMECLASSES}" == "true" ]]; then + delete_runtimeclasses + fi } function cleanup_cri_runtime() { - cleanup_different_shims_base - case $1 in crio) cleanup_crio