Notes of Kubernetes

Prepare the local working environment

System Initialization

  • Turn off firewall
    # temporarily
    systemctl stop firewalld
    # permanently
    systemctl disable firewalld
  • Turn off selinux
    # temporarily
    sed -i 's/enforcing/disabled/' /etc/selinux/config
    # permanently
    setenforce 0
  • Turn off swap
    # temporarily
    swapoff -a
    # permanently (add hash (#) to the beginning of the swap partition line)
    vim /etc/fstab
  • Configure hostname
    hostnamectl set-hostname [hostname]
  • Configure static IP
    vi /etc/sysconfig/network-scripts/ifcfg-ens32

    BOOTPROTO="static"
    IPADDR=192.168.8.20
    PREFIX0=24
    GATEWAY=192.168.8.2
    DNS1=114.114.114.114
    DNS2=8.8.8.8
  • Add information of hosts (executed only on master node)

    cat >> /etc/hosts << EOF
    192.168.8.20 master01
    192.168.8.21 worker01
    192.168.8.22 worker02
    EOF
  • IPv4 transist to iptables

    cat > /etc/sysctl.d/k8s.conf << EOF
    net.bridge.bridge-nf-call-ip6tables = 1
    net.bridge.bridge-nf-call-iptables = 1
    EOF
    sysctl --system
  • Synchronize time across cluster nodes
    yum install ntpdate -y
    ntpdate time.windows.com

Software Installation

Docker

Kubeadm

Kubelet

你可能感兴趣的