From 1802ece0908d72888850a3c577c2e0d779d5d44f Mon Sep 17 00:00:00 2001 From: Hugo Amalric Date: Mon, 2 May 2022 03:12:53 +0200 Subject: [PATCH] kaps: add cpu and memory resources in container config file example Signed-off-by: Hugo Amalric kaps: delete unused file --- container/src/cgroups.rs | 19 ------------------- hack/fixtures/config.json | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 20 deletions(-) delete mode 100644 container/src/cgroups.rs diff --git a/container/src/cgroups.rs b/container/src/cgroups.rs deleted file mode 100644 index 542dcdd..0000000 --- a/container/src/cgroups.rs +++ /dev/null @@ -1,19 +0,0 @@ - -/*pub struct Cgroups { - cgroup: Cgroup, - resources: Resources, -} - -impl Cgroups { - pub fn new() -> Self { - - } - - pub fn set_cpus(&mut self, cpus: u64) { - self.resources - .cpu - .attrs - .insert("cgroup.procs".to_string(), cpus.to_string()); - self.cgroup.apply(&self.resources).unwrap(); - } -}*/ diff --git a/hack/fixtures/config.json b/hack/fixtures/config.json index 925b845..d137d24 100644 --- a/hack/fixtures/config.json +++ b/hack/fixtures/config.json @@ -181,6 +181,23 @@ "/proc/irq", "/proc/sys", "/proc/sysrq-trigger" - ] + ], + "resources": { + "cpu": { + "shares": 1024, + "quota": 1000000, + "period": 500000, + "realtimeRuntime": 950000, + "realtimePeriod": 1000000 + }, + "memory": { + "limit": 536870912, + "reservation": 536870912, + "kernel": -1, + "kernelTCP": -1, + "swappiness": 0, + "disableOOMKiller": false + } + } } } \ No newline at end of file