Rancher
The Rancher integration reads a Rancher server, and every Kubernetes cluster it manages, through the Rancher API. It runs on an Integrator inside your network.
It is read-only. The integration never scales, deploys, drains or reconfigures anything.
What it collects
| Sync | Collects |
|---|---|
| Cluster discovery | Every managed cluster with its Kubernetes version, provider and state, and every node with its addresses, OS, kernel, kubelet version, CPU, memory, roles and state |
| Workload discovery | Namespaces with their Rancher project, deployments, statefulsets, daemonsets, jobs and cronjobs with their state and scale, pods with their address and node, containers and the images they run |
| Service discovery | Services with their cluster IP, ports, public endpoints and target workloads; ingresses with their hosts, TLS hosts, public addresses and target workloads |
Clusters appear under Compute > Kubernetes, next to those from every other cloud, with their nodes, namespaces, workloads and pods. Container images appear under Compute > Registries. A LoadBalancer service that Rancher has published appears under Networking > Load Balancers, as does every ingress.
One integration reads every cluster the token's user can see. Namespaces, workloads and services are reported per cluster, so the same namespace name in two clusters stays two items.
Create a read-only API token
Rancher authenticates API clients by API token. A token acts as the user that created it, so create one for a user that can only view.
- Under Users & Authentication > Users, create a user (for example
inventory) with the global permission User-Base or Read-only, and no other global permission. - On every cluster to inventory, under Cluster > Cluster Members, add the user with the cluster permission Read-only. To see a cluster's projects, add the user under Cluster > Projects/Namespaces as a Read-only member of each project, or give the cluster permission Member instead, which reads every project.
- Sign in as that user and, under the user avatar, open Account & API Keys.
- Click Create API Key. Choose No Scope, so the token can list every cluster
the user can see, and an expiry that suits you (No Expiration for an unattended
integration). Copy the Bearer Token (
token-xxxxx:yyyyyyyy): it is shown once.
A token scoped to one cluster lists only that cluster. A cluster the user is not a member of is not listed, and is not reported.
Connect it
- Under Integrations, add Rancher with the Rancher URL (as in the browser, for
example
https://rancher.example.com) and the bearer token. - In the integration's settings, assign the Integrator that can reach the Rancher URL on port 443.
- Enable the syncs you want.
Rancher usually serves a certificate from your CA or Let's Encrypt, which the Integrator verifies. A Rancher server that serves its own self-signed certificate is accepted on first use: the first connection records the certificate's fingerprint and later connections must present the same certificate. After replacing it, clear the pinned fingerprint in the integration's settings.
A token Rancher refuses fails the sync with an error. It does not report an empty estate.