Open PedroRegisPOAR opened 3 years ago
echo 'Start kvm stuff...' \
&& getent group kvm || sudo groupadd kvm \
&& sudo usermod --append --groups kvm "$USER" \
&& echo 'End kvm stuff!' \
&& echo 'Start cgroup v2 instalation...' \
&& sudo mkdir -p /etc/systemd/system/user@.service.d \
&& sudo sh -c "echo '[Service]' >> /etc/systemd/system/user@.service.d/delegate.conf" \
&& sudo sh -c "echo 'Delegate=yes' >> /etc/systemd/system/user@.service.d/delegate.conf" \
&& sudo \
sed \
--in-place \
's/^GRUB_CMDLINE_LINUX="/&cgroup_enable=memory swapaccount=1 systemd.unified_cgroup_hierarchy=1 cgroup_no_v1=all/' \
/etc/default/grub \
&& sudo grub-mkconfig -o /boot/grub/grub.cfg \
&& echo 'End cgroup v2 instalation...' \
&& echo 'Start uidmap instalation!' \
&& sudo apt-get update \
&& sudo apt-get install -y uidmap \
&& echo 'End uidmap instalation!' \
&& echo 'Start a lot of instalation with nix!' \
&& nix \
profile \
install \
github:ES-Nix/podman-rootless/from-nixpkgs \
nixpkgs#cni \
nixpkgs#cni-plugins \
nixpkgs#kubernetes-helm \
nixpkgs#minikube \
nixpkgs#ripgrep \
&& echo 'Start bypass sudo podman stuff...' \
&& sudo \
--preserve-env \
su \
-c \
"echo $USER ALL=\(ALL\) NOPASSWD:SETENV: $(readlink $(which podman)) >> /etc/sudoers" \
&& sudo \
sed \
-i \
's@Defaults\ssecure_path=\"@&'"$HOME"'\/.nix-profile\/bin:@' \
/etc/sudoers \
&& echo 'End bypass sudo podman stuff...' \
&& sudo mkdir -p /usr/lib/cni \
&& sudo ln -fsv $(which firewall) /usr/lib/cni/firewall \
&& sudo ln -fsv $(which bridge) /usr/lib/cni/bridge \
&& sudo ln -fsv $(which portmap) /usr/lib/cni/portmap \
&& sudo ln -fsv $(which tuning) /usr/lib/cni/tuning \
&& sudo ln -fsv $(which host-local) /usr/lib/cni/host-local \
&& nix store gc \
&& sudo -k -n podman network create podman \
&& sudo reboot
minikube start --driver=podman
sudo podman exec -it minikube bash -c 'podman --version && which podman && docker --version'
minikube kubectl -- apply -f https://k8s.io/examples/application/shell-demo.yaml
minikube kubectl -- get pod shell-demo
minikube kubectl -- exec --stdin --tty shell-demo -- /bin/bash -c 'ls -al /'
minikube kubectl -- delete pod shell-demo
Abstract
I think the problem is related to this:
TODO: does it solve the problem?
https://github.com/containers/podman/blob/c26af00c4bf5aec458868b5afd44e7a88ddcf46d/vendor/github.com/containers/storage/storage.conf#L24
But for
conmon
it includes/run/current-system/sw/bin/conmon
:Plausible solution not using symbolic links, as the documentation says, configure the
cni_plugin_dirs
. Where find a config file example? The FORMAT section does not give an example. Maybe search in github :bulb:Maybe related: https://github.com/containers/podman/issues/11358#issuecomment-908414055
Maybe it explains why the network named
podman
is not created by default: cni and How To Install Podman on Debian 10/9, TODO: test it.Details
TODO: add VM commads here
Now it must work:
TODO: https://gitlab.com/steveeJ/infra/-/blob/72b24bc3fda768c0c34cc9606321ac4df691b66a/nix/home-manager/programs/podman.nix