Quantcast
Channel: 不自量力 の Weithenn
Viewing all articles
Browse latest Browse all 598

The term kubectl is not recognized as the name of a cmdlet | AKS

$
0
0

 



Question: The term kubectl is not recognized as the name of a cmdlet

在 Windows Server 2022 建立 AKSEE (Azure Kubernetes Service Edge Essentials)環境後,嘗試執行 kubectl get nodes -o wide指令時,系統卻顯示 The term kubectl is not recognized as the name of a cmdlet訊息,表示找不到 kubectl 指令?






Answer:

簡單來說,kubectl 指令沒有加入到系統環境變數中,或因為什麼緣故被拿掉後沒有加回去。所以,只要把 kubectl 指令路徑加回系統環境變數中即可。

方法 1,直接使用 PowerShell 指令的方式,將 kubectl 指令路徑加回系統環境變數中。首先,執行「$Env:Path += ";C:\Program Files\AksEdge\kubectl\"」指令,接著執行「Get-ChildItem Env: | Where-Object {$_.name -eq "Path"} | Format-Table -Wrap」指令進行確認。


方法 2,使用 GUI 圖形操作的方式,將 kubectl 指令路徑加回系統環境變數中。


現在,應該可以順利執行 kubectl get nodes -o wide 指令。



Viewing all articles
Browse latest Browse all 598

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>