Deploy petclinic app with eG BTM monitoring enabled.
- git
- java 8
- maven 3.5.0+
- docker
- Ensure that docker cli pre-configured with docker registry to push the images.
- oc
- Ensure that oc cli pre-configured with cluster.
git clone https://github.com/eginnovations/spring-petclinic-microservices.git
cd spring-petclinic-microservices
vi spring-petclinic/src/main/resources/templates/fragments/layout.html
mvn clean package -f spring-petclinic/pom.xml
mvn clean package -f OwnerService/pom.xml
mvn clean package -f PetService/pom.xml
mvn clean package -f VetService/pom.xml
mvn clean package -f VisitService/pom.xml
ls -alth spring-petclinic/target/*.jar
ls -alth OwnerService/target/*.jar
ls -alth PetService/target/*.jar
ls -alth VetService/target/*.jar
ls -alth VisitService/target/*.jar
Note: egapm is a docker hub namespace name, replace with yours.
docker build --squash -t egapm/spring-petclinic:frontend-svc -f spring-petclinic/Dockerfile spring-petclinic/.
docker build --squash -t egapm/spring-petclinic:owners-svc -f OwnerService/Dockerfile OwnerService/.
docker build --squash -t egapm/spring-petclinic:pets-svc -f PetService/Dockerfile PetService/.
docker build --squash -t egapm/spring-petclinic:vets-svc -f VetService/Dockerfile VetService/.
docker build --squash -t egapm/spring-petclinic:visits-svc -f VisitService/Dockerfile VisitService/.
docker build --squash -t egapm/spring-petclinic:mysql-db -f mysql/Dockerfile mysql/.
docker push egapm/spring-petclinic:frontend-svc
docker push egapm/spring-petclinic:pets-svc
docker push egapm/spring-petclinic:owners-svc
docker push egapm/spring-petclinic:vets-svc
docker push egapm/spring-petclinic:visits-svc
docker push egapm/spring-petclinic:mysql-db
oc create secret generic regcred \
--from-file=.dockerconfigjson=/root/.docker/config.json \
--type=kubernetes.io/dockerconfigjson
vi k8s/eg-agent/egagent.yaml
oc apply -f k8s/eg-agent/.
Note: Update your new image name in all the YAMLs.
# Petclinic App
oc apply -f k8s/app/namespace_and_service_account/.
oc apply -f k8s/app/db/.
oc apply -f k8s/app/.
# eG Agent
oc get pods -n egagent
# Petclinic App
oc get pods -n spring-petclinic
# Petclinic App
oc get routes -n spring-petclinic
# Petclinic App
oc delete -f k8s/app/db/.
oc delete -f k8s/app/.
# Petclinic App
oc delete -f k8s/app/namespace_and_service_account/.
# eG Agent
oc delete -f k8s/eg-agent/.
-
If you dont want to build and dont want to monitor using eG, use below cmd to try out Petclinic app. Note: Update your new image name in all the YAMLs.
oc apply -f k8s/plain-app/namespace_and_service_account/. oc apply -f k8s/plain-app/db/. oc apply -f k8s/plain-app/.