Last active
April 29, 2022 19:39
-
-
Save CarlosDomingues/a20bec076b12f296de7573d0e93b9be6 to your computer and use it in GitHub Desktop.
Revisions
-
CarlosDomingues revised this gist
Apr 29, 2022 . 1 changed file with 18 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,8 +5,8 @@ This guide shows how to run Kubernetes in a Windows Host, using `kind` to run th The whole point of doing that is to run Kubernetes: 1. In a Windows Host 2. Without managing virtual machines (Docker Desktop + WSL 2 will do that for us) 3. Without using Docker Desktop's native Kubernetes feature (as it has a tendency to break workflows that do not relly on K8s). To use this guide, just follow each session sequentially. There are no optional steps. @@ -58,6 +58,22 @@ CoreDNS is running at https://127.0.0.1:62109/api/v1/namespaces/kube-system/serv To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. ``` ## A Quick Test Create a simple deployment: ```Powershell kubectl create deployment nginx --image=nginx --port=80 kubectl expose deployment/nginx ``` ## Networking Resources can be accessed from the Windows host using a browser. * Control Plane: `https://127.0.0.1:62109` * Services: ## A Winner is You That's it. You can now run commands against your cluster using `kubectl` or use graphical tools like [Lens](https://k8slens.dev/). -
CarlosDomingues revised this gist
Apr 28, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,8 @@ The whole point of doing that is to run Kubernetes: 2. Without using virtualization 3. Without using Docker Desktop's native Kubernetes feature (as it might break other workflows that do not relly on k8s). To use this guide, just follow each session sequentially. There are no optional steps. ## Install Scoop `scoop` is a lightweight package manager for Windows. It installs applications in `~/.scoop` and adds then to `PATH`. We will use it to install CLI tools. -
CarlosDomingues revised this gist
Apr 28, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -47,7 +47,7 @@ kind create cluster kubectl cluster-info --context kind-kind ``` If everything was setup correctly, you should see a message like so: ```Powershell Kubernetes control plane is running at https://127.0.0.1:62109 -
CarlosDomingues created this gist
Apr 28, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,61 @@ # Kubernetes on Docker on Linux on Windows This guide shows how to run Kubernetes in a Windows Host, using `kind` to run the control plane in Docker and WSL 2 to run Docker itself. The whole point of doing that is to run Kubernetes: 1. In a Windows Host 2. Without using virtualization 3. Without using Docker Desktop's native Kubernetes feature (as it might break other workflows that do not relly on k8s). ## Install Scoop `scoop` is a lightweight package manager for Windows. It installs applications in `~/.scoop` and adds then to `PATH`. We will use it to install CLI tools. ```Powershell Set-ExecutionPolicy RemoteSigned -scope CurrentUser iwr -useb get.scoop.sh | iex scoop --version ``` ## Install CLI Tools `kind` is a tool for running local Kubernetes clusters using Docker containers as “nodes”. `kubectl` is a tool that allows runing commands against Kubernetes clusters. We will install those tools using `scoop`. ```Powershell scoop install kind kubectl kind version kubectl version --client ``` ## Install Docker Desktop on Windows Docker Desktop an application created by Docker Inc.'s (the company that created Docker, the technology). It provides a user friendly graphical user interface to run and inspect Docker containers. It also creates and manages a virtual machine in which containers are executed. That allows Windows users to run Linux containers. The most recent versions of Docker for Desktop run containers using WSL 2, which is a Windows subsystem that ships a Linux kernel, allowing users to run Linux distros in Windows without the overhead of a virtual machine. To install Docker Desktop, download it from the [official web page](https://docs.docker.com/desktop/windows/install/) and follow the interactive graphical installer (this will require privillege elevation). ## Create a cluster Create a cluster by invoking `kind`, then check if `kubectl` is configured correctly: ```Powershell kind create cluster kubectl cluster-info --context kind-kind ``` If everything was setup correctly, you should be a message like so: ```Powershell Kubernetes control plane is running at https://127.0.0.1:62109 CoreDNS is running at https://127.0.0.1:62109/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. ``` ## A Winner is You That's it. You can now run commands against your cluster using `kubectl` or use graphical tools like [Lens](https://k8slens.dev/).