Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubernetes 库伯内特斯——”;“kubectl”;从PowerShell在Windows上安装失败_Kubernetes_Kubectl - Fatal编程技术网

Kubernetes 库伯内特斯——”;“kubectl”;从PowerShell在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

从文档来看,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/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