Rancher CLI not working as expected

For Rancher 1.x I am used to deploy stacks defined by docker-compose.yml by running: rancher up The I printed some progress and then it was done.

Now I installed Rancher 2 cluster. I UI it seems working well, co I tried to use also CLI (because I am going to use it in a GitLab CI):

 $ rancher login https://rancher.example.com/v3 --token token-xxx
INFO[0000] Only 1 project available: Default            
INFO[0000] Saving config to /Users/Bobik/.rancher/cli2.json 
 $ rancher up
FATA[0000] open : no such file or directory             
 $ rancher up -h
apply compose config

Usage: 
  rancher up [OPTIONS] [arg...]

Options:
   --file value, -f value  The location of compose config file
 $ rancher up --file ci/docker-compose.production.yml 
 $ rancher ps
NAMESPACE   NAME      TYPE      STATE     IMAGE     SCALE
 $ rancher up --file ci/docker-compose.production.yml --verbose
Incorrect Usage: flag provided but not defined: -verbose

apply compose config

Usage: 
  rancher up [OPTIONS] [arg...]

Options:
   --file value, -f value  The location of compose config file
FATA[0000] flag provided but not defined: -verbose      
 $

Nothing happened in console and in web UI.

I thing it is not clever to change behavior if some CLI tool without clear reason and if yes then it should it least print helpful error messages.

Also I was looking for some docs on how to use the new CLI, but new docs on https://rancher.com/docs/rancher/v2.x/en/ does not have CLI section like the version for 1.6.

1 Like

I don’t think with a major version upgrade it’s reasonable for you to expect backwards compatibility, for a minor version maybe … so ‘clever’ or not, there is a clear rationale.

As far as documentation, by all means lobby for improvements, that helps the community as a whole.

I am ok with not having compatibility in CLI usage, if reasonable errors are print. But printing nothing means in UNIX world that it was successful.

I expect compatibility with external standard - Docker Compose YAML because both versions were marketed having it.

What’s the word on this? Just installed Rancher and currently the CLI doesn’t work, so this would seem a critical issue that needs addressing. Am I wrong?

The 2.x and 1.x are basically entirely unrelated, including the CLI. 2.x supports kubernetes manifests, not docker-compose files. This is not going to change. You provided a YAML file which has no kubernetes resources in it, so up does nothing.

That makes sense, thanks @vincent. I’ll dig back in and if I get it working, I’ll shut my big mouth :speak_no_evil:

So we have to use http://kompose.io