美文网首页
KubeSphere 3.0多结点安装

KubeSphere 3.0多结点安装

作者: 1nvad3r | 来源:发表于2020-11-18 09:12 被阅读0次

    KubeSphere 3.0多结点安装

    参考:https://kubesphere.com.cn/docs/installing-on-linux/introduction/multioverview/
    本教程环境为Centos7。
    1.在每台虚拟机中开放防火墙端口:

    firewall-cmd --zone=public --add-port=22/tcp --permanent
    firewall-cmd --zone=public --add-port=2379-2380/tcp --permanent
    firewall-cmd --zone=public --add-port=6443/tcp --permanent
    firewall-cmd --zone=public --add-port=9099-9100/tcp --permanent
    firewall-cmd --zone=public --add-port=179/tcp --permanent
    firewall-cmd --zone=public --add-port=30000-32767/tcp --permanent
    firewall-cmd --zone=public --add-port=10250-10258/tcp --permanent
    firewall-cmd --zone=public --add-port=53/tcp --permanent
    firewall-cmd --zone=public --add-port=53/udp --permanent
    firewall-cmd --zone=public --add-port=5000/tcp --permanent
    firewall-cmd --zone=public --add-port=5080/tcp --permanent
    firewall-cmd --zone=public --add-port=111/tcp --permanent
    firewall-cmd --reload
    

    查看开放端口情况:
    firewall-cmd --list-port

    或者直接关闭防火墙
    systemctl stop firewalld.service

    2.下载KubeKey

    yum -y install wget
    wget -c https://kubesphere.io/download/kubekey-v1.0.0-linux-amd64.tar.gz -O - | tar -xz
    

    3.授予权限

    chmod +x kk
    

    4.创建并修改示例配置文件

    ./kk create config --with-kubesphere v3.0.0
    

    修改hosts,etcd , master

    spec:
      hosts:
      - {name: master, address: 10.211.55.9, internalAddress: 10.211.55.9, privateKeyPath: "~/.ssh/id_rsa"}
      - {name: node1, address: 10.211.55.8, internalAddress: 10.211.55.8, privateKeyPath: "~/.ssh/id_rsa"}
      - {name: node2, address: 10.211.55.7, internalAddress: 10.211.55.7, privateKeyPath: "~/.ssh/id_rsa"}
      roleGroups:
        etcd:
        - master
        master:
        - master
        worker:
        - node1
        - node2
    

    登录阿里云容器镜像服务控制台后,在左侧导航栏选择镜像工具镜像加速器,在镜像加速器页面获取地址。
    修改示例配置文件,在registryMirrors这一行增加容器加速器地址。

    5.实现不同机器之间的ssh免密登录:
    生成ssh秘钥信息,一直按回车:

    ssh-keygen  -t rsa
    

    把所有虚拟机的公钥文件复制到authorized_keys中。

    vi /root/.ssh/authorized_keys
    

    然后把这个authorized_keys复制到到所有虚拟机/root/.ssh目录

    scp /root/.ssh/authorized_keys root@192.168.31.223:/root/.ssh
    

    设置authorized_keys权限

    chmod 600 authorized_keys 
    

    6.安装必须的组件:

    yum -y install socat
    yum -y install conntrack
    yum -y install nfs-utils rpcbind
    

    7.创建集群:

    ./kk create cluster -f config-sample.yaml
    

    8.验证,出现以下说明成功:

    #####################################################
    ###              Welcome to KubeSphere!           ###
    #####################################################
    
    Console: http://10.211.55.10: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             2020-11-18 00:27:47
    #####################################################
    INFO[00:28:09 CST] Installation is complete.
    

    创建企业空间、项目、帐户和角色

    参考https://kubesphere.com.cn/docs/quick-start/create-workspace-and-project/

    启用Devops:

    参考https://kubesphere.com.cn/docs/pluggable-components/devops/

    部署Istio-BookInfo:

    启用ServiceMesh
    参考https://kubesphere.com.cn/docs/pluggable-components/service-mesh/

    参考https://kubesphere.com.cn/docs/quick-start/deploy-bookinfo-to-k8s/
    创建一个企业空间demo-workspace。
    创建一个项目demo-project。
    开启应用治理。
    部署示例应用。

    DevOps 用户指南:

    https://kubesphere.com.cn/docs/devops-user-guide/how-to-use/devops-project-management/

    相关文章

      网友评论

          本文标题:KubeSphere 3.0多结点安装

          本文链接:https://www.haomeiwen.com/subject/lnffiktx.html