标签:admin ima uber update yam ror force 系统信息 enabled
CentOS Linux release 7.6.1810 (Core)
3.10.0-957.27.2.el7.x86_64
systemctl stop firewalld
systemctl disable firewalld
sed -i ‘s/enforcing/disabled/‘ /etc/selinux/config setenforce 0
echo "vm.swappiness = 0">> /etc/sysctl.conf swapoff -a
cat > /etc/sysctl.d/k8s.conf << EOF net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 EOF
modprobe br_netfilter
rm -rfv /etc/yum.repos.d/* # base repo curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo # docker repo curl -o /etc/yum.repos.d/docker-ce.repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo # k8s repo cat > /etc/yum.repos.d/kubernetes.repo << EOF [kubernetes] name=Kubernetes baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg EOF # update cache yum clean all yum makecache yum repolist
yum install vim bash-completion net-tools gcc -y
# 安装docker yum install docker-ce-18.06.3.ce -y # 添加阿里云仓库加速(最好换成自己的) mkdir -p /etc/docker tee /etc/docker/daemon.json <<-‘EOF‘ { "registry-mirrors": ["https://ahtqbhz9.mirror.aliyuncs.com"] } EOF systemctl daemon-reload systemctl restart docker systemctl enable docker # 安装 kubeadm、kubelet、kubectl yum install -y kubelet-1.18.0 kubeadm-1.18.0 kubectl-1.18.0 systemctl enable kubelet
# apiserver-advertise-address地址就是master的IP。 kubeadm init --kubernetes-version=1.18.0 --apiserver-advertise-address=10.128.143.100 --image-repository registry.aliyuncs.com/google_containers --service-cidr=10.10.0.0/16 --pod-network-cidr=10.122.0.0/16 mkdir -p $HOME/.kube cp -i /etc/kubernetes/admin.conf $HOME/.kube/config chown $(id -u):$(id -g) $HOME/.kube/config
--apiserver-advertise-address: 根据实际MASTER IP地址填写
source <(kubectl completion bash)
kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
kubectl get pod --all-namespaces
kubectl get node
kubectl taint nodes --all node-role.kubernetes.io/master-
默认master节点不用调用pod,清除(taint)污点,有(taint)污点的节点不会调用pod
文章摘要:
原文链接:https://how2play.club /archives/使用kubeadm部署k8s
标签:admin ima uber update yam ror force 系统信息 enabled
原文地址:https://www.cnblogs.com/supery007/p/13370880.html