#### 介绍
sealos简介:
云原生生态之庞大与复杂,无疑让许多企业感到手足无措,这个生态依然缺乏好用的、开箱即用的发行版。在云原生市场还急需一款云操作系统以进一步降低云原生门槛与成本。Sealos 的问世为企业开启了一扇新窗。它为企业与开发者提供了一种全新的选择,无论在公有云还是私有云中,都只需安装一个云操作系统。它能让各类应用在操作系统上稳定安全地运行,一并解决了应用所需的各种依赖问题。
Sealos 坚守的理念是:云可以像 Linux 一样简单。可以像使用 Linux 一样安装后立即投入使用,使用过程无需过多纠结。唯一的差别仅在于,Linux 是安装在单一服务器上,而 Sealos 则是安装在整个数据中心。
在 Sealos 的架构中,公有云与私有云并无本质上的差异,他们应是同一套代码的不同实例,唯一的区别仅在于配置与所安装应用的差异。在内网安装即是私有云,而在公网对外提供服务则成为公有云。
随着 Sealos 的不断发展与进步,未来的云将更加开放,更加简单。云计算的美好将属于所有算力的提供者,云的价值将由所有云计算的参与者共享。他们将能够在多元化的市场环境中,以更经济的方式享受云计算所带来的种种便利。
离线安装镜像包:
kubernetes.tar registry.cn-shanghai.aliyuncs.com/labring/kubernetes:v1.28.7
helm.tar registry.cn-shanghai.aliyuncs.com/labring/helm:v3.9.4
ciliumr.tar egistry.cn-shanghai.aliyuncs.com/labring/cilium:v1.14.7
#### 软件架构
软件架构说明
三节点环境部署
192.168.135.100 master
192.168.135.110 node1
192.168.135.120 node2
#### 安装
#各个机器设置自己的域名
hostnamectl set-hostname master && bash
hostnamectl set-hostname node1 && bash
hostnamectl set-hostname node2 && bash
# 将 SELinux 设置为 permissive 模式(相当于将其禁用)
setenforce 0
#关闭swap
swapoff -a
sed -ri 's/.*swap.*/#&/' /etc/fstab
允许 iptables 检查桥接流量
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
br_netfilter
EOF
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sudo sysctl --system
#配置/etc/hosts解析
echo "192.168.135.100 master" >> /etc/hosts
echo "192.168.135.110 node1" >> /etc/hosts
echo "192.168.135.120 node2" >> /etc/hosts
配置时钟同步:
yum install chrony
# 上面的手工操作,也可以使用 sed 自动替换
sed -i 's/^pool pool.*/pool cn.pool.ntp.org iburst/g' /etc/chrony.conf
systemctl enable chronyd --now
# 执行查看命令
chronyc sourcestats -v
服务器做免密
master节点做, 要配置这台master到其他所有服务器的免密登录
ssh-keygen
#公钥复制到其他节点上
ssh-copy-id node1
ssh-copy-id node2
ssh-copy-id master
安装sealos
root@master:~# curl --silent "https://api.github.com/repos/labring/sealos/releases" | jq -r '.[].tag_name'
v5.0.0-beta5
v5.0.0-beta4
v4.4.0-beta3
v5.0.0-beta3
v5.0.0-beta2
v5.0.0-beta1
v4.3.7
v5.0.0-alpha2
v4.3.7-rc1
v4.3.6
v4.4.0-beta2
v4.4.0-beta1
v4.3.5
v4.3.4
v4.4.0-alpha3
v4.4.0-alpha1
v4.3.3
v4.3.2
v4.3.1
v4.3.1-rc2
v4.3.1-rc1
v4.3.0
v4.3.0-rc1
v4.2.3
v4.2.2
v5.0.0-alpha1
v4.2.1
v4.2.1-rc6
v4.2.1-rc5
v4.2.1-rc4
root@master:~# VERSION=v5.0.0-beta4
root@master:~# curl -sfL https://mirror.ghproxy.com/https://raw.githubusercontent.com/labring/sealos/main/scripts/install.sh | PROXY_PREFIX=https://mirror.ghproxy.com sh -s ${VERSION} labring/sealos
[INFO] Using v5.0.0-beta4 as release
[INFO] Using labring/sealos as your repo
[INFO] Downloading tar curl https://mirror.ghproxy.com/https://github.com/labring/sealos/releases/download/v5.0.0-beta4/sealos_5.0.0-beta4_linux_amd64.tar.gz
[INFO] Downloading sealos, waiting...
sealos
[INFO] Installing sealos to /usr/bin/sealos
SealosVersion:
buildDate: "2023-12-22T01:44:43Z"
compiler: gc
gitCommit: 5c22d8aa
gitVersion: 5.0.0-beta4
goVersion: go1.20.12
platform: linux/amd64
root@master:~# sealos version
SealosVersion:
buildDate: "2023-12-22T01:44:43Z"
compiler: gc
gitCommit: 5c22d8aa
gitVersion: 5.0.0-beta4
goVersion: go1.20.12
platform: linux/amd64
安装k8s
root@master:~#
sealos run registry.cn-shanghai.aliyuncs.com/labring/kubernetes:v1.28.7 registry.cn-shanghai.aliyuncs.com/labring/helm:v3.9.4 registry.cn-shanghai.aliyuncs.com/labring/cilium:v1.14.7 --masters 192.168.135.100 --nodes 192.168.135.110,192.168.135.120 -p XXXXXX
root@master:~# kubectl get nodes
NAME STATUS ROLES AGE VERSION
master Ready control-plane 3m v1.28.7
node1 Ready <none> 2m35s v1.28.7
node2 Ready <none> 2m36s v1.28.7
root@master:~# kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system cilium-26xtw 1/1 Running 0 2m6s
kube-system cilium-66s7l 1/1 Running 0 2m6s
kube-system cilium-operator-64b8744fc5-7bf8q 1/1 Running 0 2m6s
kube-system cilium-tqtv7 1/1 Running 0 2m6s
kube-system coredns-5dd5756b68-99xtj 1/1 Running 0 2m46s
kube-system coredns-5dd5756b68-mchwj 1/1 Running 0 2m46s
kube-system etcd-master 1/1 Running 0 3m
kube-system kube-apiserver-master 1/1 Running 0 2m56s
kube-system kube-controller-manager-master 1/1 Running 0 2m56s
kube-system kube-proxy-5cvzp 1/1 Running 0 2m46s
kube-system kube-proxy-8zlsj 1/1 Running 0 2m37s
kube-system kube-proxy-pzq95 1/1 Running 0 2m38s
kube-system kube-scheduler-master 1/1 Running 0 3m
kube-system kube-sealos-lvscare-node1 1/1 Running 0 2m19s
kube-system kube-sealos-lvscare-node2 1/1 Running 0 2m20s
root@master:~#