Skip to content

Lab: Deploying EKS Microservices using Jenkins

mehulsharma2010 edited this page Aug 26, 2021 · 17 revisions

Deploying EKS Microservices using Jenkins

In this lab we will be doing below steps:

  • We will build the docker image and push it to ECR.
  • Then Pull the image on Spinnaker and try to do deployments with the help of Spinnaker.

Prerequisites

Before starting working on the Lab, Make sure you are sharing your GITHUB Token and YOUR_TEAM_NAME with Instructor of the workshop so that they can add your account in Spinnaker from the back-end.

Now Fork the Spinnaker-Study Repository into your Public Github account and then clone it to your local.

Notice the manifests/deploy-microservice.yml file, and see the Deployment, and the Service.

Now we need to make updates on the all the files present under manifests directory and replace mild-temper with YOUR-NAME or YOUR-TEAM-NAME .

After making the updates you are good to push your code back to your repository.

Lab Solution

Setting up a Jenkins job

  1. Open Jenkins and login with the username: spinnaker and password: timeisluxury

  2. Click on New Item, and a Pipeline Job in Jenkins

  3. Name your job <YOUR-TEAM-NAME>-microservice, and click Ok

  4. Under Build Triggers, select Poll SCM, and in the text area enter * * * * *.

  5. Under Pipeline, change Definition to Pipeline Script from SCM.

  6. Change SCM to Git, and enter your repository URL that you cloned for your team i.e. Spinnaker-Study repository

  7. Save and Build the Job and see if your docker image is getting push to ECR or not.

Setting up a Spinnaker Application

  1. Open Spinnaker, this is not secure so don’t place any personal information.

  2. Once there create an Application with the name: <YOUR-TEAM-NAME>-microservice

  3. Add your email as Owner Email

  4. In Repo Type, Choose github.

  5. In Repo Project, Enter Forked Repo Link.

  6. In Repo Name, Enter Name of your repositoey.

  7. In Cloud Providers, Choose KUBERNETES.

  8. Create an instance port of 80

  9. Click on Create to create the Application

Now you should inside the Application that you have created.

Creating a Pipeline

  1. Click on Pipelines, and click on "Configure a new pipeline"

  2. Under Pipeline Name, name it "ToStaging"

Clone this wiki locally