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

Possibility to handle IP address conflicts with internal OpenShift CIDR #82

Open
mirogl opened this issue Nov 25, 2021 · 5 comments
Open

Comments

@mirogl
Copy link

mirogl commented Nov 25, 2021

Hi,
we have now run into the issue, that a client ip, which accesses the keepalived ip, is in the same CIDR IP range, like the internal OpenShift CIDR and can't access the services exposed by Keepalived. Requests from other Client IP ranges, whch are not in the CIDR of the OpenShift cluster work without any problem.
Our assumption is, that the packets are dropped by the OpenShift firewall, since the rules think, the packets come from the internal CIDR as SRC.

Current situation:
Client IP (10.131.3.x)->Keepalived IP(10.25.178.x) -> OpenShift internal CIDR (10.128.0.0/14)

IPTables:
Chain OPENSHIFT-FIREWALL-FORWARD (1 references)
target prot opt source destination
DROP all -- 10.128.0.0/14 anywhere /* attempted resend after connection close / ctstate INVALID
ACCEPT all -- anywhere 10.128.0.0/14 /
forward traffic from SDN

Question:
Is the keepalived operator working in NAT mode for its ip, so the 10.25.178.x should be the src ip of the packets in the cluster or is it really the problem, that the src ip 10.131.3.x is beeing routed directly ?

Since i din't find any infos about the mode (NAT/DR) in this documentation and only found an annotation in another documentation
https://github.com/munnerz/keepalived-cloud-provider

The kube-keepalived-vip service supports both the NAT and DR methods of IPVS forwarding for the service traffic. The default forwarding method is NAT. Depending on your network topology, you may need to change that to DR (direct routing). To change this globally, you can set the environment variable KEEPALIVED_DEFAULT_FORWARD_METHOD to NAT or DR. To change it on a per service basis, then specify the method via the k8s.co/keepalived-forward-method annotation on the service as shown below:

Can you please give me the info, how the routing works and if it can be changed by a annotation ?

Thanks
Miro

@raffaelespazzoli
Copy link
Collaborator

raffaelespazzoli commented Nov 25, 2021 via email

@mirogl
Copy link
Author

mirogl commented Nov 25, 2021

Hi @raffaelespazzoli
Thanks - Is there some query, how i can read out the current active routing mode ?
Do you know, where i can find the documentation for the possible verbatim configuration. Under https://keepalived.readthedocs.io/en/latest/introduction.html I don't see any documentation.

Thanks
Miro

@raffaelespazzoli
Copy link
Collaborator

raffaelespazzoli commented Nov 25, 2021 via email

@mirogl
Copy link
Author

mirogl commented Nov 25, 2021

Hi @raffaelespazzoli
Many Thanks - than I will take a look into the documentation.
Thanks
Miro

@mirogl
Copy link
Author

mirogl commented Nov 25, 2021

Ciao @raffaelespazzoli
I checked the documentation and i have one open question - you write in your documentation:

To account for that there is a way to pass verbatim options both at the keepalived group level (which maps to the keepalived config global_defs section) and at the service level (which maps to the keepalived config vrrp_instance section).

This is clear to me. But the documentation at https://keepalived.readthedocs.io/en/latest/configuration_synopsis.html#virtual-server-definitions-synopsis has
keepalived config Global Definitions
keepalived config Virtual Server Definitions
keepalived config VRRP Instance Definitions

So from your documentation it is clear, how to modify "Global Definitions" and "VRRP Instance Definitions", but not clear, how to modify the "Virtual Server Definitions" - should i just add them after the "Global Definitions" with the instructions for modifiying "Global Definitions" ?

Also unclear:
In the /etc/keepalived/keepalived.conf i found the lb_xxx setting only in the virtual server section, for e.G.:

virtual_server 192.168.200.100 443 { delay_loop 6 lb_algo rr lb_kind NAT persistence_timeout 50 protocol TCP
but this is the default configuration for some example virtual servers - but not my IP (expected)

my configuration has only the following values and no virtual server definition, where i could add the lb_xxx values:

`global_defs {
router_id keepalivedgroup-workers

}

vrrp_instance external/external {
interface ens192

virtual_router_id 3

virtual_ipaddress {

  10.25.179.x

}

}

vrrp_instance internal/internal {
interface ens192

virtual_router_id 4

virtual_ipaddress {

  10.25.179.y

}

}
`

So I'm still not clear, where to set the lb_xxx setting, so that it is used also with my vrrp_instances. Can I just add it to global config - but in the documentation it is not a valid key / value for global configuration, only for virtual server.

Thanks
Miro

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

No branches or pull requests

2 participants