部署 dashboard
1 | kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta4/aio/deploy/recommended.yaml |
1 | # 创建dashboard管理用户 |
部署
Helm
- Homebrew users can use
brew install kubernetes-helm
. - Chocolatey users can use
choco install kubernetes-helm
. - Scoop users can use
scoop install helm
. - GoFish users can use
gofish install helm
. - Snap users can use
sudo snap install helm --classic
.
k8s 升级以及容器版本升级
1 | apt-get update && apt-get upgrade kubeadm |
docker 降级
打印可用版本:
1 | apt-cache madison docker-ce |
安装指定版本:
1 | sudo apt-get install docker-ce=<VERSION> |
三、给 Tiller 授权
因为 Helm 的服务端 Tiller 是一个部署在 Kubernetes 中 Kube-System Namespace 下 的 Deployment,它会去连接 Kube-Api 在 Kubernetes 里创建和删除应用。
而从 Kubernetes 1.6 版本开始,API Server 启用了 RBAC 授权。目前的 Tiller 部署时默认没有定义授权的 ServiceAccount,这会导致访问 API Server 时被拒绝。所以我们需要明确为 Tiller 部署添加授权。
创建 Kubernetes 的服务帐号和绑定角色
1 | $ kubectl create serviceaccount --namespace kube-system tiller |
为 Tiller 设置帐号
使用 kubectl patch 更新 API 对象
1 | kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' |
查看是否授权成功
1 | kubectl get deploy --namespace kube-system tiller-deploy --output yaml|grep serviceAccount |
四、验证 Tiller 是否安装成功
1 | kubectl -n kube-system get pods|grep tiller |
NFS 挂载失败
在一台机器上创建 Pod,挂载 nfs 失败。
然后在节点上尝试挂载,依然显示失败
1 | root@master:~# mount -t nfs 192.168.207.121:/nas/dg_vd /nfs |
执行apt install nfs-common
后可以本地挂载 nfs。
这是再创建 pod 成功
Readiness probe failed: caliconode is not ready: BIRD is not ready: BGP not established with 10.117.
Calico 问题排障
// 错误信息
1 | :Readiness probe failed: caliconode is not ready: BIRD is not ready: BGP not established with 10.117.150.23 |
估计是没用发现实际真正的网卡
解决方法
/_
调整 calicao 网络插件的网卡发现机制,修改 IP_AUTODETECTION_METHOD 对应的 value 值。官方提供的 yaml 文件中,ip 识别策略(IPDETECTMETHOD)没有配置,即默认为 first-found,这会导致一个网络异常的 ip 作为 nodeIP 被注册,从而影响 node-to-node mesh。我们可以修改成 can-reach 或者 interface 的策略,尝试连接某一个 Ready 的 node 的 IP,以此选择出正确的 IP。
_/
1 | // calico.yaml 文件添加以下二行 |