Lut*_*her 4 deployment image azure kubernetes kubectl
我在 azure 中运行 kubernetes。我想使用 AZ AKS 或 kubectl 删除特定部署。
我找到的唯一信息是如何删除 pod,但这不是我要找的,因为 pod 会在删除后重新生成。
我知道我只能去 ui 并删除部署,但我想用 az aks 或 kubectl 来做。
我跑了
kubectl get all -A
Run Code Online (Sandbox Code Playgroud)
然后我复制要删除的部署的名称并运行:
kubectl delete deployment zr-binanceloggercandlestick-btcusdt-2hour
kubectl delete deployment deployment.apps/zr-binanceloggercandlestick-btcusdt-12hour
Run Code Online (Sandbox Code Playgroud)
但注意到没有成功,我收到这些错误:
Error from server (NotFound): deployments.extensions "zr-binanceloggercandlestick-btcusdt-2hour" not found
error: there is no need to specify a resource type as a separate argument when passing arguments in resource/name form (e.g. 'C:\Users\amnesia\.azure-kubectl\kubectl.exe get resource/<resource_name>' instead of 'C:\Users\amnesia\.azure-kubectl\kubectl.exe get resource resource/<resource_name>'
Run Code Online (Sandbox Code Playgroud)
Arg*_*dhu 21
找出所有命名空间中的所有部署
kubectl get deploy -A
Run Code Online (Sandbox Code Playgroud)
然后从命名空间中删除带有 deploymentname 的部署。部署名称可以从上面的命令中找到。
kubectl delete deploy deploymentname -n namespacename
Run Code Online (Sandbox Code Playgroud)
有关如何配置 kubectl 以连接到 AKS 的文档。
归档时间: |
|
查看次数: |
13348 次 |
最近记录: |