sealos搭建kubernetes(k8s)生产环境

没有废话
Sealos 是一款以 Kubernetes 为内核的云操作系统发行版。它以云原生的方式,抛弃了传统的云计算架构,转向以 Kubernetes 为云内核的新架构,使企业能够像使用个人电脑一样简单地使用云。
开始搭建

##关闭防火墙
systemctl disable --now  firewalld
##关闭selinux
vim /etc/selinux/config 
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

##搭建yum仓库
cat > /etc/yum.repos.d/labring.repo << EOF
[fury]
name=labring Yum Repo
baseurl=https://yum.fury.io/labring/
enabled=1
gpgcheck=0
EOF
sudo yum clean all
sudo yum install sealos
##ubuntu用apt源
echo "deb [trusted=yes] https://apt.fury.io/labring/ /" | sudo tee /etc/apt/sources.list.d/labring.list
sudo apt update
sudo apt install sealos
##开始安装基础环境
sealos run docker.io/labring/kubernetes:v1.25.6 --single
sealos run docker.io/labring/helm:v3.11.0
sealos run docker.io/labring/flannel:v0.21.4
seakis run docker.io/labring/bitnami-etcd:v3.5.6
##k8s常用命令
kubectl get pods -A      ##获取当前 Kubernetes 集群中所有命名空间(Namespaces)的所有 Pod 列表。
kubectl get nodes        ##获取当前 Kubernetes 集群中的所有节点(Node)的列表。
kubectl get pod -n<namespace>    ##获取指定命名空间(<namespace>)中的所有 Pod 列表。
kubectl get pod <pod名> -o wide -n<spacename>    ##获取指定命名空间(<namespace>)中特定名称为 <pod名> 的 Pod 的详细信息,包括 Pod 的 IP 地址等。
kubectl delete -n <namespace> pod <pod名>   ##删除特定命名空间(namespace)下的 Pod。
kubectl describe -n <namespace> pod <pod名>  ##输出指定资源<pod>的详细信息`在这里插入代码片`
kubectl logs -n <namespace> pods/<pod名>  ##查看pod的日志
##Prometheus+neuvector+Grafana部署
sealos run labring/loki-stack:v2.6.1   #Grafana
sealos run labring/prometheus:v2.44.0  #Prometheus
sealos run labring/neuvector:v5.1.0  #neuvector
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值