Minikube Tunnel: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 41: Line 41:
==Playground==
==Playground==
{|
{|
|valign='top'|
<syntaxhighlight lang="bash">
# check minikube user either exists or not
cat /etc/passwd|grep minikube
sudo usermod -aG sudo minikube
</syntaxhighlight>
|valign='top'|
<syntaxhighlight lang="bash">
# minikube no-password sudo access add to EOL
sudo visudo
minikube ALL=(ALL) NOPASSWD: ALL
</syntaxhighlight>
|valign='top'|
<syntaxhighlight lang="bash">
# login to minikube user and start tunneling
sudo -i -u minikube
minikube tunnel
</syntaxhighlight>
|-
|colspan="3"|
----
|-
|valign="top"|
|valign="top"|
  sudo systemctl enable  --now  minikube-tunnel.service
  sudo systemctl enable  --now  minikube-tunnel.service
Line 50: Line 75:


|valign="top"|
|valign="top"|
  systemctl stop  minikube-tunnel.service
  sudo systemctl stop  minikube-tunnel.service
  systemctl start minikube-tunnel.service
  sudo systemctl start minikube-tunnel.service
 
|-
|colspan="3"|
----
|-
|valign="top"|
<syntaxhighlight lang="bash">
SYSTEM_RAM_LIMIT=$(awk '/^MemTotal:/ { print int($2/1024); }' /proc/meminfo)
SYSTEM_CPU_LIMIT=$(getconf _NPROCESSORS_ONLN)
minikube config view
minikube config
</syntaxhighlight>
 
|valign="top" colspan="2"|
<syntaxhighlight lang="bash">
minikube config set memory $((${SYSTEM_RAM_LIMIT}-1024*4))
minikube config set cpus  $((${SYSTEM_CPU_LIMIT}-4))
minikube delete
minikube start
</syntaxhighlight>


|-
|-
Line 118: Line 123:


| valign="top" |
| valign="top" |
* [https://medium.com/globant/load-balance-microservices-using-kubernetes-minikube-88b78dae4796 Minikube » Load balance » Micro-services]
* [[K8s/CSI Hostpath Driver]]
* [[Minikube Ingress DNS]]
* [[Minikube Ingress DNS]]
* [[Minikube Systemd]]
* [[Minikube Systemd]]
* [[Minikube Registry]]
* [[Minikube Registry]]
* [[K8s/Swiss Knife]]
* [[Free Up RAM]]
* [[Free Up RAM]]
* [[K8s/Ingress]]
* [[K8s/Run]]
* [[CIDR]]
* [[CIDR]]


| valign="top" |
| valign="top" |
* [[Minikube Ingress DNS| Minikube » Ingress DNS]]
* [[Minikube MetalLB|Minikube » MetalLB]]
* [[Minikube Registry|Minikube » Registry]]


|-
|-

Latest revision as of 23:02, 18 December 2024

sudo -i -u minikube
minikube tunnel --cleanup
minikube tunnel --cleanup=true
minikube status -ojson|jq -r .

Systemd

Line number: 19 meaningless, kept backed those lines for identical purpose

cat << INI | sudo tee /etc/systemd/system/minikube-tunnel.service >/dev/null
[Unit]
Description=Minikube Tunnel
Documentation=https://minikube.sigs.k8s.io/docs/commands/tunnel/
After=network-online.target containerd.service docker.service minikube.service
Requires=network-online.target containerd.service docker.service minikube.service
Wants=network-online.target docker.service minikube.service
AssertFileIsExecutable=/var/minikube/bin/minikube

[Service]
User=minikube
Group=minikube
ProtectProc=invisible
StandardOutput=journal
WorkingDirectory=/var/minikube

EnvironmentFile=-/etc/default/minikube
ExecStart=/var/minikube/bin/minikube tunnel --cleanup=true
ExecStartPost=/bin/bash -c "echo ${MAINPID} > /var/minikube/etc/tunnel.pid"

Restart=always
SendSIGKILL=no
TasksMax=infinity
TimeoutStopSec=infinity

[Install]
WantedBy=multi-user.target
INI

Playground

# check minikube user either exists or not
cat /etc/passwd|grep minikube
sudo usermod -aG sudo minikube
# minikube no-password sudo access add to EOL
sudo visudo
minikube ALL=(ALL) NOPASSWD: ALL
# login to minikube user and start tunneling
sudo -i -u minikube
minikube tunnel

sudo systemctl enable  --now  minikube-tunnel.service
sudo systemctl disable --now  minikube-tunnel.service
systemctl status minikube-tunnel.service
journalctl -xeu  minikube-tunnel.service
sudo systemctl stop  minikube-tunnel.service
sudo systemctl start minikube-tunnel.service

docker network prune -f
docker volume  prune -f
docker system  prune -f
docker image ls
cat <<'EXE' | bash
for d in system network volume
do docker ${d} prune -f;done
EXE
cat <<'EXE' | ssh [email protected]
for d in system network volume
do docker ${d} prune -f;done
EXE

References