admin管理员组

文章数量:1123925

In a Dev OpenShift sandbox I have the following kubernetes resources:

NAME READY STATUS RESTARTS AGE pod/workspace036c85e5c44e4207-697d66f7c4-jbwcp 2/2 Running 0 20m

NAME                                        TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                               AGE
service/modelmesh-serving                   ClusterIP   None            <none>        8033/TCP,8008/TCP,8443/TCP,2112/TCP   17s
service/workspace036c85e5c44e4207-service   ClusterIP   172.30.250.95   <none>        4444/TCP                              2m40s

NAME                                        READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/workspace036c85e5c44e4207   1/1     1            1           20m

NAME                                                   DESIRED   CURRENT   READY   AGE
replicaset.apps/workspace036c85e5c44e4207-697d66f7c4   1         1         1       20m

When I try to delete the deployment using the following command

kubectl delete deployment workspace036c85e5c44e4207

the deployment gets recreated. How can I delete a deployment that has a Recreate update strategy?

In a Dev OpenShift sandbox I have the following kubernetes resources:

NAME READY STATUS RESTARTS AGE pod/workspace036c85e5c44e4207-697d66f7c4-jbwcp 2/2 Running 0 20m

NAME                                        TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                               AGE
service/modelmesh-serving                   ClusterIP   None            <none>        8033/TCP,8008/TCP,8443/TCP,2112/TCP   17s
service/workspace036c85e5c44e4207-service   ClusterIP   172.30.250.95   <none>        4444/TCP                              2m40s

NAME                                        READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/workspace036c85e5c44e4207   1/1     1            1           20m

NAME                                                   DESIRED   CURRENT   READY   AGE
replicaset.apps/workspace036c85e5c44e4207-697d66f7c4   1         1         1       20m

When I try to delete the deployment using the following command

kubectl delete deployment workspace036c85e5c44e4207

the deployment gets recreated. How can I delete a deployment that has a Recreate update strategy?

Share Improve this question edited 21 hours ago Broken_Window 2,0933 gold badges23 silver badges47 bronze badges asked yesterday Mohammad JumahMohammad Jumah 11 bronze badge New contributor Mohammad Jumah is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Add a comment  | 

1 Answer 1

Reset to default 0

Please check the devworkspace first

$ oc get devworkspace

If found, delete the DevWorkspace resource instead of the deployment directly

$ oc delete devworkspace <workspace-name>

Please check the potential parent resources

$ oc get all -l component=workspace036c85e5c44e4207

Also, please share the below files further discussion

$ oc get deployment workspace036c85e5c44e4207 -o yaml | grep -A 5 ownerReferences
$ oc get events --sort-by='.lastTimestamp' | grep workspace036c85e5c44e4207

Dr Vivek Yoganand, #openshift +9197864365245

本文标签: kubectlDeleting an OpenShift deployment with a Recreate Update strategyStack Overflow