前提条件:
需要安装Virtualbox与vagrant(配置虚拟环境)
1.参照vagrant文件生成三个虚拟机
Vagrant.configure("2") do |config|
(1..3).each do |i|
config.vm.define "k8s-node#{i}" do |node|
# 设置虚拟机的Box
node.vm.box = "centos/7"
# 设置虚拟机的主机名
node.vm.hostname="k8s-node#{i}"
# 设置虚拟机的IP
node.vm.network "private_network", ip: "192.168.56.#{99+i}", netmask: "255.255.255.0"
# 设置主机与虚拟机的共享目录
# node.vm.synced_folder "~/Documents/vagrant/share", "/home/vagrant/share"
# VirtaulBox相关配置
node.vm.provider "virtualbox" do |v|
# 设置虚拟机的名称
v.name = "k8s-node#{i}"
# 设置虚拟机的内存大小
v.memory = 4096
# 设置虚拟机的CPU个数
v.cpus = 4
end
end
end
end
2.参考文章【k8s】2、k8s安装、kubeSphere安装与使用_努力充实,远方可期-优快云博客
3.遇到的问题:
1)没有安装wget:执行命令安装
yum -y install wget
2)XShell连接虚拟机只能输入Public Key解决方案
XShell连接虚拟机只能输入Public Key解决方案 - 简书
3)k8s集群中Node节点忘记了token密码的解决办法
k8s集群中Node节点忘记了token密码的解决办法_阿文的博客-优快云博客
4)helm version报错
kubectl taint nodes --all node-role.kubernetes.io/master-
5)k8s版本低升级方式升级 kubeadm 集群 | Kubernetes
6)kubesphere安装以及修改插件库方式
在 Kubernetes 上最小化安装 KubeSphere
7)主节点token过期
8)安装最新版kubernetes升级Kubernetes版本至1.18 - 董广明 - 博客园
9)The connection to the server localhost:8080 was refused - did you specify the right host or port The connection to the server localhost:8080 was refused - did you specify the right host or port?解决_CEVERY的博客-优快云博客
10)最新的openEbs.yamlhttps://openebs.github.io/charts/openebs-operator.yaml
11)tiller一直pending(报错{node-role.kubernetes.io/master: }, that the pod didn't tolerate.)0/1 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn‘t_YuanOo。的博客-优快云博客
12)查看某节点状态命令
kubectl describe pod tiller-deploy-7cd7c99ff9-h6s22 --namespace=kube-system