Evolveum / midpoint-kubernetes

All stuff related to midPoint in Kubernetes
Apache License 2.0
2 stars 2 forks source link

Running midpoint-live-demo-setup.sh #1

Open Cykllon opened 1 year ago

Cykllon commented 1 year ago

When running script I get two errors. I have kubernetes and it is working so I don't understand how can i get error "kubectl: command not found". Please help. image

janmederly commented 1 year ago

Hi, @Cykllon could you please provide more information about your environment? What k8s distribution do you use? What version of kubectl do you have? Do you use wsl or some interpreter, if yes, what version do you use? At first look, it may be caused by running the bash script in the wsl environment where kubectl isn't installed, while running the kubectl command in the windows environment.

Cykllon commented 1 year ago

Maybe I should have started differently. I'm wandering in the dark trying to run this demo at my place. I am working on windows 10, what should I do to make it work?

janmederly commented 1 year ago

Sorry, I didn't put prerequisites to the readme but it wasn't developed for windows 10. I could still check and test it in my own environment but I really need to know what k8s cluster you use because there were some distributions that still had some bugs that needs to be fixed and also there were some with which I have not tested this script.

Cykllon commented 1 year ago

minikube ( I followed this instruction https://minikube.sigs.k8s.io/docs/start/). I am using WSL 2 with Ubuntu 22.04.2 LTS. What system does it work best with?

janmederly commented 1 year ago

Hi, it was developed mainly for linux and original k8s and microk8s. But I checked and it should work with windows 10 with wsl and minikube also. But there are a few steps that you should follow (I am going to add these also to the readme):

  1. When running the setup script it runs in wsl environment where you don't have kubectl installed. So you have two options to resolve this: a) install kubectl in wsl and copy configuration from windows, b) Replace the kubectl command in setup script with the path to kubectl.exe. To do so find the kubectl.exe location in windows with where.exe kubectl and then replace "kubectl" in the startup script with the output of that command, also replace C:\ with /mnt/c/ and "\" with "/" and directories with multiple words in name put into single quotes (for example C:\Program Files\Docker\Docker\resources\bin\kubectl.exe was my output and I edited it to /mnt/c/'Program Files'/Docker/Docker/resources/bin/kubectl.exe and then replaced "kubectl" with this). I think this is a more straightforward solution.
  2. Minikube does not have an installed ingress controller by default so you should enable it: https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/
  3. Run setup script. Now wait till the midpoint starts. On a multinode k8s cluster this is about 3-4 minutes, on a single node cluster running on vm it was more like 10-20 minutes. Then you can try to add minikube ip to the hosts file so you can access midpoint with demo.example.com, but there were some problems in windows and minikube, I am going to look into it in a while. Alternatively, you can use port forwarding, this method should work. For more info please read minikube documentation https://minikube.sigs.k8s.io/docs/start/ Note: this demo may need more than 2 CPU cores and 2 GB of memory.