如何在Kubernetes本地设置上杀死Pod [英] How to kill pods on Kubernetes local setup
问题描述
我开始使用Kubernetes探索可运行的Docker容器.我做了以下
I am starting exploring runnign docker containers with Kubernetes. I did the following
- Docker运行etcd
- docker run master
- docker运行服务代理
- kubectl运行web --image = nginx
要清理状态,我首先停止了所有容器并清除了下载的图像.但是我仍然看到豆荚在运转.
To cleanup the state, I first stopped all the containers and cleared the downloaded images. However I still see pods running.
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
web-3476088249-w66jr 1/1 Running 0 16m
我如何删除它?
推荐答案
要删除广告连播,
kubectl delete pods web-3476088249-w66jr
如果此Pod是通过某些plicateSet或部署或正在创建副本的任何东西启动的,则找到它并首先将其删除.
If this pod is started via some replicaSet or deployment or anything that is creating replicas then find that and delete that first.
kubectl get all
这将列出在您的k8s集群中创建的所有资源.要获取有关在名称空间kubectl get all --namespace=<your_namespace>
This will list all the resources that have been created in your k8s cluster. To get information with respect to resources created in your namespace kubectl get all --namespace=<your_namespace>
要获取有关控制此pod的资源的信息,您可以
To get info about the resource that is controlling this pod, you can do
kubectl describe web-3476088249-w66jr
会有一个控制者"字段,或者是一个所有者字段,您可以使用它来标识创建该资源的资源.
There will be a field "Controlled By", or some owner field using which you can identify which resource created it.
这篇关于如何在Kubernetes本地设置上杀死Pod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!