活泼的甜薯

导航

统计

Centos7安装kubernetes

环境:

  奇数台设备(虚拟机或服务器)

  最低配置:2 core,4GB

初始操作

  1. 关闭防火墙
    systemctl stop firewalld
    systemctl disable firewalld
  2. 关闭selinux
    sed -i 's/enforcing/disabled/' /etc/selinux/config
  3. 关闭swap,并重启
    swapoff -a # 临时
    sed -ri 's/.*swap.*/#&/' /etc/fstab # 永久
  4. 根据规则设置主机名
    hostnamectl set-hostname <hostname>
  5. 在master节点添加hosts
    1
    2
    3
    4
    cat >> /etc/hosts << EOF
    192.168.59.130 k8s-master
    192.168.59.131 k8s-node1
    192.168.59.132 k8s-node2
  6. 将桥接的IPv4流量传递到iptables
    1
    2
    3
    4
    5
    6
    7
    cat > /etc/sysctl.d/k8s.conf << EOF
    net.bridge.bridge-nf-call-ip6tables = 1
    net.bridge.bridge-nf-call-iptables = 1
    EOF
     
    # 生效
    sysctl --system
  7. 时间同步
    1
    2
    yum install ntpdate -y
    ntpdate time.windows.com

posted on   活泼的甜薯  阅读(6)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
点击右上角即可分享
微信分享提示