# Rancher Build Pipelines

**URL:** <https://forums.suse.com/t/rancher-build-pipelines/15658>\
**Category:** SUSE Rancher Prime\
**Created:** [October 27, 2019, 10:35pm UTC](https://forums.suse.com/t/rancher-build-pipelines/15658 "2019-10-27T22:35:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cjohn001](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cjohn001/32/5702_2.png) [@cjohn001](https://forums.suse.com/u/cjohn001)\
**Post date:** [October 27, 2019, 10:35pm UTC](https://forums.suse.com/t/rancher-build-pipelines/15658/1 "2019-10-27T22:35:42Z")

</div>

Hello together,  
I am currently trying to get a Rancher 2.3 pipeline working. The pipeline executes successful but I can not deploy the image afterwords. I suspect that the local docker-registry is not found as the deployment can not pull the image.

I generated my build pipeline via gui. It looks as follows:

stages:

- name: Build  
steps:
  - publishImageConfig:  
dockerfilePath: ./Dockerfile  
buildContext: .  
tag: percona:8.0.15  
registry: 127.0.0.1:34513

- name: Deploy  
steps:
  - applyYamlConfig:  
path: ./deployment.yaml  
timeout: 60  
notification: {}

and my deployment file looks as follows:

apiVersion: apps/v1  
kind: Deployment  
metadata:  
name: percona  
labels:  
app: percona  
spec:  
replicas: 1  
selector:  
matchLabels:  
app: percona  
template:  
metadata:  
labels:  
app: percona  
spec:  
imagePullSecrets:  
- name: pipeline-docker-registry  
containers:  
- name: percona  
image: percona:8.0.15  
ports:  
- containerPort: 3306

So I am wondering about the registry entry registry: 127.0.0.1:34513 which was generated. I would assume, that it it not guaranteed that all pods of the deployment run on the same node, i.e. I assume that localhost address here is wrong. Unfortunately, when setting up the pipeline it seems I cannot configure any specifics on the registry.

And I do have two further conceptional question, as I would like to create an deploy a database image with the build pipeline. I would like to enforce a rebuild of the pipeline on a manual base only, not when a commit or tag happens on the connected git repository. Seems this is not an option?

Second question, when manually enforcing a rebuild of the image, I would like the new image to reuse a persistent volume of a database image that is replaced. How could I do this?  
Thanks for your help! I am rather new to the entire kubernetes world, hence I hope my questions are not to stupid 🙂

Best regards,  
Christoph

---

<div class="post-metadata">

**Author:** ![l0wskilled](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/l0wskilled/32/5727_2.png) [@l0wskilled](https://forums.suse.com/u/l0wskilled)\
**Post date:** [October 28, 2019, 12:05pm UTC](https://forums.suse.com/t/rancher-build-pipelines/15658/2 "2019-10-28T12:05:19Z")

</div>

> [@cjohn001](#):
>
> containers:
> 
> - name: percona  
> image: percona:8.0.15

in Image you must reference the ip and port of the local registry, like 127.0.0.1:32014, no idea waht your random port is.  
But anyway usually you would define the image like this: `image: ${CICD_IMAGE}:${CICD_EXECUTION_SEQUENCE}`  
CICD\_IMAGE (it takes this from the previous executed step) takes the created image with the address of the registry into account resulting into something like 127.0.0.1:31423/yourimage:43

---

<div class="post-metadata">

**Author:** ![cjohn001](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cjohn001/32/5702_2.png) [@cjohn001](https://forums.suse.com/u/cjohn001)\
**Post date:** [October 28, 2019, 8:52pm UTC](https://forums.suse.com/t/rancher-build-pipelines/15658/3 "2019-10-28T20:52:48Z")

</div>

> [@l0wskilled](#):
>
> ${CICD\_EXECUTION\_SEQUENCE}

Hello I0wskilled, thanks this solved my problem. I am wondering if you can help we with the other questions as well:

> > And I do have two further conceptional question, as I would like to create and deploy a database image with the build pipeline. I would like to enforce a rebuild of the pipeline on a manual base only, not when a commit or tag happens on the connected git repository. Seems this is not an option?

> > Second question, when manually enforcing a rebuild of the image, I would like the new image to reuse a persistent volume of a database image that is replaced. How could I do this?

Thx a lot!

---

<div class="post-metadata">

**Author:** ![l0wskilled](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/l0wskilled/32/5727_2.png) [@l0wskilled](https://forums.suse.com/u/l0wskilled)\
**Post date:** [October 28, 2019, 9:09pm UTC](https://forums.suse.com/t/rancher-build-pipelines/15658/4 "2019-10-28T21:09:04Z")

</div>

> [@cjohn001](#):
>
> And I do have two further conceptional question, as I would like to create and deploy a database image with the build pipeline. I would like to enforce a rebuild of the pipeline on a manual base only, not when a commit or tag happens on the connected git repository. Seems this is not an option?

below your stage in pipeline you can hit advanced and get exclusion rules and so on. You could say to only deploy on a tag push

---

<div class="post-metadata">

**Author:** ![cjohn001](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cjohn001/32/5702_2.png) [@cjohn001](https://forums.suse.com/u/cjohn001)\
**Post date:** [October 28, 2019, 10:20pm UTC](https://forums.suse.com/t/rancher-build-pipelines/15658/5 "2019-10-28T22:20:41Z")

</div>

Thanks,  
I actually just realized that I can simple remove the webhook in gitlab to enfore manual builds.

So just the a single question is remaining. How can I configure the pipeline pods to reuse already existing volumes?

---

<div class="post-metadata">

**Author:** ![l0wskilled](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/l0wskilled/32/5727_2.png) [@l0wskilled](https://forums.suse.com/u/l0wskilled)\
**Post date:** [October 28, 2019, 10:59pm UTC](https://forums.suse.com/t/rancher-build-pipelines/15658/6 "2019-10-28T22:59:21Z")

</div>

Good question. I have no idea how. Please tell me when you find out.

I tried that too. In the deployment yaml you can define volumes as explained in the kubernetes docs but I didn’t get it to work with the Rancher volumes.
