openelb icon indicating copy to clipboard operation
openelb copied to clipboard

Avoid service get IP from EIP which is different family

Open ElectricFish7 opened this issue 1 year ago • 2 comments

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:

ElectricFish7 avatar Aug 29 '24 06:08 ElectricFish7

/lgtm /approve

renyunkang avatar Aug 30 '24 10:08 renyunkang

LGTM label has been added.

Git tree hash: 48309e83e9a58387c832058a8e9baedff1f6bd13

ks-ci-bot avatar Aug 30 '24 10:08 ks-ci-bot

LGTM label has been added.

Git tree hash: 48309e83e9a58387c832058a8e9baedff1f6bd13

ks-ci-bot avatar Aug 30 '24 10:08 ks-ci-bot

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

ks-ci-bot avatar Aug 30 '24 10:08 ks-ci-bot

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

ks-ci-bot avatar Aug 30 '24 10:08 ks-ci-bot