Kubernetes VMs gets wrong interface address host unreachable
Syntax3rror404 opened this issue · 2 comments
I want to mange my kuberentes farm with awx to run updates etc
The problem is that the script use the cluster internal interfaces to get the address instead of get the interface from the host machine itself.
In my case the script get the ip from cilium host interface instead of enp6s18
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp6s18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 26:64:e7:bb:b4:09 brd ff:ff:ff:ff:ff:ff
inet 192.168.35.151/24 brd 192.168.35.255 scope global dynamic noprefixroute enp6s18
valid_lft 4323sec preferred_lft 4323sec
inet6 fe80::2464:e7ff:febb:b409/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: cilium_net@cilium_host: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether fa:27:76:c1:df:09 brd ff:ff:ff:ff:ff:ff
inet6 fe80::f827:76ff:fec1:df09/64 scope link
valid_lft forever preferred_lft forever
4: cilium_host@cilium_net: <BROADCAST,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 0e:0e:0f:1e:f5:6b brd ff:ff:ff:ff:ff:ff
inet 10.0.1.142/32 scope global cilium_host
valid_lft forever preferred_lft forever
inet6 fe80::c0e:fff:fe1e:f56b/64 scope link
valid_lft forever preferred_lft forever
5: cilium_vxlan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
link/ether ea:c0:d4:a7:b9:d9 brd ff:ff:ff:ff:ff:ff
inet6 fe80::e8c0:d4ff:fea7:b9d9/64 scope link
valid_lft forever preferred_lft forever
7: lxc_health@if6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether a2:94:1f:54:f5:c9 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::a094:1fff:fe54:f5c9/64 scope link
valid_lft forever preferred_lft forever
9: lxc7de01107cb8e@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 4e:a6:1d:e3:7f:e5 brd ff:ff:ff:ff:ff:ff link-netns cni-7d8bf335-1848-df62-7b99-b65e95d27ae7
inet6 fe80::4ca6:1dff:fee3:7fe5/64 scope link
valid_lft forever preferred_lft forever
11: lxc1d4511e0a59b@if10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether c2:b4:ee:bf:1f:b3 brd ff:ff:ff:ff:ff:ff link-netns cni-1bf3e96a-1311-8608-feb0-04bed94df987
inet6 fe80::c0b4:eeff:febf:1fb3/64 scope link
valid_lft forever preferred_lft forever
13: lxcaccf375d0ffd@if12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 9e:75:2d:25:1e:8a brd ff:ff:ff:ff:ff:ff link-netns cni-f3c61a9c-604d-10b3-cdae-62bfdebb40b7
inet6 fe80::9c75:2dff:fe25:1e8a/64 scope link
valid_lft forever preferred_lft forever
15: lxc5e722163217a@if14: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 66:5a:4f:40:fb:57 brd ff:ff:ff:ff:ff:ff link-netns cni-66a9058b-b3fc-a97d-ce89-68e0c41021f3
inet6 fe80::645a:4fff:fe40:fb57/64 scope link
valid_lft forever preferred_lft forever
25: lxc34a49c7a5dd9@if24: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 12:22:fb:2f:6a:b5 brd ff:ff:ff:ff:ff:ff link-netns cni-bd06f607-167a-2de3-e00f-3620401ce6fe
inet6 fe80::1022:fbff:fe2f:6ab5/64 scope link
valid_lft forever preferred_lft forever
29: lxcaa90c05e1679@if28: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 76:a3:11:3d:37:51 brd ff:ff:ff:ff:ff:ff link-netns cni-33933d1f-a2f0-5836-65d8-f89f76584143
inet6 fe80::74a3:11ff:fe3d:3751/64 scope link
valid_lft forever preferred_lft forever
When using "Source variables" in AWX to pass things by environment variables, it doesn't follow the pattern of most other vars (i.e. url
is PROXMOX_URL
), but instead of PROXMOX_INCLUDE
and PROXMOX_EXCLUDE
is INCLUDE_FILTER
and EXCLUDE_FILTER
- I had to go peek at the source code to figure out why it wasn't doing anything different when I tried setting them. Note that the README currently says instead to use EXCLUDE_LIST
... ?
However, using the "correct" (from source) variable names, it doesn't seem to quite work as desired?
Using EXCLUDE_FILTER
, I end up with no addresses being returned, and INCLUDE_FILTER
doesn't seem to do anything (same results as not using either). Also, from looking at the code, doesn't appear that splitting these variables by ;
actually happens despite it being indicated that you can do that with the misnamed EXCLUDE_LIST
?
I've tried various permutations:
EXCLUDE_FILTER
: 'docker.*;br.*;veth.*'
, 'veth.*'
, '^veth.*'
, etc
INCLUDE_FILTER
: 'eth.*;ens.*'
, '^eth.*;^ens.*'
, 'eth0'
, etc
This is on the latest commit 4bc5bda
(as AWX is pulling the repo directly from github). I haven't tried it with a proxmox.json
because then I would need to fork the repo and put credentials into the repo, since with Ansible AWX I can't just drop a file in (everything must come from repos or such - technically we could create an archive someplace with the json embedded, and then have AWX pull that archive from wherever we put it, but then we have to do it all over again if there's an update to the project...)
So it feels like there's two issues:
- When passing multiple include/exclude filters by environment variable, there's no splitting on
;
despite the README saying so. - The actual inclusion/exclusion doesn't seem to work as expected, even when passing a single regex (to avoid the above issue)