<> = wsl = Windows Subsystem for Linux == Install docker in wsl ubuntu 20.04.6 LTS == {{{#!highlight sh sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io sudo usermod -aG docker $USER sudo service docker start docker run hello-world sudo apt install net-tools docker pull vbodocker/cherrypy-test docker run --rm --name ctest -P -d vbodocker/cherrypy-test docker stop ctest docker system prune -a docker run --detach --name some-mariadb --env MARIADB_USER=example-user --env MARIADB_PASSWORD=my_cool_secret --env MARIADB_ROOT_PASSWORD=my-secret-pw mariadb:latest docker exec -it some-mariadb bash }}} == Install k3s == {{{#!highlight sh curl -sfL https://get.k3s.io | sh - sudo k3s server > /tmp/k3s.log 2>&1 & sudo chmod 644 /etc/rancher/k3s/k3s.yaml kubectl get node }}} == Run cherrypy-test in k3s == {{{#!highlight sh cd ~ git clone https://github.com/vborrego/cherrypy-test.git cd cherrypy-test/ cat README.md kubectl apply -f cherrypy-test-deployment.yaml curl $(kubectl get services | grep cherry | awk '//{print $3}'):8080 kubectl get services kubectl get deployment cat cherrypy-test-deployment.yaml kubectl delete -f cherrypy-test-deployment.yaml }}} == Certificate issue == Unable to connect to the server: x509: certificate has expired or is not yet valid: current time 2023-12-12T22:48:20Z is after 2023-05-17T21:01:11Z {{{#!highlight sh sudo rm /var/lib/rancher/k3s/server/tls/dynamic-cert.json sudo kubectl --insecure-skip-tls-verify=true delete secret -n kube-system k3s-serving kill sudo k3s server > /tmp/k3s.log 2>&1 & sudo chmod 644 /etc/rancher/k3s/k3s.yaml kubectl get pods }}} == Install debian in WSL == {{{#!highlight sh wsl --install -d Debian #Installing, this may take a few minutes... #Please create a default UNIX user account. The username does not need to match your Windows username. #For more information visit: https://aka.ms/wslusers #Enter new UNIX username: wsl #New password: #Retype new password: #passwd: password updated successfully #Installation successful! wsl -d debian }}} {{{#!highlight sh sudo apt update && sudo apt full-upgrade sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io sudo usermod -aG docker $USER sudo update-alternatives --config iptables # * 1 /usr/sbin/iptables-legacy 10 manual mode exit sudo service docker start docker run hello-world sudo apt install net-tools docker pull vbodocker/cherrypy-test docker run --rm --name ctest -P -d vbodocker/cherrypy-test docker ps -a docker stop ctest docker system prune -a docker run --detach --name some-mariadb --env MARIADB_USER=example-user --env MARIADB_PASSWORD=my_cool_secret --env MARIADB_ROOT_PASSWORD=my-secret-pw mariadb:latest docker exec -it some-mariadb bash # Install k3s curl -sfL https://get.k3s.io | sh - sudo k3s server > /tmp/k3s.log 2>&1 & sudo chmod 644 /etc/rancher/k3s/k3s.yaml kubectl get node cd ~ git clone https://github.com/vborrego/cherrypy-test.git cd cherrypy-test/ kubectl apply -f cherrypy-test-deployment.yaml curl $(kubectl get services | grep cherry | awk '//{print $3}'):8080 kubectl get services kubectl get deployment kubectl get services kubectl get deployment curl $(kubectl get services | grep cherry | awk '//{print $3}'):8080 }}}