You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/content/en/docs/handbook/accessing.md
+128-60
Original file line number
Diff line number
Diff line change
@@ -25,10 +25,77 @@ A NodePort service is the most basic way to get external traffic directly to you
25
25
We also have a shortcut for fetching the minikube IP and a service's `NodePort`:
26
26
27
27
```shell
28
-
minikube service --url <service-name>
28
+
minikube service <service-name> --url
29
29
```
30
30
31
-
## Getting the NodePort using kubectl
31
+
### Using `minikube service` with tunnel
32
+
33
+
The network is limited if you are using a Docker driver on darwin, Windows or WSL, and the Node IP is not reachable directly.
34
+
35
+
If minikube runs on Linux with Docker driver, no tunnel will be created.
36
+
37
+
Services of type `NodePort` can be exposed via the `minikube service <service-name> --url` command. It must be run in a separate terminal window to keep the [tunnel](https://en.wikipedia.org/wiki/Port_forwarding#Local_port_forwarding) open. Ctrl-C in the terminal can be used to terminate the process at which time the network routes will be cleaned up.
`minikube service hello-minikube1 --url` runs as a process, creating a [tunnel](https://en.wikipedia.org/wiki/Port_forwarding#Local_port_forwarding) to cluster. The command exposes the service directly to any program running on the host operating system.
71
+
72
+
<details>
73
+
<summary>
74
+
service output example
75
+
</summary>
76
+
<pre>
77
+
$ minikube service hello-minikube1 --url
78
+
http://127.0.0.1:57123
79
+
❗ Because you are using a Docker driver on darwin, the terminal needs to be open to run it.
open in your browser (make sure there is no proxy set)
93
+
94
+
```shell
95
+
http://127.0.0.1:TUNNEL_PORT
96
+
```
97
+
98
+
### Getting the NodePort using kubectl
32
99
33
100
The minikube VM is exposed to the host system via a host-only IP address, that can be obtained with the `minikube ip` command. Any services of type`NodePort` can be accessed over that IP address, on the NodePort.
34
101
@@ -54,77 +121,78 @@ This flag also accepts a comma separated list of ports and port ranges.
54
121
55
122
A LoadBalancer service is the standard way to expose a service to the internet. With this method, each service gets its own IP address.
56
123
57
-
## Using `minikube tunnel`
124
+
### Using `minikube tunnel`
58
125
59
126
Services of type`LoadBalancer` can be exposed via the `minikube tunnel` command. It must be run in a separate terminal window to keep the `LoadBalancer` running. Ctrl-C in the terminal can be used to terminate the process at which time the network routes will be cleaned up.
60
127
61
-
## Example
128
+
### Example of LoadBalancer
62
129
63
-
####Run tunnel in a separate terminal
130
+
1. Run tunnel in a separate terminal
64
131
65
-
it will ask for password.
132
+
it will ask for password.
66
133
67
-
```shell
68
-
minikube tunnel
69
-
```
134
+
```shell
135
+
minikube tunnel
136
+
```
70
137
71
-
`minikube tunnel` runs as a process, creating a network route on the host to the service CIDR of the cluster using the cluster's IP address as a gateway. The tunnel command exposes the external IP directly to any program running on the host operating system.
72
-
73
-
<details>
74
-
<summary>
75
-
tunnel output example
76
-
</summary>
77
-
<pre>
78
-
Password:
79
-
Status:
80
-
machine: minikube
81
-
pid: 39087
82
-
route: 10.96.0.0/12 -> 192.168.64.194
83
-
minikube: Running
84
-
services: [hello-minikube]
85
-
errors:
86
-
minikube: no errors
87
-
router: no errors
88
-
loadbalancer emulator: no errors
89
-
...
90
-
...
91
-
...
92
-
</pre>
93
-
</details>
94
-
95
-
#### Create a kubernetes deployment
138
+
`minikube tunnel` runs as a process, creating a network route on the host to the service CIDR of the cluster using the cluster's IP address as a gateway. The tunnel command exposes the external IP directly to any program running on the host operating system.
### Access to ports <1024 on Windows requires root permission
222
+
155
223
If you are using Docker driver on Windows, there is a chance that you have an old version of SSH client you might get an error like - `Privileged ports can only be forwarded by root.` or you might not be able to access the service even after `minikube tunnel` if the access port is less than 1024 but for ports greater than 1024 works fine.
156
224
157
225
In order to resolve this, ensure that you are running the latest version of SSH client. You can install the latest version of the SSH client on Windows by running the following in a Command Prompt with an Administrator Privileges (Requires [chocolatey package manager](https://chocolatey.org/install))
158
-
```
226
+
```cmd
159
227
choco install openssh
160
228
```
161
-
The latest version (`OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5`) which is available on Windows 10 by default doesn't work. You can track the issue with this over here - https://github.com/PowerShell/Win32-OpenSSH/issues/1693
229
+
The latest version (`OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5`) which is available on Windows 10 by default doesn't work. You can track the issue with this over here - https://github.com/PowerShell/Win32-OpenSSH/issues/1693
0 commit comments