MCPcopy
hub / github.com/rancher/rke2

github.com/rancher/rke2 @v1.36.2+rke2r1 sqlite

repository ↗ · DeepWiki ↗ · release v1.36.2+rke2r1 ↗
486 symbols 1,806 edges 92 files 225 documented · 46%
README

RKE2

RKE2

RKE2, also known as RKE Government, is Rancher's next-generation Kubernetes distribution.

It is a fully conformant Kubernetes distribution that focuses on security and compliance within the U.S. Federal Government sector.

To meet these goals, RKE2 does the following:

For more information and detailed installation and operation instructions, please visit our docs.

Quick Start

Here's the extremely quick start:

curl -sfL https://get.rke2.io | sh -
systemctl enable rke2-server.service
systemctl start rke2-server.service
# Wait a bit
export KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/var/lib/rancher/rke2/bin
kubectl get nodes

For a bit more, check out our full quick start guide.

Installation

A full breakdown of installation methods and information can be found here.

Configuration File

The primary way to configure RKE2 is through its config file. Command line arguments and environment variables are also available, but RKE2 is installed as a systemd service and thus these are not as easy to leverage.

By default, RKE2 will launch with the values present in the YAML file located at /etc/rancher/rke2/config.yaml.

An example of a basic server config file is below:

# /etc/rancher/rke2/config.yaml
write-kubeconfig-mode: "0644"
tls-san:
  - "foo.local"
node-label:
  - "foo=bar"
  - "something=amazing"

In general, cli arguments map to their respective yaml key, with repeatable cli args being represented as yaml lists. So, an identical configuration using solely cli arguments is shown below to demonstrate this:

rke2 server \
  --write-kubeconfig-mode "0644"    \
  --tls-san "foo.local"             \
  --node-label "foo=bar"            \
  --node-label "something=amazing"

It is also possible to use both a configuration file and cli arguments. In these situations, values will be loaded from both sources, but cli arguments will take precedence. For repeatable arguments such as --node-label, the cli arguments will overwrite all values in the list.

Finally, the location of the config file can be changed either through the cli argument --config FILE, -c FILE, or the environment variable $RKE2_CONFIG_FILE.

FAQ

Security

Security issues in RKE2 can be reported by sending an email to security@rancher.com. Please do not open security issues here.

Extension points exported contracts — how you extend this code

CNIPlugin (Interface)
(no doc) [3 implementers]
pkg/windows/types.go
ResolverOpt (FuncType)
ResolverOpt is an option to modify image resolution behavior.
pkg/images/images.go
Server (Interface)
(no doc)
pkg/controllers/types.go

Core symbols most depended-on inside this repo

RunCommand
called by 116
tests/e2e/testutils.go
RunCommand
called by 72
tests/docker/testutils.go
DeployWorkload
called by 45
tests/e2e/testutils.go
RunCmdOnNode
called by 45
tests/e2e/testutils.go
ParsePods
called by 38
tests/e2e/testutils.go
ParseNodes
called by 35
tests/e2e/testutils.go
RunCmdOnNode
called by 33
tests/docker/testutils.go
DeployWorkload
called by 16
tests/docker/testutils.go

Shape

Function 300
Method 124
Struct 52
TypeAlias 5
Interface 3
FuncType 1
Route 1

Languages

Go98%
Python2%

Modules by API surface

tests/e2e/testutils.go42 symbols
pkg/executor/staticpod/staticpod.go30 symbols
pkg/executor/pebinary/pebinary.go28 symbols
tests/docker/testutils.go27 symbols
pkg/bootstrap/bootstrap.go22 symbols
pkg/windows/calico.go19 symbols
tests/integration/integration.go15 symbols
pkg/windows/utils.go15 symbols
pkg/images/images.go15 symbols
tests/client.go13 symbols
pkg/rke2/clusterrole_bootstrap.go12 symbols
pkg/podtemplate/podtemplate.go12 symbols

Dependencies from manifests, versioned

cel.dev/exprv0.25.1 · 1×
cyphar.com/go-pathrsv0.2.2 · 1×
filippo.io/bigmodv0.1.1-0.20260103110 · 1×
filippo.io/edwards25519v1.2.0 · 1×
filippo.io/keygenv0.0.0-2026011415190 · 1×
github.com/Azure/go-ansitermv0.0.0-2025010203350 · 1×
github.com/DataDog/zstdv1.5.7 · 1×
github.com/HdrHistogram/hdrhistogram-gov1.2.0 · 1×
github.com/JeffAshton/win_pdhv0.0.0-2016110914355 · 1×
github.com/Masterminds/semver/v3v3.4.0 · 1×
github.com/Microsoft/go-winiov0.6.3-0.20251027160 · 1×
github.com/Microsoft/hcsshimv0.15.0-rc.1 · 1×

For agents

$ claude mcp add rke2 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact