强制删除pod 在openshift 上失败的解决

今天运行的pod 总是失败,想把它删除,pod 删除后,又重新create.

特别说明,这个pod 是openshift 上创建新的new-app 一起创建的:

[root@test3 docker]# oc new-app nginx 
warning: Cannot find git. Ensure that it is installed and in your path. Git is required to work with git repositories.
--> Found Docker image 231d40e (4 weeks old) from Docker Hub for "nginx"

    * An image stream will be created as "nginx:latest" that will track this image
    * This image will be deployed in deployment config "nginx"
    * Port 80/tcp will be load balanced by service "nginx"
      * Other containers can access this service through the hostname "nginx"
    * WARNING: Image "nginx" runs as the 'root' user which may not be permitted by your cluster administrator

--> Creating resources ...
    imagestream "nginx" created
    deploymentconfig "nginx" created
    service "nginx" created
--> Success
    WARNING: No Docker registry has been configured with the server. Automatic builds and deployments may not function.
    Run 'oc status' to view your app.
 

2: 查看is(imagestream), dc (deployment config), svc (service) 已经都创建好拉。当然还有pod 也好了,只是pod 的状态不对,想把它delete.

但是通过强制删除: oc delete pod nginx --grace-period=0 -f  都没有效果。

后来进入openshift 的管理界面,点进去这个pod 界面,又terminate 里面,到这个pod在waiting for deployment 发指令,我想到这个pod 是有dc (deployment config) 的创建来同时完成的。

3:下面开始删除这dc:

[root@test3 cache]# oc get dc
NAME              REVISION   DESIRED   CURRENT   TRIGGERED BY
hello-openshift   1          2         2         config,image(hello-openshift:latest)
nginx             1          1         0         config,image(nginx:latest)
[root@test3 cache]# oc delete dc nginx
deploymentconfig "nginx" deleted
[root@test3 cache]# 

这个时候,openshift 的控制台看到关联的pod 也删除了。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

shenghuiping2001

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值