Attribute text added to the images
Signed-off-by: Ihor Dvoretskyi <ihor@linux.com>pull/21092/head
parent
041b9d6f65
commit
a29878d29d
|
@ -36,7 +36,7 @@ However, here is the list of the prerequisites needed and their version/lane:
|
|||
- [Docker Desktop for Windows](https://hub.docker.com/editions/community/docker-ce-desktop-windows), stable channel - the version used is 2.2.0.4
|
||||
- [Optional] Microsoft Terminal installed from the Windows Store
|
||||
- Open the Windows store and type "Terminal" in the search, it will be (normally) the first option
|
||||

|
||||

|
||||
|
||||
And that's actually it. For Docker Desktop for Windows, no need to configure anything yet as we will explain it in the next section.
|
||||
|
||||
|
@ -44,13 +44,13 @@ And that's actually it. For Docker Desktop for Windows, no need to configure any
|
|||
|
||||
Once everything is installed, we can launch the WSL2 terminal from the Start menu, and type "Ubuntu" for searching the applications and documents:
|
||||
|
||||

|
||||

|
||||
|
||||
Once found, click on the name and it will launch the default Windows console with the Ubuntu bash shell running.
|
||||
|
||||
Like for any normal Linux distro, you need to create a user and set a password:
|
||||
|
||||

|
||||

|
||||
|
||||
## [Optional] Update the `sudoers`
|
||||
|
||||
|
@ -68,7 +68,7 @@ sudo visudo
|
|||
# Press Enter to confirm
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
## Update Ubuntu
|
||||
|
||||
|
@ -81,7 +81,7 @@ sudo apt update
|
|||
sudo apt upgrade -y
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
# Docker Desktop: faster with WSL2
|
||||
|
||||
|
@ -94,7 +94,7 @@ docker version
|
|||
kubectl version
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
You got an error? Perfect! It's actually good news, so let's now move on to the settings.
|
||||
|
||||
|
@ -102,19 +102,19 @@ You got an error? Perfect! It's actually good news, so let's now move on to the
|
|||
|
||||
First let's start Docker Desktop for Windows if it's not still the case. Open the Windows start menu and type "docker", click on the name to start the application:
|
||||
|
||||

|
||||

|
||||
|
||||
You should now see the Docker icon with the other taskbar icons near the clock:
|
||||
|
||||

|
||||

|
||||
|
||||
Now click on the Docker icon and choose settings. A new window will appear:
|
||||
|
||||

|
||||

|
||||
|
||||
By default, the WSL2 integration is not active, so click the "Enable the experimental WSL 2 based engine" and click "Apply & Restart":
|
||||
|
||||

|
||||

|
||||
|
||||
What this feature did behind the scenes was to create two new distros in WSL2, containing and running all the needed backend sockets, daemons and also the CLI tools (read: docker and kubectl command).
|
||||
|
||||
|
@ -122,7 +122,7 @@ Still, this first setting is still not enough to run the commands inside our dis
|
|||
|
||||
In order to fix it, and finally be able to use the commands, we need to tell the Docker Desktop to "attach" itself to our distro also:
|
||||
|
||||

|
||||

|
||||
|
||||
Let's now switch back to our WSL2 terminal and see if we can (finally) launch the commands:
|
||||
|
||||
|
@ -133,7 +133,7 @@ docker version
|
|||
kubectl version
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
> Tip: if nothing happens, restart Docker Desktop and restart the WSL process in Powershell: `Restart-Service LxssManager` and launch a new Ubuntu session
|
||||
|
||||
|
@ -158,7 +158,7 @@ chmod +x ./kind
|
|||
sudo mv ./kind /usr/local/bin/
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
## KinD: the first cluster
|
||||
|
||||
|
@ -175,7 +175,7 @@ kind create cluster --name wslkind
|
|||
ls $HOME/.kube
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
> Tip: as you can see, the Terminal was changed so the nice icons are all displayed
|
||||
|
||||
|
@ -183,7 +183,7 @@ The cluster has been successfully created, and because we are using Docker Deskt
|
|||
|
||||
So we can open the `Kubernetes master` URL in our Windows browser:
|
||||
|
||||

|
||||

|
||||
|
||||
And this is the real strength from Docker Desktop for Windows with the WSL2 backend. Docker really did an amazing integration.
|
||||
|
||||
|
@ -198,7 +198,7 @@ kubectl get nodes
|
|||
kubectl get all --all-namespaces
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
While this will be enough for a lot of persons, let's leverage one of the coolest feature, multi-node clustering:
|
||||
|
||||
|
@ -220,7 +220,7 @@ kind create cluster --name wslkindmultinodes --config ./kind-3nodes.yaml
|
|||
kubectl get nodes
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
> Tip: depending on how fast we run the "get nodes" command, it can be that not all the nodes are ready, wait few seconds and run it again, everything should be ready
|
||||
|
||||
|
@ -231,7 +231,7 @@ And that's it, we have created a three nodes cluster, and if we look at the serv
|
|||
kubectl get all --all-namespaces
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
## KinD: can I see a nice dashboard?
|
||||
|
||||
|
@ -246,11 +246,11 @@ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-r
|
|||
kubectl get all -n kubernetes-dashboard
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
As it created a service with a ClusterIP (read: internal network address), we cannot reach it if we type the URL in our Windows browser:
|
||||
|
||||

|
||||

|
||||
|
||||
That's why, if we continue reading the how-to, we need to create a temporary proxy:
|
||||
|
||||
|
@ -260,7 +260,7 @@ kubectl proxy
|
|||
# Enter the URL on your browser: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Finally to login, we can either enter a Token, which we didn't create, or enter the `kubeconfig` file from our Cluster.
|
||||
|
||||
|
@ -296,7 +296,7 @@ subjects:
|
|||
EOF
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
```bash
|
||||
# Get the Token for the ServiceAccount
|
||||
|
@ -304,11 +304,11 @@ kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboar
|
|||
# Copy the token and copy it into the Dashboard login and press "Sign in"
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Success! And let's see our nodes listed also:
|
||||
|
||||

|
||||

|
||||
|
||||
A nice and shiny three nodes appear.
|
||||
|
||||
|
@ -331,7 +331,7 @@ chmod +x ./minikube
|
|||
sudo mv ./minikube /usr/local/bin/
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
## Minikube: updating the host
|
||||
|
||||
|
@ -344,7 +344,7 @@ Unfortunately, we will get an error about "conntrack" being required to run Kube
|
|||
minikube start --driver=none
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
> Tip: as you can see, the Terminal was changed so the nice icons are all displayed
|
||||
|
||||
|
@ -355,7 +355,7 @@ So let's fix the issue by installing the missing package:
|
|||
sudo apt install -y conntrack
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Let's try to launch it again:
|
||||
|
||||
|
@ -366,7 +366,7 @@ minikube start --driver=none
|
|||
sudo minikube start --driver=none
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Ok, this error cloud be problematic ... in the past. Luckily for us, there's a solution
|
||||
|
||||
|
@ -383,7 +383,7 @@ So in a nutshell, here are the commands:
|
|||
sudo apt install -yqq daemonize dbus-user-session fontconfig
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
```bash
|
||||
# Create the start-systemd-namespace script
|
||||
|
@ -469,11 +469,11 @@ sudo chmod +x /usr/sbin/enter-systemd-namespace
|
|||
sudo sed -i 2a"# Start or enter a PID namespace in WSL2\nsource /usr/sbin/start-systemd-namespace\n" /etc/bash.bashrc
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Finally, exit and launch a new session. You **do not** need to stop WSL2, a new session is enough:
|
||||
|
||||

|
||||

|
||||
|
||||
## Minikube: the first cluster
|
||||
|
||||
|
@ -501,15 +501,15 @@ kubectl cluster-info
|
|||
kubectl get all --all-namespaces
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
The cluster has been successfully created, and Minikube used the WSL2 IP, which is great for several reasons, and one of them is that we can open the `Kubernetes master` URL in our Windows browser:
|
||||
|
||||

|
||||

|
||||
|
||||
And the real strength of WSL2 integration, the port `8443` once open on WSL2 distro, it actually forwards it to Windows, so instead of the need to remind the IP address, we can also reach the `Kubernetes master` URL via `localhost`:
|
||||
|
||||

|
||||

|
||||
|
||||
## Minikube: can I see a nice dashboard?
|
||||
|
||||
|
@ -523,7 +523,7 @@ sudo minikube dashboard
|
|||
# Access the Dashboard from a browser on Windows side
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
The command creates also a proxy, which means that once we end the command, by pressing `CTRL+C`, the Dashboard will no more be accessible.
|
||||
|
||||
|
@ -534,7 +534,7 @@ Still, if we look at the namespace `kubernetes-dashboard`, we will see that the
|
|||
kubectl get all --namespace kubernetes-dashboard
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Let's edit the service and change it's type to `LoadBalancer`:
|
||||
|
||||
|
@ -549,7 +549,7 @@ status:
|
|||
# Save the file
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Check again the Dashboard service and let's access the Dashboard via the LoadBalancer:
|
||||
|
||||
|
@ -559,7 +559,7 @@ kubectl get all --namespace kubernetes-dashboard
|
|||
# Access the Dashboard from a browser on Windows side with the URL: localhost:<port exposed>
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
# Conclusion
|
||||
|
||||
|
|
Loading…
Reference in New Issue