安装
Kubernetes 基础环境要求
· ☕ 2 分钟
1. 基础包 Kubernetes 版本 ≥ 1.18 socat 必须安装 conntrack 必须安装 ebtables 可选,但推荐安装 ipset 可选,但推荐安装 ipvsadm 可选,但推荐安装 1 apt-get -y install socat conntrack ebtables ipset ipvsadm 2. 端口要求 2.1 基础节点服务 Service Protocol Action Start Port End Port Comment ssh TCP allow 22 22 节点远程管理 docker TCP allow 2375 2376 Docker 远程通信 etcd TCP allow 2379 2380 etcd 集群通信 2.2 Master/Control Plane 组件 Service Protocol Action Start Port End Port Comment apiserver

Kubernetes 安装问题 QA
· ☕ 1 分钟
1. Calico 1.1 BIRD is not ready 1 kubectl -n kube-system get pod calico-node-xxx 0/1 一直起不来,报错 calico/node is not ready: BIRD is not ready: BGP not established with 解决办法: Calico 默认使用 first-found,也就是从第一个找到的网卡中获取 NodeIP。虽然排除了 lo、docker0 等网卡,但是依然有一定概率会识别失败。需要手动修改,

Kubernetes 添加 Windows 节点
· ☕ 4 分钟
这里主要使用 Windows 节点作为 Worker,而 Master 控制平面依然在 Linux 。 1. 系统配置 1.1 Kubernetes 控制平面 Kubernetes 自 1.14 版本,增加了对 Windows 节点生产级的支持。由于微软官方文档主要提供的是 flannel 网络插件的安装方式,这里建议 Kubernetes 也采用 flannel 插件。 查看当前集群 Kubernetes 版本 1 2 3 4 kubectl version Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.6", GitCommit:"d32e40e20d167e103faf894261614c5b45c44198", GitTreeState:"clean", BuildDate:"2020-05-20T13:16:24Z",

KubeSpray 安装 Kubernetes 报错 ip in ansible_all_ipv4_addresses
· ☕ 2 分钟
使用 KubeSpray 安装 Kubernetes 时,报错 1 2 3 4 5 6 fatal: [node0]: FAILED! => { "assertion": "ip in ansible_all_ipv4_addresses", "changed": false, "evaluated_to": false, "failed": true } 查看 inventory.ini 配置 1 2 3 4 5 6 7 cat inventory.ini # ## Configure 'ip' variable to bind kubernetes services on a # ## different ip than the default iface # ## We should set etcd_member_name for etcd cluster. The node that is not a etcd member do not need to set the value, or can set the empty string value. [all] node0 ansible_host=139.168.12.4 ip=139.168.12.4 ... 查找报错信息来源 kubespray/extra_playbooks/roles/network_plugin/calico/tasks/pre.yml 1 2 3 4 5 6 7 8 9 ---

Kubernetes 1.6.0 安装问题汇总
· ☕ 1 分钟
1. CNI 问题 错误日志 1 2 journalctl -u kubelet ...Unable to update cni config: No networks found in /etc/cni/net.d 由于没有安装 CNI ,需要移除 /var/lib/kubelet/kubeadm-flags.env 参数中的--network-plugin=cni 1 2 cat /var/lib/kubelet/kubeadm-flags.env KUBELET_KUBEADM_ARGS="--cgroup-driver=systemd --pod-infra-container-image=k8s.gcr.io/pause:3.1" 2. 节点 NotReady 节点 NotReady 可能的原因有很多。通常会是网络、容器配置错误导致,需要逐一排查。 这里使用的是 使用 Kubeadm 安装 Kubernetes 集群 文