-
-
Save debovema/783f29040059f8b2b784a246dbd96365 to your computer and use it in GitHub Desktop.
# start a Minikube instance | |
minikube start --addons=ingress --driver=docker --memory=12288 --cpus=6 | |
# deploy Eclipse Che | |
chectl server:deploy --platform=minikube | |
# configure network | |
## 1. edit /etc/hosts in WSL2 (warning: this will not persist across WSL restarts) | |
echo "127.0.0.1\t$(minikube ip).nip.io" | sudo tee -a /etc/hosts | |
echo "127.0.0.1\tdex.$(minikube ip).nip.io" | sudo tee -a /etc/hosts | |
## 2. edit /etc/hosts in Windows hosts | |
## next line must be run with administrative rights (for instance launch Windows Terminal as administrator) | |
echo "127.0.0.1\t$(minikube ip).nip.io" | sudo tee -a /c/Windows/System32/drivers/etc/hosts # path could also starts with /mnt/c instead of /c | |
echo "127.0.0.1\tdex.$(minikube ip).nip.io" | sudo tee -a /c/Windows/System32/drivers/etc/hosts # path could also starts with /mnt/c instead of /c | |
## 3. add reverse entries in Core DNS | |
kubectl get configmap coredns -n kube-system -o json | sed "s[hosts {[hosts {\\\\n $(echo `kubectl run -it --rm coredns-fix --image=alpine --restart=Never -- sh -c 'getent hosts host.docker.internal'` | awk '{ print $1 }') $(minikube ip).nip.io[" | kubectl replace -f - | |
kubectl get configmap coredns -n kube-system -o json | sed "s[hosts {[hosts {\\\\n $(echo `kubectl run -it --rm coredns-fix --image=alpine --restart=Never -- sh -c 'getent hosts host.docker.internal'` | awk '{ print $1 }') dex.$(minikube ip).nip.io[" | kubectl replace -f - | |
# export Eclipse Che Certificate Authority (to be imported in end-user browser) | |
chectl cacert:export | |
# pull the (huge) Docker image used by DevWorkspaces in the Minikube Docker daemon | |
eval $(minikube docker-env) | |
docker pull quay.io/devfile/universal-developer-image:ubi8-latest | |
# start the Minikube tunnel | |
minikube tunnel | |
# open the Eclipse Che Dashboard | |
chectl dashboard:open |
This script is so cool! Thank you @debovema
I have successfully installed using this script. But I have a problem. When the system is logged in, a 500 exception occurs。
The exception stack is as follows:
[2022/06/27 10:07:07] [oauthproxy.go:723] Error redeeming code during OAuth2 callback: token exchange failed: Post "https://dex.192.168.49.2.nip.io/token": dial tcp 127.0.0.1:443: connect: connection refused 172.17.0.9:45400 - e23fb40c58c534a619bafa9ad18dd519 - - [2022/06/27 10:07:07] 192.168.49.2.nip.io GET - "/oauth/callback?code=gwxvkvyyexziamfb7ynjldcmp&state=B8mekKte-U97aPyAl18Npe39irhhEBBVqBBGIvHiiLg%3A%2Fdashboard%2F" HTTP/1.1 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" 500 2830 0.001 [2022/06/27 10:07:07] [oauthproxy.go:862] No valid authentication in request. Initiating login.
I used to have this issue too.
Check the new version of the Gist, especially:
kubectl get configmap coredns -n kube-system -o json | sed "s[hosts {[hosts {\\\\n $(echo `kubectl run -it --rm coredns-fix --image=alpine --restart=Never -- sh -c 'getent hosts host.docker.internal'` | awk '{ print $1 }') $(minikube ip).nip.io[" | kubectl replace -f -
kubectl get configmap coredns -n kube-system -o json | sed "s[hosts {[hosts {\\\\n $(echo `kubectl run -it --rm coredns-fix --image=alpine --restart=Never -- sh -c 'getent hosts host.docker.internal'` | awk '{ print $1 }') dex.$(minikube ip).nip.io[" | kubectl replace -f -
basically it updates the hosts
section in the CoreDNS configuration (you might need to delete the CoreDNS pod to recreate a pod with the new configuration).
Instead of resolving dex.192.168.49.2.nip.io to 127.0.0.1, it will resolve as the Docker host IP as seen from inside a Kubernetes pod.
Hi @debovema,
awesome script.
I'm using containerd
as the container runtime.
Can you point me in the right direction on what I need to do?
Merci
Update:
I followed your commands except for the last two.
Accessing Eclipse Che from localhost works though!
Tested on Minikube 1.26.0