3.1 Pipeline CI/CD — GitHub, Maven, Jenkins, Artifactory, SonarQube, Docker, Tomcat, Kubernetes ( Pods and Services)

Dileep Prithvi
3 min readJun 11, 2020

--

I hope you had visited the previous stories 1.1 Series & 2.1 Series and this is the continuation of it.

Scenario:

This Lab Setup describes about the inclusion of Kubernetes Tool using the SSH Setup. Jenkins will connect to Kubernetes Cluster using the SSH mechanism and copy the yaml files from Jenkins to Kubernetes and trigger the Pods and Services in the Kubernetes Cluster.

Note: We are not using any available Kubernetes plugin to connect from Jenkins to Kubernetes Cluster. We are using SSH Agent Plugin to connect to Kubernetes Master from the Jenkins.

  • I have divided the story in to Two Sections.

3.1 Pipeline CI/CD — GitHub, Maven, Jenkins, Artifactory, SonarQube, Docker, Tomcat, Kubernetes ( Pods and Services)

3.2 Pipeline CI/CD — GitHub, Maven, Jenkins, Artifactory, SonarQube, Docker, Tomcat, Kubernetes ( Pods and Services)

In this article, we will discuss the Jenkins Declarative Pipeline Approach of Building the CI/CD Pipeline

Application: Simple JSP Application

Tools Used:

  • GitHub — Source Code Management
  • Maven — Build Tool
  • Jenkins — Continuous Integration (CI/CD)
  • Artifactory — Artifact Repository Manager
  • SonarQube — Code Quality and Code Analysis
  • Docker — Container Engine
  • Tomcat — Application Server
  • Kubernetes — Container Orchestration
Architecture

Pre-requisites:

Lab Setup:

  • Configuring the Kubernetes Master’s Private key in the Jenkins Credentials store with the type “SSH Username with private key
Fig1.1
  • Creation of the Jenkins Job — — Pipeline Project
Fig1.1
  • Go to Pipeline Section, Select the Git Repository and save the job

GitHub URL: https://github.com/Dileeprithvi/CI-CD-Jks-K8s-SSH.git

Branch: master

Fig 1.2
  • Clicking on the build to trigger the Job.
  • Please find the Output Below.

Jenkins Console Output Log is attached for your reference in the GitHub

To check the code is deployed correctly, Please follow the below URL Pattern:

http://<kubernetes-master-ip>:<service-external-port>/webapp/

Ex: http://35.65.45.127:30035/webapp/

  • Jenkins Pipeline Stages Screenshot:
Pipeline Screenshot
  • Breaking the Code:

We can examine the Jenkinsfile in this Page

--

--

Dileep Prithvi

AWS Certified Solution Architect– Associate. Skill set - AWS, DevOps