Giter Site home page Giter Site logo

Comments (1)

gulecroc avatar gulecroc commented on June 16, 2024

Workaround :

I create a fake service so kube-vip can update iptables with IP and port SNAT :

---
apiVersion: v1
kind: Service
metadata:
  annotations:
    kube-vip.io/egress: "true"
    kube-vip.io/egress-destination-ports: tcp:389
  name: kube-vip-egress-service-fake
  namespace: my-namespace
spec:
  externalTrafficPolicy: Local
  ports:
    - name: kube-vip-egress-service-fake
      port: 1234
  type: LoadBalancer
  loadBalancerIP: 4.5.6.7
  selector:
    app.kubernetes.io/instance: my-instance

the iptables is correctly updated :

guillaume.lecroc@lab-k8s-demo5:~$ sudo iptables-legacy -t nat -L POSTROUTING
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
SNAT       tcp  --  10.42.4.83           anywhere             mark match 0x40/0x40 tcp dpt:ldap /* a3ViZS12aXAK=kube-vip-pod-name */ to:4.5.6.7

then I create the original service and endpoint :

---
apiVersion: v1
kind: Endpoints
metadata:
  name: my-service
  namespace: my-namespace
subsets:
  - addresses:
      - ip: 1.2.3.4
    ports:
      - name: ldap
        port: 389
        protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
  annotations:
  name: my-service
  namespace: my-namespace
spec:
  ports:
    - name: service-port-name
      port: 1234
      protocol: TCP
      targetPort: 1234

And it works as expected.

So the question is : why kube-vip with egress need service selector to the load-balancer ip ?

from kube-vip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.