Linux command
k3s 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Start server
sudo k3s server
Join as agent
sudo k3s agent --server [https://server:6443] --token [token]
Get kubeconfig
sudo k3s kubectl config view
Run kubectl command
k3s kubectl get pods
Start with disabled components
sudo k3s server --disable traefik
Check token
sudo cat /var/lib/rancher/k3s/server/node-token
说明
K3s is a lightweight Kubernetes distribution. It runs a full Kubernetes cluster with minimal resources. The tool packages Kubernetes, containerd, and Flannel in a single binary. It's designed for edge, IoT, and development.
参数
- server
- Start control plane.
- agent
- Start worker node.
- kubectl
- Run kubectl commands.
- --server _URL_
- Server URL for agent.
- --token _TOKEN_
- Join token.
- --disable _COMPONENT_
- Disable component.
- --help
- Display help information.
FAQ
What is the k3s command used for?
K3s is a lightweight Kubernetes distribution. It runs a full Kubernetes cluster with minimal resources. The tool packages Kubernetes, containerd, and Flannel in a single binary. It's designed for edge, IoT, and development.
How do I run a basic k3s example?
Run `sudo k3s server` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does server do in k3s?
Start control plane.