Kubernetes 库伯内特斯——”;“kubectl”;从PowerShell在Windows上安装失败
从文档来看,windows上的安装应该非常简单,但我的安装在第二步失败Kubernetes 库伯内特斯——”;“kubectl”;从PowerShell在Windows上安装失败,kubernetes,kubectl,Kubernetes,Kubectl,从文档来看,windows上的安装应该非常简单,但我的安装在第二步失败 Install-Script -Name 'install-kubectl' -Scope CurrentUser -Force install-kubectl.ps1 [-DownloadLocation <path>] install-kubectl.ps1 c:\kubectl ==>Getting download link from https://kubernetes.io/docs/ta
Install-Script -Name 'install-kubectl' -Scope CurrentUser -Force
install-kubectl.ps1 [-DownloadLocation <path>]
install-kubectl.ps1 c:\kubectl
==>Getting download link from https://kubernetes.io/docs/tasks/tools/install-kubectl/
Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send.
At C:\Program Files\PowerShell\Scripts\install-kubectl.ps1:31 char:8
+ $req = Invoke-WebRequest -UseBasicParsing -Uri $uri
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
如评论中所述:
您可以从下载
kubectl.exe
,然后将路径kubectl.exe
添加到环境变量中。对我来说效果很好。。您可以从这里下载kubectl.exe
-https://dl.k8s.io/release/v1.20.0/bin/windows/amd64/kubectl.exe
然后将路径kubectl.exe添加到环境变量shi Amit中,您可以将其作为答案发布。谢谢
PS C:\Users\e561> Test-NetConnection -ComputerName "kubernetes.io" -Port 443
ComputerName : kubernetes.io
RemoteAddress : 147.75.40.148
RemotePort : 443
InterfaceAlias : Ethernet 2
SourceAddress : 10.7.147.211
TcpTestSucceeded : True