如何在Kubernetes本地设置上杀死Pod [英] How to kill pods on Kubernetes local setup

查看:160
本文介绍了如何在Kubernetes本地设置上杀死Pod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用Kubernetes探索可运行的Docker容器.我做了以下

I am starting exploring runnign docker containers with Kubernetes. I did the following

  1. Docker运行etcd
  2. docker run master
  3. docker运行服务代理
  4. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆