2

I am following the instructions (https://www.eclipse.org/che/docs/che-7/installation-guide/installing-che-on-minikube/) to install Eclipse:Che from Minikube hosted on a remote ubuntu VM box;

I got the installation done successfully,

[![enter image description here][1]][1]

I could access the portal from ubuntu VM console:

[![enter image description here][2]][2]

overhere, the 172.17.0.3 is actually the minikube IP;

How do I enable external access to https://che-che.172.17.0.3.nip.io/dashboard/?

from my reading and googling, it seems like SSH forwarding is the right way, but I am struggling to get it correct.

thanks!

====== update 2020.11.27 =====

$ minikube start --addons=ingress  --memory=8192
$ chectl server:deploy --platform minikube --installer helm
$ kubectl expose deployment che --type=NodePort -n che --port 8080

$ kubectl get svc -n che
NAME               TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
che                NodePort    10.109.226.80    <none>        8080:32540/TCP      16h
che-dashboard      ClusterIP   10.105.102.187   <none>        8080/TCP            17h
che-host           ClusterIP   10.106.2.155     <none>        8080/TCP,8087/TCP   17h
devfile-registry   ClusterIP   10.103.124.53    <none>        8080/TCP            17h
plugin-registry    ClusterIP   10.97.131.33     <none>        8080/TCP            17h

$ minikube service  -n che che
|-----------|------|-------------|-------------------------|
| NAMESPACE | NAME | TARGET PORT |           URL           |
|-----------|------|-------------|-------------------------|
| che       | che  |        8080 | http://172.17.0.4:32540 |
|-----------|------|-------------|-------------------------|
  Opening service che/che in default browser...
  http://172.17.0.4:32540

chaoshi@prd-sal-demo01:~$ kubectl port-forward -n che svc/che 9911:8080
Forwarding from 127.0.0.1:9911 -> 8080
Forwarding from [::1]:9911 -> 8080
Handling connection for 9911
Handling connection for 9911
Handling connection for 9911
Handling connection for 9911
Handling connection for 9911

$ curl http://localhost:9911
[![CircleCI](https://circleci.com/gh/eclipse/che-plugin-registry.svg?style=svg)](https://circleci.com/gh/eclipse/che-plugin-registry)
[![Master Build Status](https://ci.centos.org/buildStatus/icon?subject=master&job=devtools-che-plugin-registry-build-master/)](https://ci.centos.org/job/devtools-che-plugin-registry-build-master/)
[![Nightly Build Status](https://ci.centos.org/buildStatus/icon?subject=nightly&job=devtools-che-plugin-registry-nightly/)](https://ci.centos.org/job/devtools-che-plugin-registry-nightly/)
[![Release Build Status](https://ci.centos.org/buildStatus/icon?subject=release&job=devtools-che-plugin-registry-release/)](https://ci.centos.org/job/devtools-che-plugin-registry-release/)
[![Release Preview Build Status](https://ci.centos.org/buildStatus/icon?subject=release-preview&job=devtools-che-plugin-registry-release-preview/)](https://ci.centos.org/job/devtools-che-plugin-registry-release-preview/)


  [1]: https://i.stack.imgur.com/sVZVz.png
  [2]: https://i.stack.imgur.com/JsOOW.png
  [3]: https://i.stack.imgur.com/maoWv.png
sqr
  • 365
  • 2
  • 12
  • 29
  • 1
    You should create NodePort type service and then app will be available on your ubuntu VM's IP and on the port provided in NodePort service config – avadhut007 Nov 20 '20 at 09:57
  • thank you, @avadhut007. I will try and update. – sqr Nov 23 '20 at 00:31
  • @sqr, did you solve with nodePort? – Mr.KoopaKiller Nov 23 '20 at 06:48
  • @avahut007, sorry, I am newbie to k8s; I tried something and updated the original post above; can you help to take a look again? thanks! – sqr Nov 23 '20 at 12:59
  • @avadhut007, sorry, I am really newbie to k8s, so I don't know what I am doing here; i tried something with NodePort, but I don't understand the output here; I added some update in the post; do you mind helping to take a look again? thank you! – sqr Nov 23 '20 at 13:01
  • The port should be 8080 when creating service. The nodePort gets randomly assigned (or you can choose it --nodePort ). For your config you can see it in the output http://172.17.0.4:31243. So the port is 31243. – avadhut007 Nov 24 '20 at 12:16
  • https://minikube.sigs.k8s.io/docs/handbook/accessing/ – avadhut007 Nov 24 '20 at 12:25
  • @avadhut007, thank you, I tried to export port 8080, update the log above; now I am able to access it from curl http://172.17.0.4:32510/dashboard/; however, 172.17.0.4 is still the minikube IP here, and the EXTERNAL-IP is displayed as none. Is there any way I could fix it and access the service from the VM ip address? – sqr Nov 25 '20 at 02:22
  • try this one for localhost/VM IP:- kubectl port-forward svc/che 32510:32510 – avadhut007 Nov 25 '20 at 06:50
  • @avadhut007, thanks. I got some error port-forwarding the service; however, port-forward the deployment is running, but I am still not getting anything from localhost:32510; i updated above. – sqr Nov 26 '20 at 09:38
  • for deployment portforward will not work. Try other port of your service kubectl port-forward svc/che 8080:8080 – avadhut007 Nov 26 '20 at 13:06
  • thank you so much, @avadhut007. I managed to get response from localhost:9911; I think I am just one step away to access it from another machine. I think I need to investigate more on the VM network settings. – sqr Nov 27 '20 at 02:24
  • 1
    @avadhut007, What do you think to provide an answer with all information you gave in comments? It will be appreciated by community. – Mr.KoopaKiller Dec 01 '20 at 09:02

1 Answers1

3

First, you should create a NodePort type service and then the app will be available on your Ubuntu VM's IP and on the port provided in the NodePort service config

The port should be 8080 when creating service. The nodePort gets randomly assigned (or you can choose it --nodePort ). For your config, you can see it in the output 172.17.0.4:31243. So the port is 31243. Reference: https://minikube.sigs.k8s.io/docs/handbook/accessing/

For deployment portforward will not work instead use service. Try other port of your service: Here, first port is Host Port and seccond port is container port.

kubectl port-forward svc/che 8080:8080

Once it's accessible on localhost:8080 you can access it outside the VM using externalIPofVM:8080

avadhut007
  • 332
  • 3
  • 16