solr-operator icon indicating copy to clipboard operation
solr-operator copied to clipboard

Provide a tutorial for running solr-operator on microk8s / minikube.

Open sigram opened this issue 5 years ago • 3 comments

Is your feature request related to a problem? Please describe. Current Local Tutorial instructions don't work on microk8s or minikube.

Describe the solution you'd like It would be great to provide instructions on how to run solr-operator on microk8s / minikube. Docker-edge on macOS has a bug that results in very high CPU usage even when idle.

Additional context I followed the steps in the existing tutorial (plus some corrections) but this resulted in a non-functional Solr cluster.

The main issue seems to be that both microk8s and minikube use 10.x.x.x subnet for internal pod IPs (and each of them gets a different IP, unlike with Docker.app which seems to use 127.0.0.1 for all of them), and apparently the ingress configuration doesn't deal with it properly - in some cases I could use minikube tunnel to contact one of the nodes but it wouldn't be able to see any other node (or ZK).

sigram avatar Oct 28 '20 16:10 sigram

Here's a draft write-up that I came up with for running solr-operator on microk8s:

==Solr-operator on microk8s==

  • install microk8s

brew install ubuntu/microk8s/microk8s

  • install microk8s components. This will also install Canonical Multipass service.

microk8s install

  • Microk8s comes with its own version of kubectl available via microk8s kubectl command. In order to use the external kubectl command a proper config needs to be created for it:
cd ~/.kube
microk8s config > config
  • you can view Kubernetes Dashboard by running this:

microk8s dashboard proxy

NOTE: this command runs in foreground and outputs the URL where the Dashboard can be viewed, as well as the security token needed to log in. Please also note that Chrome refuses to open this HTTPS URL because of invalid certificate, and it doesn't offer any option to proceed. You can bypass it by typing (anywhere) on the error page "thisisunsafe" - this will add the page to the Chrome's security exceptions.

  • follow the remaining steps in the tutorial. NOTE: on a slow internet connection it may take several minutes to pull necessary images, so the first time a complete SolrCloud startup could take ~10 min.

sigram avatar Oct 28 '20 16:10 sigram

Here's an example taken from a running Solr cluster that is nonetheless non-functional (and inaccessible):

bash-3.2$ kubectl get svc
NAME                                   TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
kubernetes                             ClusterIP   10.152.183.1     <none>        443/TCP             51m
example-solrcloud-common               ClusterIP   10.152.183.22    <none>        80/TCP              28m
example-solrcloud-0                    ClusterIP   10.152.183.55    <none>        80/TCP              28m
example-solrcloud-1                    ClusterIP   10.152.183.11    <none>        80/TCP              28m
example-solrcloud-2                    ClusterIP   10.152.183.245   <none>        80/TCP              28m
example-solrcloud-zookeeper-client     ClusterIP   10.152.183.111   <none>        2181/TCP            28m
example-solrcloud-zookeeper-headless   ClusterIP   None             <none>        2888/TCP,3888/TCP   28m

sigram avatar Oct 28 '20 16:10 sigram

I think this is a great idea!

So my thoughts (not complete, just a first pass):

  • microk8s config > config This is pretty heavy weight, kubectl supports parsing of multiple kube config files, so we can pipe to a separate file and add that to the environment variable.
  • We could not use ingresses in the basic example, and instead use kubectl port-forward. We would have a separate tutorial that explains how to use with ingresses/ExternalDNS. This should fix the IP issue for most people.

We are probably going to want to wait until this repo is migrated to apache/solr-operator before implementing new tutorials. That is the next milestone and all effort is going to making that happen currently. This (and other tutorial improvements) should certainly be one of the priorities after the migration is done.

HoustonPutman avatar Nov 18 '20 22:11 HoustonPutman