mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-22 01:43:04 +00:00
kata-deploy: Configure Kata & containerd for CCv0
Introduce kata-cc runtime class, shim & config - Specify cri_handler in containerd config - Specify to use initrd - Specify kernel_params according to guest config - Specify service_offload Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
This commit is contained in:
parent
a570b6a0a6
commit
f5e6961dcb
@ -28,6 +28,8 @@ spec:
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: CONFIGURE_CC
|
||||
value: "yes"
|
||||
securityContext:
|
||||
privileged: false
|
||||
volumeMounts:
|
||||
|
@ -18,6 +18,7 @@ shims=(
|
||||
"qemu"
|
||||
"clh"
|
||||
)
|
||||
[ "${CONFIGURE_CC:-}" == "yes" ] && shims+=("cc")
|
||||
|
||||
# If we fail for any reason a message will be displayed
|
||||
die() {
|
||||
@ -171,7 +172,8 @@ function configure_containerd_runtime() {
|
||||
else
|
||||
cat <<EOT | tee -a "$containerd_conf_file"
|
||||
[$runtime_table]
|
||||
runtime_type = "${runtime_type}"
|
||||
runtime_type = "${runtime_type}" \
|
||||
$([ "$runtime" == "kata-cc" ] && printf '\n cri_handler = "cc"')
|
||||
privileged_without_host_devices = true
|
||||
pod_annotations = ["io.katacontainers.*"]
|
||||
EOT
|
||||
@ -207,6 +209,17 @@ function configure_containerd() {
|
||||
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-config.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() {
|
||||
echo "deleting kata artifacts"
|
||||
rm -rf /opt/kata/
|
||||
@ -287,6 +300,7 @@ function main() {
|
||||
|
||||
install_artifacts
|
||||
configure_cri_runtime "$runtime"
|
||||
configure_kata
|
||||
kubectl label node "$NODE_NAME" --overwrite katacontainers.io/kata-runtime=true
|
||||
;;
|
||||
cleanup)
|
||||
|
Loading…
Reference in New Issue
Block a user