sealos 创建单节点集群
1. sealos 安装
2. 创建一个k8s集群
- 方式1
参考 kuberentes-life-cycle
# sealos version must >= v4.1.0
$ sealos run labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24.1 --single
- 方式2
创建Clusterfile
文件
apiVersion: apps.sealos.io/v1beta1
kind: Cluster
metadata:
creationTimestamp: null
name: default
spec:
hosts:
- ips:
- 172.16.51.5:22
roles:
- master
- amd64
# - ips:
# - 172.16.51.12:22
# roles:
# - node
# - amd64
image:
- labring/kubernetes-docker:v1.26.1
- labring/helm:v3.10.3
- labring/calico:v3.25.0
ssh:
passwd: ${ssh登录密码}
pk: /root/.ssh/id_rsa
port: 22
user: root
status: {}
# 执行安装
sealos apply -f Clusterfile
3. 允许master节点调度pod
kubectl taint node ${master节点名称} node-role.kubernetes.io/control-plane:NoSchedule-
4. 部署nginx-ingress
常见错误处理
invalid capacity 0 on image filesystem
1.修改/etc/default/grub
添加一行
GRUB_CMDLINE_LINUX="cgroup_enable=cpu"
本文来自博客园,作者:gui.h,转载请注明原文链接:https://www.cnblogs.com/springhgui/p/16797247.html
![](https://img2022.cnblogs.com/blog/960145/202204/960145-20220412154117172-1575691884.png)