Table of Contents |
---|
Pre-Requisits
- Install Ubuntu on WSL2 in windows
Install
...
See https://minikube.sigs.k8s.io/docs/start/
Download the executable : https://storage.googleapis.com/minikube/releases/latest/minikube-installer.exe
From a Powershell with Administrator Privileges
Code Block |
---|
PS > minikube config set cpus 4
PS > minikube config set memory 8192
PS > minikube start --driver=hyperv
* minikube v1.23.2 on Microsoft Windows 10 Enterprise 10.0.18363 Build 18363
* Using the hyperv driver based on user configuration
* Starting control plane node minikube in cluster minikube
* Creating hyperv VM (CPUs=4, Memory=8192MB, Disk=20000MB) ...
* Preparing Kubernetes v1.22.2 on Docker 20.10.8 ...
- Generating certificates and keys ...
- Booting up control plane ...
- Configuring RBAC rules ...
* Verifying Kubernetes components...
- Using image gcr.io/k8s-minikube/storage-provisioner:v5
* Enabled addons: storage-provisioner, default-storageclass
* kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default |
Create a Script too call minikube.exe from WSL2/Ubuntu
Code Block |
---|
$ vi minikube |
Code Block |
---|
#!/bin/sh
/mnt/c/Program\ Files/Kubernetes/Minikube/minikube.exe $@ |
Make executable and copy it to a folder in your path
Code Block |
---|
$ chmod +x ./minikube
$ sudo mv minikube /usr/local/bin/. |
Configure
Code Block |
---|
$ minikube config set cpus 4
$ minikube config set memory 8192
|
If you are changing the above configuration, you will need to first delete the minikube instance using the command 'minikube delete'.
Start
Code Block |
---|
$ minikube start
* minikube v1.23.2 on Microsoft Windows 10 Enterprise 10.0.18363 Build 18363
* Automatically selected the virtualbox driver
* Downloading VM boot image ...
> minikube-v1.23.1.iso.sha256: 65 B / 65 B [-------------] 100.00% ? p/s 0s
> minikube-v1.23.1.iso: 26.05 MiB / 225.22 MiB 11.56% 5.51 MiB p/s ETA 36s
... |
Install Kubectl
In WSL/Ubuntu:
Code Block |
---|
# download
$ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
#install
$ sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl |
Code Block |
---|
$ cd ~
$ cp -R /mnt/c/Users/mehan/.kube/ .
|
...
Docker
...
In WSL2/Ubuntu:
Code Block |
---|
$ sudo apt-get update $ sudo apt-get 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-get update $ sudo apt-get install docker-ce docker-ce-cli containerd.io |
...
Code Block |
---|
$ sudo /etc/init.d/docker start |
Minikube
Install
Code Block |
---|
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube |
Configure
Code Block |
---|
$ minikube config view $ minikube config set cpusvm-driver 4docker $ minikube config set memory 8192 |
If you are changing the above configuration, you will need to first delete the minikube instance using the command 'minikube delete'.
Start Minikube
Code Block |
---|
$ minikube config set cpu 4
$ eval $(minikube docker-env)
|
Start Minikube
Code Block |
---|
$ minikube start minikube v1.23.2 on Ubuntu 20.04 Automatically selectedUsing the docker driver. Otherbased choices:on none,user sshconfiguration Starting control plane node minikube in cluster minikube Pulling base image ... Downloading Kubernetes v1.22.2 preload ... > gcr.io/k8s-minikube/kicbase: 1.21preloaded-images-k8s-v13-v1...: 511.84 MiB / 355.40 511.84 MiB 100.00% 3.39 MiB 0.34% 23.92 KiB p/s E ...Creating docker container (CPUs=2, Memory=3100MB) ... This container is having trouble accessing https://k8s.gcr.io To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/ Preparing Kubernetes v1.22.2 on Docker 20.10.8 ... ▪ Generating certificates and keys ... ▪ Booting up control plane ... ▪ Configuring RBAC rules ... Verifying Kubernetes components... ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5 Enabled addons: storage-provisioner, default-storageclass Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default |
FORGET IT - THIS DOESN'T WORK
References
Reference | URL |
---|---|
Setting up Kubernetes on WSL to work with Minikube on Windows 10 | https://blog.thepolyglotprogrammer.com/setting-up-kubernetes-on-wsl-to-work-with-minikube-on-windows-10-90dac3c72fa1 |
Install Docker Engine on Ubuntu | https://docs.docker.com/engine/install/ubuntu/ |
Minikube start | https://minikube.sigs.k8s.io/docs/start/ |
...