标签:span 安装流程 拉取 环境 swapoff 软件 images base 内容
主要内容 1.环境准备(2主机) 2.安装流程 3.问题分析 4.总结 环境配置(2主机) 系统:CentOS 7.3 x64 网络:局域网(VPC) 主机: master:172.16.0.17 node-1:172.16.0.7
设置hostname-将hostname修改为 k8s-master并且sudo vim /etc/hosts 追加 39.96.69.98 k8s-master
[root@k8s-master ~]#hostnamectl set-hostname k8s-master echo "39.96.69.98 k8s-master" >> /etc/hosts [root@k8s-node-1 ~]#hostnamectl set-hostname k8s-master echo "39.96.69.98 k8s-master" >> /etc/hosts
[root@k8s-master ~]#echo "39.96.69.98 k8s-master
47.94.174.85 k8s-node1" >> /etc/hosts
[root@k8s-node-1 ~]#echo "39.96.69.98 k8s-master
47.94.174.85 k8s-node1" >> /etc/hosts
注:这里有n个node就追加n个。
1、禁用并关闭防火墙或者直接一句话 systemctl stop firewalld & systemctl disable firewalld
[root@k8s-master ~]# systemctl disable firewalld [root@k8s-master ~]# systemctl stop firewalld [root@k8s-node-1 ~]# systemctl disable firewalld [root@k8s-node-1 ~]# systemctl stop firewalld
2、关闭selinux(临时关闭,重启后失效)
[root@k8s-master ~]# setenforce 0 [root@k8s-node-1 ~]# setenforce 0
3、关闭swap(临时关闭,重启后失效)
[root@k8s-master ~]# swapoff -a [root@k8s-node-1 ~]# swapoff -a
cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=0 repo_gpgcheck=0 gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg EOF
yum install -y kubelet kubeadm kubectl
systemctl start docker && systemctl enable docker
systemctl start kubelet && systemctl enable kubelet
kubeadm config images list #输出如下结果 k8s.gcr.io/kube-apiserver:v1.12.2 k8s.gcr.io/kube-controller-manager:v1.12.2 k8s.gcr.io/kube-scheduler:v1.12.2 k8s.gcr.io/kube-proxy:v1.12.2 k8s.gcr.io/pause:3.1 k8s.gcr.io/etcd:3.2.24 k8s.gcr.io/coredns:1.2.2
标签:span 安装流程 拉取 环境 swapoff 软件 images base 内容
原文地址:https://www.cnblogs.com/fger/p/10992485.html