Error running PrepareNode.ps1
Hello Running script using ContainerD as CRI, fails with the error below (c:\PrepareNode.ps1 -KubernetesVersion v1.25.2 -ContainerRuntime ContainerD). Where to find missing functions? Thanks
Daniele
C:\PrepareNode.ps1 : The term 'Get-HNSNetwork' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ c:\PrepareNode.ps1 -KubernetesVersion v1.25.2 -ContainerRuntime Conta ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-HNSNetwork:String) [PrepareNode.ps1], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,PrepareNode.ps1
- Calico version 3.24
- Orchestrator version: kubernetes 1.25.2
- Windows Server Standard 2022/2019
Hi @danielescattaglia, could you share some more details on your setup? Are you running on AWS and using "Powershell for AWS" by any chance? (long shot I know, but this is what I could find by googling around)
Hello. No, I'm running on vSphere's VM in my server farm. No cloud providers involved. Windows image has been downloaded from Microsoft. Thanks
Daniele
@coutinhop do we need more information?
The Get-HNSNetwork function comes from hns.psm1, imported here: https://github.com/projectcalico/calico/blob/release-v3.24/calico/scripts/PrepareNode.ps1#L81 and downloaded from https://raw.githubusercontent.com/Microsoft/SDN/master/Kubernetes/windows/hns.psm1. By any chance do you see any errors regarding that?
Though, on a side note, these scripts (PrepareNode.ps1 and Install-Containerd.ps1 are now maintained by sig-windows and I don't see that command in the current version: https://github.com/kubernetes-sigs/sig-windows-tools/blob/master/hostprocess/PrepareNode.ps1
Could you try the updated scripts?