Skip to main content
Connect your Rancher server so CloudThinker can list the clusters, projects, and nodes Rancher manages, report cluster health and node readiness, and show who holds Rancher access to a cluster or project. The connection uses a Rancher API key (you paste its Bearer Token into the API token field) and is read-only by design: agents can describe what Rancher manages and cannot change any of it.

Prerequisites

  • Rancher 2.8 or later, reachable from the internet over HTTPS. Commands run in the CloudThinker cloud. For an internal Rancher, see Reaching private services. These docs don’t publish CloudThinker’s egress IP list: ask your CloudThinker contact, or contact us.
  • Permission in Rancher to create a user and assign cluster and project roles.
  • Optional: the PEM certificate of your private certificate authority, if Rancher’s certificate is not publicly trusted.
A workspace holds one Rancher connection. To inspect workloads, pods, and Kubernetes RBAC inside a cluster, add a Kubernetes connection as well.

Setup

1

Create a dedicated Rancher user

Add a user for CloudThinker instead of reusing a person’s account. The API key you create next inherits this user’s access, so a dedicated user keeps the scope visible and easy to revoke.
  1. Open ☰ → Users & Authentication → Users and click Create. Enter a Username such as cloudthinker and a New Password. Under Global Permissions, select User-Base instead of the default Standard User, which can create clusters. User-Base lets the account sign in and nothing more. Click Create.
  2. In each cluster you want inspected, open ☰, select the cluster under Explore Cluster, then open Cluster → Cluster and Project Members in the left menu.
  3. On the Cluster Membership tab, add the user with Cluster Member (or your custom role).
  4. On the Project Membership tab, add the user to each project with Read Only.
2

Create an API key

In a private browser window, so your admin session stays signed in, sign in as that user with the password from step 1. If Rancher asks for a new password, set one. Open the user avatar → Account & API Keys in the upper right, and click Create API Key.
  • Expiry: pick a date that matches your rotation schedule, such as 90 days. Rancher caps it at the server’s auth-token-max-ttl-minutes setting, which you can check in ☰ → Global Settings → Settings, and uses the cap without warning if you ask for longer. When the key expires, the connection switches to Error. Create a new key and enter it with Replace credentials on the detail panel, which appears once the connection shows Error. See Rotate a credential.
  • Scope: leave it as No Scope. A scoped key only works against one cluster’s Kubernetes API, which this connection does not use.
Copy the Bearer Token. Rancher shows it only once.
3

Add the connection in CloudThinker

In the sidebar, click More → Workspace settings → Connections, then on the Builtin Connections tab select Rancher, and fill in the fields from Connection details. Click Connect.Success state: the connection shows Connecting and Verifying, then a Connected status. CloudThinker reads one cluster from Rancher to prove the API key works.

Connection details

TLS verification is always on, because the key travels with every request. If Rancher uses a private CA, paste that CA’s certificate chain into CA certificate bundle. CloudThinker also refuses redirects, so the URL must be the address Rancher answers on directly.

Required permissions

The API key’s user needs read access to clusters, nodes, projects, and cluster and project role bindings. Pick one recipe:
  • Built-in roles: Cluster Member on each cluster, plus Read Only on each project (Setup step 1, items 3 and 4).
  • Custom role: the custom cluster role below on each cluster, in place of Cluster Member. Its rule includes projects and project role bindings. Run the check below, and add Read Only on a project only if that check reports a permission error for it.
The roles: A custom role needs one rule:
To check the role before you rely on it, connect, then ask Who holds Rancher access to the <project> project on <cluster>?. The answer must list bindings. If it reports a permission error, the role doesn’t reach that project.
A Rancher API key has no read-only switch, so it can see exactly what its user can see. Narrow access through the user’s roles. Write permissions never help, because the connection has no way to send a change.

What this connection cannot reach

The connection only sends read requests to Rancher’s management resources. These stay out of reach even if the API key’s user could read them:
  • Secrets, kubeconfigs, API tokens, and cluster registration tokens
  • Cloud credentials, authentication settings, and global settings
  • Any change to Rancher: creating, updating, deleting, or scaling
  • The older Rancher v3 API
Ask an agent to change something in Rancher and it tells you the connection cannot, and that nothing changed.

Agent capabilities

Each lookup returns one page of at most 50 rows, and agents can’t fetch the next page. When Rancher does not report a total, agents say “returned 12” rather than “12 exist”, and they say when more rows exist. For a large fleet, ask cluster by cluster, such as Show node readiness for the prod-sea cluster. Whenever a message mentions Rancher, agents query it live instead of reusing a result from an earlier message.

Verify the connection

You get a list of clusters with their projects and a count of ready and not-ready nodes.

Example prompts

Troubleshooting

The API key expired, was deleted, or was copied incompletely. Rancher shows the Bearer Token only once, so create a new key under Account & API Keys and update the connection.
The API key signs in, but its user cannot read clusters. Give that user Cluster Member (or a custom read role) on the clusters you want inspected, then test the connection again.
RK-API is Rancher’s Kubernetes-style management API, served under /apis/management.cattle.io/v3. The URL points somewhere other than the Rancher server root, or the Rancher release is older than 2.8. Reconnect with the plain Rancher address and check your version.
Nothing answered, or the address redirected elsewhere. Check that the host is reachable from the internet, that the URL is the address Rancher answers on directly, and, for a private CA, that the bundle holds the CA that issued Rancher’s certificate.
The address starts with http://, which would send the API key in clear text. On CloudThinker’s cloud, http:// is refused for every host, including localhost. Serve Rancher over HTTPS and reconnect with an https:// URL.
The bundle is not plain PEM certificates, or the Bearer Token has quotes, spaces, or line breaks around it. Paste only the CA certificate chain, never a private key, and re-copy the Bearer Token as one line.
This workspace already has a Rancher connection. Edit that connection, or disconnect it first.
The API key’s user cannot see the rest, or the answer came from a single page of results. Check the user’s cluster roles first, then ask about the specific cluster or project.

Security

  • Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
  • Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
  • Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
  • Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
  • Narrow through roles. The API key sees exactly what its user sees, so the user’s roles are your only scope control.
  • Read-only by construction. The connection can only send read requests, so no permission you grant lets an agent change Rancher.
  • Plan for expiry. A workspace holds one Rancher connection, so there’s no in-place swap while it’s healthy. Either wait for Error and use Replace credentials, or rotate early by disconnecting and connecting again with a new key. Reconnecting reruns Discovery and means checking that Rules still name the connection. See Rotate a credential.
  • Revoke at the source. Delete the API key in Account & API Keys, or deactivate the user, to stop all access through this connection.

Kubernetes

Inspect pods, logs, nodes, and RBAC inside one cluster

Connections Overview

How connection status, testing, and discovery work