今天运行的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 也删除了。