Use a better structure

This commit is contained in:
Baohua Yang
2026-02-09 09:32:05 -08:00
parent fdb879dcf2
commit e669ee0fe8
167 changed files with 2462 additions and 2462 deletions

View File

@@ -1,17 +1,17 @@
# K3s - 轻量级 Kubernetes
## K3s - 轻量级 Kubernetes
[K3s](https://k3s.io/) 是一个轻量级的 Kubernetes 发行版,由 Rancher Labs 开发。它专为边缘计算、物联网、CI、ARM 等资源受限的环境设计。K3s 被打包为单个二进制文件,只有不到 100MB但通过了 CNCF 的一致性测试。
## 核心特性
### 核心特性
* **轻量级**移除过时的非必须的 Kubernetes 功能如传统的云提供商插件使用 SQLite 作为默认数据存储也支持 Etcd/MySQL/Postgres
* **单一二进制**所有组件API Server, Controller Manager, Scheduler, Kubelet, Kube-proxy打包在一个进程中运行
* **开箱即用**内置 Helm ControllerTraefik Ingress controllerServiceLBLocal-Path-Provisioner
* **安全**默认启用安全配置基于 TLS 通信
## 安装
### 安装
### 脚本安装Linux
#### 脚本安装Linux
K3s 提供了极为便捷的安装脚本
@@ -21,7 +21,7 @@ curl -sfL https://get.k3s.io | sh -
安装完成后K3s 会自动启动并配置好 `systemd` 服务
### 查看状态
#### 查看状态
```bash
sudo k3s kubectl get nodes
@@ -33,19 +33,19 @@ NAME STATUS ROLES AGE VERSION
k3s-master Ready control-plane,master 1m v1.28.2+k3s1
```
## 快速使用
### 快速使用
K3s 内置了 `kubectl` 命令通过 `k3s kubectl` 调用为了方便通常会建立别名或配置 `KUBECONFIG`
```bash
# 读取 K3s 的配置文件
## 读取 K3s 的配置文件
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
# 现在可以直接使用 kubectl
## 现在可以直接使用 kubectl
kubectl get pods -A
```
## 清理卸载
### 清理卸载
```bash
/usr/local/bin/k3s-uninstall.sh