Skip to content

Latest commit

 

History

History
65 lines (41 loc) · 2.17 KB

README.md

File metadata and controls

65 lines (41 loc) · 2.17 KB

How to run the exercise

Installation

  1. Clone both service's repos -
git clone [email protected]:eilonash92/time-service.git
git clone [email protected]:eilonash92/facts-service.git
  1. Install local kubernetes using Docker for Desktop.

  2. Download helm installer - https://helm.sh/docs/intro/install

  3. Install Jenkins using helm chart-

helm repo add jenkins https://charts.jenkins.io
helm install jenkins
  1. Fetch your admin password -
 kubectl exec --namespace default -it svc/myjenkins -c jenkins -- /bin/cat /run/secrets/additional/chart-admin-password && echo
  1. Connect to your jenkins using this URL and port - http://localhost:8080.

  2. Install plugins - Go to Manage Jenkins -> Manage Plugins -> Choose Available tab -> Search for docker-pipeline, docker, Steps View

  3. Go to https://dockerhub.com, register with username and password.

  4. Add credentials to dockerhub - Go to Manage Jenkins -> Manage Credentials -> Jenkins -> Global Credentials -> New Credentials -> add the username and password and name in the id fill docker-hub-credentials

  5. Click on "New Item" and give your pipeline the name "deploy_time_service" and choose "FreeStyle" option.

  6. Under Source Code Management tab choose Git and add the time_service Github repository URL (No credentials are needed, since the repos are public) SCM

  7. Click "Save" and repeat steps 6 + 7 for facts_service.

Usage

  1. Push your new version to 'main' branch.

  2. Go to Jenkins, click on the specific service' deployment job, and click "Build".

The job will run 3 stages -

a. Build - Building a docker image and pushing it to Dockerhub.

b. Deploy - Deploying the new image using helm install.

c. Test - Using cURL to test the web app is alive and it fails the step if the web app not returning 200 OK.

Facts_Service Time_Service Stages Main