Table of Contents

fleetgrid

Init

From the projects root directory:

$ echo $PWD
/Users/doorway/Projects/fleetgrid

If you don't have fleetgrid cloned then do so now.

# jump to the projects directory
$ cd ~/Projects

# clone project
$ git clone git@gitlab.com:fleetgrid/fleetgrid.git

# jump into the project
$ cd fleetgrid

Start

Start minikube.

$ minikube start --cpus=2 --memory=4096

Dashboard

To access the Kubernetes Dashboard, run this command in a shell after starting minikube to get the address:

$ minikube dashboard

Ingress

To setup ingress, enable the minikube add-on

# Based off the following guide:
# https://medium.com/@Oskarr3/setting-up-ingress-on-minikube-6ae825e98f82

$ minikube addons enable ingress

Helm

Next, we need to initialize helm.

$ helm init

Namespace

Create a namespace for the app.

$ kubectl create namespace fleetgrid

Container Registry

Give minikube access to private container registery (gcr).

# based off the following guide:
# https://ryaneschinger.com/blog/using-google-container-registry-gcr-with-minikube/

# add secret
$ kubectl --namespace=fleetgrid create secret docker-registry gcr-json-key           --docker-server=https://gcr.io           --docker-username=_json_key           --docker-password="(cat ~/Projects/fleetgrid/fleetgrid-1123d633e242.json)"           --docker-email=travis.burandt@gmail.com

# config serviceaccount to use secret
$ kubectl --namespace=fleetgrid patch serviceaccount default           -p '{"imagePullSecrets": [{"name": "gcr-json-key"}]}'

# veryify that it was set correctly
$ kubectl --namespace=fleetgrid get serviceaccount default -o yaml

Give minikube access to private container registery (gitlab).

# based off the following gitlab ticket
# https://gitlab.com/gitlab-org/gitlab-ce/issues/41265

# add secret
$ kubectl create secret docker-registry my-reg     --docker-server=https://registry.gitlab.com     --docker-username=metaheap     --docker-password=XUZti74diuas     --docker-email=metaheap.io@gmail.com     --namespace=fleetgrid

# config serviceaccount to use secret
$ kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "my-reg"}]}' --namespace=fleetgrid

Dependancies

If not already, build helm dependancies.

$ helm dep build ./chart

If not already, update helm dependancies (requirements.yaml to import into ./charts)

$ cd ./chart
$ helm dep up

Install

Install fleetgrid and give it a release name.

$ helm --namespace=fleetgrid install ./chart --name=burandt

Install monitoring.

# prometheus
$ helm install --name prometheus stable/prometheus --namespace=fleetgrid -f ./chart/prometheus.yaml

# Grafana
$ helm install --name grafana stable/grafana --namespace=fleetgrid -f ./chart/grafana.yaml

Check fleetgrid:

# List services
$ minikube service list

Hosts

Add domains to hosts file.

# if you don't already have hostile installed
$ sudo npm i hostile -g

# add domains to hostsfile
# sudo hostile set [ip] [host]
# use "set $(minikube ip)" if you're using bash instead of fish 
$ sudo hostile set (minikube ip) fleetgrid.minikube
$ sudo hostile set (minikube ip) www.fleetgrid.minikube
$ sudo hostile set (minikube ip) api.fleetgrid.minikube
$ sudo hostile set (minikube ip) jsreport.fleetgrid.minikube
$ sudo hostile set (minikube ip) rabbitmq.fleetgrid.minikube
$ sudo hostile set (minikube ip) prometheus.fleetgrid.minikube
$ sudo hostile set (minikube ip) grafana.fleetgrid.minikube

# --- or ---
$ echo "$(minikube ip) fleetgrid.minikube" | sudo tee -a /etc/hosts
$ echo "$(minikube ip) www.fleetgrid.minikube" | sudo tee -a /etc/hosts
$ echo "$(minikube ip) api.fleetgrid.minikube" | sudo tee -a /etc/hosts
$ echo "$(minikube ip) jsreport.fleetgrid.minikube" | sudo tee -a /etc/hosts
$ echo "$(minikube ip) rabbitmq.fleetgrid.minikube" | sudo tee -a /etc/hosts
$ echo "$(minikube ip) prometheus.fleetgrid.minikube" | sudo tee -a /etc/hosts
$ echo "$(minikube ip) grafana.fleetgrid.minikube" | sudo tee -a /etc/hosts

$ cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
192.168.99.100 fleetgrid.minikube
192.168.99.100 www.fleetgrid.minikube
192.168.99.100 api.fleetgrid.minikube
192.168.99.100 jsreport.fleetgrid.minikube
192.168.99.100 rabbitmq.fleetgrid.minikube
192.168.99.100 prometheus.fleetgrid.minikube
192.168.99.100 grafana.fleetgrid.minikube
127.0.0.1 fleetgrid.development
127.0.0.1 www.fleetgrid.development
127.0.0.1 api.fleetgrid.development
127.0.0.1 jsreport.fleetgrid.development
127.0.0.1 rabbitmq.fleetgrid.development
127.0.0.1 prometheus.fleetgrid.development
127.0.0.1 grafana.fleetgrid.development

Upgrade

Upgrade a release.

# helm upgrade [RELEASE] [CHART]
$ helm --namespace=fleetgrid upgrade burandt ./chart

Cleanup

# remove a release
$ helm del --purge burandt
$ helm del --purge prometheus
$ helm del --purge grafana

# destory
$ minikube stop
$ minikube delete
  

About

We are technologically disrupting industries by focusing on one thing; field service.

fleetgrid is owned and operated by the Burandt family.

This site is copyright © fleetgrid 2018. Design and logo copyright © fleetgrid 2018.

v0.0.27

2

What are you waiting for?

Get started with fleetgrid today. It takes minutes to fill in our signup form then just seconds to add your first customer; you will be scheduling work orders and getting paid before you know it.

fleetgrid

fleetgrid

12
2