Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "sudo" to podman calls #7631

Merged
merged 28 commits into from
Apr 29, 2020
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d7dc7bf
The podman driver should not be run as root
afbjorklund Apr 12, 2020
f264ac1
Remove extra single-quotes from format parameter
afbjorklund Apr 13, 2020
401e94c
Don't download podman images to docker daemon
afbjorklund Apr 13, 2020
22aa1af
Handle more state and status for the podman driver
afbjorklund Apr 13, 2020
f57faf8
Only remount the /var/lib/minikube directory
afbjorklund Apr 13, 2020
df3aec6
Missed to wrap one podman inspect in sudo proper
afbjorklund Apr 13, 2020
2234246
Also create and mount the container runtime dirs
afbjorklund Apr 13, 2020
8987b10
Also persist the kubelet and the cni state dirs
afbjorklund Apr 13, 2020
45ec38d
Fix hack binary, as pointed out by golangci-lint
afbjorklund Apr 13, 2020
024cd6b
Use the same kind of named /var mount for podman
afbjorklund Apr 14, 2020
19be561
Resource limits seem to work ok when not rootless
afbjorklund Apr 14, 2020
e99340b
Improve podman status when checking for sudo
afbjorklund Apr 18, 2020
6644c5c
Merge branch 'master' into podman-sudo
afbjorklund Apr 25, 2020
bb37c70
Fix log message to say driver and not cruntime
afbjorklund Apr 25, 2020
7647b1f
Don't try to limit podman memory without cgroup
afbjorklund Apr 25, 2020
7185140
Remove extra quotes added in conflict resolution
afbjorklund Apr 25, 2020
88c8a24
Pass the container implementation on to systemd
afbjorklund Apr 25, 2020
d96d9d3
Include any output from podman version in the log
afbjorklund Apr 26, 2020
28106fa
Use constants instead of the KIC prefix strings
afbjorklund Apr 26, 2020
e95ae32
Fix copy/paste error on the podman usage page
afbjorklund Apr 26, 2020
7951281
Remove old Copy function added in merge conflict
afbjorklund Apr 26, 2020
998ab84
Use simple version of podman info format parameter
afbjorklund Apr 26, 2020
95c9559
Align podman driver with docker and improve check
afbjorklund Apr 27, 2020
a041f40
Podman allows setting --cpus and --memory now
afbjorklund Apr 27, 2020
bf4aa78
Log the version used of the two KIC runtimes
afbjorklund Apr 27, 2020
1744ffe
Restore the configured state added for podman
afbjorklund Apr 27, 2020
f78e00e
Merge branch 'master' into podman-sudo
afbjorklund Apr 28, 2020
78a22f5
Remove prefix parameter and add prefix command
afbjorklund Apr 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't try to limit podman memory without cgroup
Podman requires both memcg and memcg_swap for it (--memory).

Docker will still limit memory, without swap limit support.
  • Loading branch information
afbjorklund committed Apr 25, 2020
commit 7647b1f998b36401a396acceddd7c147fb736f19
19 changes: 18 additions & 1 deletion pkg/drivers/kic/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (

"fmt"
"os/exec"
"runtime"
"strconv"
"strings"
)
Expand Down Expand Up @@ -139,7 +140,23 @@ func CreateContainerNode(p CreateParams) error {
runArgs = append(runArgs, "--volume", fmt.Sprintf("%s:/var", p.Name))
}

runArgs = append(runArgs, fmt.Sprintf("--cpus=%s", p.CPUs), fmt.Sprintf("--memory=%s", p.Memory))
runArgs = append(runArgs, fmt.Sprintf("--cpus=%s", p.CPUs))

memcgSwap := true
if runtime.GOOS == "linux" {
if _, err := os.Stat("/sys/fs/cgroup/memory/memsw.limit_in_bytes"); os.IsNotExist(err) {
// requires CONFIG_MEMCG_SWAP_ENABLED or cgroup_enable=memory in grub
glog.Warning("Your kernel does not support swap limit capabilities or the cgroup is not mounted.")
memcgSwap = false
}
}

if p.OCIBinary == Podman && memcgSwap { // swap is required for memory
runArgs = append(runArgs, fmt.Sprintf("--memory=%s", p.Memory))
}
if p.OCIBinary == Docker { // swap is only required for --memory-swap
runArgs = append(runArgs, fmt.Sprintf("--memory=%s", p.Memory))
}

for key, val := range p.Envs {
runArgs = append(runArgs, "-e", fmt.Sprintf("%s=%s", key, val))
Expand Down