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

install-calico-windows.ps1 EnableWinDsrForEKS checks do not work #5774

Closed
dropdeadfu opened this issue Mar 18, 2022 · 2 comments · Fixed by #5903
Closed

install-calico-windows.ps1 EnableWinDsrForEKS checks do not work #5774

dropdeadfu opened this issue Mar 18, 2022 · 2 comments · Fixed by #5903

Comments

@dropdeadfu
Copy link

Since the last patch of the install script which fixed the argument-list syntax issue
#5570
the check if the OS supports DSR also got changed.

Before the change it was:
$OSInfo = (Get-ComputerInfo | select WindowsVersion, OsBuildNumber)
$PlatformSupportDSR = (($OSInfo.WindowsVersion -as [int]) -GE 1903 -And ($OSInfo.OsBuildNumber -as [int]) -GE 18317)
if (-Not $PlatformSupportDSR) {
Write-Host "WinDsr is not supported ($OSInfo)"
return
}
After the change it is:
$OSInfo = (Get-ComputerInfo | select WindowsVersion, OsBuildNumber)
$supportsDSR = Get-IsDSRSupported
if (-Not $supportsDSR) {
Write-Host "WinDsr is not supported ($OSInfo)"
return
}

However, "Get-IsDSRSupported" does not seem to be a valid command, at least not on a freshly installed windows node which in turn leaves renders kube-proxy on newly installed nodes almost useless (due to pods being not able to connect to services, only pods directly).

Expected Behavior

The check of DSR is supported should either be reverted or be replaced with another general function that actually works.

Current Behavior

Current check does not work

Possible Solution

Revert to previous check

Steps to Reproduce (for bugs)

Execute install-calico-windows.ps1 on a fresh windows node on EKS

Context

Without DSR enabled the pods can not access services, only pod-to-pod networking is working.

Also I extended my patch that I used while the previous fix was being reviewed to address this issue:
https://github.com/Germanedge/eks-kube-proxy-windows-patch/blob/master/eks-calico-patch.ps1

Your Environment

  • Calico version
  • Orchestrator version (e.g. kubernetes, mesos, rkt):
  • Operating System and version:
  • Link to your project (optional):
@FischlerA
Copy link

FischlerA commented Mar 18, 2022

I think the correct query to check for DSR support should be this:

# Determine the windows version and build number for DSR support.
# OsHardwareAbstractionLayer is a version string like 10.0.17763.1432
$OSInfo = (Get-ComputerInfo  | select WindowsVersion, OsBuildNumber, OsHardwareAbstractionLayer)

# Windows supports DSR if
# - it is 1809 build 1432
# - it is 1903 or later
$min1809BuildSupportingDSR = (($OSInfo.OsHardwareAbstractionLayer.Split(".") | select-object -Last 1) -as [int]) -GE 1432
$windows1809 = (($OSInfo.WindowsVersion -as [int]) -EQ 1809 -And ($OSInfo.OsBuildNumber -as [int]) -GE 17763)
$windows1903OrNewer = (($OSInfo.WindowsVersion -as [int]) -GE 1903 -And ($OSInfo.OsBuildNumber -as [int]) -GE 18317)

$PlatformSupportDSR = ($windows1809 -And $min1809BuildSupportingDSR) -Or $windows1903OrNewer

Taken from here:
c100950#diff-ffb53e52132618f5318f780f7e499350e96dbbc75991e03b36421ebf1dd5d531

@lmm
Copy link
Contributor

lmm commented Mar 21, 2022

Thanks for reporting this @dropdeadfu (and providing a workaround). The change I added to update the DSR checks uses a function that is defined in calico.psm1. The bug is that we're not importing that file.

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

Successfully merging a pull request may close this issue.

3 participants