Deploy a Jenkins CI/CD Pipeline with Persistent Storage: Red Hat OpenShift with NetApp
Contributors Download PDF of this page
This section provides the steps to deploy a continuous integration/continuous delivery or deployment (CI/CD) pipeline with Jenkins to validate solution operation.
Create the resources required for Jenkins deployment
To create the resources required for deploying the Jenkins application, complete the following steps:
Create a new project named Jenkins.
In this example, we deployed Jenkins with persistent storage. To support the Jenkins build, create the PVC. Navigate to
Storage > Persistent Volume Claimsand click
Create Persistent Volume Claim. Select the storage class that was created, make sure that the Persistent Volume Claim Name is jenkins, select the appropriate size and access mode, and then click Create.
Deploy Jenkins with Persistent Storage
To deploy Jenkins with persistent storage, complete the following steps:
In the upper left corner, change the role from Administrator to Developer. Click
From Catalog. In the
Filter by Keywordbar, search for jenkins. Select Jenkins Service with Persistent Storage.
By default, the details for the Jenkins application are populated. Based on your requirements, modify the parameters and click Create. This process creates all the required resources for supporting Jenkins on OpenShift.
The Jenkins pods take approximately 10–12 minutes to enter the Ready state.
After the pods are instantiated, navigate to
Networking > Routes. To open the Jenkins webpage, click the URL provided for the jenkins route.
Because OpenShift OAuth was used while creating the Jenkins app, click
Log in with OpenShift.
Authorize the Jenkins service-account to access the OpenShift users.
The Jenkins welcome page is displayed. Because we are using a Maven build, complete the Maven installation first. Navigate to
Manage Jenkins > Global Tool Configuration, and then, in the Maven subhead, click
Add Maven. Enter the name of your choice and make sure that the Install Automatically option is selected. Click Save.
You can now create a pipeline to demonstrate the CI/CD workflow. On the home page, click
Create New Jobsor
New Itemfrom the left-hand menu.
On the Create Item page, enter the name of your choice, select Pipeline, and click Ok.
Select the Pipeline tab. From the Try Sample Pipeline drop-down menu, select
Github + Maven. The code is automatically populated. Click Save.
Build Nowto trigger the development through the preparation, build, and testing phase. It can take several minutes to complete the whole build process and display the results of the build.
Whenever there are any code changes, the pipeline can be rebuilt to patch the new version of software enabling continuous integration and continuous delivery. Click
Recent Changesto track the changes from the previous version.