Minikube install guide
Minikube is a lite installation for Kubernetes (K8s). This is a great option for standalone (eg Pre-sales workstation) or low usage environments.
Table of contents
Introduction
The goal of this guide is to allow you to run our own custom implementation of Buzzy on a local system (eg laptop).
The summary of what we’ll be doing:
Get prerequisites defined/installed ie Docker and Minikube
Setup Buzzy running on your Minikube environment
Install NGINX to optionally allow external access to your local Buzzy server - for example, allowing a mobile phone to connect to the local Buzzy server
Prequisites - Docker & Minikube
Ensure you have a computer with enough disk space - eg 10GB space, obviously, size of files on the server like Map Tiles Caches etc should be taken into account.
You will need to be able to setup 2 DNS entries:
External IP - Where ever you see
buzzydev1.buzzy.buzz
in the settings/documentation. This will be the IP address of the server/aka your dev machine that is accessible by users on the network. For example if this is a192.168.x.y
address of your machine and your device/phone is on the same WIFI in the same subnet.Internal IP represented by
buzzydev1.buzzy.buzz
in the settings/documentation. You’ll get this for thebuzzy-service
once you have completed the K8s/Minikube setup below.
Setup an account on docker.com and contact the Buzzy team with the username, so you can get secure access to the docker images
Install Docker - recommend install Docker Community Edition - please follow the instructions for your specific operating system
Install Minikube - see the Getting Started Guide for instructions on installing Minikube for you operating system
Run
minikube start
- this will start your local Minikube environment. You should be able to verify your Minikube has started by running a command likekubectl get po -A
and get a list of processes running.minikube status
will give you the status.Get the K8s dashboard running: (see here for more info)
minikube dashboard
- this will open your minikube dashboard in your local browser and you should beOptional - if you intend to access the server from another device, then you need to have a way to define a domain name for the service. There are lots of ways to do this eg editing individual hosts files on each device. On mobile devices, this can be harder. Setting up an external DNS that points to the internal IP addresses is one simple solution. Other solutions include setting it up as part of your local WIFI network.
Setting up Buzzy on Minikube
Clone/download the Buzzy Docs repo - so you can get copies of all the relevant files to install and run Buzzy on your Minikube. Once the repo is cloned/downloaded (upzipped) to your local machine is running, in
Terminal
go into yourbuzzy-docs
repo/directory and change into theminikube/samples
directory/folder.Create a custom namespace (eg
buzzy
or whatever you’d like to call your service):kubectl create namespace buzzy
; on success you should seenamespace/buzzy created
. We’ll use this namespace to help separate the Buzzy related services on the K8s system. If you refresh your Minikube dashboard URL (setup above) you should new see the name space listed in the dashboard console.Create a
docker-registry
secret with your username/password so can access the docker images mentioned above. Replace thebuzzy
namespace with your name space you defined:kubectl create secret docker-registry dockerhub --docker-server=docker.io --docker-username=<username> --docker-password=<password> --docker-email=<email> --namespace=buzzy
Once created you should get the success messagesecret/dockerhub created
. In you K8s Dashboard screen you can now select the namespace and on theOverview
page you should see your secret that has been created.Now we’re going to enable an ingress, which controls access to the relevant service. In Terminal, execute:
minikube addons enable ingress
. You should see the success messageingress was successfully enabled
and if you execute the commandminikube addons list
you should see it’s enabled:Edit your
buzzy.yaml
file to reflect your settings.Variable Info Example ROOT_URL
External url to your server/machine
eg. `https://buzzydev1.somedomain.com`
MONGO_URL
URL to mongo service. In this example it's already setup in Minikube, however this could be changed to point to another Mongo DB instance on the cloud or elsewhere.
METEOR_SETTINGS
This must be a string that interprets to valid JSON object.
Meteor.settings
valiables that are not underpublic
are visible to the server only. Anything underMeteor.settings.public
will be visible to the client: browser, phone, tablet etc. Be careful not provide any secret confidential settings underpublic
See below for specific settings. Please go through each of the settings and fill out as best as possible.
Variable Info Example Meteor.settings.jwtSecret
Set this to a long eg 30+ character random string. IT will be used for encoding JWT secrets on the server
Now we need to run the relevant YAML files that will setup the relevant services. Inside your
buzzy-docs\minikube
directory/folder you’ll see a lot of yaml files. You can run these one by one or as a batch by runningapply_all.sh
. If you get a permission denied error when trying to rule./apply_all.sh
then in Terminal do achmod u+x apply_all.sh
and try and run again. If run successfully you should see something like:You should be able to see the deployments starting successfully in your Minikube dashboard. Note, it may take some time to download and start some of your services. For troubleshooting, see below.
In the terminal type minikube service buzzy-service --url -n buzzy
this will give you something like http://192.168.64.9:31836
and if you plug that into a browser you should see the login page… YAY!!!
That means Buzzy is up and running on the internal Minikube environment.
Now we need to make your local Buzzy server available to the outside world, so that other computers/devices can access it. This is an optional step, as you can already access you server from you machine. If you don’t need external access you can stop here. Firstly we’re going to create a Minikube tunnel - open a new terminal tab and type
minikube tunnel
. You should now be able to access your server in the browser from itsCluster IP
which can be found underServices
in the K8s Dashboard.The next step is passing external network traffic to the Minikube ingress and services. For this we’ll use NGINX. Note there will be other ways to do this, but this is one that works. Please install NGINX which will give access to your computer and the Minikube services to the outside world. Next we’ll need to edit the NGINX conf file to pass traffic to the server. Find your default NGINX file and make it look like , replacing
buzzydev1.buzzy.buzz
with your external DNS entry that points to you machines IP andbuzzydemo.buzzy.buzz
with your internal DNS entry for your ingress.
Now run NGINX ex - eg on mac sudo nginx
and if you need to stop it sudo nginx -s stop
Trouble shooting
Trouble shooting: For example if the buzzy service
has not started:
buzzy service
has not started:Find the pod or service that’s failing in the Dashboard. In the Terminal type kubectl logs <ID of the pod/service buzzy-app-59d9d786dc-kbsdx>
This should show you some logs, that will help you debug the specific issue. It’s probably going to be an issue in the buzzy.yaml
file.
Stop the specific service, for example to stop the buzzy service kubectl delete -f ./8_buzzy.yaml
, you should see the service disappear from the K8s dashboard. Then fix the YAML and just reload/apply that specific YAML, for example: kubectl apply -f ./8_buzzy.yaml
and check the Dashboard to see if there service has started successfully.
Debugging mongo
Login in to the mongodb
pod with something like kubectl exec -it mongodb-758868b55b-5mj2k -n buzzy bash
That should give you a shell into the Mongo pod. Now type mongo
, which should open a mongo shell. Type help
for mongo shell commands eg show dbs
and you should see a buzzy
db. You can then use buzzy
and perform queries and updated from the console.
Last updated