CMPE272 assignment1
- Create 3 different springboot projects through Spring Tool Suite.
- Create an endpoint called "/hello" in the 1st project, "/world" in the 2nd project and "/integrated" in the 3rd project.
- Convert the given java files to their corresponding .jar files by clicking on the project and selecting 'Run as Maven install'.
- Create separate dockerfiles for these 3 projects.
- Include these newly created .jar files in the dockerfiles.
- Build 3 separate docker images for these 3 projects using: 'docker build -t spb_hello .' , 'docker build -t spb_world .' , 'docker build -t spring_boot_integration .'
- The newly built docker images can be viewed using 'docker images' command. It will look like this: Dockerhub links to the repositories
- Once the images are built, try to run those newly built images using the command: 'docker run -p 7000:8080 -it spb_hello' and 'docker run -p 8000:8080 -it spb_world. Once this command runs, by going on the browser we need to type: 'localhost://7000/hello', 'localhost://8000/world'.
- Install Minikube and Kubectl.
- Create a minikube cluster by using the command: 'minikube start --driver=docker'.
- Create and define services and deployment manifest files for these three microservices.
- Define the port, target port and the nodeport in the services files.
- In order to include the local docker images in the minikube cluster, we will need to load these images using the command: 'docker image load imagename'. In this way, the docker images would be loaded inside the minikube cluster.
- In the terminal, execute a command: kubectl apply -f "hello_deployment_manifest.yml". And similarly, apply it for the hello_service_manifest.yml, world_deployment_manifest.yml and world_service_manifest.yml, and integrated_service_manifest.yml.
- Using the command: 'kubectl get all', we will get the newly created pods along with their status.
- Now using the command: 'minikube service servicename --url', we will get an ip address where we can access the application. We will need to give the corresponding endpoint after this url such as "/hello", "/world", "/integrated".