Avoid service get IP from EIP which is different family
Description
What type of PR is this ?: Previously, a service could obtain a LoadBalancerIP from an EIP of a different protocol family, such as an IPv4 service using an IPv6 EIP. Now, this situation has been avoided.”
root@i-emydamjm:~# kubectl get eip
NAME CIDR USAGE TOTAL
layer2-eip fc00:f853:ccd:e793::d-fc00:f853:ccd:e793::f 1 3
root@i-emydamjm:~# kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
layer2-svc LoadBalancer 10.96.188.6 fc00:f853:ccd:e793::d 80:31224/TCP 4h27m
-->
root@ospp:/home/wuyq# kubectl get eip
NAME CIDR USAGE TOTAL
layer2-eip 192.168.8.1-192.168.8.5 5
root@ospp:/home/wuyq# kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
layer2-ipv6svc LoadBalancer fd00:10:96::f325 <pending> 80:31209/TCP 6s
root@ospp:/home/wuyq# kubectl describe svc layer2-ipv6svc
Name: layer2-ipv6svc
Namespace: default
Labels: <none>
Annotations: eip.openelb.kubesphere.io/v1alpha2: layer2-eip
lb.kubesphere.io/v1alpha1: openelb
Selector: app=layer2-openelb
Type: LoadBalancer
IP Family Policy: SingleStack
IP Families: IPv6
IP: fd00:10:96::f325
IPs: fd00:10:96::f325
Port: http 80/TCP
TargetPort: 8080/TCP
NodePort: http 31209/TCP
Endpoints: <none>
Session Affinity: None
External Traffic Policy: Cluster
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning AssignIPFailed 7s (x13 over 28s) OpenELBController ipv6 service can't use ipv4 eip
Related links:
/lgtm /approve
LGTM label has been added.
LGTM label has been added.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: renyunkang, yq-wu
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [renyunkang]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: renyunkang, yq-wu
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [renyunkang]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment