diff --git a/tools/packaging/kata-deploy/Dockerfile b/tools/packaging/kata-deploy/Dockerfile index 8bcd0f298a..1a30e3b84f 100644 --- a/tools/packaging/kata-deploy/Dockerfile +++ b/tools/packaging/kata-deploy/Dockerfile @@ -23,13 +23,17 @@ RUN \ ARCH=$(uname -m) && \ if [ "${ARCH}" = "x86_64" ]; then ARCH=amd64; fi && \ if [ "${ARCH}" = "aarch64" ]; then ARCH=arm64; fi && \ + DEBIAN_ARCH=${ARCH} && \ + if [ "${DEBIAN_ARCH}" = "ppc64le" ]; then DEBIAN_ARCH=ppc64el; fi && \ curl -fL --progress-bar -o /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl && \ chmod +x /usr/bin/kubectl && \ + curl -fL --progress-bar -o /usr/bin/jq https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-${DEBIAN_ARCH} && \ + chmod +x /usr/bin/jq && \ mkdir -p ${DESTINATION} && \ tar xvf ${WORKDIR}/${KATA_ARTIFACTS} -C ${DESTINATION} && \ rm -f ${WORKDIR}/${KATA_ARTIFACTS} && \ apk del curl && \ - apk --no-cache add jq py3-pip && \ + apk --no-cache add py3-pip && \ pip install --no-cache-dir yq==3.2.3 COPY scripts ${DESTINATION}/scripts diff --git a/tools/packaging/kata-deploy/scripts/kata-deploy.sh b/tools/packaging/kata-deploy/scripts/kata-deploy.sh index 208b3c96ce..7ff1b54d8a 100755 --- a/tools/packaging/kata-deploy/scripts/kata-deploy.sh +++ b/tools/packaging/kata-deploy/scripts/kata-deploy.sh @@ -94,8 +94,8 @@ function get_container_runtime() { else echo "k3s" fi - # Note: we assumed you used a conventional k0s setup and k0s will generate a systemd entry k0scontroller.service and k0sworker.service respectively - # and it is impossible to run this script without a kubelet, so this k0s controller must also have worker mode enabled + # Note: we assumed you used a conventional k0s setup and k0s will generate a systemd entry k0scontroller.service and k0sworker.service respectively + # and it is impossible to run this script without a kubelet, so this k0s controller must also have worker mode enabled elif host_systemctl is-active --quiet k0scontroller; then echo "k0s-controller" elif host_systemctl is-active --quiet k0sworker; then @@ -344,48 +344,24 @@ function configure_containerd_runtime() { local runtime="kata-${shim}" local configuration="configuration-${shim}" local pluginid=cri - + # if we are running k0s auto containerd.toml generation, the base template is by default version 2 # we can safely assume to reference the newer version of cri if grep -q "version = 2\>" $containerd_conf_file || [ "$1" == "k0s-worker" ] || [ "$1" == "k0s-controller" ]; then pluginid=\"io.containerd.grpc.v1.cri\" fi - local runtime_table="plugins.${pluginid}.containerd.runtimes.$runtime" - local runtime_type="io.containerd.$runtime.v2" - local options_table="$runtime_table.options" - local config_path="$(get_kata_containers_config_path "${shim}")/$configuration.toml" - if grep -q "\[$runtime_table\]" $containerd_conf_file; then - echo "Configuration exists for $runtime_table, overwriting" - sed -i "/\[$runtime_table\]/,+1s#runtime_type.*#runtime_type = \"${runtime_type}\"#" $containerd_conf_file - else - cat <