Skip to content

Conversation

@MrFreezeex
Copy link
Contributor

Add a --service-cidr argument and ignore deletion of IPVS rules not in the service cidr.

Fixes #829

@murali-reddy
Copy link
Member

thanks @MrFreezeex for the PR

I think we will still have problem with service external IP. If some one deploys a service with external IP defined then an IPVS service and endpoints are created in the IPVS. At later point if external IP is removed from the service definition we will still endup having stale ipvs entries

@MrFreezeex
Copy link
Contributor Author

Indeed, this is quite problematic...

After studying the implementation of ipvs in kube-proxy, It appears that they are using an array of excluded CIDR (see https://github.com/kubernetes/kubernetes/blob/f4db8212be53c69a27d893d6a4111422fbce8008/pkg/proxy/ipvs/proxier.go#L2039).

I will rewrite my PR to implement the same kind of behavior, this should do the job.

@murali-reddy
Copy link
Member

array of exclude CIDR sounds good to me.

@MrFreezeex MrFreezeex force-pushed the ignore-ipvs-deletion branch from 2ae22a7 to 0b5afca Compare January 15, 2020 19:10
@MrFreezeex
Copy link
Contributor Author

I changed my code to have an array of excluded cidrs.
Let me know if further changes are needed.

@murali-reddy
Copy link
Member

LGTM

@murali-reddy
Copy link
Member

@MrFreezeex sorry after i approved the PR. There are some conflicts to merge the PR. Can you please rebase. Sorry about that. I would to push this PR in coming release.

* add a --excluded-cidrs
* ignore deletion of ipvs rules with address in excluded cidrs

Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>
@MrFreezeex
Copy link
Contributor Author

I have rebased my PR.

@murali-reddy murali-reddy merged commit 97c682e into cloudnativelabs:master Feb 16, 2020
@murali-reddy
Copy link
Member

thanks @MrFreezeex

mk01 pushed a commit to mk01/kube-router-ipv6 that referenced this pull request Mar 12, 2020
* add a --excluded-cidrs
* ignore deletion of ipvs rules with address in excluded cidrs

Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>
(cherry picked from commit 97c682e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid removal of IPVS rules not related to kubernetes services

2 participants