zoukankan      html  css  js  c++  java
  • k8s集群搭建之一:基础环境

    一按照kubernetes对软件和硬件的要求:

    二准备的主机系统以及ip配置

    角色 系统 IP
    k8s-master centos7.4 192.168.137.66
    k8s-node1 centos7.4 192.168.137.16
    k8s-node2 centos7.4 192.168.137.26

    三 基础环境的安装(准备的系统:CentOS Linux release 7.4.1708 (Core) )

    2.1 必备工具的安装(三台安装)

    yum -y install epel-release
    
    yum -y install  net-tools  vim   wget   ntpdate  wget  tree nload

    2.2 修改主机名称(三台安装)

    # cat /etc/hosts

    192.168.137.66 k8s-master
    192.168.137.16 k8s-node1
    192.168.137.26 k8s-node2

     2.3 禁用selinux(三台安装)

    setenforce 0
    sed -i 's/enforcing/disabled/' /etc/selinux/config
    getenforce

    2.4 关闭防火墙(三台安装)

    systemctl   stop firewalld
    systemctl disable firewalld

    2.5 关闭 swap和配置转发参数(三台安装)

    swappoff   -a
    cat <<EOF >/etc/sysctl.d/k8s.conf

     net.brideg.brideg-nf-call-ip6tables =1
      net.bridge.bridge-nf-call-iptables = 1
      vm.swappiness=0

      EOF

      sysctl --system

     2.6 设置国内 yum源(三台安装)

    cat <<EOF > /etc/yum.repos.d/kubernetes.repo 

      [kubernetes]

      name=Kubernetes baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/

      enabled=1

      gpgcheck=1

      gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg 

      EOF

    2.7 三台服务器之间建立免密登录(三台安装)

    ssh-keygen -t rsa  #一路回车
    
    ssh-copy-id -i  /root/.ssh/id_rsa.pub root@192.168.137.16  #[后面的ip换成其他的ip完善三台操作]

    2.8 安装docker(三台安装)

    yum install -y yum-utils device-mapper-persistent-data lvm2

      yum-config-manager

      --add-repo

      https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

      yum  install docker-ce -y

     #配置私有仓库:信任地址和国内镜像地址

      mkdir -p  /etc/docker

      cat /etc/docker/daemon.json

      {

      "registry-mirrors": [ "https://registry.docker-cn.com"],

      "insecure-registries":["192.168.137.1:5000"]

      }

      #启动docker并设置开机启动

      systemctl start docker

      systemctl enable docker

     2.9 同步时间(三台安装)

    ntpdate  cn.pool.ntp.org
    hwclock -w
  • 相关阅读:
    Servlet
    MySQL游标
    MySQL数据库的备份和还原
    MySQL安全管理
    MySQL存储过程
    MySQL联结——实现多表查询
    MySQL视图
    MySQL触发器
    asp.net core 读取连接字符串
    form表单提交前进行ajax验证
  • 原文地址:https://www.cnblogs.com/mmyy-blog/p/10922412.html
Copyright © 2011-2022 走看看