Skip to content

Instantly share code, notes, and snippets.

@tanvirraj
Created January 17, 2026 11:41
Show Gist options
  • Select an option

  • Save tanvirraj/941855b7e927e2ea26e935f8916d7c9d to your computer and use it in GitHub Desktop.

Select an option

Save tanvirraj/941855b7e927e2ea26e935f8916d7c9d to your computer and use it in GitHub Desktop.
Rancher

Rancher Codebase Architecture Guide

A comprehensive guide for new developers to understand and contribute to Rancher


Table of Contents

  1. Introduction
  2. High-Level Architecture
  3. Project Structure
  4. Entry Points
  5. Core Packages
  6. API Layer
  7. Authentication & Authorization
  8. Kubernetes Integration
  9. Multi-Cluster Architecture
  10. Controllers
  11. Data Flow
  12. Key Concepts

Introduction

Rancher is a complete container management platform that provides a centralized control plane for managing multiple Kubernetes clusters. The codebase is written in Go and follows Kubernetes-native patterns, using Custom Resource Definitions (CRDs) as its primary state storage mechanism and controllers (reconcilers) for business logic.

The system consists of two main components: the Management Server (this repository's main binary) and Cluster Agents that run inside managed clusters. The management server hosts the Rancher UI/API, runs controllers over Rancher CRDs, and coordinates operations across all managed clusters.


High-Level Architecture

┌─────────────────────────────────────────────────────────────────────────────┐
│                           RANCHER MANAGEMENT SERVER                          │
│                                                                              │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │                         HTTP Handler Stack                            │   │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  │   │
│  │  │  Auth       │  │  RBAC       │  │  Routing    │  │  Steve/     │  │   │
│  │  │  Middleware │──│  Handler    │──│  Middleware │──│  Norman API │  │   │
│  │  └─────────────┘  └─────────────┘  └─────────────┘  └─────────────┘  │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                                                              │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │                           Controllers                                 │   │
│  │  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐             │   │
│  │  │  Auth    │  │  Cluster │  │  Project │  │  RBAC    │   ...       │   │
│  │  │  Ctrl    │  │  Ctrl    │  │  Ctrl    │  │  Ctrl    │             │   │
│  │  └──────────┘  └──────────┘  └──────────┘  └──────────┘             │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                                                              │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │                    Kubernetes API (Local Cluster)                     │   │
│  │                         CRDs + Native Resources                       │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────────────────┘

         ▲                                                    ▲
         │ Tunnel                                             │ Tunnel
         │ (remotedialer)                                     │ (remotedialer)
         ▼                                                    ▼

┌─────────────────────────┐                     ┌─────────────────────────┐
│   DOWNSTREAM CLUSTER A  │                     │   DOWNSTREAM CLUSTER B  │
│                         │                     │                         │
│  ┌───────────────────┐  │                     │  ┌───────────────────┐  │
│  │   Cluster Agent   │  │                     │  │   Cluster Agent   │  │
│  └───────────────────┘  │                     │  └───────────────────┘  │
│                         │                     │                         │
│  ┌───────────────────┐  │                     │  ┌───────────────────┐  │
│  │   K8s API Server  │  │                     │  │   K8s API Server  │  │
│  └───────────────────┘  │                     │  └───────────────────┘  │
└─────────────────────────┘                     └─────────────────────────┘

The management server maintains persistent connections (tunnels) to each downstream cluster's agent. These tunnels enable the server to proxy Kubernetes API requests and execute operations on behalf of users.


Project Structure

The Rancher repository is organized into distinct directories, each serving a specific purpose:

rancher/
├── main.go                    # Entry point for the Rancher server binary
├── cmd/
│   └── agent/                 # Entry point for the cluster agent binary
├── pkg/
│   ├── rancher/               # Core server construction and startup
│   ├── multiclustermanager/   # HTTP routing and multi-cluster coordination
│   ├── api/                   # API implementations (Norman v3 + Steve v1)
│   ├── apis/                  # CRD Go types (management, provisioning, etc.)
│   ├── schemas/               # API schema definitions
│   ├── auth/                  # Authentication and authorization
│   ├── controllers/           # All reconciliation controllers
│   ├── clustermanager/        # Per-cluster client management
│   ├── k8sproxy/              # Kubernetes API proxy handler
│   ├── tunnelserver/          # Agent tunnel termination
│   ├── wrangler/              # Controller context and factories
│   ├── types/                 # Configuration contexts
│   ├── generated/             # Generated clients and informers
│   ├── features/              # Feature flag framework
│   ├── settings/              # Cluster-stored configuration
│   └── ...                    # Additional supporting packages
├── chart/                     # Helm chart for Rancher deployment
├── scripts/                   # Build and development scripts
└── tests/                     # Integration and e2e tests

Entry Points

Management Server: main.go

The server entry point at main.go follows a straightforward flow. The main() function begins by registering special commands for password reset and ensuring default admin users. It then sets up the CLI application with various flags for configuration such as ports, logging, audit settings, and feature flags.

The actual startup happens in the run() function starting at line 212:

main.go:run()
    │
    ├── k8s.GetConfig()                    # Get Kubernetes client config
    │   (embedded vs external cluster)
    │
    ├── rancher.New()                      # Construct the Rancher server
    │   │
    │   ├── wrangler.NewPrimaryContext()   # Build controller factories
    │   ├── crds.EnsureRequired()          # Ensure CRDs exist
    │   ├── features.InitializeFeatures()  # Initialize feature flags
    │   ├── auth.NewServer()               # Create auth server
    │   └── Build HTTP handler stack       # Assemble middleware chain
    │
    └── server.ListenAndServe()            # Start HTTPS server

The rancher.New() function in pkg/rancher/rancher.go performs the heavy lifting of assembling all components. It creates a Rancher struct that contains the authentication middleware, HTTP handler, and wrangler context.

Cluster Agent: cmd/agent/main.go

The agent binary runs inside each downstream cluster. Its primary responsibility is establishing and maintaining a tunnel connection back to the Rancher server. When started, the agent:

  1. Fetches cluster parameters and server URL
  2. Verifies TLS/CA connectivity to the Rancher server
  3. Opens a persistent tunnel using remotedialer
  4. Authenticates via tunnel headers (X-API-Tunnel-Token, X-API-Tunnel-Params)

Core Packages

pkg/rancher

This package contains the core server construction logic. The Rancher struct defined in pkg/rancher/rancher.go holds:

  • Auth: The authentication middleware chain
  • Handler: The main HTTP handler stack
  • Wrangler: The controller context with clients and factories
  • Steve: The Steve API server instance

The New() function constructs this struct by:

  1. Setting up the REST config and validating connectivity
  2. Running encryption config migrations
  3. Creating the wrangler context with shared controller factories
  4. Ensuring all required CRDs are installed
  5. Initializing features and auth server
  6. Building the HTTP handler middleware chain

pkg/wrangler

The wrangler package provides the Context struct that aggregates all typed Kubernetes clients, shared controller factories, and informers. This context is passed throughout the codebase to provide access to cluster resources.

pkg/multiclustermanager

This package defines the HTTP routing for most external endpoints. The router() function in pkg/multiclustermanager/routes.go builds several routers that are chained together:

                    ┌─────────────────┐
                    │   unauthed      │  Unauthenticated endpoints
                    │   router        │  /v3/connect, /v3/settings/cacerts, etc.
                    └────────┬────────┘
                             │ NotFoundHandler
                             ▼
                    ┌─────────────────┐
                    │   saauthed      │  Service account authenticated
                    │   router        │  /k8s/clusters/{clusterID}
                    └────────┬────────┘
                             │ NotFoundHandler
                             ▼
                    ┌─────────────────┐
                    │   authed        │  User authenticated endpoints
                    │   router        │  /v3/*, /meta/*, etc.
                    └────────┬────────┘
                             │ NotFoundHandler
                             ▼
                    ┌─────────────────┐
                    │   metricsAuthed │  Metrics endpoint
                    │   router        │  /metrics
                    └────────┬────────┘
                             │ NotFoundHandler
                             ▼
                    ┌─────────────────┐
                    │   next handler  │  Steve/inner handlers
                    └─────────────────┘

pkg/types/config

Contains configuration contexts like ScaledContext and ManagementContext that aggregate typed clients and access control handlers. These contexts are passed to controllers and API handlers.

pkg/settings

Provides cluster-stored configuration settings backed by CRDs. Settings can be read and modified at runtime.

pkg/features

Implements the feature flag framework. Features can be enabled/disabled at startup or dynamically.


API Layer

Rancher exposes two API systems that evolved over time:

Norman API (v3)

The legacy management API served at /v3. It uses a schema-driven approach where API resources are defined in pkg/schemas/management.cattle.io/v3/schema.go.

Norman schemas define:

  • Resource types and their fields
  • Collection and resource methods (GET, POST, PUT, DELETE)
  • Actions that can be performed on resources
  • Input/output types for actions

The Norman API server is created in pkg/api/norman/server/server.go which registers all schemas and sets up stores for CRUD operations.

Steve API (v1)

The newer Kubernetes-style API served at /v1. Steve directly exposes Kubernetes resources with minimal transformation, providing a more native experience. It is built on the external rancher/steve library.

API Endpoints Summary

Unauthenticated Endpoints:

  • GET / - Management API root (non-browser)
  • GET /v3/settings/cacerts - CA certificates
  • GET /v3/settings/first-login - First login status
  • GET /v3/settings/ui-* - UI settings
  • POST /v3/connect - Agent tunnel connection
  • GET /v3/import/{token}_{clusterId}.yaml - Cluster import manifest
  • GET /rancherversion - Rancher version info
  • /v1-{prefix}-release/* - Channel server
  • /v1-saml/* - SAML authentication flows
  • /v1-public/* - Public auth endpoints (login, providers)
  • /v3-public/* - Legacy public auth endpoints (deprecated)

Service Account Authenticated:

  • /k8s/clusters/{clusterID}/* - Kubernetes API proxy to downstream clusters

User Authenticated:

  • /v3/* - Full management API surface
  • /v3/identit* - Identity endpoints
  • /v3/token* - Token management
  • /meta/aks.*, /meta/gke.*, etc. - Cloud provider metadata
  • /meta/proxy - HTTP proxy for external services
  • /v3/tokenreview - Token review webhook
  • /v1/logout - Logout endpoint

Metrics:

  • /metrics - Prometheus metrics (protected by TokenReview)

Authentication & Authorization

Authentication Flow

Authentication is centralized in pkg/auth. The Server struct in pkg/auth/server.go provides:

  • Authenticator: Middleware that extracts and validates tokens from requests
  • Management: Middleware that injects auth API routes
                    ┌─────────────────────────────────────┐
                    │           Incoming Request          │
                    └────────────────┬────────────────────┘
                                     │
                                     ▼
                    ┌─────────────────────────────────────┐
                    │      requests.Authenticator         │
                    │  Extract token from:                │
                    │  - Authorization header (Bearer)    │
                    │  - R_SESS cookie                    │
                    └────────────────┬────────────────────┘
                                     │
                                     ▼
                    ┌─────────────────────────────────────┐
                    │        Token Validation             │
                    │  - Check token exists in CRD        │
                    │  - Verify not expired               │
                    │  - Validate signature               │
                    └────────────────┬────────────────────┘
                                     │
                                     ▼
                    ┌─────────────────────────────────────┐
                    │      User Info Attached             │
                    │  - User ID                          │
                    │  - Groups                           │
                    │  - Provider info                    │
                    └─────────────────────────────────────┘

Authentication Providers

Rancher supports multiple authentication providers, each implemented in pkg/auth/providers:

Provider Type Login Input
Local Username/Password BasicLogin
GitHub OAuth GithubLogin (code)
GitHub App OAuth GithubLogin (code)
Active Directory LDAP BasicLogin
Azure AD OAuth/OIDC AzureADLogin (code)
OpenLDAP LDAP BasicLogin
FreeIPA LDAP BasicLogin
Ping Identity SAML SamlLoginInput
ADFS SAML SamlLoginInput
KeyCloak (SAML) SAML SamlLoginInput
OKTA SAML SamlLoginInput
Shibboleth SAML SamlLoginInput
Google OAuth OAuth GoogleOauthLogin (code)
Generic OIDC OIDC OIDCLogin (code)
KeyCloak OIDC OIDC OIDCLogin (code)
AWS Cognito OIDC OIDCLogin (code)

Token Management

Tokens are managed in pkg/auth/tokens. The Token CRD stores authentication tokens with the following key fields:

  • token: The hashed token value
  • userID: Reference to the user
  • authProvider: Which provider authenticated the user
  • ttlMillis: Token time-to-live
  • isDerived: Whether this is a derived (API) token
  • clusterName: Optional cluster scope

Authorization (RBAC)

Rancher extends Kubernetes RBAC with its own role model:

  1. GlobalRoles: Apply to the local cluster and/or all downstream clusters
  2. RoleTemplates: Templates for creating Kubernetes Roles/ClusterRoles
  3. ClusterRoleTemplateBindings: Bind users to roles within a cluster
  4. ProjectRoleTemplateBindings: Bind users to roles within a project

The RBAC middleware in pkg/rbac enforces permissions based on these bindings.


Kubernetes Integration

Client Configuration

At startup, k8s.GetConfig determines how to connect to Kubernetes:

  • Embedded Mode: Rancher runs its own API server (Docker installation)
  • External Mode: Rancher connects to an existing cluster (Helm installation)
  • Auto Mode: Automatically determines based on environment

CRD Management

Custom Resource Definitions are defined in pkg/apis. Each API group has its own subdirectory:

pkg/apis/
├── management.cattle.io/v3/     # Core management resources
│   ├── authn_types.go           # Token, User, Group, AuthConfig
│   ├── authz_types.go           # Project, GlobalRole, RoleTemplate
│   ├── cluster_types.go         # Cluster, ClusterRegistrationToken
│   └── ...
├── provisioning.cattle.io/v1/   # RKE2/K3s provisioning
│   └── cluster_types.go         # Provisioning Cluster, MachinePools
├── project.cattle.io/v3/        # Project-scoped resources
├── catalog.cattle.io/v1/        # Helm catalog resources
└── rke.cattle.io/v1/            # RKE2 configuration

CRDs are installed at startup in pkg/crds and pkg/crds/dashboard.

Wrangler Context

The wrangler context created by wrangler.NewPrimaryContext() provides:

  • Typed Kubernetes clients (core, apps, RBAC, etc.)
  • Typed Rancher clients (management, provisioning, etc.)
  • Shared informer factories
  • Controller factories

Multi-Cluster Architecture

Cluster Types

Rancher manages several types of clusters:

  1. Local Cluster: The cluster where Rancher runs
  2. Imported Clusters: Existing clusters registered with Rancher
  3. Provisioned Clusters: Clusters created by Rancher (RKE2/K3s)
  4. Hosted Clusters: EKS, AKS, GKE managed by cloud providers

Tunnel Architecture

┌──────────────────────────────────────────────────────────────┐
│                     RANCHER SERVER                            │
│                                                               │
│  ┌─────────────────────────────────────────────────────────┐ │
│  │                   Tunnel Server                          │ │
│  │  pkg/tunnelserver                                        │ │
│  │                                                          │ │
│  │  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐   │ │
│  │  │  Authorizer  │  │  Authorizer  │  │  Authorizer  │   │ │
│  │  │  (cluster-a) │  │  (cluster-b) │  │  (cluster-c) │   │ │
│  │  └──────┬───────┘  └──────┬───────┘  └──────┬───────┘   │ │
│  │         │                 │                 │            │ │
│  │         │    remotedialer │                 │            │ │
│  │         │    connections  │                 │            │ │
│  └─────────┼─────────────────┼─────────────────┼────────────┘ │
│            │                 │                 │              │
└────────────┼─────────────────┼─────────────────┼──────────────┘
             │                 │                 │
             ▼                 ▼                 ▼
    ┌────────────────┐ ┌────────────────┐ ┌────────────────┐
    │  Cluster Agent │ │  Cluster Agent │ │  Cluster Agent │
    │  (cluster-a)   │ │  (cluster-b)   │ │  (cluster-c)   │
    └────────────────┘ └────────────────┘ └────────────────┘

Agents authenticate using tunnel tokens and transmit cluster identity via headers. The server uses these tunnels to:

  • Proxy Kubernetes API requests
  • Execute controller logic remotely
  • Deploy workloads and configurations

Kubernetes API Proxy

The proxy in pkg/k8sproxy handles requests to /k8s/clusters/{clusterID}/*. It:

  1. Extracts the cluster ID from the URL
  2. Looks up the appropriate tunnel connection
  3. Forwards the request through the tunnel
  4. Returns the response to the client

Controllers

Controllers (reconcilers) implement the business logic for Rancher resources. They are organized in pkg/controllers:

pkg/controllers/
├── auditlog/              # Audit logging
├── capr/                  # CAPI/RKE2 provisioning
├── dashboard/             # Dashboard/UI integration
├── dashboardapi/          # Dashboard API resources
├── management/            # Core management controllers
│   └── auth/              # Authentication controllers
├── managementagent/       # Agent-side management
├── managementapi/         # API-related controllers
├── managementlegacy/      # Legacy management controllers
├── managementuser/        # User-scoped controllers
├── nodedriver/            # Node driver controllers
├── provisioningv2/        # RKE2/K3s provisioning
│   └── cluster/           # Cluster provisioning
└── status/                # Status aggregation

Controller Pattern

Controllers follow the standard Kubernetes controller pattern:

// Handler interface pattern
type Handler interface {
    OnChange(key string, obj *v3.SomeResource) (*v3.SomeResource, error)
}

// Registration
controller.Register(ctx, "controller-name", factory, handler.OnChange)

Key controllers include:

  • Auth Controllers: User, token, and provider management
  • Cluster Controllers: Cluster lifecycle and status
  • Project Controllers: Project creation and RBAC
  • Provisioning Controllers: Machine pool and RKE2 setup

Data Flow

Login Flow

1. User submits credentials to /v1-public/login
                    │
                    ▼
2. PublicAPI handler (pkg/auth/providers/publicapi/login.go)
   - Unmarshal request based on provider type
   - Call provider-specific authentication
                    │
                    ▼
3. Provider authentication (pkg/auth/providers/*)
   - Validate credentials with external system
   - Return user principal and group principals
                    │
                    ▼
4. User management (pkg/user)
   - Ensure user exists in local database
   - Update user attributes
                    │
                    ▼
5. Token creation (pkg/auth/tokens)
   - Generate new token
   - Store token as CRD
                    │
                    ▼
6. Response
   - Return token to client (bearer or cookie)

Cluster Creation Flow (Provisioning)

1. User creates provisioning.cattle.io/v1.Cluster
                    │
                    ▼
2. Provisioning controller (pkg/controllers/provisioningv2/cluster)
   - Validate spec
   - Create management.cattle.io/v3.Cluster
                    │
                    ▼
3. Cluster controller
   - Create ClusterRegistrationToken
   - Generate agent manifests
                    │
                    ▼
4. Machine pool controllers
   - Create machine templates
   - Provision infrastructure
                    │
                    ▼
5. Agent deployment
   - Agent connects via tunnel
   - Cluster becomes Ready

API Request Flow

┌──────────────┐
│   Request    │
└──────┬───────┘
       │
       ▼
┌──────────────────────────────────────────────────────────┐
│  SetXAPICattleAuthHeader                                 │
│  Set X-API-Cattle-Auth header for UI                     │
└──────────────────────────────────────────────────────────┘
       │
       ▼
┌──────────────────────────────────────────────────────────┐
│  WebSocket Handler                                        │
│  Handle WebSocket upgrades                                │
└──────────────────────────────────────────────────────────┘
       │
       ▼
┌──────────────────────────────────────────────────────────┐
│  Cluster Proxy                                            │
│  Route /k8s/clusters/* to downstream                      │
└──────────────────────────────────────────────────────────┘
       │
       ▼
┌──────────────────────────────────────────────────────────┐
│  MultiClusterManager Middleware                          │
│  Route to management API or pass through                  │
└──────────────────────────────────────────────────────────┘
       │
       ▼
┌──────────────────────────────────────────────────────────┐
│  Auth Server Management                                   │
│  Handle auth-specific routes                              │
└──────────────────────────────────────────────────────────┘
       │
       ▼
┌──────────────────────────────────────────────────────────┐
│  Authentication Filter                                    │
│  Require authenticated user for protected paths           │
└──────────────────────────────────────────────────────────┘
       │
       ▼
┌──────────────────────────────────────────────────────────┐
│  Steve API Server                                         │
│  Handle /v1 Kubernetes-style API                          │
└──────────────────────────────────────────────────────────┘

Key Concepts

Principals

Principals represent identities in Rancher. They are formatted as {provider}_{type}://{identifier}:

  • local://u-{id} - Local user
  • github_user://{id} - GitHub user
  • activedirectory_user://CN=... - AD user
  • local://g-{id} - Local group

Projects

Projects group namespaces within a cluster. They provide:

  • Multi-tenancy within a cluster
  • Shared resource quotas
  • Project-scoped RBAC

A project's name format is {clusterName}:{projectName}.

Fleet Workspaces

Fleet workspaces organize clusters for GitOps deployments. Each workspace can have its own GitRepos and Bundles.

Conditions

Resources use conditions to communicate status. Common condition types:

  • Ready - Resource is fully operational
  • Provisioned - Underlying resources created
  • AgentDeployed - Cluster agent is running
  • Updated - Desired state matches actual state

Development Quick Reference

Building

# Full build
make

# Just the rancher binary
go build -o bin/rancher .

# Agent binary
go build -o bin/agent ./cmd/agent

Running Locally

# With existing kubeconfig
./bin/rancher --kubeconfig=$KUBECONFIG

# Development mode
CATTLE_DEV_MODE=1 ./bin/rancher

Key Environment Variables

Variable Description
KUBECONFIG Path to kubeconfig file
CATTLE_DEV_MODE Enable development mode
CATTLE_FEATURES Feature flag overrides
AUDIT_LEVEL Audit logging level (0-3)

Adding a New Controller

  1. Define your handler in pkg/controllers/<area>/
  2. Register it in the appropriate Register() function
  3. The handler will be called when watched resources change

Adding a New API Endpoint

For Norman API:

  1. Add types to pkg/apis/management.cattle.io/v3/
  2. Add schema registration in pkg/schemas/management.cattle.io/v3/schema.go
  3. Implement custom handlers if needed

For Steve API:

  1. Resources are automatically exposed based on CRDs
  2. Custom logic via schema stores and handlers

Further Reading

{
"openapi": "3.0.3",
"info": {
"title": "Rancher Management API",
"description": "API schemas for Rancher management endpoints. This document describes the request and response schemas for the Rancher API, which is primarily Kubernetes-native but exposes management endpoints via Norman (v3) and Steve (v1) APIs.",
"version": "2.x"
},
"servers": [
{
"url": "https://{rancher-server}",
"description": "Rancher Management Server"
}
],
"paths": {
"/v1-public/authproviders": {
"get": {
"summary": "List available authentication providers",
"description": "Returns a list of configured authentication providers that can be used for login.",
"tags": ["Authentication"],
"security": [],
"responses": {
"200": {
"description": "List of auth providers",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AuthProviderList"
}
}
}
}
}
}
},
"/v1-public/login": {
"post": {
"summary": "Authenticate user",
"description": "Authenticate a user using the specified provider and return a token.",
"tags": ["Authentication"],
"security": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"oneOf": [
{ "$ref": "#/components/schemas/BasicLoginInput" },
{ "$ref": "#/components/schemas/OAuthLoginInput" },
{ "$ref": "#/components/schemas/SamlLoginInput" }
]
}
}
}
},
"responses": {
"201": {
"description": "Authentication successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LoginResponse"
}
}
}
},
"401": {
"description": "Authentication failed"
}
}
}
},
"/v1-public/authtokens/{id}": {
"get": {
"summary": "Get auth token by ID",
"tags": ["Authentication"],
"security": [],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "Auth token details",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AuthToken"
}
}
}
}
}
},
"delete": {
"summary": "Delete auth token",
"tags": ["Authentication"],
"security": [],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"204": {
"description": "Token deleted"
}
}
}
},
"/v1/logout": {
"post": {
"summary": "Logout current user",
"tags": ["Authentication"],
"responses": {
"200": {
"description": "Logout successful"
}
}
}
},
"/v3/tokens": {
"get": {
"summary": "List tokens for current user",
"tags": ["Tokens"],
"responses": {
"200": {
"description": "List of tokens",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenList"
}
}
}
}
}
},
"post": {
"summary": "Create a derived API token",
"tags": ["Tokens"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenCreateInput"
}
}
}
},
"responses": {
"201": {
"description": "Token created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Token"
}
}
}
}
}
}
},
"/v3/tokens/{id}": {
"get": {
"summary": "Get token by ID",
"tags": ["Tokens"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "Token details",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Token"
}
}
}
}
}
},
"delete": {
"summary": "Delete token",
"tags": ["Tokens"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"204": {
"description": "Token deleted"
}
}
}
},
"/v3/users": {
"get": {
"summary": "List users",
"tags": ["Users"],
"responses": {
"200": {
"description": "List of users",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserList"
}
}
}
}
}
},
"post": {
"summary": "Create a new user",
"tags": ["Users"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserCreateInput"
}
}
}
},
"responses": {
"201": {
"description": "User created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
}
}
}
},
"/v3/users/{id}": {
"get": {
"summary": "Get user by ID",
"tags": ["Users"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "User details",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
}
}
},
"put": {
"summary": "Update user",
"tags": ["Users"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"responses": {
"200": {
"description": "User updated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
}
}
},
"delete": {
"summary": "Delete user",
"tags": ["Users"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"204": {
"description": "User deleted"
}
}
}
},
"/v3/clusters": {
"get": {
"summary": "List clusters",
"tags": ["Clusters"],
"responses": {
"200": {
"description": "List of clusters",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClusterList"
}
}
}
}
}
},
"post": {
"summary": "Create a new cluster",
"tags": ["Clusters"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClusterCreateInput"
}
}
}
},
"responses": {
"201": {
"description": "Cluster created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Cluster"
}
}
}
}
}
}
},
"/v3/clusters/{id}": {
"get": {
"summary": "Get cluster by ID",
"tags": ["Clusters"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "Cluster details",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Cluster"
}
}
}
}
}
},
"put": {
"summary": "Update cluster",
"tags": ["Clusters"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Cluster"
}
}
}
},
"responses": {
"200": {
"description": "Cluster updated"
}
}
},
"delete": {
"summary": "Delete cluster",
"tags": ["Clusters"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"204": {
"description": "Cluster deleted"
}
}
}
},
"/v3/clusters/{id}?action=generateKubeconfig": {
"post": {
"summary": "Generate kubeconfig for cluster",
"tags": ["Clusters"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "Kubeconfig generated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GenerateKubeConfigOutput"
}
}
}
}
}
}
},
"/v3/clusters/{id}?action=importYaml": {
"post": {
"summary": "Import YAML into cluster",
"tags": ["Clusters"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ImportClusterYamlInput"
}
}
}
},
"responses": {
"200": {
"description": "YAML imported",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ImportYamlOutput"
}
}
}
}
}
}
},
"/v3/clusters/{id}?action=rotateCertificates": {
"post": {
"summary": "Rotate cluster certificates",
"tags": ["Clusters"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RotateCertificateInput"
}
}
}
},
"responses": {
"200": {
"description": "Certificate rotation initiated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RotateCertificateOutput"
}
}
}
}
}
}
},
"/v3/clusterregistrationtokens": {
"get": {
"summary": "List cluster registration tokens",
"tags": ["Clusters"],
"responses": {
"200": {
"description": "List of registration tokens",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClusterRegistrationTokenList"
}
}
}
}
}
}
},
"/v3/projects": {
"get": {
"summary": "List projects",
"tags": ["Projects"],
"responses": {
"200": {
"description": "List of projects",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProjectList"
}
}
}
}
}
},
"post": {
"summary": "Create a new project",
"tags": ["Projects"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProjectCreateInput"
}
}
}
},
"responses": {
"201": {
"description": "Project created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Project"
}
}
}
}
}
}
},
"/v3/projects/{id}": {
"get": {
"summary": "Get project by ID",
"tags": ["Projects"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" },
"description": "Project ID in format {clusterName}:{projectName}"
}
],
"responses": {
"200": {
"description": "Project details",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Project"
}
}
}
}
}
},
"put": {
"summary": "Update project",
"tags": ["Projects"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Project"
}
}
}
},
"responses": {
"200": {
"description": "Project updated"
}
}
},
"delete": {
"summary": "Delete project",
"tags": ["Projects"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"204": {
"description": "Project deleted"
}
}
}
},
"/v3/globalroles": {
"get": {
"summary": "List global roles",
"tags": ["Authorization"],
"responses": {
"200": {
"description": "List of global roles",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GlobalRoleList"
}
}
}
}
}
},
"post": {
"summary": "Create a global role",
"tags": ["Authorization"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GlobalRole"
}
}
}
},
"responses": {
"201": {
"description": "Global role created"
}
}
}
},
"/v3/globalrolebindings": {
"get": {
"summary": "List global role bindings",
"tags": ["Authorization"],
"responses": {
"200": {
"description": "List of global role bindings",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GlobalRoleBindingList"
}
}
}
}
}
},
"post": {
"summary": "Create a global role binding",
"tags": ["Authorization"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GlobalRoleBinding"
}
}
}
},
"responses": {
"201": {
"description": "Global role binding created"
}
}
}
},
"/v3/roletemplates": {
"get": {
"summary": "List role templates",
"tags": ["Authorization"],
"responses": {
"200": {
"description": "List of role templates",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RoleTemplateList"
}
}
}
}
}
},
"post": {
"summary": "Create a role template",
"tags": ["Authorization"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RoleTemplate"
}
}
}
},
"responses": {
"201": {
"description": "Role template created"
}
}
}
},
"/v3/clusterroletemplatebindings": {
"get": {
"summary": "List cluster role template bindings",
"tags": ["Authorization"],
"responses": {
"200": {
"description": "List of cluster role template bindings"
}
}
},
"post": {
"summary": "Create cluster role template binding",
"tags": ["Authorization"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClusterRoleTemplateBinding"
}
}
}
},
"responses": {
"201": {
"description": "Binding created"
}
}
}
},
"/v3/projectroletemplatebindings": {
"get": {
"summary": "List project role template bindings",
"tags": ["Authorization"],
"responses": {
"200": {
"description": "List of project role template bindings"
}
}
},
"post": {
"summary": "Create project role template binding",
"tags": ["Authorization"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProjectRoleTemplateBinding"
}
}
}
},
"responses": {
"201": {
"description": "Binding created"
}
}
}
},
"/v3/authconfigs": {
"get": {
"summary": "List authentication configurations",
"tags": ["AuthConfig"],
"responses": {
"200": {
"description": "List of auth configs"
}
}
}
},
"/v3/authconfigs/{id}": {
"get": {
"summary": "Get auth config by provider name",
"tags": ["AuthConfig"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" },
"description": "Provider name (e.g., github, activedirectory, azuread)"
}
],
"responses": {
"200": {
"description": "Auth config details"
}
}
},
"put": {
"summary": "Update auth config",
"tags": ["AuthConfig"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{ "$ref": "#/components/schemas/GithubConfig" },
{ "$ref": "#/components/schemas/ActiveDirectoryConfig" },
{ "$ref": "#/components/schemas/AzureADConfig" },
{ "$ref": "#/components/schemas/LdapConfig" },
{ "$ref": "#/components/schemas/SamlConfig" },
{ "$ref": "#/components/schemas/OIDCConfig" }
]
}
}
}
},
"responses": {
"200": {
"description": "Auth config updated"
}
}
}
},
"/v3/settings": {
"get": {
"summary": "List settings",
"tags": ["Settings"],
"responses": {
"200": {
"description": "List of settings",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SettingList"
}
}
}
}
}
}
},
"/v3/settings/{id}": {
"get": {
"summary": "Get setting by name",
"tags": ["Settings"],
"security": [],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "Setting value",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Setting"
}
}
}
}
}
},
"put": {
"summary": "Update setting",
"tags": ["Settings"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Setting"
}
}
}
},
"responses": {
"200": {
"description": "Setting updated"
}
}
}
},
"/v3/features": {
"get": {
"summary": "List features",
"tags": ["Features"],
"responses": {
"200": {
"description": "List of features",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FeatureList"
}
}
}
}
}
}
},
"/v3/features/{id}": {
"get": {
"summary": "Get feature by name",
"tags": ["Features"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "Feature details",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Feature"
}
}
}
}
}
},
"put": {
"summary": "Update feature",
"tags": ["Features"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Feature"
}
}
}
},
"responses": {
"200": {
"description": "Feature updated"
}
}
}
},
"/v3/principals": {
"get": {
"summary": "Search principals",
"description": "Search for users and groups across configured auth providers",
"tags": ["Principals"],
"parameters": [
{
"name": "name",
"in": "query",
"schema": { "type": "string" },
"description": "Search query"
}
],
"responses": {
"200": {
"description": "List of matching principals",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PrincipalList"
}
}
}
}
}
}
},
"/v3/cloudcredentials": {
"get": {
"summary": "List cloud credentials",
"tags": ["CloudCredentials"],
"responses": {
"200": {
"description": "List of cloud credentials"
}
}
},
"post": {
"summary": "Create cloud credential",
"tags": ["CloudCredentials"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CloudCredential"
}
}
}
},
"responses": {
"201": {
"description": "Cloud credential created"
}
}
}
},
"/v3/kontainerdrivers": {
"get": {
"summary": "List kontainer drivers",
"tags": ["KontainerDrivers"],
"responses": {
"200": {
"description": "List of kontainer drivers"
}
}
}
},
"/v3/kontainerdrivers/{id}?action=activate": {
"post": {
"summary": "Activate kontainer driver",
"tags": ["KontainerDrivers"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "Driver activated"
}
}
}
},
"/v3/kontainerdrivers/{id}?action=deactivate": {
"post": {
"summary": "Deactivate kontainer driver",
"tags": ["KontainerDrivers"],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "Driver deactivated"
}
}
}
},
"/k8s/clusters/{clusterID}": {
"description": "Kubernetes API proxy to downstream cluster",
"get": {
"summary": "Proxy GET request to downstream cluster",
"tags": ["KubernetesProxy"],
"parameters": [
{
"name": "clusterID",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "Proxied response from downstream cluster"
}
}
}
},
"/v3/tokenreview": {
"post": {
"summary": "Token review webhook",
"description": "Kubernetes TokenReview webhook for validating tokens",
"tags": ["Authentication"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenReviewRequest"
}
}
}
},
"responses": {
"200": {
"description": "Token review result",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenReviewResponse"
}
}
}
}
}
}
},
"/rancherversion": {
"get": {
"summary": "Get Rancher version",
"tags": ["System"],
"security": [],
"responses": {
"200": {
"description": "Version information",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RancherVersion"
}
}
}
}
}
}
},
"/metrics": {
"get": {
"summary": "Prometheus metrics",
"tags": ["System"],
"responses": {
"200": {
"description": "Prometheus metrics in text format"
}
}
}
}
},
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"description": "Bearer token in format: {tokenName}:{tokenKey}"
},
"cookieAuth": {
"type": "apiKey",
"in": "cookie",
"name": "R_SESS"
}
},
"schemas": {
"AuthProvider": {
"type": "object",
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"logoutAllSupported": { "type": "boolean" },
"logoutAllEnabled": { "type": "boolean" },
"logoutAllForced": { "type": "boolean" }
}
},
"AuthProviderList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": { "$ref": "#/components/schemas/AuthProvider" }
}
}
},
"BasicLoginInput": {
"type": "object",
"required": ["username", "password", "responseType"],
"properties": {
"type": {
"type": "string",
"enum": ["localProvider", "activeDirectoryProvider", "openLdapProvider", "freeIpaProvider"],
"description": "Provider type for authentication"
},
"username": { "type": "string" },
"password": { "type": "string", "format": "password" },
"description": { "type": "string" },
"responseType": {
"type": "string",
"enum": ["json", "cookie"],
"description": "How to return the token"
},
"ttl": {
"type": "integer",
"format": "int64",
"description": "Token TTL in milliseconds"
}
}
},
"OAuthLoginInput": {
"type": "object",
"required": ["code", "responseType"],
"properties": {
"type": {
"type": "string",
"enum": ["githubProvider", "azureADProvider", "googleOAuthProvider", "oidcProvider", "keyCloakOidcProvider", "genericOidcProvider", "cognitoProvider"]
},
"code": { "type": "string", "description": "OAuth authorization code" },
"description": { "type": "string" },
"responseType": { "type": "string", "enum": ["json", "cookie"] },
"ttl": { "type": "integer", "format": "int64" }
}
},
"SamlLoginInput": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["pingProvider", "adfsProvider", "keyCloakProvider", "oktaProvider", "shibbolethProvider"]
},
"finalRedirectUrl": { "type": "string" },
"requestId": { "type": "string" },
"publicKey": { "type": "string" },
"responseType": { "type": "string" }
}
},
"LoginResponse": {
"type": "object",
"properties": {
"id": { "type": "string" },
"type": { "type": "string", "example": "token" },
"baseType": { "type": "string", "example": "token" },
"token": { "type": "string", "description": "Bearer token in format {name}:{key}" },
"expiresAt": { "type": "string", "format": "date-time" }
}
},
"AuthToken": {
"type": "object",
"properties": {
"id": { "type": "string" },
"token": { "type": "string" },
"expiresAt": { "type": "string" }
}
},
"Token": {
"type": "object",
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"userId": { "type": "string" },
"authProvider": { "type": "string" },
"ttl": { "type": "integer", "format": "int64" },
"lastUsedAt": { "type": "string", "format": "date-time" },
"isDerived": { "type": "boolean" },
"description": { "type": "string" },
"expired": { "type": "boolean" },
"expiresAt": { "type": "string" },
"current": { "type": "boolean" },
"clusterName": { "type": "string" },
"enabled": { "type": "boolean" },
"userPrincipal": { "$ref": "#/components/schemas/Principal" },
"groupPrincipals": {
"type": "array",
"items": { "$ref": "#/components/schemas/Principal" }
}
}
},
"TokenList": {
"type": "object",
"properties": {
"type": { "type": "string", "example": "collection" },
"data": {
"type": "array",
"items": { "$ref": "#/components/schemas/Token" }
}
}
},
"TokenCreateInput": {
"type": "object",
"properties": {
"description": { "type": "string" },
"ttl": { "type": "integer", "format": "int64" },
"clusterName": { "type": "string" }
}
},
"User": {
"type": "object",
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"displayName": { "type": "string" },
"description": { "type": "string" },
"username": { "type": "string" },
"mustChangePassword": { "type": "boolean" },
"principalIds": {
"type": "array",
"items": { "type": "string" }
},
"enabled": { "type": "boolean" },
"status": { "$ref": "#/components/schemas/UserStatus" }
}
},
"UserStatus": {
"type": "object",
"properties": {
"conditions": {
"type": "array",
"items": { "$ref": "#/components/schemas/Condition" }
}
}
},
"UserList": {
"type": "object",
"properties": {
"type": { "type": "string" },
"data": {
"type": "array",
"items": { "$ref": "#/components/schemas/User" }
}
}
},
"UserCreateInput": {
"type": "object",
"required": ["username", "password"],
"properties": {
"displayName": { "type": "string" },
"username": { "type": "string" },
"password": { "type": "string", "format": "password" },
"mustChangePassword": { "type": "boolean" },
"enabled": { "type": "boolean", "default": true }
}
},
"Principal": {
"type": "object",
"properties": {
"id": { "type": "string", "description": "Principal ID in format {provider}_{type}://{identifier}" },
"type": { "type": "string" },
"name": { "type": "string" },
"loginName": { "type": "string" },
"displayName": { "type": "string" },
"profilePicture": { "type": "string" },
"profileURL": { "type": "string" },
"principalType": { "type": "string", "enum": ["user", "group"] },
"provider": { "type": "string" }
}
},
"PrincipalList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": { "$ref": "#/components/schemas/Principal" }
}
}
},
"Cluster": {
"type": "object",
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"name": { "type": "string" },
"displayName": { "type": "string", "description": "Human-readable cluster name" },
"description": { "type": "string" },
"internal": { "type": "boolean", "description": "Whether this is the local cluster" },
"driver": {
"type": "string",
"enum": ["imported", "local", "k3s", "rke2", "AKS", "EKS", "GKE"]
},
"provider": { "type": "string" },
"state": { "type": "string" },
"transitioning": { "type": "string" },
"transitioningMessage": { "type": "string" },
"agentImage": { "type": "string" },
"apiEndpoint": { "type": "string" },
"caCert": { "type": "string" },
"capacity": { "$ref": "#/components/schemas/ResourceList" },
"allocatable": { "$ref": "#/components/schemas/ResourceList" },
"requested": { "$ref": "#/components/schemas/ResourceList" },
"limits": { "$ref": "#/components/schemas/ResourceList" },
"nodeCount": { "type": "integer" },
"version": { "$ref": "#/components/schemas/KubernetesVersion" },
"conditions": {
"type": "array",
"items": { "$ref": "#/components/schemas/ClusterCondition" }
},
"enableNetworkPolicy": { "type": "boolean" },
"localClusterAuthEndpoint": { "$ref": "#/components/schemas/LocalClusterAuthEndpoint" },
"agentEnvVars": {
"type": "array",
"items": { "$ref": "#/components/schemas/EnvVar" }
},
"defaultPodSecurityAdmissionConfigurationTemplateName": { "type": "string" },
"clusterAgentDeploymentCustomization": { "$ref": "#/components/schemas/AgentDeploymentCustomization" },
"fleetAgentDeploymentCustomization": { "$ref": "#/components/schemas/AgentDeploymentCustomization" },
"k3sConfig": { "$ref": "#/components/schemas/K3sConfig" },
"rke2Config": { "$ref": "#/components/schemas/Rke2Config" },
"aksConfig": { "type": "object", "description": "AKS-specific configuration" },
"eksConfig": { "type": "object", "description": "EKS-specific configuration" },
"gkeConfig": { "type": "object", "description": "GKE-specific configuration" }
}
},
"ClusterList": {
"type": "object",
"properties": {
"type": { "type": "string" },
"data": {
"type": "array",
"items": { "$ref": "#/components/schemas/Cluster" }
}
}
},
"ClusterCreateInput": {
"type": "object",
"required": ["displayName"],
"properties": {
"name": { "type": "string", "pattern": "^[a-z0-9-]+$" },
"displayName": { "type": "string" },
"description": { "type": "string" },
"enableNetworkPolicy": { "type": "boolean" },
"localClusterAuthEndpoint": { "$ref": "#/components/schemas/LocalClusterAuthEndpoint" },
"agentEnvVars": {
"type": "array",
"items": { "$ref": "#/components/schemas/EnvVar" }
}
}
},
"ClusterCondition": {
"type": "object",
"properties": {
"type": { "type": "string" },
"status": { "type": "string", "enum": ["True", "False", "Unknown"] },
"lastUpdateTime": { "type": "string" },
"lastTransitionTime": { "type": "string" },
"reason": { "type": "string" },
"message": { "type": "string" }
}
},
"LocalClusterAuthEndpoint": {
"type": "object",
"properties": {
"enabled": { "type": "boolean" },
"fqdn": { "type": "string" },
"caCerts": { "type": "string" }
}
},
"AgentDeploymentCustomization": {
"type": "object",
"properties": {
"appendTolerations": {
"type": "array",
"items": { "type": "object" }
},
"overrideAffinity": { "type": "object" },
"overrideResourceRequirements": { "type": "object" }
}
},
"K3sConfig": {
"type": "object"
},
"Rke2Config": {
"type": "object"
},
"ResourceList": {
"type": "object",
"additionalProperties": { "type": "string" }
},
"KubernetesVersion": {
"type": "object",
"properties": {
"major": { "type": "string" },
"minor": { "type": "string" },
"gitVersion": { "type": "string" }
}
},
"EnvVar": {
"type": "object",
"properties": {
"name": { "type": "string" },
"value": { "type": "string" }
}
},
"GenerateKubeConfigOutput": {
"type": "object",
"properties": {
"config": { "type": "string", "description": "Kubeconfig YAML content" }
}
},
"ImportClusterYamlInput": {
"type": "object",
"properties": {
"yaml": { "type": "string" },
"defaultNamespace": { "type": "string" },
"namespace": { "type": "string" },
"projectName": { "type": "string" }
}
},
"ImportYamlOutput": {
"type": "object",
"properties": {
"message": { "type": "string" }
}
},
"RotateCertificateInput": {
"type": "object",
"properties": {
"caCertificates": { "type": "boolean" },
"services": {
"type": "array",
"items": {
"type": "string",
"enum": ["etcd", "kubelet", "kube-apiserver", "kube-proxy", "kube-scheduler", "kube-controller-manager"]
}
}
}
},
"RotateCertificateOutput": {
"type": "object",
"properties": {
"message": { "type": "string" }
}
},
"ClusterRegistrationToken": {
"type": "object",
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"clusterName": { "type": "string" },
"command": { "type": "string" },
"insecureCommand": { "type": "string" },
"manifestUrl": { "type": "string" },
"token": { "type": "string" }
}
},
"ClusterRegistrationTokenList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": { "$ref": "#/components/schemas/ClusterRegistrationToken" }
}
}
},
"Project": {
"type": "object",
"properties": {
"id": { "type": "string", "description": "Format: {clusterName}:{projectName}" },
"type": { "type": "string" },
"displayName": { "type": "string" },
"description": { "type": "string" },
"clusterName": { "type": "string" },
"state": { "type": "string" },
"resourceQuota": { "$ref": "#/components/schemas/ProjectResourceQuota" },
"namespaceDefaultResourceQuota": { "$ref": "#/components/schemas/NamespaceResourceQuota" },
"containerDefaultResourceLimit": { "$ref": "#/components/schemas/ContainerResourceLimit" },
"conditions": {
"type": "array",
"items": { "$ref": "#/components/schemas/Condition" }
}
}
},
"ProjectList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": { "$ref": "#/components/schemas/Project" }
}
}
},
"ProjectCreateInput": {
"type": "object",
"required": ["displayName", "clusterName"],
"properties": {
"displayName": { "type": "string" },
"description": { "type": "string" },
"clusterName": { "type": "string" },
"resourceQuota": { "$ref": "#/components/schemas/ProjectResourceQuota" },
"namespaceDefaultResourceQuota": { "$ref": "#/components/schemas/NamespaceResourceQuota" },
"containerDefaultResourceLimit": { "$ref": "#/components/schemas/ContainerResourceLimit" }
}
},
"ProjectResourceQuota": {
"type": "object"
},
"NamespaceResourceQuota": {
"type": "object"
},
"ContainerResourceLimit": {
"type": "object"
},
"GlobalRole": {
"type": "object",
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"displayName": { "type": "string" },
"description": { "type": "string" },
"rules": {
"type": "array",
"items": { "$ref": "#/components/schemas/PolicyRule" }
},
"newUserDefault": { "type": "boolean" },
"builtin": { "type": "boolean" },
"inheritedClusterRoles": {
"type": "array",
"items": { "type": "string" }
},
"namespacedRules": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": { "$ref": "#/components/schemas/PolicyRule" }
}
}
}
},
"GlobalRoleList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": { "$ref": "#/components/schemas/GlobalRole" }
}
}
},
"GlobalRoleBinding": {
"type": "object",
"required": ["globalRoleName"],
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"userName": { "type": "string" },
"groupPrincipalName": { "type": "string" },
"userPrincipalName": { "type": "string" },
"globalRoleName": { "type": "string" }
}
},
"GlobalRoleBindingList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": { "$ref": "#/components/schemas/GlobalRoleBinding" }
}
}
},
"RoleTemplate": {
"type": "object",
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"displayName": { "type": "string" },
"description": { "type": "string" },
"rules": {
"type": "array",
"items": { "$ref": "#/components/schemas/PolicyRule" }
},
"builtin": { "type": "boolean" },
"external": { "type": "boolean" },
"hidden": { "type": "boolean" },
"locked": { "type": "boolean" },
"clusterCreatorDefault": { "type": "boolean" },
"projectCreatorDefault": { "type": "boolean" },
"context": { "type": "string", "enum": ["project", "cluster", ""] },
"roleTemplateNames": {
"type": "array",
"items": { "type": "string" }
}
}
},
"RoleTemplateList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": { "$ref": "#/components/schemas/RoleTemplate" }
}
}
},
"ClusterRoleTemplateBinding": {
"type": "object",
"required": ["clusterName", "roleTemplateName"],
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"userName": { "type": "string" },
"userPrincipalName": { "type": "string" },
"groupName": { "type": "string" },
"groupPrincipalName": { "type": "string" },
"clusterName": { "type": "string" },
"roleTemplateName": { "type": "string" }
}
},
"ProjectRoleTemplateBinding": {
"type": "object",
"required": ["projectName", "roleTemplateName"],
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"userName": { "type": "string" },
"userPrincipalName": { "type": "string" },
"groupName": { "type": "string" },
"groupPrincipalName": { "type": "string" },
"projectName": { "type": "string", "description": "Format: {clusterName}:{projectName}" },
"roleTemplateName": { "type": "string" }
}
},
"PolicyRule": {
"type": "object",
"properties": {
"verbs": {
"type": "array",
"items": { "type": "string" }
},
"apiGroups": {
"type": "array",
"items": { "type": "string" }
},
"resources": {
"type": "array",
"items": { "type": "string" }
},
"resourceNames": {
"type": "array",
"items": { "type": "string" }
},
"nonResourceURLs": {
"type": "array",
"items": { "type": "string" }
}
}
},
"GithubConfig": {
"type": "object",
"properties": {
"type": { "type": "string" },
"enabled": { "type": "boolean" },
"hostname": { "type": "string" },
"tls": { "type": "boolean" },
"clientId": { "type": "string" },
"clientSecret": { "type": "string", "format": "password" },
"allowedPrincipalIds": {
"type": "array",
"items": { "type": "string" }
},
"accessMode": { "type": "string", "enum": ["unrestricted", "required", "restricted"] }
}
},
"ActiveDirectoryConfig": {
"type": "object",
"properties": {
"type": { "type": "string" },
"enabled": { "type": "boolean" },
"servers": { "type": "array", "items": { "type": "string" } },
"port": { "type": "integer" },
"tls": { "type": "boolean" },
"certificate": { "type": "string" },
"defaultLoginDomain": { "type": "string" },
"serviceAccountUsername": { "type": "string" },
"serviceAccountPassword": { "type": "string", "format": "password" },
"userSearchBase": { "type": "string" },
"groupSearchBase": { "type": "string" },
"accessMode": { "type": "string" }
}
},
"AzureADConfig": {
"type": "object",
"properties": {
"type": { "type": "string" },
"enabled": { "type": "boolean" },
"tenantId": { "type": "string" },
"applicationId": { "type": "string" },
"applicationSecret": { "type": "string", "format": "password" },
"endpoint": { "type": "string" },
"graphEndpoint": { "type": "string" },
"tokenEndpoint": { "type": "string" },
"authEndpoint": { "type": "string" },
"accessMode": { "type": "string" }
}
},
"LdapConfig": {
"type": "object",
"properties": {
"type": { "type": "string" },
"enabled": { "type": "boolean" },
"servers": { "type": "array", "items": { "type": "string" } },
"port": { "type": "integer" },
"tls": { "type": "boolean" },
"starttls": { "type": "boolean" },
"certificate": { "type": "string" },
"serviceAccountDistinguishedName": { "type": "string" },
"serviceAccountPassword": { "type": "string", "format": "password" },
"userSearchBase": { "type": "string" },
"userSearchAttribute": { "type": "string" },
"userLoginAttribute": { "type": "string" },
"groupSearchBase": { "type": "string" },
"groupSearchAttribute": { "type": "string" },
"accessMode": { "type": "string" }
}
},
"SamlConfig": {
"type": "object",
"properties": {
"type": { "type": "string" },
"enabled": { "type": "boolean" },
"idpMetadataContent": { "type": "string" },
"spCert": { "type": "string" },
"spKey": { "type": "string", "format": "password" },
"groupsField": { "type": "string" },
"displayNameField": { "type": "string" },
"userNameField": { "type": "string" },
"uidField": { "type": "string" },
"rancherApiHost": { "type": "string" },
"entityID": { "type": "string" },
"accessMode": { "type": "string" }
}
},
"OIDCConfig": {
"type": "object",
"properties": {
"type": { "type": "string" },
"enabled": { "type": "boolean" },
"clientId": { "type": "string" },
"clientSecret": { "type": "string", "format": "password" },
"rancherUrl": { "type": "string" },
"issuer": { "type": "string" },
"authEndpoint": { "type": "string" },
"tokenEndpoint": { "type": "string" },
"userInfoEndpoint": { "type": "string" },
"jwksUrl": { "type": "string" },
"scope": { "type": "string" },
"groupsClaim": { "type": "string" },
"accessMode": { "type": "string" }
}
},
"Setting": {
"type": "object",
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"value": { "type": "string" },
"default": { "type": "string" },
"customized": { "type": "boolean" },
"source": { "type": "string", "enum": ["db", "default", "env"] }
}
},
"SettingList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": { "$ref": "#/components/schemas/Setting" }
}
}
},
"Feature": {
"type": "object",
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"spec": {
"type": "object",
"properties": {
"value": { "type": "boolean" }
}
},
"status": {
"type": "object",
"properties": {
"dynamic": { "type": "boolean" },
"default": { "type": "boolean" },
"description": { "type": "string" },
"lockedValue": { "type": "boolean" }
}
}
}
},
"FeatureList": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": { "$ref": "#/components/schemas/Feature" }
}
}
},
"CloudCredential": {
"type": "object",
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"name": { "type": "string" },
"description": { "type": "string" },
"amazonec2credentialConfig": { "type": "object" },
"azurecredentialConfig": { "type": "object" },
"digitaloceanConfig": { "type": "object" },
"googlecredentialConfig": { "type": "object" },
"linodecredentialConfig": { "type": "object" },
"vmaborecredentialConfig": { "type": "object" }
}
},
"Condition": {
"type": "object",
"properties": {
"type": { "type": "string" },
"status": { "type": "string" },
"lastUpdateTime": { "type": "string" },
"lastTransitionTime": { "type": "string" },
"reason": { "type": "string" },
"message": { "type": "string" }
}
},
"TokenReviewRequest": {
"type": "object",
"properties": {
"apiVersion": { "type": "string" },
"kind": { "type": "string" },
"spec": {
"type": "object",
"properties": {
"token": { "type": "string" }
}
}
}
},
"TokenReviewResponse": {
"type": "object",
"properties": {
"apiVersion": { "type": "string" },
"kind": { "type": "string" },
"status": {
"type": "object",
"properties": {
"authenticated": { "type": "boolean" },
"user": {
"type": "object",
"properties": {
"username": { "type": "string" },
"uid": { "type": "string" },
"groups": { "type": "array", "items": { "type": "string" } }
}
}
}
}
}
},
"RancherVersion": {
"type": "object",
"properties": {
"Version": { "type": "string" },
"GitCommit": { "type": "string" },
"RancherPrime": { "type": "string" }
}
}
}
},
"security": [
{ "bearerAuth": [] },
{ "cookieAuth": [] }
],
"tags": [
{ "name": "Authentication", "description": "Login and authentication operations" },
{ "name": "Tokens", "description": "API token management" },
{ "name": "Users", "description": "User management" },
{ "name": "Clusters", "description": "Cluster management" },
{ "name": "Projects", "description": "Project management" },
{ "name": "Authorization", "description": "RBAC and role management" },
{ "name": "AuthConfig", "description": "Authentication provider configuration" },
{ "name": "Settings", "description": "Global settings" },
{ "name": "Features", "description": "Feature flags" },
{ "name": "Principals", "description": "Identity principals search" },
{ "name": "CloudCredentials", "description": "Cloud provider credentials" },
{ "name": "KontainerDrivers", "description": "Kubernetes distribution drivers" },
{ "name": "KubernetesProxy", "description": "Proxy to downstream Kubernetes clusters" },
{ "name": "System", "description": "System information and metrics" }
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment