K8s部署学习笔记

前提条件:

需要安装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过期

error execution phase preflight: couldn‘t validate the identity of the API Server: abort connecting_YouMing_Li的博客-优快云博客

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值