# Multi Cluster Pipeline

**URL:** <https://forums.suse.com/t/multi-cluster-pipeline/16046>\
**Category:** SUSE Rancher Prime\
**Created:** [December 9, 2019, 8:47am UTC](https://forums.suse.com/t/multi-cluster-pipeline/16046 "2019-12-09T08:47:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![flfrolund](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/flfrolund/32/5882_2.png) [@flfrolund](https://forums.suse.com/u/flfrolund)\
**Post date:** [December 9, 2019, 8:47am UTC](https://forums.suse.com/t/multi-cluster-pipeline/16046/1 "2019-12-09T08:47:02Z")

</div>

It would be nice if rancher pipeline could set kubernetes context based on branches, so you can switch cluster dependent on dev and production branches.

---

<div class="post-metadata">

**Author:** ![everton.andrade](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/everton.andrade/32/5875_2.png) [@everton.andrade](https://forums.suse.com/u/everton.andrade)\
**Post date:** [December 9, 2019, 11:46am UTC](https://forums.suse.com/t/multi-cluster-pipeline/16046/2 "2019-12-09T11:46:51Z")

</div>

What you can do is create 2 different pipelines in 2 different clusters where both listen to the same git repository but different branches.

---

<div class="post-metadata">

**Author:** ![flfrolund](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/flfrolund/32/5882_2.png) [@flfrolund](https://forums.suse.com/u/flfrolund)\
**Post date:** [December 9, 2019, 12:04pm UTC](https://forums.suse.com/t/multi-cluster-pipeline/16046/3 "2019-12-09T12:04:19Z")

</div>

But then you have x amount of rancher-pipeline.yaml files, thats all unique for different branches? Then you need to ignore it for merges.

---

<div class="post-metadata">

**Author:** ![pdavisfmnh](https://avatars.discourse-cdn.com/v4/letter/p/6bbea6/32.png) [@pdavisfmnh](https://forums.suse.com/u/pdavisfmnh)\
**Post date:** [October 16, 2020, 12:47pm UTC](https://forums.suse.com/t/multi-cluster-pipeline/16046/4 "2020-10-16T12:47:48Z")

</div>

So my question with this is how to trigger the pipelines on only the one cluster.

I have my different pipeline files working between the branches. But if I do a push to dev, it triggers on both clusters (since the webhooks are there for both). But I want a push to dev to only run on the dev cluster and master to run only on the production cluster.

I’ve tried conditionals but because it can’t limit on the cluster only the branch they are always true.

Running rancher 2.4.8. Haven’t upgraded to 2.5 yet. Thats coming soon.
