k8s
轻量应用服务器部署k3s,并搭建可视化高性能网关 apisix
https://m.tongfu.net/home/35/blog/513533.html#1.
rancher 中文网 | rancher 中文文档
云原生博客 | 云原生应用架构实战手册 | 云原生社区B站视频
基于Wireguard组网Kubernetes(k3s)集群搭建
Install K3s with Wireguard as flannel interface
借助 WireGuard 跨云搭建 K3s 集群环境 | 使用Wireguard进行异地组网
k8s
边缘路由器,又称“接入路由器”,是位于网络外围(边缘)的路由器。 位于网络中心的路由器叫核心路由器。 边缘路由器和核心路由器是相对概念,它们都属于路由器,但是有不同的大小和容量,某一层的核心路由器是另一层的边缘路由器。 Traefik 是一款 open-source 边缘路由器,可让您轻松地发布服务. 它接收来自您的系统请求,并找出负责处理它们的后端服务组件。 CNI(Container Network Interface) CNI 插件通常有三种实现模式: 1.Overlay:靠隧道打通,不依赖底层网络; 2.路由:靠路由打通,部分依赖底层网络; 3.Underlay:靠底层网络打通,强依赖底层网络; CNI 中经常见到的解决方案是 Flannel,由CoreOS推出,Flannel 采用的便是上面讲到的 Overlay 网络模式。 Overlay 网络 (overlay network) 属于应用层网络,它是面向应用层的,不考虑网络层,物理层的问题。 CRI(Container Runtime Interface 容器运行时接口)本质上就是 Kubernetes 定义的一组与容器运行时进行交互的接口 kubelet 则作为 gRPC Client 运行, 调用gRPC Server; Container Runtime 实现了 CRI gRPC Server,包括 RuntimeService 和 ImageService。该 gRPC Server 监听本地的 Unix socket 即是k3s中的containd CSI(Container Storage Interface 容器存储接口)是一个行业标准接口的规范,借助 CSI 容器编排系统(CO)可以将任意存储系统暴露给自己的容器工作负载。 CSI 是一个标准的、可插拔的存储接口,支持多种存储类型,包括块存储、文件存储和对象存储 CSI 的架构包括两个主要组件:CSI 驱动程序和 CSI 节点插件。 CSI 驱动程序是一个独立的进程,负责与 Kubernetes API 交互,并处理存储插件的请求。 CSI 节点插件则是在每个节点上运行的进程,它将容器请求映射到 CSI 驱动程序,并与容器运行时一起管理存储。
k3s
K3s 软件包需要的依赖项包括: * containerd * Flannel * CoreDNS * CNI * 主机实用程序(iptables、socat 等) * Ingress controller(Traefik) * 嵌入式服务负载均衡器(service load balancer) * 嵌入式网络策略控制器(network policy controller) 二进制安装 curl -x socks5://localhost:1088 -LO https://github.com/k3s-io/k3s/releases/download/v1.28.5%2Bk3s1/k3s 安装k3s-server #curl -sfL https://get.k3s.io | sh - #systemctl start k3s 安装k3s-agent #token="" #curl -sfL https://get.k3s.io | K3S_URL=https://server:6443 K3S_TOKEN=$token sh - #systemctl start k3s-agent #curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn sh - curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_SKIP_SELINUX_RPM=true INSTALL_K3S_SELINUX_WARN=true INSTALL_K3S_MIRROR=cn K3S_URL=https://serverIP:6443 K3S_TOKEN=$token sh - Kubeconfig File: /etc/rancher/k3s/k3s.yaml Token File: /var/lib/rancher/k3s/server/node-token Agent Config File: /etc/systemd/system/k3s.agent.service.env 运行systemctl start k3s vim /etc/profile export KUBECONFIG=/etc/rancher/k3s/k3s.yaml k3s agent生成及配置 mkdir -p /etc/rancher/k3s cat <<EOF >/etc/rancher/k3s/config.yaml server: https://server:6443 token: my-token EOF curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC=agent sh - 关闭和删除k3s-agent /usr/local/bin/k3s-killall.sh /usr/local/bin/k3s-agent-uninstall.sh /etc/systemd/system/k3s-agent.service.env /etc/systemd/system/k3s-agent.service kubectl get nodes kubectl get pod 查看日志 journalctl -u k3s 检查出错信息: kubectl get nodes -v=10