Overview of services:
- kubectl (part of gcloud sdk)
- minikube or kubernetes cluster
- docker (for building service images)
- NodeJS
- Angular CLI tool (for building frontend)
git clone git@github.com:me-ventures/microservice-toolkit-demo.gitStart the minikube cluster with the following command:
minikube startKubectl will be automatically setup to connect to the local minikube cluster.
To get credentials you can use the gcloud sdk:
# List clusters
gcloud container clusters list
gcloud container clusters get-credentials <CLUSTER_NAME>Now you should be connected to the Kubernetes cluster.
We first deploy the rabbitmq service.
# from project directory
kubectl apply -f infra/rabbitmq.ymlBefore deploying the other services we have to wait until the rabbitmq service is running. You check that by using the kubectl get pods --watch. Wait until the rabbitmq pod is in running status.
Now we can deploy the rest of the services. This command will apply all the infrastructure files in the directory (not recursive).
# from project directory
kubectl apply -f infra/You can watch the pods again and wait until they are all have the running status. This can take a couple minutes.
Add traefik service external ip to /etc/hosts under articles.demo.com
# list services
kubectl get svc
# should output something like this:
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
...
traefik-service 10.3.248.53 123.45.67.89 80/TCP 2d
# /etc/hosts
123.45.67.89 articles.demo.com.. then go to articles.demo.com
Port forward grafana pod
# list pods
kubectl get pods
kubectl port-forward <grafana-pod> <local-port>:3000.. then view grafana at localhost:<local-port>
- add Graphite data source with address
http://graphite-service - add Prometheus data source with address
http://prometheus:9090
Import optional dashboards located in the grafana directory of this repository: https://github.com/me-ventures/microservice-toolkit-demo/tree/master/grafana
Port forward relationship mapper and relationship backend pods
# list pods
kubectl get pods
kubectl port-forward <relationship-mapper-pod> <local-port>:80
kubectl port-forward <relationship-backend-pod> 3000.. then view the tool at localhost:<local-port>
