From a5be15770f5901bfdfb0132771158f976e413e27 Mon Sep 17 00:00:00 2001 From: Mark Bishop Date: Mon, 11 Jun 2018 15:23:46 -0700 Subject: [PATCH] editing Dan's CLI documentation --- .../cli-configuration/_index.md | 50 ++++++++++++++----- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/content/rancher/v2.x/en/concepts/global-configuration/cli-configuration/_index.md b/content/rancher/v2.x/en/concepts/global-configuration/cli-configuration/_index.md index 739c6b3e772..ce483d60a20 100644 --- a/content/rancher/v2.x/en/concepts/global-configuration/cli-configuration/_index.md +++ b/content/rancher/v2.x/en/concepts/global-configuration/cli-configuration/_index.md @@ -3,27 +3,51 @@ title: Rancher CLI Configuration weight: 1 --- -The CLI needs an API token and the URL of your server in order to start using it. Instructions for creating the API token and getting your server URL can be found at TODOMARK: Add a link to the docs on how to create an API key for the user to use in the CLI login +Rancher CLI (Command Line Interface) is a unified tool that you can use to manage Rancher Server. With this tool, you can operate Rancher using command line rather than GUI. -Begin using the CLI by running +### Download Rancher CLI + +You can download Rancher CLI from [GitHub](https://github.com/rancher/cli/releases). Download the version of Rancher CLI that corresponds with your version of Rancher Server. + +>**Note:** Rancher CLI only works with its corresponding Rancher Server release. Rancher Server and Rancher CLI installations that don't share the same version are incompatible. + +### Configuration Requirements + +After you download Rancher CLI, you need to make a few configurations. Rancher CLI requires: + +- Your [Rancher Server URL]({{< baseurl >}}/rancher/v2.x/en/tasks/global-configuration/server-url), which is used to connect to Rancher Server. +- An [API token]({{< baseurl >}}/rancher/v2.x/en/tasks/user-settings/api-keys), which is used to authenticate with Rancher. + +### Common Usage + +Begin using Rancher CLI by logging into your Rancher Server. Log in using the following command (replace `` and `` with your information): ```bash -$ rancher login -t +$ ./rancher login https:// -t ``` -If the rancher server is using a self signed cert the CLI will ask for confirmation to continue connecting to the server. +If Rancher Server uses a self-signed certificate, Rancher CLI prompts you to continue with the connection. -Once logged in run `rancher --help` for a list of commands +Rancher CLI uses a _context_ to determine what resources to fetch when running commands. Context is another name for the cluster/project that's currently in focus. -All commands accept the `--help` flag to further describe the usage +The `./rancher context switch` command displays a list of contexts available and allows the user to change contexts. -The CLI uses a context to determine what resources to fetch when running commands. A context is a cluster/project currently focused on. +**Other Common Commands:** -`rancher context switch` displays a list of available contexts and allows user selection to change to context +* `rancher ps` + + Lists workloads in the current context. -Common Commands: +* `rancher clusters` + + Lists all clusters in the current context. -* `rancher ps` to show workloads in the current Context -* `rancher clusters` to view all clusters -* `rancher kubectl` runs kubectl commands against the cluster -(requires kubectl to be installed but CLI will pull the kubeconfig) \ No newline at end of file +* `rancher kubectl` + + Runs `kubectl` commands against the cluster. This command requires `kubectl` to be installed. However Rancher, CLI will pull the kubeconfig. + +### Rancher CLI Help + +Once logged into Rancher Server using the CLI, enter `./rancher --help` for a list of commands. + +All commands accept the `--help` flag, which documents each command's usage. \ No newline at end of file