Automated Racher Deploy

Hi Guys,

I’m trying to create a pipeline to recreate all my environment from Jenkins, but the initial Rancher installation needs to setup a password and them create a API Key to use the API to import a cluster created with RKE tool.

There is a way to do the initial setup, password and URL, and API key creation form API?

There is a documentation on how to do it?



There is a way to pass the admin initial password and Rancher endpoint URL via ENV vars when starting Rancher?

This will be very helpful when we are automating the Rancher deploy.



This and this with some ideas from here

Solved my problem.

Have a look in the Rancher quick start guides. There are example API calls for both.

Thanks, but I’ve solved the problem using the information on the links i’ve put on my thread. If I know about this Quick Start repo before it would be handful.


Does this help -

@ amioranza care to share more details about your approach on this? I have a slew of shell scripts that call the rancher api and rancher cli in order to provision a cluster in a existing rancher server.

Not really happy with the shell script approach at this point, so curious on how your approach looks.

I have shell scripts using curl too, but I run it via Jenkins pipeline. That pipeline have other steps where I use Terraform, Chef and RKE to provision the servers(kubernetes cluster and rancher server) and the final steps is to setup the Rancher and import the new cluster created by RKE.

@amioranza & @jeremyweber-np, I had setup an HA cluster with RKE using terraform, rancher API, CLI & shell scripts. But when I am trying to add the custom clusters on top of local cluster, I am frequently getting into this issue:

When I get into this scenario, I had to remove the nodes, the cluster and retry from scratch.

May I know if you have encountered this issue in your setup?

Sarma K