@@ -59,6 +59,19 @@ var generateFlags = []cli.Flag{
5959 cli.StringFlag {Name : "template" , Usage : "base template to use for creating the configuration" },
6060 cli.StringSliceFlag {Name : "label" , Usage : "add annotations to the configuration e.g. key=value" },
6161 cli.IntFlag {Name : "oom-score-adj" , Usage : "oom_score_adj for the container" },
62+ cli.Uint64Flag {Name : "linux-cpu-shares" , Usage : "the relative share of CPU time available to the tasks in a cgroup" },
63+ cli.Uint64Flag {Name : "linux-cpu-period" , Usage : "the CPU period to be used for hardcapping (in usecs)" },
64+ cli.Uint64Flag {Name : "linux-cpu-quota" , Usage : "the allowed CPU time in a given period (in usecs)" },
65+ cli.Uint64Flag {Name : "linux-realtime-runtime" , Usage : "the time realtime scheduling may use (in usecs)" },
66+ cli.Uint64Flag {Name : "linux-realtime-period" , Usage : "CPU period to be used for realtime scheduling (in usecs)" },
67+ cli.StringFlag {Name : "linux-cpus" , Usage : "CPUs to use within the cpuset (default is to use any CPU available)" },
68+ cli.StringFlag {Name : "linux-mems" , Usage : "list of memory nodes in the cpuset (default is to use any available memory node)" },
69+ cli.Uint64Flag {Name : "linux-mem-limit" , Usage : "memory limit (in bytes)" },
70+ cli.Uint64Flag {Name : "linux-mem-reservation" , Usage : "memory reservation or soft limit (in bytes)" },
71+ cli.Uint64Flag {Name : "linux-mem-swap" , Usage : "total memory limit (memory + swap) (in bytes)" },
72+ cli.Uint64Flag {Name : "linux-mem-kernel-limit" , Usage : "kernel memory limit (in bytes)" },
73+ cli.Uint64Flag {Name : "linux-mem-kernel-tcp" , Usage : "kernel memory limit for tcp (in bytes)" },
74+ cli.Uint64Flag {Name : "linux-mem-swappiness" , Usage : "how aggressive the kernel will swap memory pages (Range from 0 to 100)" },
6275}
6376
6477var generateCommand = cli.Command {
@@ -324,6 +337,58 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
324337 g .SetLinuxResourcesOOMScoreAdj (context .Int ("oom-score-adj" ))
325338 }
326339
340+ if context .IsSet ("linux-cpu-shares" ) {
341+ g .SetLinuxResourcesCPUShares (context .Uint64 ("linux-cpu-shares" ))
342+ }
343+
344+ if context .IsSet ("linux-cpu-period" ) {
345+ g .SetLinuxResourcesCPUPeriod (context .Uint64 ("linux-cpu-period" ))
346+ }
347+
348+ if context .IsSet ("linux-cpu-quota" ) {
349+ g .SetLinuxResourcesCPUQuota (context .Uint64 ("linux-cpu-quota" ))
350+ }
351+
352+ if context .IsSet ("linux-realtime-runtime" ) {
353+ g .SetLinuxResourcesCPURealtimeRuntime (context .Uint64 ("linux-realtime-runtime" ))
354+ }
355+
356+ if context .IsSet ("linux-realtime-period" ) {
357+ g .SetLinuxResourcesCPURealtimePeriod (context .Uint64 ("linux-realtime-period" ))
358+ }
359+
360+ if context .IsSet ("linux-cpus" ) {
361+ g .SetLinuxResourcesCPUCpus (context .String ("linux-cpus" ))
362+ }
363+
364+ if context .IsSet ("linux-mems" ) {
365+ g .SetLinuxResourcesCPUMems (context .String ("linux-mems" ))
366+ }
367+
368+ if context .IsSet ("linux-mem-limit" ) {
369+ g .SetLinuxResourcesMemoryLimit (context .Uint64 ("linux-mem-limit" ))
370+ }
371+
372+ if context .IsSet ("linux-mem-reservation" ) {
373+ g .SetLinuxResourcesMemoryReservation (context .Uint64 ("linux-mem-reservation" ))
374+ }
375+
376+ if context .IsSet ("linux-mem-swap" ) {
377+ g .SetLinuxResourcesMemorySwap (context .Uint64 ("linux-mem-swap" ))
378+ }
379+
380+ if context .IsSet ("linux-mem-kernel-limit" ) {
381+ g .SetLinuxResourcesMemoryKernel (context .Uint64 ("linux-mem-kernel-limit" ))
382+ }
383+
384+ if context .IsSet ("linux-mem-kernel-tcp" ) {
385+ g .SetLinuxResourcesMemoryKernelTCP (context .Uint64 ("linux-mem-kernel-tcp" ))
386+ }
387+
388+ if context .IsSet ("linux-mem-swappiness" ) {
389+ g .SetLinuxResourcesMemorySwappiness (context .Uint64 ("linux-mem-swappiness" ))
390+ }
391+
327392 var sd string
328393 var sa , ss []string
329394
0 commit comments