diff --git a/src/libs/kata-types/src/config/runtime.rs b/src/libs/kata-types/src/config/runtime.rs index bfbde60d0d..1d73643686 100644 --- a/src/libs/kata-types/src/config/runtime.rs +++ b/src/libs/kata-types/src/config/runtime.rs @@ -103,8 +103,9 @@ pub struct Runtime { pub enable_pprof: bool, /// If enabled, static resource management will calculate the vcpu and memory for the sandbox/container + /// And pod configured this will not be able to further update its CPU/Memory resource #[serde(default)] - pub static_resource_mgmt: bool, + pub static_sandbox_resource_mgmt: bool, /// Determines whether container seccomp profiles are passed to the virtual machine and /// applied by the kata agent. If set to true, seccomp is not applied within the guest. diff --git a/src/runtime-rs/config/configuration-dragonball.toml.in b/src/runtime-rs/config/configuration-dragonball.toml.in index 8131d0c68e..8b963e12d8 100644 --- a/src/runtime-rs/config/configuration-dragonball.toml.in +++ b/src/runtime-rs/config/configuration-dragonball.toml.in @@ -293,5 +293,12 @@ experimental=@DEFAULTEXPFEATURES@ # (default: false) # enable_pprof = true -static_resource_mgmt=@DEFSTATICRESOURCEMGMT_DB@ +# If enabled, the runtime will attempt to determine appropriate sandbox size (memory, CPU) before booting the virtual machine. In +# this case, the runtime will not dynamically update the amount of memory and CPU in the virtual machine. This is generally helpful +# when a hardware architecture or hypervisor solutions is utilized which does not support CPU and/or memory hotplug. +# Compatibility for determining appropriate sandbox (VM) size: +# - When running with pods, sandbox sizing information will only be available if using Kubernetes >= 1.23 and containerd >= 1.6. CRI-O +# does not yet support sandbox sizing annotations. +# - When running single containers using a tool like ctr, container sizing information will be available. +static_sandbox_resource_mgmt=@DEFSTATICRESOURCEMGMT_DB@ diff --git a/src/runtime-rs/crates/runtimes/src/manager.rs b/src/runtime-rs/crates/runtimes/src/manager.rs index 1fba4e5221..c8e5f0f109 100644 --- a/src/runtime-rs/crates/runtimes/src/manager.rs +++ b/src/runtime-rs/crates/runtimes/src/manager.rs @@ -374,7 +374,7 @@ fn load_config(spec: &oci::Spec, option: &Option>) -> Result // 2. If this is not a sandbox infrastructure container, but instead a standalone single container (analogous to "docker run..."), // then the container spec itself will contain appropriate sizing information for the entire sandbox (since it is // a single container. - if toml_config.runtime.static_resource_mgmt { + if toml_config.runtime.static_sandbox_resource_mgmt { info!(sl!(), "static resource management enabled"); let static_resource_manager = StaticResourceManager::new(spec) .context("failed to construct static resource manager")?; @@ -382,6 +382,7 @@ fn load_config(spec: &oci::Spec, option: &Option>) -> Result .setup_config(&mut toml_config) .context("failed to setup static resource mgmt config")?; } + info!(sl!(), "get config content {:?}", &toml_config); Ok(toml_config) }