Skip to content

Commit dd1e85f

Browse files
committedApr 15, 2021
Instructions for Win 10 Pro/Home
1 parent bb6b98c commit dd1e85f

File tree

1 file changed

+85
-19
lines changed

1 file changed

+85
-19
lines changed
 

‎docs/Development.md

+85-19
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
# Development
22

3-
## Setting up development environment with Skaffold
3+
## Table of Contents
4+
1. [Setting up development environment on Linux](#setting-up-development-environment-on-linux)
5+
2. [Setting up development environment on Windows 10](#setting-up-development-environment-on-windows-10)
6+
## Setting up development environment on Linux
47

58
### Development tools
69

7-
1. Install Skaffold: https://skaffold.dev/docs/install/
10+
1. Install Skaffold: https://skaffold.dev/docs/install/
811
2. Install kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/
912
3. Install minikube: https://minikube.sigs.k8s.io/docs/start/
1013

11-
You may also need stern and kubectx or [kubectxwin](https://github.com/thomasliddledba/kubectxwin).
14+
You may also need stern and kubectx.
1215

13-
Windows TIP: Install tools via Chocolatey.
14-
> **Alternative**: Save all `.exe` files in same location and rename them to be `skaffold.exe` etc.
15-
> Run command ```rundll32.exe sysdm.cpl,EditEnvironmentVariables``` and add the path for executable files to **System variable PATH**.
16-
17-
### Setting up minikube (Linux)
16+
### Setting up minikube
1817

1918
Start minikube:
2019

@@ -28,17 +27,86 @@ Enable the ingress addon:
2827
minikube addons enable ingress
2928
```
3029

31-
### Setting up minikube (Windows)
30+
### Starting the development cluster
31+
32+
In the root of the repo, run: `bin/dev`. This skript will start the development cluster with skaffold. The initial build will take a while but after that is done, everything should be relatively quick.
33+
34+
You can monitor the process by running `watch kubectl get pods` in another terminal.
35+
36+
TIP: For multiple terminal windows, we recommend you to use a terminal with split window support for convenience. For Linux, one good option is [Tilix](https://gnunn1.github.io/tilix-web/).
37+
38+
### Setting up a local domain name
39+
40+
After skaffold has started up, we need to add a local domain name so that we can access the ingress of the cluster.
41+
42+
List ingresses with kubectl and grab the IP address for `project-331-ingress`:
43+
44+
```sh
45+
kubectl get ingress
46+
```
47+
48+
Next, add a hosts entry for the IP address you got from the previous command:
49+
50+
```
51+
ip-from-previous-command project-331.local
52+
```
53+
54+
You can find the hosts file in Linux from `/etc/hosts`.
55+
56+
After that, you should be able to access the application by going to `http://project-331.local/` in your web browser. Take a look at `kubernetes/ingress.yml` to see how requests are routed to different services.
57+
58+
59+
## Setting up development environment on Windows 10
60+
61+
### Development tools
62+
63+
Install the following tools with [chocolatey](https://docs.chocolatey.org/en-us/choco/setup ):
64+
2. Kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/
65+
3. Minikube: https://minikube.sigs.k8s.io/docs/start/
66+
67+
You may also need [stern](https://community.chocolatey.org/packages/stern) and [kubectx](https://community.chocolatey.org/packages/kubectx).
68+
69+
### Windows Terminal & Cygwin
70+
71+
1. Install [Windows Terminal](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab)
72+
2. Install [Cygwin](https://www.cygwin.com/)
73+
- During installation of Cygwin you will be prompted for additional packages, these are needed: `postgres-client` & `procps-ng`
74+
3. Open Windows Terminal and press the small arrow down and open Settings (as JSON), add the following:
75+
```
76+
profiles: {
77+
...
78+
list: [
79+
...
80+
{
81+
"guid": "{00000000-0000-0000-0000-000000000001}",
82+
"commandline": "C:/cygwin64/Cygwin.bat",
83+
"icon": "C:/cygwin64/Cygwin-Terminal.ico",
84+
"hidden": false,
85+
"name": "Cygwin"
86+
}
87+
]
88+
}
89+
```
90+
91+
### Skaffold
92+
93+
1. Download [Skaffold](https://skaffold.dev/docs/install/) latest [stable release](https://storage.googleapis.com/skaffold/releases/latest/skaffold-windows-amd64.exe) for Windows and save it under `C:\Binary`.
94+
2. Rename the executable to `skaffold.exe`.
95+
3. Start `cmd` or `Powershell` as administrator and run: `rundll32.exe sysdm.cpl,EditEnvironmentVariables`
96+
4. Under **System variables** click the **Path** row and click button `Edit...`, click button `New` and type in the row: `C:\Binary\`.
97+
5. Check with `Git Bash` or `Cygwin` that Skaffold is in correct folder by running `which skaffold`.
98+
99+
### Setting up minikube (HyperV/Virtualbox)
32100

33101
Using Windows 10 Pro, you can enable HyperV with these [instructions](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v).
34-
If you don't have Windows 10 Pro, you can install [Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/install/) and change driver to ```--vm-driver docker``` for Minikube commands.
35102

36-
*TODO: Figure out if you need to create the default vSwitch in HyperV or does Minikube take care of that*
103+
**NB!** If you don't have access to HyperV, you can install [Virtualbox](https://www.virtualbox.org/) and change driver to `--vm-driver=virtualbox` for Minikube commands.
104+
> NOTE: You may need the `--no-vtx-check` parameter for `minikube start` when using Virtualbox, please try to run the command without it.
37105
38-
Using HyperV:
106+
Example:
39107

40108
```sh
41-
minikube start --vm-driver hyperv
109+
minikube start --vm-driver=hyperv
42110
```
43111

44112
Enable ingress:
@@ -48,12 +116,11 @@ minikube addons enable ingress
48116

49117
### Starting the development cluster
50118

51-
In the root of the repo, run: `bin/dev`. This skript will start the development cluster with skaffold. The initial build will take a while but after that is done, everything should be relatively quick.
52-
53-
You can monitor the process by running `watch kubectl get pods` in another terminal.
119+
Start Windows Terminal (Make sure you are using *Cygwin* terminal)
54120

55-
TIP: For multiple terminal windows, we recommend you to use a terminal with split window support for convenience. For Linux, one good option is [Tilix](https://gnunn1.github.io/tilix-web/) and if you're using Windows, you can use the new [Windows terminal](https://github.com/microsoft/terminal) (Documentation here: https://docs.microsoft.com/en-us/windows/terminal/panes).
121+
In the root of the repo, run: `bin/dev`. This skript will start the development cluster with skaffold. The initial build will take a while but after that is done, everything should be relatively quick.
56122

123+
You can monitor the process by running `watch kubectl get pods` in another *Cygwin* terminal.
57124

58125
### Setting up a local domain name
59126

@@ -71,7 +138,6 @@ Next, add a hosts entry for the IP address you got from the previous command:
71138
ip-from-previous-command project-331.local
72139
```
73140

74-
You can find the hosts file in Linux from `/etc/hosts`.
75-
You can find the hosts file in Windows from `C:\Windows\System32\drivers\etc`.
141+
You can find the hosts file in Windows from `C:\Windows\System32\drivers\etc` (edit as administrator).
76142

77143
After that, you should be able to access the application by going to `http://project-331.local/` in your web browser. Take a look at `kubernetes/ingress.yml` to see how requests are routed to different services.

0 commit comments

Comments
 (0)
Please sign in to comment.