Rancher Build Pipelines

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 :slight_smile:

Best regards,
Christoph

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

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!

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

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?

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.