Jenkins + Rancher 2.0.x

Hi,

I am quite new to k8s and have played a little with Rancher 2.0 to figure out if it can help to manager k8s easily.

I would like to run a test on Jenkins, build an image within it and deploy to Rancher 2.0. There is a Jenkins plugin available, but is seems to be compatible only with Rancher 1.6.

Unfortunately it seems that Rancher 2.0 API docs are not available yet, so I cannot figure out how to interact. I have also looked into rancher CLI, but it seems that apps can only be deployed from templates. This is not what I need.

Could you please advice?

I guess I will have to do something like:

./rancher kubectl set image ...

I hoped I could do that without the need to learn kubectl. Anyway, it works.

Maybe there’s other way but what I would do:

At the end of you jenkins build, upload your image to a private docker registries. Docker Hub offer a free one (https://hub.docker.com/billing-plans/) or you can install one. There’s a registeries ready to install in the Rancher Catalog.

After that, you can configure in your project in the menu resource/registries your repository. (Doc is there but not a lot is written for now: (http://staging.rancher.com/docs/rancher/v2.x/en/concepts/resources/)

Then you can deploy your image specifiying registry_name/image_name.

I hope this will help.

yes, I was planing to use our private register in such a way. Anyway, thank for the suggestion.

Use Helm to deploy the built docker image to the kubernetes cluster what you deployed via rancher

Hi, I have a similar requirement and trying to integrate Jenkins with rancher2.0 and it is not possible.

Could you give me some hint to get it done via rancher cli and kubectl ? Or any better options.

Thanks a lot for the update.

Regards
Dhp

Just call kubectl commands in jenkins, treat it as a any other kubernetes cluster.