This is my first devops project :

Author :

Nawress Mahmoudi
Data Engineer student, DSTI, Spring Cohort 2020

This is my first challenge using DevOps tools. it includes different tasks.

1. Create a web application (Java, JSP, maven, MySql, Tomcat):

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. alt text

2. Apply CI/CD pipeline with GitLab

CI Part : (gitlab-ci)

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. alt text

CD Part : (Heroku)

To be able to do the CD part, I used Heroku where I created my project target. alt text

Successufuls deployement are automatically detected by Heroku at each pull request on master branch: alt text

To verify this pipeline, we went back to gitlab-ci where we could check the status of the different stages : alt text

3. Configure and provision a virtual environment and run your application using IaC approach :

-- 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.

4. Build Docker image of your application :

1- Create Docker image of your application :

After creating the Dockerfile and .dockerignore files, I executed this comand to generate the image: alt text

Then I got a message confirming that the build was successfull alt text

2- Push the image to Docker Hub :

To run the docker image I executed this command: alt text

Then to check active docker container I executed this command: alt text

Finally, to push image into my ptivate repository of docker hub I executed these commands: alt text

Then I went to my docker hub repository to check the image: alt text

5. Make container orchestration using Docker Compose :

First I created the docker-compose.yml file then I executed command:

alt text

Then build has been processed and I got this message:

alt text

6. Make docker orchestration using Kubernetes :

I successfully installed Kubernetes cluster using Minikube. And it is running. alt text

Then , I created many yaml files :

1- Deployments file : I configured a a link alt text

2- Services file : I configured a [service.yaml] alt text

After that , i made an [index.html] : alt text

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. alt text

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 ! alt text

5- Pod creation : The next step is to create a Pod that uses your PersistentVolumeClaim as a volume, configured in [pv-pod.yaml]

alt text

When showing the pod information : alt text 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.

7.Make a service mesh using Istio

Same thing as part 3. I will try to do it next days.

Tools used :

  • Github
  • MySql
  • Java , JSP
  • maven
  • Tomcat
  • Gitlab-CI
  • Heroku
  • Docker
  • Kubernetes

Usefull Links :

Thanks for your help during the DevOps course ! :)