Leen15 / rancher-wrapper

A php wrapper for use rancher API. Used for scale or upgrade services
11 stars 3 forks source link

Suggest using alternate environment variables for Rancher API / key and password #1

Open etlweather opened 8 years ago

etlweather commented 8 years ago

See http://docs.rancher.com/rancher/latest/en/rancher-services/service-accounts/

By setting the following labels on the service:

io.rancher.container.create_agent=true
io.rancher.container.agent.role=environment

The container will be started by Rancher with the following environment variables:

CATTLE_ACCESS_KEY
CATTLE_SECRET_KEY
CATTLE_URL

Which makes it that you don't have to hard code the credentials when creating the service.

Leen15 commented 8 years ago

Thanks for your suggestion. I choose to add credentials in ENVs for not constrain the use of this container in rancher (so you can also start it in a local docker installation).

If you want, you can make a PR for check existance of both modes.