14

Assuming I have Kubernetes deployed via Rancher and Jenkins is building new images and pushing them to DockerHub upon check-in of new code to GitHub, how do I automate getting new images deployed?

Another way to ask the question might be, “I used to use Octopus to manage my deployments. Is there something similar built in to Kubernetes or Rancher?” Ultimately, it’s this last gap that I’m struggling with.

2 Answers 2

4
+50

As of you are using Rancher the easiest way would be to register custom Rancher Catalog and create an item for each stack/service you want to deploy.

Add custom catalog

Rancher Catalog is a Git repository with the following structure

Git repository structure

Then in Jenkins you can create a job that would call Rancher REST API to deploy/update stack/service.

enter image description here

In its turn Rancher would pull latest version of the Docker image for this service and deploy it corresponding to Docker Compose file from the catalog.

enter image description here

Pros:

  • generic approach that might be used for almost every app
  • Jenkins itself might be deployed into Rancher environment, agents might be created in Kubernetes cluster

Cons:

  • development team should follow solid release strategy to be able to use generic builds
  • storage drivers are still under the question in alpha release of Rancher 2.0
-2

Terraform with Kubernetes provider.

1
  • 2
    Hi. Possible to expand the answer a bit with details on how to do the same, or with helpful links?
    – Dawny33
    Jan 10, 2018 at 9:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.