This demo is aimed to demonstrate how SOFA run in Kubernetes.
- Install minikube in your desktop.
- Run
minikube startto start minikube. - Run
kubectl apply -f zookeeper.ymlto install zookeeper in minikube. - Run
kubectl apply -f zipkin.ymlto install Zipkin in minikube. - Run
eval $(minikube docker-env)to change the docker env to minikube. - Change directory to rpcserver than run
mvn clean packageto package rpcserver. - Run
docker build --build-arg JAR_FILE=./target/rpcserver-0.0.1-SNAPSHOT.jar . -t rpc-serverto build a docker image for rpcserver - Change directory to rpcclient than run
mvn clean packageto package rpcclient. - Run
docker build --build-arg JAR_FILE=./target/rpcclient-0.0.1-SNAPSHOT.jar . -t rpc-clientto build a docker image for rpcclient. - Change directory to the root of this project and run
kubectl apply -f rpcserver.ymlto run rpcserver in minikube. - Run
kubectl apply -f rpcclient.ymlto run rpcclient in minikube. - Run
docker build -t my-prometheus .to build a prometheus image. - Run
kubectl apply -f prometheus.ymlto run a prometheus in minikube. - Run
kubectl expose deployment rpc-client-deployment --type=NodePort && minikube service rpc-client-deployment --urlto get the URL of rpcclient, than you can visit http://192.168.99.100:30304/hello (Please change the ip and port according to the result of command above.) - Run
kubectl expose deployment prometheus-deployment --type=NodePort && minikube service prometheus-deployment --urlto get the address of prometheus, than you can visit prometheus via the address. - Run
kubectl expose deployment zipkin-deployment --type=NodePort && minikube service zipkin-deployment --urlto get the address of zipkin, than you can visit zipkin via the address.