E-mail adress : nawress.abdelkabir@edu.dsti.institute
This is my first challenge using DevOps tools. it includes different tasks.
I created a web application based on java/jsp and maven .
The database used is : MySql.
I wrote unit tests for this CRUD app in Test.java .
This application is a sort of online car store to manage cars.
Each car is decribed by its :
- matriculation
- brand
- model
- price
we can list, update, add, delete cars. For test and validation purpose, the application has been deployed locally on Tomcat server.
I imported my github repository into a new project in GitLAB CI.
Then, I created .gitlab-ci.yml file which includes different instructions. 3 Stages has been defined for this pipeline :
- Build
- Test
- Deploy
To setup the host server, I installed gitlab runner on my local machine then I registred the CI/CD pipeline to be able to run it.
To be able to do the CD part, I used Heroku where I created my project target.
Successufuls deployement are automatically detected by Heroku at each pull request on master branch:
To verify this pipeline, we went back to gitlab-ci where we could check the status of the different stages :
-- Sorry, I had a health problem so I didn't have a enough time to finish this part. I will try to work on it next days.
After creating the Dockerfile and .dockerignore files, I executed this comand to generate the image:
Then I got a message confirming that the build was successfull
To run the docker image I executed this command:
Then to check active docker container I executed this command:
Finally, to push image into my ptivate repository of docker hub I executed these commands:
Then I went to my docker hub repository to check the image:
First I created the docker-compose.yml file then I executed command:
Then build has been processed and I got this message:
I successfully installed Kubernetes cluster using Minikube. And it is running.
Then , I created many yaml files :
1- Deployments file : I configured a a link
2- Services file : I configured a [service.yaml]
After that , i made an [index.html] :
3- Persistent volume file : I configured a [pv-volume.yaml ]
And then, I created the Persistent Volume . The "get" shows us information about what we created. The output shows the status of the PersistentVolume : available.
4- Persistent volume claim file : I configured a [pv-claim.yaml] . Then a created the persistent volume claim. It shows now that the status of PV is Bound !
5- Pod creation : The next step is to create a Pod that uses your PersistentVolumeClaim as a volume, configured in [pv-pod.yaml]
When showing the pod information : There is a error in the status . before that when i first tried it was pending . However, it seems it has an error in the image.
Same thing as part 3. I will try to do it next days.
- Github
- MySql
- Java , JSP
- maven
- Tomcat
- Gitlab-CI
- Heroku
- Docker
- Kubernetes
- https://malike.github.io/Gitlab-CI-CD-Pipeline.html
- https://dzone.com/articles/automate-spring-boot-app-deployment-with-gitlab-ci
- https://dashboard.heroku.com/apps/devops-project-s20
- https://linuxize.com/post/how-to-list-docker-containers/
- https://www.oreilly.com/content/how-to-manage-docker-containers-in-kubernetes-with-java/
- https://dev.to/pmgysel/from-a-web-application-to-a-docker-image-to-a-deployment-with-kubernetes-171b
- https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/