CentOS通过 All-in-One 模式安装 KubeSphere技巧

对于刚接触 KubeSphere 并想快速上手该容器平台的用户,All-in-One 安装模式是最佳的选择,它能够帮助您零配置快速部署 KubeSphere 和 Kubernetes。

1. 安装CentOS

要把处理器核心数设置在 2以上,这是k8s安装配置要求的

2. 配置 ip

vi /etc/sysconfig/network-scripts/ifcfg-ens33
## 简单的就是设置为静态ip
ONBOOT=yes

3. 禁用selinux(坑 一)

vi /etc/sysconfig/selinux
## 这是设置一个属性为disabled
SELINUX=disabled

配置完之后需要重启 reboot

4. 官网要求

(1)节点必须能够通过 SSH 连接。

(2)节点上可以使用 sudo/curl/openssl 命令

(3)docker 可以由您自己安装或由 KubeKey 安装。

注意:如果你想离线安装 KubeSphere,请务必提前安装好 docker。

安装要求的依赖

yum install socat conntrack ebtables ipset

5. 关闭防火墙(坑二)

systemctl stop firewalld.service # 停止
systemctl disable firewalld.service # 禁用防火墙,下次启动也不会开启

6. 安装docker(坑三)

# 安装docker
yum  install docker docker.io
#配置docker 源
vim /etc/docker/daemon.json
{
        "registry-mirrors": [
                "https://registry.docker-cn.com"
        ]
}
#重载docker
sudo systemctl daemon-reload
sudo systemctl restart docker

7. 安装KubeKey

# 先执行以下命令以确保从正确的区域下载 KubeKey
export KKZONE=cn
# 执行以下命令下载 KubeKey
curl -sfL https://get-kk.kubesphere.io | VERSION=v1.0.1 sh -
# 为kk添加可执行权限
chmod +x kk

8. 安装Kubernetes和kubesphere

# 安装
./kk create cluster --with-kubernetes v1.17.9 --with-kubesphere v3.0.0

验证结果

kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
**************************************************
#####################################################
###              Welcome to KubeSphere!           ###
#####################################################
Console: http://192.168.106.135:30880
Account: admin
Password: P@88w0rd
NOTES:
  1. After logging into the console, please check the
     monitoring status of service components in
     the "Cluster Management". If any service is not
     ready, please wait patiently until all components
     are ready.
  2. Please modify the default password after login.
#####################################################
https://kubesphere.io             2021-08-28 12:20:55
#####################################################

9.登录

CentOS通过 All-in-One 模式安装 KubeSphere技巧CentOS通过 All-in-One 模式安装 KubeSphere技巧

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值