我安装了 MetalLB 以便能够通过我的网络的 IP 公开我的服务。安装后,我尝试了一个简单的 hello-world: https ://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/
我注意到,外部 IP 始终处于状态
在控制器 pod 的日志中,我收到以下错误消息:
{"caller":"reflector.go:205","level":"error","msg":"go.universe.tf/metallb/internal/k8s/k8s.go:231: Failed to list *v1.Service: Get https://10.96.0.1:443/api/v1/services?limit=500\u0026resourceVersion=0: dial tcp 10.96.0.1:443: i/o timeout","ts":"2019-04-23T12:16:31.3694Z"}
{"caller":"reflector.go:205","level":"error","msg":"go.universe.tf/metallb/internal/k8s/k8s.go:237: Failed to list *v1.ConfigMap: Get https://10.96.0.1:443/api/v1/namespaces/metallb-system/configmaps?fieldSelector=metadata.name%3Dconfig\u0026limit=500\u0026resourceVersion=0: dial tcp 10.96.0.1:443: i/o timeout","ts":"2019-04-23T12:17:01.779341Z"}
我像往常一样安装了 Kubernetes 并使用以下命令进行了初始化:
sudo kubeadm init --pod-network-cidr=10.21.8.128/25 --apiserver-advertise-address=10.21.8.1
在"kube-controller-manager.yaml"
我更改了的大小,"node-cidr-mask"
因为标准值是"/24"
,我的集群大小是"/25"
:
--node-cidr-mask-size=26
我还安装了 flannel 和 Kubernetes Dashboard。一切正常!
然后我安装了MetalLB: https ://metallb.universe.tf/tutorial/layer2/
并使用此配置配置了 MetalLB:
*apiVersion: v1
kind: ConfigMap
metadata:
namespace: metallb-system
name: config
data:
config: |
address-pools:
- name: my-ip-space
protocol: layer2
addresses:
- 10.21.8.129-10.21.8.254*
我错过了什么吗?