Updated sections and corrected nits per feedback

This commit is contained in:
Jennifer Travinski
2022-05-13 15:39:15 -04:00
parent a0c5126214
commit ee8b7fce32
2 changed files with 50 additions and 30 deletions
+25 -14
View File
@@ -1,11 +1,23 @@
---
title: Rancher Command Line Interface
description: The Rancher CLI is a unified tool that you can use to interact with Rancher. With it, you can operate Rancher using a command line interface rather than the GUI
metaTitle: "Using the Rancher Command Line Interface"
metaDescription: "The Rancher CLI is a unified tool that you can use to interact with Rancher. With it, you can operate Rancher using a command line interface rather than the GUI"
title: CLI with Rancher
description: Interact with Rancher using command line interface (CLI) tools from your workstation.
weight: 21
---
- [Rancher CLI](#rancher-cli)
- [Download Rancher CLI](#download-rancher-cli)
- [Requirements](#requirements)
- [CLI Authentication](#cli-authentication)
- [Project Selection](#project-selection)
- [Commands](#commands)
- [Rancher CLI Help](#rancher-cli-help)
- [Limitations](#limitations)
- [kubectl](#kubectl)
- [kubectl Utility](#kubectl-utility)
- [Authentication with kubectl and kubeconfig Tokens with TTL](#authentication-with-kubectl-and-kubeconfig-tokens-with-ttl)
# Rancher CLI
The Rancher CLI (Command Line Interface) is a unified tool that you can use to interact with Rancher. With this tool, you can operate Rancher using a command line rather than the GUI.
### Download Rancher CLI
@@ -51,6 +63,8 @@ INFO[0005] Setting new context to project project-1
INFO[0005] Saving config to /Users/markbishop/.rancher/cli2.json
```
Ensure you can run `rancher kubectl get pods` successfully.
### Commands
The following commands are available for use in Rancher CLI.
@@ -83,15 +97,11 @@ All commands accept the `--help` flag, which documents each command's usage.
The Rancher CLI **cannot** be used to install [dashboard apps or Rancher feature charts](../helm-charts/).
# Using the CLI with Rancher
# kubectl
Interact with Rancher using command line interface (CLI) tools from your workstation.
Interact with Rancher using kubectl.
### Rancher CLI
Ensure you can run `rancher kubectl get pods` successfully.
### kubectl
### kubectl Utility
Install the `kubectl` utility. See [install kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/).
@@ -109,9 +119,10 @@ If admins have [enforced TTL on kubeconfig tokens]({{<baseurl>}}/rancher/v2.5/en
This feature enables kubectl to authenticate with the Rancher server and get a new kubeconfig token when required. The following auth providers are currently supported:
1. Local
2. Active Directory
3. FreeIpa, OpenLdap
4. SAML providers - Ping, Okta, ADFS, Keycloak, Shibboleth
2. Active Directory (LDAP only)
3. FreeIPA
4. OpenLDAP
5. SAML providers: Ping, Okta, ADFS, Keycloak, Shibboleth
When you first run kubectl, for example, `kubectl get pods`, it will ask you to pick an auth provider and log in with the Rancher server.
The kubeconfig token is cached in the path where you run kubectl under `./.cache/token`. This token is valid until [it expires](../../api/api-tokens/#setting-ttl-on-kubeconfig-tokens-period), or [gets deleted from the Rancher server](../../api/api-tokens/#deleting-tokens).
+25 -16
View File
@@ -1,19 +1,29 @@
---
title: Rancher Command Line Interface
description: The Rancher CLI is a unified tool that you can use to interact with Rancher. With it, you can operate Rancher using a command line interface rather than the GUI
metaTitle: "Using the Rancher Command Line Interface"
metaDescription: "The Rancher CLI is a unified tool that you can use to interact with Rancher. With it, you can operate Rancher using a command line interface rather than the GUI"
title: CLI with Rancher
description: Interact with Rancher using command line interface (CLI) tools from your workstation.
weight: 21
---
- [Rancher CLI](#rancher-cli)
- [Download Rancher CLI](#download-rancher-cli)
- [Requirements](#requirements)
- [CLI Authentication](#cli-authentication)
- [Project Selection](#project-selection)
- [Commands](#commands)
- [Rancher CLI Help](#rancher-cli-help)
- [Limitations](#limitations)
- [kubectl](#kubectl)
- [kubectl Utility](#kubectl-utility)
- [Authentication with kubectl and kubeconfig Tokens with TTL](#authentication-with-kubectl-and-kubeconfig-tokens-with-ttl)
# Rancher CLI
The Rancher CLI (Command Line Interface) is a unified tool that you can use to interact with Rancher. With this tool, you can operate Rancher using a command line rather than the GUI.
### Download Rancher CLI
The binary can be downloaded directly from the UI. The link can be found in the right hand side of the footer in the UI. We have binaries for Windows, Mac, and Linux. You can also check the [releases page for our CLI](https://github.com/rancher/cli/releases) for direct downloads of the binary.
The binary can be downloaded directly from the UI.
1. In the upper left corner, click **☰**.
1. At the bottom, click **v2.6.x**, where **v2.6.x** is a hyperlinked text indicating the installed Rancher version.
1. Under the **CLI Downloads section**, there are links to download the binaries for Windows, Mac, and Linux. You can also check the [releases page for our CLI](https://github.com/rancher/cli/releases) for direct downloads of the binary.
@@ -57,6 +67,8 @@ INFO[0005] Setting new context to project project-1
INFO[0005] Saving config to /Users/markbishop/.rancher/cli2.json
```
Ensure you can run `rancher kubectl get pods` successfully.
### Commands
The following commands are available for use in Rancher CLI.
@@ -89,15 +101,11 @@ All commands accept the `--help` flag, which documents each command's usage.
The Rancher CLI **cannot** be used to install [dashboard apps or Rancher feature charts](../helm-charts/).
# Using the CLI with Rancher
# kubectl
Interact with Rancher using command line interface (CLI) tools from your workstation.
Interact with Rancher using kubectl.
### Rancher CLI
Ensure you can run `rancher kubectl get pods` successfully.
### kubectl
### kubectl Utility
Install the `kubectl` utility. See [install kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/).
@@ -115,9 +123,10 @@ If admins have [enforced TTL on kubeconfig tokens]({{<baseurl>}}/rancher/v2.6/en
This feature enables kubectl to authenticate with the Rancher server and get a new kubeconfig token when required. The following auth providers are currently supported:
1. Local
2. Active Directory
3. FreeIpa, OpenLdap
4. SAML providers - Ping, Okta, ADFS, Keycloak, Shibboleth
2. Active Directory (LDAP only)
3. FreeIPA
4. OpenLDAP
5. SAML providers: Ping, Okta, ADFS, Keycloak, Shibboleth
When you first run kubectl, for example, `kubectl get pods`, it will ask you to pick an auth provider and log in with the Rancher server.
The kubeconfig token is cached in the path where you run kubectl under `./.cache/token`. This token is valid until [it expires](../../api/api-tokens/#setting-ttl-on-kubeconfig-tokens-period), or [gets deleted from the Rancher server](../../api/api-tokens/#deleting-tokens).