Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Egress and ServiceExternalIP can not works together for the same External IP #3334

Open
ikandars opened this issue Feb 20, 2022 · 14 comments
Open
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@ikandars
Copy link

Describe the bug

If we create Egress object where we defined egressIP for example 103.15.226.42, we can't use that IP in Service LoadBalancer type in loadBalancerIP key. The status will be pending.

To Reproduce

create external IP Pool object:

apiVersion: crd.antrea.io/v1alpha2
kind: ExternalIPPool
metadata:
  name: prod-external-ip-pool
spec:
  ipRanges:
  - start: 103.15.226.41
    end: 103.15.226.42
  nodeSelector:
    matchLabels:
      kubernetes.io/hostname: awid5

Create Egress object:

kind: Egress
metadata:
  name: egress-prod-web
spec:
  appliedTo:
    namespaceSelector:
      matchLabels:
        kubernetes.io/metadata.name: default
    podSelector:
      matchLabels:
        app: network-tools
  egressIP: 103.15.226.42
  externalIPPool: prod-external-ip-pool

Create a pod:

apiVersion: v1
kind: Pod
metadata:
  name: network-tools
  labels:
    app: network-tools
spec:
  containers:
  - name: network-multitool
    image: praqma/network-multitool:d57af61
    resources:
      limits:
        memory: "200Mi"
        cpu: "0.3"
      requests:
        memory: "100Mi"
        cpu: "0.2"

Create service object:

kind: Service
metadata:
  name: network-tools
  annotations:
    service.antrea.io/external-ip-pool: prod-external-ip-pool
spec:
  ports:
  - port: 80
    targetPort: 80
  selector:
    app: network-tools
  type: LoadBalancer
  loadBalancerIP: 103.15.226.42

Check service:

kubectl get svc
NAME            TYPE           CLUSTER-IP    EXTERNAL-IP   PORT(S)        AGE
kubernetes      ClusterIP      10.1.0.1      <none>        443/TCP        5d15h
network-tools   LoadBalancer   10.1.108.67   <pending>     80:30207/TCP   2m23s

Expected

We can use Egress and ServiceExternalIP for the same Ip at the same time.

Actual behavior

Egress and ServiceExternalIP can not works to together for the same External IP

Versions:

$ antctl version
antctlVersion: v1.5.0
controllerVersion: v1.5.0
kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3", GitCommit:"816c97ab8cff8a1c72eccca1026f7820e93e0d25", GitTreeState:"clean", BuildDate:"2022-01-25T21:24:08Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"linux/amd64"}
sudo containerd --version
containerd github.com/containerd/containerd v1.5.9 1407cab509ff0d96baa4f0eb6ff9980270e6e620
sudo uname -r
5.4.0-99-generic
@ikandars ikandars added the kind/bug Categorizes issue or PR as related to a bug. label Feb 20, 2022
@ikandars ikandars changed the title Egress and ServiceExternalIP can not works to together for the same External IP Egress and ServiceExternalIP can not works together for the same External IP Feb 20, 2022
@antoninbas
Copy link
Contributor

We can use Egress and ServiceExternalIP for the same Ip at the same time.

Can you clarify why this is the expected behavior for you?
What's the use case for having the same IP for Egress traffic and for a LoadBalancer Service?

IMO, what you are observing would be the correct behavior since you are trying to use the same IP from the same pool for 2 different things. But we should try to find a way to report an error to the user (if this is not already the case).

@ikandars
Copy link
Author

So, there is a case where a workload use both public IP for in ingress and egress. In my case, I use KubeVirt to manage Virtual Machine. Another example is, deploying smtp server in a pod, where the public IP should consistent.

So, if this behavior expected, then I should change the label to feature request then.

@jsalatiel
Copy link

This would be really great for containerized postfix.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 19, 2022
@jsalatiel
Copy link

/remove-stale

@tnqn tnqn reopened this Sep 26, 2022
@github-actions github-actions bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 27, 2022
@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 27, 2022
@jsalatiel
Copy link

/remove-stale

@github-actions github-actions bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 28, 2022
@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 28, 2023
@jsalatiel
Copy link

/remove-stale

@github-actions github-actions bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2023

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 6, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2023
@tnqn tnqn reopened this Nov 6, 2023
@tnqn tnqn removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 6, 2023
Copy link
Contributor

github-actions bot commented Feb 5, 2024

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 5, 2024
@jsalatiel
Copy link

/remove-stale

@tnqn tnqn removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 5, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 6, 2024
@tnqn tnqn added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 6, 2024
Copy link
Contributor

github-actions bot commented Aug 5, 2024

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 5, 2024
@tnqn tnqn removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 6, 2024
@antoninbas antoninbas added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

4 participants