deadbug
deadbug

Reputation: 444

How to use external Jenkins to deploy applications in Openshift

In Openshift 4 the pipeline build strategy is deprecated. As per documentation :

The Pipeline build strategy is deprecated in OpenShift Container Platform 4. Equivalent and improved functionality is present in the OpenShift Pipelines based on Tekton.

Jenkins images on OpenShift are fully supported and users should follow Jenkins user documentation for defining their Jenkinsfile in a job or store it in a Source Control Management system.

In my organization, we have on-prem Jenkins available; which is managed by external team. I am trying to to do following:

  1. Check out from Gitlab
  2. Build using Maven
  3. Docker build
  4. Push to enterprise Jfrog Artifactory
  5. Deploy to Openshift

I tried below:

  1. Tried Jenkins image available in Openshift.
  2. Completed till step 4.
  3. Installed Openshift Client, Openshift Sync, Kubernetes plugins.

I am stuck in following:

  1. Now my doubt is, since the Openshift 4 deprecated the Jenkinspipeline build strategy, how do I deploy my image into Openshift cluster ?
  2. How do I get the image from Artifactory ?
  3. Is there any other alternative ways ?

Upvotes: 1

Views: 4102

Answers (1)

titou10
titou10

Reputation: 2977

You have to install the kubernetes and OpenShift plugins in Jenkins. From there you can configure your OCP clusters (address, credentials etc..) and in your pipeline, use the objets that come with the OpenShift plugin: openshift.withCluster(), openshift.create()...

Official doc here

If you install Jenkins from the template that comes with OCP, all the necessary plugins are already setup (with the jenkins security and the local cluster). More info here

Upvotes: 1

Related Questions