Last active
April 19, 2023 04:02
-
-
Save debovema/783f29040059f8b2b784a246dbd96365 to your computer and use it in GitHub Desktop.
Eclipse Che on WSL2
This file contains 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 characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!