Minikube Systemd: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 19: Line 19:
LXC_USER_NAME="${USER}"
LXC_USER_NAME="${USER}"
if ! sudo id -u \${LXC_USER_NAME} &>/dev/null;then
if ! sudo id -u \${LXC_USER_NAME} &>/dev/null;then
    useradd --create-home --shell /bin/bash \${LXC_USER_NAME}
  useradd --create-home --shell /bin/bash \${LXC_USER_NAME}
    passwd --quiet --delete "\${LXC_USER_NAME}"
  passwd --quiet --delete "\${LXC_USER_NAME}"
    usermod -aG sudo "\${LXC_USER_NAME}"
  usermod -aG sudo "\${LXC_USER_NAME}"
fi
fi
EXE
EXE
Line 92: Line 92:
----
----
|-
|-
| valign="top" |
lxc stop  minikube
lxc info  minikube
lxc list
| valign="top" |
| valign="top" |
  lxc config set  minikube limits.cpu 4
  lxc config set  minikube limits.cpu 4
  lxc config get  minikube limits.cpu
  lxc config get  minikube limits.cpu
  lxc config unset minikube limits.cpu
  lxc config unset minikube limits.cpu
lxc config show  minikube


| valign="top" |
| valign="top" |
lxc config set  minikube limits.memory 8GB
lxc config get  minikube limits.memory
lxc config unset minikube limits.memory


|-
| colspan="3" |
----
|-
| valign="top" |
| valign="top" |
lxc start minikube
lxc info  minikube
lxc config show minikube
| valign="top" colspan="2" |
lxc exec minikube -- awk '/^MemTotal:/ { print int($2/1024); }' /proc/meminfo
lxc exec minikube -- getconf _NPROCESSORS_ONLN
lxc exec minikube -- free -th


|}
|}

Revision as of 02:51, 27 June 2024

if [ -x "$(command -v curl)" ];then \
sudo apt -qq update;\
export MINIKUBE_CPU_USE=8;\
export MINIKUBE_RAM_USE=16384;\
bash <(curl -s 'https://cdn.chorke.org/exec/cli/bash/install/minikube/1.0.0-ubuntu-22.04.sh.txt');\
else printf 'curl \033[0;31mnot found! \033[0m:(\n';fi

Prepare Debug

lxc launch ubuntu:22.04 minikube --vm
lxc snapshot minikube ubuntu:22.04
lxc restore  minikube ubuntu:22.04

cat << EXE | lxc exec minikube -- bash
LXC_USER_NAME="${USER}"
if ! sudo id -u \${LXC_USER_NAME} &>/dev/null;then
  useradd --create-home --shell /bin/bash \${LXC_USER_NAME}
  passwd --quiet --delete "\${LXC_USER_NAME}"
  usermod -aG sudo "\${LXC_USER_NAME}"
fi
EXE
lxc exec minikube -- sudo --login --user ${USER} bash
lxc exec minikube -- sudo  -i      -u    ${USER} bash
cat << EXE | lxc exec minikube -- sudo -i -u ${USER} bash
sudo apt-get update -qq
sudo mkdir -p /etc/apt/keyrings
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg\
| sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

cat << SRC | sudo tee /etc/apt/sources.list.d/docker.list >/dev/null
deb [arch=\$(dpkg --print-architecture)\
 signed-by=/etc/apt/keyrings/docker.gpg]\
 https://download.docker.com/linux/ubuntu \$(lsb_release -cs) stable
SRC
EXE

cat << EXE | lxc exec minikube -- sudo -i -u ${USER} bash
sudo apt-get update -qq
sudo apt-get install -y docker-ce jq
sudo usermod -aG docker \${USER}
su - \${USER}
id -nG
EXE
cat << EXE | lxc exec minikube -- sudo -i -u ${USER} bash
sudo systemctl status network-online.target
sudo systemctl status containerd.service
sudo systemctl status docker.service
docker version
docker ps -a
EXE

lxc delete   minikube/ubuntu:docker:22.04
lxc snapshot minikube ubuntu:docker:22.04
lxc restore  minikube ubuntu:docker:22.04
lxc info     minikube
lxc exec minikube -- sudo -i -u ${USER} docker ps
lxc exec minikube -- sudo -i -u ${USER} jq --help

lxc stop  minikube
lxc info  minikube
lxc list
lxc config set   minikube limits.cpu 4
lxc config get   minikube limits.cpu
lxc config unset minikube limits.cpu
lxc config set   minikube limits.memory 8GB
lxc config get   minikube limits.memory
lxc config unset minikube limits.memory

lxc start minikube
lxc info  minikube
lxc config show minikube
lxc exec minikube -- awk '/^MemTotal:/ { print int($2/1024); }' /proc/meminfo
lxc exec minikube -- getconf _NPROCESSORS_ONLN
lxc exec minikube -- free -th

Execute Debug


Playground

lxc launch ubuntu:22.04 minikube --vm
lxc exec minikube -- bash
lxc snapshot minikube ubuntu:docker:22.04
lxc restore  minikube ubuntu:docker:22.04
lxc delete   minikube/ubuntu:docker:22.04
lxc info     minikube

References