TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
IPADDR=192.168.66.10
GATEWAY=192.168.66.2
NETMASK=255.255.255.0
DNS1=10.8.0.2
DNS2=192.168.66.2
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=68b1d42c-83fa-4e41-b262-53dd7b844ae8
DEVICE=ens33
ONBOOT=yes
[root@localhost ~]# systemctl restart network.service
[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
[root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@localhost ~]# yum clean all
[root@localhost ~]# yum makecache
[root@localhost ~]# yum upgrade
[root@localhost ~]# yum update
[root@localhost ~]# uname -a
Linux localhost 3.10.0-1160.6.1.el7.x86_64 #1 SMP Tue Nov 17 13:59:11 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# uname -sr
Linux 3.10.0-1160.6.1.el7.x86_64
[root@localhost ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
[root@localhost ~]# yum --enablerepo=elrepo-kernel install -y kernel-lt
[root@localhost ~]# grub2-set-default 0
[root@localhost ~]# sync
[root@localhost ~]# reboot
... ... ... ...
[root@localhost ~]# uname -sr
Linux 4.4.248-1.el7.elrepo.x86_64
[root@localhost ~]# timedatectl set-timezone Asia/Shanghai
[root@localhost ~]# systemctl enable chronyd
[root@localhost ~]# systemctl start chronyd
[root@localhost ~]# yum install -y epel-release
[root@localhost ~]# yum install -y chrony conntrack ipvsadm ipset jq iptables curl sysstat libseccomp wget socat git
[root@localhost ~]# cat >>/etc/modules-load.d/kubernetes.conf<
[root@localhost ~]# systemctl enable systemd-modules-load.service
[root@localhost ~]# lsmod | grep -e ip_vs -e nf_conntrack_ipv4
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# iptables -F && iptables -X && iptables -F -t nat && iptables -X -t nat
[root@localhost ~]# iptables -P FORWARD ACCEPT
[root@localhost ~]# swapoff -a
[root@localhost ~]# sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
[root@localhost ~]# setenforce 0
[root@localhost ~]# sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
[root@localhost ~]# cat > /etc/sysctl.d/sysctl.conf <
[root@localhost ~]# systemctl stop postfix && systemctl disable postfix
[root@localhost ~]# rpm -qa | grep docker
[root@localhost ~]# yum remove docker docker-common docker-selinux docker-engine
[root@localhost ~]# rm -rf /var/lib/docker
[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
[root@localhost ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
[root@localhost ~]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
[root@localhost ~]# yum clean all
[root@localhost ~]# yum makecache fast
[root@localhost ~]# yum list docker-ce --showduplicates | sort -r
[root@localhost ~]# yum install docker-ce-18.09.9-3.el7.x86_64
[root@localhost ~]# systemctl start docker
[root@localhost ~]# systemctl enable docker
[root@localhost ~]# docker version
[root@localhost ~]# docker info
[root@localhost ~]# docker -h
组件 | 版本 | 命令 |
---|---|---|
kubernetes | 1.18.5 | kubectl version |
docker-ce | 19.03.11 | docker version 或者 rpm -qa | grep docker |
etcd | 3.4.3 | etcdctl version |
calico | 3.13.3 | calico -v |
coredns | 1.7.0 | coredns -version |
K8S-Demo集群实践00:搭建镜像仓库Harbor+安全扫描
K8S-Demo集群实践01:准备VMware虚拟机模板
K8S-Demo集群实践02:准备VMware虚拟机3台Master+3台Node
K8S-Demo集群实践03:准备集群各组件间HTTPS通讯需要的x509证书
K8S-Demo集群实践04:部署etcd三节点高可用集群
K8S-Demo集群实践05:安装kubectl并配置集群管理员账户
K8S-Demo集群实践06:部署kube-apiserver到master节点(3个无状态实例)
K8S-Demo集群实践07:kube-apiserver高可用方案
K8S-Demo集群实践08:部署高可用kube-controller-manager集群
K8S-Demo集群实践09:部署高可用kube-scheduler集群
K8S-Demo集群实践10:部署ipvs模式的kube-proxy组件
K8S-Demo集群实践11:部署ipvs模式的kube-kubelet组件
K8S-Demo集群实践12:部署Calico网络
K8S-Demo集群实践13:部署集群CoreDNS
K8S-Demo集群实践14:部署集群监控服务Metrics Server
K8S-Demo集群实践15:部署Kubernetes Dashboard
K8S-Demo集群实践16:部署Kube-Prometheus
K8S-Demo集群实践17:部署私有云盘owncloud(10.6版本)
K8S-Demo集群实践18:构建宇宙中第一个基础容器镜像