- minikube v0.14.0+
- Kubernetes Helm
Start minikube
minikube start
Deploy Mongo Data Store
carshare-api uses mongo for data persistence.
kubectl create -f mongo-rc.yaml
kubectl create -f mongo-service.yaml
Deploy Carshare API
kubectl create -f carshare-api-rc.yaml
kubectl create -f carshare-api-service.yaml
Deploy Carshare Web
kubectl create -f carshare-web-rc.yaml
kubectl create -f carshare-web-service.yaml
Ingress is not enabled by default in minikube.
minikube addons enable ingress
Initialise helm on the cluster
helm init
Deploy the NGINX Ingress Helm Chart.
helm install --name my-release stable/nginx-ingress
Create Ingress
kubectl create -f ingress.yaml
You can test the system by adding carshare.test
to your /ets/hosts
file.
echo "$(minikube ip) carshare.test" | sudo tee -a /etc/hosts
You should be able to access carshare-web by navigating to carshare.test in a browser.
You should also be able to make a GET
request on carshare-api.
$ curl http://carshare.test/api/v0/carShares
{"errors":[{"status":"403","title":"Forbidden"}]}
It should respond with an error 404 forbidden as you will not be authenticated.