10

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.

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
-1

https://kubernetes.io/docs/concepts/cluster-administration/manage-deployment/

kubectl apply is able to perform rolling updates.

  • 1
    That documentation certainly helps. However, I don’t think I was very clear in my question. When I refer to automation regarding Kubernetes deployments, I’m asking if there is a common tool or pattern that will detect, for example, a new push to Docker Hub, update the config(s), and trigger Kubernetes to apply. Is Weave Flux the only tool of its kind? Does everyone just roll their own? – Greg Dec 10 '17 at 13:30
  • Then you need a CI/CD tool, e.g. gocd that is able to listen to dockerhub and triggers another process when a newer docker image is pushed – 030 Dec 10 '17 at 14:00
-2

Terraform with Kubernetes provider.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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