Rancher-compose and Account API Keys

Hi,

Can I use rancher-compose with account api key ?

It seems to only work with environment key.

Thanks.

You can only use it with an environment API key. It needs to know which environment to launch the services/stacks into.

1 Like

This will be coming in a future release, and is mainly why account keys are mostly hidden in the UI now.

Ok, thanks for this quick answer.

Wait & see.

I actually was able to make this work by using an account API key and changing the RANCHER_URL to something slightly different.

For example, with my account API key, I can set RANCHER_URL to be
https://cluster.company.com/v1/projects/1a5/containers
and it then targets the environment with ID “1a5”

I started working on a bit of wrapper script that would use an init style configuration script to specify “profiles” with different credentials that I could then use with rancher-compose (Would be awesome if this was built into rancher-compose directly).

I formatted the credentials file after the AWS CLI credentials file and it supports doing a source_profile as well.
That way I can specify 1 account API key and then profiles that inherit it and use a different URL.

Any idea when this will get fixed? I just ran into this in my own environmet.

I created an issue in Github to track it, but it currently isn’t directly on the roadmap.

We will probably add this support directly for rancher CLI that we are planning.

Thanks for the update!