Documentation PortalBack to Self Assist PortalBack
Documentation Portal
Contents

Rancher CLI Authentication - V 1

Rancher CLI Authentication

Method 1 (Rancher Dashboard Portal):

  1. Navigate to the Rancher Dashboard and make sure the correct cluster is selected

    edit-profile

  2. Click the "Launch kubectl" button

    edit-profile

Method 2 (Rancher Cluster Explorer Portal):

  1. Navigate to the Cluster Explorer

    edit-profile

  2. Click the Kubectl Shell button

    edit-profile

Method 3 (Local Machine):

  1. Navigate to the Rancher Dashboard and make sure the correct cluster is selected

    • Same as Method 1 -> Step 1
  2. Click the "Kubeconfig File" button
  3. Copy the contents and save it to a file on your local system

    • example: 'rancher-aws-kubeconfig.conf'
  4. Scroll to the bottom of the Rancher Dashboard page and download the Rancher CLI

    edit-profile

  5. Add the Rancher cli executable location to your PATH environment variable
  6. Install kubectl
  7. Execute your desired kubectl command and reference the kubeconfig file you had earlier saved

    • The first time you execute a kubectl command, you will be prompted to authenticate
  8. During authentication prompts, enter the following

    • Provider: 0 (activeDirectoryProvider)
    • Username: {your sso@netapp.com}
    • Password: { your sso password}

    Example:

    $ kubectl --kubeconfig=rancher-aws-kubeconfig.conf get pods -n abc-hostspace1-stg
    https://aws-us-east-1.rancher.cloudone.netapp.com/v3-public/authProviders 
    Enter auth provider
    0 - activeDirectoryProvider
    1 - localProvider: 0  
    Enter credentials for activeDirectoryProvider 
    
    Enter username: ***@netapp.com
    Enter password: 
    INFO[0011] Saving config to /Users/***/.rancher/cli2.json 
    No resources found in abc-hostspace1-stg namespace.