Skip to main content
NetApp Solutions

Deploy a Jenkins CI/CD Pipeline with Persistent Storage: Red Hat OpenShift with NetApp

Contributors kevin-hoke ac-ntap

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:

  1. Create a new project named Jenkins.

    Figure showing input/output dialog or representing written content

  2. In this example, we deployed Jenkins with persistent storage. To support the Jenkins build, create the PVC. Navigate to Storage > Persistent Volume Claims and 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.

Figure showing input/output dialog or representing written content

Deploy Jenkins with Persistent Storage

To deploy Jenkins with persistent storage, complete the following steps:

  1. In the upper left corner, change the role from Administrator to Developer. Click +Add and select From Catalog. In the Filter by Keyword bar, search for jenkins. Select Jenkins Service with Persistent Storage.

    Figure showing input/output dialog or representing written content

  2. Click Instantiate Template.

    Figure showing input/output dialog or representing written content

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

    Figure showing input/output dialog or representing written content

  4. The Jenkins pods take approximately 10 to 12 minutes to enter the Ready state.

    Figure showing input/output dialog or representing written content

  5. After the pods are instantiated, navigate to Networking > Routes. To open the Jenkins webpage, click the URL provided for the jenkins route.

    Figure showing input/output dialog or representing written content

  6. Because OpenShift OAuth was used while creating the Jenkins app, click Log in with OpenShift.

    Figure showing input/output dialog or representing written content

  7. Authorize the Jenkins service account to access the OpenShift users.

    Figure showing input/output dialog or representing written content

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

    Figure showing input/output dialog or representing written content

  9. You can now create a pipeline to demonstrate the CI/CD workflow. On the home page, click Create New Jobs or New Item from the left-hand menu.

    Figure showing input/output dialog or representing written content

  10. On the Create Item page, enter the name of your choice, select Pipeline, and click Ok.

    Figure showing input/output dialog or representing written content

  11. Select the Pipeline tab. From the Try Sample Pipeline drop-down menu, select Github + Maven. The code is automatically populated. Click Save.

    Figure showing input/output dialog or representing written content

  12. Click Build Now to 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.

    Figure showing input/output dialog or representing written content

  13. 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 Changes to track the changes from the previous version.

    Figure showing input/output dialog or representing written content