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

kubelet-service.ps1 fails to discover the network interface #5231

Open
craigminihan opened this issue Apr 20, 2021 · 3 comments
Open

kubelet-service.ps1 fails to discover the network interface #5231

craigminihan opened this issue Apr 20, 2021 · 3 comments

Comments

@craigminihan
Copy link

Expected Behavior

The script should discover the NodeIp when a matching network adapter is found.

Current Behavior

Rather than finding the NodeIp it loops forever.

PS C:\CalicoWindows\kubernetes> .\kubelet-service.ps1
Running kubelet service.
Using configured nodename: hvk8s-node9 DNS: 10.96.0.10
Auto-detecting node IP, looking for interface named 'vEthernet (Ethernet...'.
Waiting for interface named 'vEthernet (Ethernet...'.
Waiting for interface named 'vEthernet (Ethernet...'.
Waiting for interface named 'vEthernet (Ethernet...'.
Waiting for interface named 'vEthernet (Ethernet...'.
Waiting for interface named 'vEthernet (Ethernet...'.
Waiting for interface named 'vEthernet (Ethernet...'.
Waiting for interface named 'vEthernet (Ethernet...'.
Waiting for interface named 'vEthernet (Ethernet...'.
Waiting for interface named 'vEthernet (Ethernet...'.
Waiting for interface named 'vEthernet (Ethernet...'.

The network is configured as:

PS C:\CalicoWindows\kubernetes> ipconfig

Windows IP Configuration
Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . : hvk8s.local
   Link-local IPv6 Address . . . . . : fe80::9d78:7b20:7abd:c4a2%3
   IPv4 Address. . . . . . . . . . . : 172.31.0.19
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 172.31.0.1

Ethernet adapter vEthernet (nat):
   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::c99c:4b74:2101:612c%12
   IPv4 Address. . . . . . . . . . . : 172.23.160.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :

Possible Solution

The NodeIp parameter is defined (see https://github.com/projectcalico/node/blob/b210fcb832a0b6931e73fc6f88dc9ee9272cead4/windows-packaging/CalicoWindows/kubernetes/kubelet-service.ps1#L16) but isn't used in the script apart from initialization at https://github.com/projectcalico/node/blob/b210fcb832a0b6931e73fc6f88dc9ee9272cead4/windows-packaging/CalicoWindows/kubernetes/kubelet-service.ps1#L34 which doesn't look like the original intent.

When the parameter is provided the discovery logic should be skipped (i.e. .\kubelet-service.ps1 -NodeIp 172.31.0.19 ). This should preserve existing behaviour and allow me to complete the Calico install. I can test and PR if that is useful.

Steps to Reproduce (for bugs)

See above.

Context

I'm running Windows 10 with Hyper-V and a custom Hyper-V switch (shows as hvk8s.local). The Linux control plane and node are functional at 172.31.0.10 and 172.31.0.11, see:

PS C:\Users\Craig> kubectl get no -o wide
NAME           STATUS   ROLES                  AGE    VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE                       KERNEL-VERSION    CONTAINER-RUNTIME
hvk8s-master   Ready    control-plane,master   114m   v1.20.5   172.31.0.10   <none>        Debian GNU/Linux 10 (buster)   4.19.0-16-amd64   docker://19.3.15
hvk8s-node1    Ready    <none>                 114m   v1.20.5   172.31.0.11   <none>        Debian GNU/Linux 10 (buster)   4.19.0-16-amd64   docker://19.3.15

The un-joined Windows Server Core 20H2 node is on the Hyper-V virtual network at 172.31.0.19.

Your Environment

@song-jiang
Copy link
Member

@craigminihan Thanks for details. Yeah, the logic of how NodeIP parameter is handled can be improved.

When the parameter is provided the discovery logic should be skipped

Agree. Could you help to submit a PR?

@caseydavenport caseydavenport transferred this issue from projectcalico/node Dec 15, 2021
@bangzhuzhu
Copy link

is there any update?

@bangzhuzhu
Copy link

@craigminihan do you know how to bypass this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants