RKE2 Administration
Introduction
Section titled “Introduction”This document provides a quick reference for managing and troubleshooting an RKE2 Kubernetes cluster. It includes common administrative commands for crictl, kubectl, and RKE2 components.
Getting Started
Section titled “Getting Started”Prerequisites
Section titled “Prerequisites”Before using the commands in this guide, ensure the following requirements are met:
- RKE2 is installed.
kubectlis installed and configured.crictlis installed.- You have sufficient privileges (typically
sudo) to manage the cluster.
Installation
Section titled “Installation”Install RKE2 by following the official installation instructions for your operating system and environment.
Software Dependencies
Section titled “Software Dependencies”The following tools are required:
- RKE2
kubectlcrictl
Latest Releases
Section titled “Latest Releases”Keep your RKE2 installation up to date by using the latest stable release recommended by your organization.
API References
Section titled “API References”Refer to the official Kubernetes and RKE2 documentation for detailed API and configuration information.
CRICTL
Section titled “CRICTL”crictl communicates directly with the container runtime. Before using it, verify that it is configured with the correct runtime endpoint.
Verify the Runtime Endpoint
Section titled “Verify the Runtime Endpoint”Run the following command to identify the active container runtime:
ps aux | grep -E 'containerd|crio|dockerd'Configure the Runtime Endpoint
Section titled “Configure the Runtime Endpoint”Edit the crictl configuration file:
sudo nano /etc/crictl.yamlUpdate the runtime endpoint to match the socket identified in the previous step.
Example configuration (RKE2 default):
runtime-endpoint: unix:///run/k3s/containerd/containerd.sockimage-endpoint: unix:///run/k3s/containerd/containerd.socktimeout: 10debug: falseKubectl
Section titled “Kubectl”Useful commands for inspecting and troubleshooting Kubernetes resources.
List All Pods
Section titled “List All Pods”kubectl get pods --all-namespacesView Pod Logs
Section titled “View Pod Logs”kubectl logs <pod-name> -n kube-systemGeneral
Section titled “General”Stop all RKE2 processes:
rke2-killall.shMaster Nodes
Section titled “Master Nodes”View Server Logs
Section titled “View Server Logs”journalctl -u rke2-server -fStop the Server
Section titled “Stop the Server”systemctl stop rke2-serverStart the Server
Section titled “Start the Server”systemctl start rke2-serverRestart the Server
Section titled “Restart the Server”systemctl restart rke2-serverRestart the Agent
Section titled “Restart the Agent”systemctl restart rke2-agentWorker Nodes
Section titled “Worker Nodes”View Agent Logs
Section titled “View Agent Logs”journalctl -u rke2-agent -fRestart the Agent
Section titled “Restart the Agent”systemctl restart rke2-agentUninstallation
Section titled “Uninstallation”To completely remove RKE2 from a node:
/usr/local/bin/rke2-uninstall.sh