Sign inSign up

prasannjeet/easy-rancher-cli

By prasannjeet

•Updated almost 5 years ago

Image
0

184

prasannjeet/easy-rancher-cli repository overview

GitHub Repository⁠

⁠Rancher CLI for Rancher v1.6

For people still using older versions of Rancher, this is a quick and easy way to set it up.

⁠Get up and running in 2 minutes

  1. Get access keys and secret from Rancher. Go to the menu API->Keys.

  2. In the same page, you will also find the endpoint URL. If there are multiple URL's given, preferably use v2.

  3. Now create the following environment variables in your computer. Replace the values with your details.

    RANCHER_URL=https://your-rancher-url/v2-beta
    RANCHER_ACCESS_KEY=XXXXXXXXXXXX
    RANCHER_SECRET_KEY=XYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZ
    

    For MacOS, environment variables are usually set in your bash profile by adding a line: export ENV_VAR=value. Bash profile is located at ~/.bash_profile.

  4. For ease of use, you can also create an alias command like so:

    alias rancher='docker run -ti -v /some/folder/in/local/computer/volume:/root/.rancher -e RANCHER_URL=$RANCHER_URL -e RANCHER_ACCESS_KEY=$RANCHER_ACCESS_KEY -e RANCHER_SECRET_KEY=$RANCHER_SECRET_KEY --rm prasannjeet/easy-rancher-cli:0.6.14'
    

    For MacOS, to create an alias command you usually save the above in your bash profile.

    Of course in the above line, you must replace /some/folder/in/local/computer/volume with the path of a folder in your computer. This folder will act as a volume for the rancher container.

  5. After the above setup is complete, the first command that needs to be run is: rancher config. This will ask a bunch of questions and create a configuration file.

  6. That's it! Now you are able to use the rancher command as usual to run commands like rancher ps, rancher logs -f <container-name> etc.

Tag summary

Content type

Image

Digest

Size

166.5 MB

Last updated

almost 5 years ago

docker pull prasannjeet/easy-rancher-cli