脚本宝典收集整理的这篇文章主要介绍了kubeadm部署新版本k8s集群基本命令,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
1.基础环境 modPRobe br_netfilter cat >> /etc/Sysctl.conf << EOF net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 net.ipv4.ip_forward = 1 vm.swappiness=0 EOF sysctl -p 2.安装容器运行时环境 wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.COM/docker-ce/linux/centos/docker-ce.repo yum -y install docker-ce mkdir -p /etc/docker cat > /etc/docker/daemon.JSON << EOF { "exec-opts": ["native.cgroupdriver=systemd"], "registry-mirrors": ["https://registry.cn-hangzhou.aliyuncs.com"] } EOF systemctl daemon-reload systemctl start docker systemctl enable docker 3.部署kubernetes主节点 cat > /etc/yum.repos.d/kubeadm.repo << EOF [kubernetes] name=Kubernetes baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/ enabled=1 gpgcheck=0 repo_gpgcheck=0 gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg EOF yum install -y kubeadm kubelet kubectl systemctl enable kubelet.service kubeadm inIT --control-plane-endpoint "192.168.200.140:6443" --pod-network-cidr 10.10.0.0/16 --service-cidr 172.16.0.0/16 --image-repository registry.aliyuncs.com/GOOGLE_containers --upload-certs | tee kubeadm-init.LOG mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config docker run --network host --rm plndr/kube-vip:latest manifest pod --interface ens33 --vip 192.168.200.140 --arp --leaderElection --startAsLeader | tee /etc/kubernetes/manifests/kube-vip.yaML 4.部署cni网络插件 wget -O calico.yaml --no-check-certificate https://docs.projectcalico.org/manifests/calico.yaml vim calico.yaml - name: CALICO_Ipv4POOL_CIDR value: "10.10.0.0/16" kubectl apply -f calico.yaml 5.kubectl命令补全 yum install bash-completion -y source /usr/share/bash-completion/bash_completion kubectl completion bash > /etc/bash_completion.d/kubectl source /etc/bash_completion.d/kubectl
以上是脚本宝典为你收集整理的kubeadm部署新版本k8s集群基本命令全部内容,希望文章能够帮你解决kubeadm部署新版本k8s集群基本命令所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。