forked from labring/sealos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request labring#570 from oldthreefeng/develop
fix readme_en add go test in pr.
- Loading branch information
Showing
8 changed files
with
168 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,122 @@ | ||
[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/fanux/sealos) | ||
[![Build Status](https://cloud.drone.io/api/badges/fanux/sealos/status.svg)](https://cloud.drone.io/fanux/sealos) | ||
<a href="https://trackgit.com"> | ||
<img src="https://us-central1-trackgit-analytics.cloudfunctions.net/token/ping/kexrkhvqjlzkdiap4zke" alt="trackgit-views" /> | ||
</a> | ||
|
||
[简体中文,老版本](https://sealyun.com/post/sealos/) | ||
![](https://socialify.git.ci/fanux/sealos/image?description=1&font=Source%20Code%20Pro&forks=1&language=1&pattern=Charlie%20Brown&stargazers=1&theme=Light) | ||
|
||
[离线包购买市场](http://store.lameleg.com/) | ||
<div align="center"> | ||
<p> | ||
<b>一条命令部署 Kubernetes 高可用集群 👋</b> | ||
</p> | ||
<p> | ||
<i>只能用丝滑一词形容的kubernetes高可用安装(kubernetes install)工具,一条命令,离线安装,包含所有依赖,内核负载不依赖haproxy keepalived,纯golang开发,99年证书,支持v1.20.0 v1.19.5 v1.18.13 v1.17.15!</i> | ||
</p> | ||
<p> | ||
|
||
kubernetes 1.14以下版本请移步老掉牙教程[sealos 1.x docs](https://github.com/fanux/sealos/tree/v1.14.0) | ||
[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/fanux/sealos) | ||
[![Build Status](https://cloud.drone.io/api/badges/fanux/sealos/status.svg)](https://cloud.drone.io/fanux/sealos) | ||
[![Website](https://img.shields.io/website?url=https%3A%2F%2Fpostwoman.io&logo=Postwoman)](https://sealyun.com) | ||
[![Go Report Card](https://goreportcard.com/badge/github.com/fanux/sealos)](https://goreportcard.com/report/github.com/fanux/sealos) | ||
[![Chat on Telegram](https://img.shields.io/badge/chat-Telegram-blueviolet?logo=Telegram)](https://t.me/gsealyun) | ||
|
||
# Sealos 2.0 | ||
支持kubernetes 1.14.0 以上版本,HA不再依赖keeplived与haproxy, 通过ipvs直接代理masters节点 | ||
</p> | ||
</div> | ||
|
||
通过lvscare健康检测masters, 是一种非常先进且稳定的HA方式。安装失败率极低。 | ||
--- | ||
|
||
![](./arch.jpg) | ||
**文档: _[官方文档](https://www.sealyun.com/instructions), [博客](https://fuckcloudnative.io)_** | ||
|
||
# 快速使用 | ||
## 准备条件 | ||
* 装好docker并启动docker | ||
* 把[离线安装包](http://store.lameleg.com) 下载好拷贝到执行节点的任意目录,不需要解压,sealos会自动检测各个节点是否有安装包,若不存在则会scp到该节点。如果有文件服务器更好,sealos也支持从一个服务器上wget到所有节点上。 离线包中sealos暂不支持scp,请到release界面下载最新版sealos | ||
**加入组织: _钉钉群(35371178), [Telegram](https://t.me/gsealyun)_** | ||
|
||
## 安装 | ||
sealos已经放在离线包中,解压后在kube/bin目录下(可以解压一个,获取sealos bin文件) | ||
``` | ||
sealos init \ | ||
--master 192.168.0.2 \ | ||
--master 192.168.0.3 \ | ||
--master 192.168.0.4 \ # master地址列表 | ||
--node 192.168.0.5 \ # node地址列表 | ||
--user root \ # 服务用户名 | ||
--passwd your-server-password \ # 服务器密码,用于远程执行命令 | ||
--pkg-url /root/kube1.14.1.tar.gz \ # 离线安装包位置,可支持http/https服务器(http://store.lameleg.com/kube1.14.1.tar.gz)存放和本地(/root/kube1.14.1.tar.gz)存放两种方式。若对应节点上文件不存在则会从执行机器上scp文件到对应节点。 | ||
--version v1.14.1 # kubernetes 离线安装包版本,这渲染kubeadm配置时需要使用 | ||
``` | ||
然后,就没有然后了 | ||
![](./arch.png) | ||
|
||
[English Docs](/README_en.md) | ||
|
||
其它参数: | ||
# 🚀 快速开始 | ||
|
||
``` | ||
--kubeadm-config string kubeadm-config.yaml local # 自定义kubeadm配置文件,如有这个sealos就不去渲染kubeadm配置 | ||
--vip string virtual ip (default "10.103.97.2") # 代理master的虚拟IP,只要与你地址不冲突请不要改 | ||
``` | ||
> 环境信息 | ||
主机名|IP地址 | ||
---|--- | ||
master0|192.168.0.2 | ||
master1|192.168.0.3 | ||
master2|192.168.0.4 | ||
node0|192.168.0.5 | ||
|
||
## 清理 | ||
``` | ||
sealos clean \ | ||
--master 192.168.0.2 \ | ||
--master 192.168.0.3 \ | ||
--master 192.168.0.4 \ # master地址列表 | ||
--node 192.168.0.5 \ # node地址列表 | ||
--user root \ # 服务用户名 | ||
--passwd your-server-password | ||
``` | ||
服务器密码:123456 | ||
|
||
## 增加节点 | ||
新增节点可直接使用kubeadm, 到新节点上解压 | ||
``` | ||
cd kube/shell && init.sh | ||
echo "10.103.97.2 apiserver.cluster.local" >> /etc/hosts # using vip | ||
kubeadm join 10.103.97.2:6443 --token 9vr73a.a8uxyaju799qwdjv \ | ||
--master 10.103.97.100:6443 \ | ||
--master 10.103.97.101:6443 \ | ||
--master 10.103.97.102:6443 \ | ||
--discovery-token-ca-cert-hash sha256:7c2e69131a36ae2a042a339b33381c6d0d43887e2de83720eff5359e26aec866 | ||
``` | ||
**kubernetes .0版本不建议上生产环境!!!** | ||
|
||
> 只需要准备好服务器,在任意一台服务器上执行下面命令即可 | ||
```sh | ||
# 下载并安装sealos, sealos是个golang的二进制工具,直接下载拷贝到bin目录即可, release页面也可下载 | ||
$ wget -c https://sealyun.oss-cn-beijing.aliyuncs.com/latest/sealos && \ | ||
chmod +x sealos && mv sealos /usr/bin | ||
|
||
## 安装dashboard prometheus等 | ||
离线包里包含了yaml配置和镜像,用户按需安装。 | ||
# 下载离线资源包 | ||
$ wget -c https://sealyun.oss-cn-beijing.aliyuncs.com/2fb10b1396f8c6674355fcc14a8cda7c-v1.20.0/kube1.20.0.tar.gz | ||
|
||
# 安装一个三master的kubernetes集群 | ||
$ sealos init --passwd '123456' \ | ||
--master 192.168.0.2 --master 192.168.0.3 --master 192.168.0.4 \ | ||
--node 192.168.0.5 \ | ||
--pkg-url /root/kube1.20.0.tar.gz \ | ||
--version v1.20.0 | ||
``` | ||
cd /root/kube/conf | ||
kubectl taint nodes --all node-role.kubernetes.io/master- # 去污点,根据需求看情况,去了后master允许调度 | ||
kubectl apply -f heapster/ # 安装heapster, 不安装dashboard上没监控数据 | ||
kubectl apply -f heapster/rbac | ||
kubectl apply -f dashboard # 装dashboard | ||
kubectl apply -f prometheus # 装监控 | ||
|
||
> 参数含义 | ||
参数名|含义|示例 | ||
---|---|--- | ||
passwd|服务器密码|123456 | ||
master|k8s master节点IP地址| 192.168.0.2 | ||
node|k8s node节点IP地址|192.168.0.3 | ||
pkg-url|离线资源包地址,支持下载到本地,或者一个远程地址|/root/kube1.20.0.tar.gz | ||
version|[资源包](https://www.sealyun.com/goodsDetail?type=cloud_kernel&name=kubernetes)对应的版本|v1.20.0 | ||
|
||
> 增加master | ||
```shell script | ||
🐳 → sealos join --master 192.168.0.6 --master 192.168.0.7 | ||
🐳 → sealos join --master 192.168.0.6-192.168.0.9 # 或者多个连续IP | ||
``` | ||
|
||
# 原理 | ||
> 增加node | ||
```shell script | ||
🐳 → sealos join --node 192.168.0.6 --node 192.168.0.7 | ||
🐳 → sealos join --node 192.168.0.6-192.168.0.9 # 或者多个连续IP | ||
``` | ||
+----------+ +---------------+ virturl server: 127.0.0.1:6443 | ||
| mater0 |<----------------------| ipvs nodes | real servers: | ||
+----------+ |+---------------+ 10.103.97.200:6443 | ||
| 10.103.97.201:6443 | ||
+----------+ | 10.103.97.202:6443 | ||
| mater1 |<---------------------+ | ||
+----------+ | | ||
| | ||
+----------+ | | ||
| mater2 |<---------------------+ | ||
+----------+ | ||
> 删除指定master节点 | ||
```shell script | ||
🐳 → sealos clean --master 192.168.0.6 --master 192.168.0.7 | ||
🐳 → sealos clean --master 192.168.0.6-192.168.0.9 # 或者多个连续IP | ||
``` | ||
sealos 只是帮助用户去渲染配置远程执行命令,低层依赖两个东西,一个是lvscare,一个是定制化的超级kubeadm | ||
|
||
关于[LVScare](https://github.com/fanux/LVScare) | ||
> 删除指定node节点 | ||
关于超级kubeadm[简体中文,kubernetes v1.14.0+](https://sealyun.com/post/super-kubeadm/) | ||
```shell script | ||
🐳 → sealos clean --node 192.168.0.6 --node 192.168.0.7 | ||
🐳 → sealos clean --node 192.168.0.6-192.168.0.9 # 或者多个连续IP | ||
``` | ||
|
||
会以类似kube-proxy的ipvs的形式去守护k8s master节点,一旦apiserver不可访问了,会自动清理掉所有node上对应的ipvs规则, master恢复正常时添加回来。 | ||
> 清理集群 | ||
```shell script | ||
🐳 → sealos clean --all | ||
``` | ||
|
||
# 公众号: | ||
![sealyun](https://sealyun.com/kubernetes-qrcode.jpg) | ||
# ✅ 特性 | ||
|
||
- [x] 支持ARM版本离线包,v1.20版本离线包支持containerd集成,完全抛弃docker | ||
- [x] 99年证书, 支持集群备份,升级 | ||
- [x] 不依赖ansible haproxy keepalived, 一个二进制工具,0依赖 | ||
- [x] 离线安装,不同kubernetes版本下载对应不同版本的[资源包](https://www.sealyun.com/goodsDetail?type=cloud_kernel&name=kubernetes)即可,离线包包含所有二进制文件配置文件和镜像 | ||
- [x] 高可用通过ipvs实现的localLB,占用资源少,稳定可靠,类似kube-proxy的实现 | ||
- [x] 几乎可兼容所有支持systemd的x86_64架构的环境 | ||
- [x] 轻松实现集群节点的增加/删除 | ||
- [x] 上千用户在线上环境使用sealos,稳定可靠 | ||
- [x] 资源包放在阿里云oss上,再也不用担心网速 | ||
- [x] dashboard ingress prometheus等APP 同样离线打包,一键安装 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.