# Add existing cluster to rancher using api

**URL:** <https://forums.suse.com/t/add-existing-cluster-to-rancher-using-api/21207>\
**Category:** SUSE Rancher Prime\
**Created:** [September 20, 2021, 8:03pm UTC](https://forums.suse.com/t/add-existing-cluster-to-rancher-using-api/21207 "2021-09-20T20:03:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabriel.vicente](https://avatars.discourse-cdn.com/v4/letter/g/c2a13f/32.png) [@gabriel.vicente](https://forums.suse.com/u/gabriel.vicente)\
**Post date:** [September 20, 2021, 8:03pm UTC](https://forums.suse.com/t/add-existing-cluster-to-rancher-using-api/21207/1 "2021-09-20T20:03:58Z")

</div>

I have a cluster creation pipeline using terraform that creates 5 GKE clusters. One cluster is for rancher, and the other 4 are for the application itself ( dev, qa, stg and prod ). I need to add these 4 clusters to rancher programmatically using the api because I need to do that on a pipeline step.  
On rancher docs I only found how to do that using the web UI.  
Can you please help me ? Thank you.

---

<div class="post-metadata">

**Author:** ![dorancemc](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/dorancemc/32/7385_2.png) [@dorancemc](https://forums.suse.com/u/dorancemc)\
**Post date:** [September 23, 2021, 11:38am UTC](https://forums.suse.com/t/add-existing-cluster-to-rancher-using-api/21207/2 "2021-09-23T11:38:33Z")

</div>

Hello Gabriel,

This article could help you

> **[Adding custom nodes to your Kubernetes cluster in Rancher 2.0](https://medium.com/@superseb/adding-custom-nodes-to-your-kubernetes-cluster-in-rancher-2-0-tech-preview-2-89cf4f55808a)**
>
> Note: This article was written when Rancher was in Tech Preview, now it’s updated to reflect the 2.0 release. There might be references in…

I used it as a reference to create a cluster with ansible.

---

<div class="post-metadata">

**Author:** ![gabriel.vicente](https://avatars.discourse-cdn.com/v4/letter/g/c2a13f/32.png) [@gabriel.vicente](https://forums.suse.com/u/gabriel.vicente)\
**Post date:** [September 23, 2021, 11:53am UTC](https://forums.suse.com/t/add-existing-cluster-to-rancher-using-api/21207/3 "2021-09-23T11:53:08Z")

</div>

Thank you,  
Yes I already saw this article but didn’t have a chance to test yet. But what surprise me most is that there’s no documentation at all, no examples, etc.

Anyway, thanks
