使用MetalLB负载均衡器时无法连接到Kubernetes部署(App)。尝试配置浮动IP,以便当一个节点失败并且工作负载跨时,我仍然知道在具有新地址的新节点上IP是什么。
已部署:
的小子网)。
经核实:
部署.yaml
metallb.yaml
`apiVersion: v1 kind: ConfigMap metadata: namespace: metallb-system name: config data: config: | address-pools: - name: my-ip-space protocol: layer2 addresses: - 192.168.0.240/28` nginx.yaml apiVersion: apps/v1beta2 kind: Deployment metadata: name: nginx spec: selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1 ports: - name: http containerPort: 80
nginx服务-lb.yaml apiVersion: v1 kind: Service metadata: name: nginx labels: app: nginx spec: selector: app: nginx type: LoadBalancer ports: - port: 80 name: http protocol: TCP targetPort: 80
结果
我认为是可行的:
不管用:
膝上型电脑的结果
来自笔记本电脑.102的ARP请求是节点,.240是MetalLB分配的VIP。
ethernet上的
ethernet上的
发布于 2021-03-17 18:46:01
我们遇到了一个完全相同的问题,我们追溯到Windows网络桥接MetalLB网络与另一个网络(我们的办公室无线)。
还有其他可能以类似方式出现的问题(例如防火墙配置),因此要验证桥接网络是否导致了这些问题,请运行
arping -I <interface> <target ip>其中,<interface>是MetalLB网络上的一个接口路由(在您的例子中是en0),而<target ip>是Kubernetes服务的外部IP (在您的示例中是192.168.0.240)。如果桥导致了问题,您将看到与两个不同的MAC地址相关联的IP (或更多,取决于桥接器的特性)。
一旦MetalLB分配了IP地址,即使在重新部署服务或部署新服务时,连接网络似乎也是有效的。
如果存在桥,并且必须对其进行维护,请考虑在BGP模式下配置MetalLB。
https://stackoverflow.com/questions/57985614
复制相似问题