Comments (1)
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)
- Kube-VIP does not recover after network outages
- Report the use of components with vulnerabilities in kube-vip
- DHCP for control plane VIP fails: got an error while the discovery request: no matching response packet received
- [Question / Bug] kube-vip keeps assigning used IP to LoadBalancer HOT 4
- [LoadBalancerClass] Better defaulting for Service objects
- Default value of vip_cidr HOT 2
- Using TCP/UDP on the same port, same service and IP HOT 9
- nodelabel is not applied after a leader change HOT 1
- [Quetion] Is CP load balance supported for BGP mode?
- Egress pod startup delay HOT 1
- Multiple interfaces with kube-vip
- [Bug or Feature?] kube-vip drops VIP when kube-apiserver unreachable. HOT 1
- How to set vip for pods with hostNetwork
- Consistent DHCP renew failure analysis HOT 6
- CrashLoopBackOff Error in kube-vip Daemonset Due to Missing iptables Executable with --lbForwardingMethod masquerade
- kube-vip does not re-add control plane IP to IPVS when kube-apiserver becomes reachable
- Generated manifest contain "status", leading to errors in ArgoCD HOT 1
- Load balancing load balancer when using ARP mode seems to be not working
- kube-vip on ubuntu 22 Leaderelection lost. HOT 3
- svc_election=true will cause load balancers with the same IP to appear on different servers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kube-vip.