Tools needed
- download and install minikube from https://minikube.sigs.k8s.io/docs/start/
Machine Preparation
You will need to edit the local DNS resolver. On Linux / MacOS it's straight forward, you will have to figure it out on your own on Windows
- run
minikube ip
- copy/paste the IP address you get.
- edit /etc/hosts like so:
sudo nano /etc/hosts
- add an entry at the end of /etc/hosts
192.168.99.109 api.k8s.local
- if you are on a mac m1, then add
127.0.0.1 api.k8s.local
- if you are on a mac m1, then add
- make sure to use the correct IP address
- save and exit
- run
minikube addons enable ingress
Running the backend locally
- run
minikube start
in case minikube is not already running- if you are on a mac m1, then in a new tab run
minikube tunnel
- if you are on a mac m1, then in a new tab run
- go to the location where you cloned the
k8s-tutorial
repository - apply all yaml files under
aggregator/deployment/kubernetes
,movies/deployment/kubernetes
,weather/deployment/kubernetes
andk8s/ingress.yaml
using for examplekubectl apply -f k8s/ingress.yaml
- once the build has completed open your browser and go to
http://api.k8s.local/aggregator/all