[英]kubernetes service external IP assigned to node secondary interface
I have a two node kubernetes cluster deployed on ec2. 我在ec2上部署了两个节点的kubernetes集群。 One of the nodes is attached with a secondary network interface as below. 节点之一与第二个网络接口相连,如下所示。
NODE 1 --> eth0 (ip1).
NODE 2 --> eth0 (ip2), eth1 (ip3)
We are creating a Load Balancer service with externalIPs
as ip3
, 我们正在使用externalIPs
ip3
作为ip3
创建负载均衡器服务,
apiVersion: v1
kind: Service
metadata:
name: test-service
namespace: test-namespace
spec:
type: LoadBalancer
selector:
app: test-service
ports:
- protocol: TCP
port: 12222
targetPort: 12222
name: media-dev
- protocol: TCP
port: 12223
targetPort: 12223
name: dev-test
externalIPs:
- ip3
But this doesn't work and we will not able to access ip3. 但这不起作用,我们将无法访问ip3。
Please let me know if there is any what that I can stream traffic from secondary interface (ip3) to the pod. 请让我知道是否有什么可以将流量从辅助接口(ip3)流到Pod的功能。
Try to set kubelet on Node2 to use ip3 from eth1 by setting following flag: 尝试通过设置以下标志来在Node2上设置kubelet以使用eth1中的ip3:
--node-ip <ip3>
in 在
/etc/systemd/system/kubelet.service.d/10-kubeadm.conf
and then 接着
systemctl daemon-reload
systemctl restart kubelet
More info about kubelet: https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/ 有关kubelet的更多信息: https ://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.