<p>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.</p>

<p><a href="https://i.sstatic.net/eKzP7.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eKzP7.png" alt="Add custom catalog"></a></p>

<p>Rancher Catalog is a Git repository with the following structure</p>

<p><a href="https://i.sstatic.net/Sx8fu.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Sx8fu.png" alt="Git repository structure"></a></p>

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

<p><a href="https://i.sstatic.net/yK0Cr.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/yK0Cr.png" alt="enter image description here"></a></p>

<p>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.</p>

<p><a href="https://i.sstatic.net/f3OtP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/f3OtP.png" alt="enter image description here"></a></p>

<p>Pros:</p>

<ul>
<li>generic approach that might be used for almost every app</li>
<li>Jenkins itself might be deployed into Rancher environment, agents might be created in Kubernetes cluster</li>
</ul>

<p>Cons:</p>

<ul>
<li>development team should follow solid release strategy to be able to use generic builds</li>
<li>storage drivers are still under the question in alpha release of Rancher 2.0</li>
</ul>

CC BY-SA 3.0
2018-01-10T09:24:46.513Z
2018-01-10T10:52:02.773Z
2018-01-10T10:52:02.773Z
Maksim
<p>Terraform with Kubernetes provider.</p>

CC BY-SA 3.0
2018-01-10T09:18:33.857Z
Hi. Possible to expand the answer a bit with details on how to do the same, or with helpful links?
Dawny33
CC BY-SA 3.0
2018-01-10T07:15:37.183Z
2018-01-10T07:15:37.183Z
Yuriy Medvedev
<p>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?</p>

<p>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.</p>

<docker><deployment><kubernetes><rancher>
How do I automate deployments with Kubernetes?
Greg
# How do I automate deployments with Kubernetes?

(Asked by: username_0 on 2017-12-09)

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.

**Tags:** docker, deployment, kubernetes, rancher


---

## 2 answers

### Answer by username_1 on 2018-01-10. Score: 4

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](https://i.sstatic.net/eKzP7.png)](https://i.sstatic.net/eKzP7.png)

Rancher Catalog is a Git repository with the following structure

[![Git repository structure](https://i.sstatic.net/Sx8fu.png)](https://i.sstatic.net/Sx8fu.png)

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

[![enter image description here](https://i.sstatic.net/yK0Cr.png)](https://i.sstatic.net/yK0Cr.png)

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](https://i.sstatic.net/f3OtP.png)](https://i.sstatic.net/f3OtP.png)

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


---

### Answer by username_2 on 2018-01-10. Score: -2

Terraform with Kubernetes provider.

> **Comments:**
> **username_3**: Hi. Possible to expand the answer a bit with details on how to do the same, or with helpful links?  

---

