MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

  • wsl

Contents

  1. wsl
    1. Install docker in wsl ubuntu 20.04.6 LTS
    2. Install k3s
    3. Run cherrypy-test in k3s
    4. Certificate issue
    5. Install debian in WSL

wsl

Windows Subsystem for Linux

Install docker in wsl ubuntu 20.04.6 LTS

   1 sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release
   2 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
   3 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
   4 sudo apt update
   5 sudo apt install docker-ce docker-ce-cli containerd.io
   6 sudo usermod -aG docker $USER
   7 sudo service docker start
   8 docker run hello-world
   9 sudo apt install net-tools
  10 docker pull vbodocker/cherrypy-test
  11 docker run --rm --name ctest -P -d vbodocker/cherrypy-test   
  12 docker stop ctest
  13 docker system prune -a
  14 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
  15 docker exec -it some-mariadb bash

Install k3s

   1 curl -sfL https://get.k3s.io | sh -
   2 sudo k3s server > /tmp/k3s.log  2>&1 &
   3 sudo chmod 644 /etc/rancher/k3s/k3s.yaml
   4 kubectl get node

Run cherrypy-test in k3s

   1 cd ~
   2 git clone https://github.com/vborrego/cherrypy-test.git
   3 cd cherrypy-test/
   4 cat README.md
   5 kubectl apply -f cherrypy-test-deployment.yaml
   6 curl $(kubectl get services | grep cherry | awk '//{print $3}'):8080
   7 kubectl get services
   8 kubectl get deployment
   9 cat cherrypy-test-deployment.yaml
  10 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

   1 sudo rm /var/lib/rancher/k3s/server/tls/dynamic-cert.json
   2 sudo kubectl --insecure-skip-tls-verify=true delete secret -n kube-system k3s-serving
   3 kill <k3s pid>
   4 sudo k3s server > /tmp/k3s.log  2>&1 &  
   5 sudo chmod 644 /etc/rancher/k3s/k3s.yaml
   6 kubectl get pods

Install debian in WSL

   1 wsl --install -d Debian
   2 #Installing, this may take a few minutes...
   3 #Please create a default UNIX user account. The username does not need to match your Windows username.
   4 #For more information visit: https://aka.ms/wslusers
   5 #Enter new UNIX username: wsl
   6 #New password:
   7 #Retype new password:
   8 #passwd: password updated successfully
   9 #Installation successful!
  10 wsl -d debian 

   1 sudo apt update         
   2 sudo apt upgrade 
   3 sudo apt install ca-certificates curl gnupg lsb-release apt-transport-https podman 
   4 lsb_release -a 
   5 sudo apt autoremove 
   6 podman run hello-world
   7 curl -sfL https://get.k3s.io | sh -
   8 sudo k3s server > /tmp/k3s.log 2>&1 &
   9 sudo dd if=/dev/zero of=/swapfile1 bs=1024 count=4194304 
  10 sudo chown root:root /swapfile1
  11 sudo /sbin/mkswap /swapfile1
  12 sudo /sbin/swapon /swapfile1
  13 sudo chmod 0600 /swapfile1
  14 sudo update-alternatives --config iptables
  15 #  1            /usr/sbin/iptables-legacy   10        manual mode
  16 sudo k3s server > /tmp/k3s.log 2>&1 &
  17 sudo chmod 644 /etc/rancher/k3s/k3s.yaml 
  18 kubectl get pods 
  19 sudo apt install openjdk-17-jdk
  20 sudo apt install nodejs 
  21 kubectl get node 
  22 cd ~
  23 sudo apt install git 
  24 git clone https://github.com/vborrego/cherrypy-test.git 
  25 cd cherrypy-test/
  26 kubectl apply -f cherrypy-test-deployment.yaml
  27 curl $(kubectl get services | grep cherry | awk '//{print $3}'):8080
  28 kubectl get deployments
  29 kubectl get pods
  30 kubectl logs cherrypy-test-7ddf49f4b6-b7lft
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01