-
Notifications
You must be signed in to change notification settings - Fork 579
Setup locally on Linux and MacOS
Thang Chung edited this page Aug 29, 2018
·
2 revisions
-
Make sure we have
Docker for Desktop
running withKubernetes
option enabled. We need to installkubectl
,helm
andistioctl
on the build machine as well. -
Clone the current source code to your local machine
git clone https://github.com/vietnam-devs/coolstore-microservices.git
- Then
cd
intocoolstore-microservices
folder (just cloned)
> ./deploys/scripts/build-all-images.sh
It should run and package all docker images, type docker images
to check it.
- Download and install istio-1.0.0 to your local machine, and unzip it into somewhere, then initialize it with following commands
> cd <istio-1.0.0 path>
> kubectl create -f install/kubernetes/helm/helm-service-account.yaml
> kubectl create -f install/kubernetes/helm/istio/templates/crds.yaml
> helm init --service-account tiller --upgrade
Waiting until it downloads and runs on your machine.
- Get
istio-ingressgateway
IP address
> kubectl get services istio-ingressgateway -n istio-system -o=jsonpath={.spec.clusterIP}
> 10.96.34.68 <== let assume that we get the IP
- Create
values.dev.local.yaml
file indeploys/charts/coolstore
, and put content as following
gateway:
ip: 10.96.34.68
- Apply
istioctl
command tocoolstore
chart
> helm template deploys/charts/coolstore -f deploys/charts/coolstore/values.dev.yaml -f deploys/charts/coolstore/values.dev.local.yaml > deploys/k8s/dev-all-in-one.yaml
> kubectl create -f <(istioctl kube-inject -f deploys/k8s/dev-all-in-one.yaml)
- Add hosts file with following content (
/etc/hosts
)
127.0.0.1 api.coolstore.local
127.0.0.1 id.coolstore.local
127.0.0.1 coolstore.local
Waiting for the container provision completed
> curl -I http://coolstore.local # Website
> curl -I http://api.coolstore.local # API Gateway
> curl -I http://id.coolstore.local # Identity Provider
🐝 Hola! We get it works on the local machine.
- Clean up
coolstore
chart as
> kubectl delete -f deployment/k8s/dev-all-in-one.yaml
> helm delete istio --purge