Oc delete: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * oc =Overview= =Subcommands= ==identity== Deletes a user identity.")
 
 
(7 intermediate revisions by the same user not shown)
Line 4: Line 4:


=Overview=
=Overview=
Deletes a resource, possibly specified in YAML or JSON format in a local file.
To investigate a resource to be deleted, it may be possible to use [[oc edit]].
=Deleting with Selectors=
oc delete pod -l 'component=fluentd'
The selector syntax (-l) is similar to [[Oc_get#Selectors|oc get's]].
==Deleting Related Resources==
A common patter is to label all related objects with a common label - for example, a deployment configuration, service and route of an application, and then delete them in a single transaction, as such:
oc delete dc,route,svc -l <''common-app-labs''>l=<''app-name''>
oc delete dc,route,svc -l app=noss
Note that "dc,route,svc" argument must not contain spaces.
==Deleting All Resources Associated with a Label==
To avoid specifying the object type, the following form can be used:
oc delete all -l <''common-app-labs''>l=<''app-name''>


=Subcommands=
=Subcommands=
Line 10: Line 36:


Deletes a [[OpenShift_Security_Concepts#User_Identity|user identity]].
Deletes a [[OpenShift_Security_Concepts#User_Identity|user identity]].
oc delete identity htpasswd:user1

Latest revision as of 20:12, 9 December 2017

Internal

Overview

Deletes a resource, possibly specified in YAML or JSON format in a local file.

To investigate a resource to be deleted, it may be possible to use oc edit.

Deleting with Selectors

oc delete pod -l 'component=fluentd'

The selector syntax (-l) is similar to oc get's.

Deleting Related Resources

A common patter is to label all related objects with a common label - for example, a deployment configuration, service and route of an application, and then delete them in a single transaction, as such:

oc delete dc,route,svc -l <common-app-labs>l=<app-name>
oc delete dc,route,svc -l app=noss

Note that "dc,route,svc" argument must not contain spaces.

Deleting All Resources Associated with a Label

To avoid specifying the object type, the following form can be used:

oc delete all -l <common-app-labs>l=<app-name>

Subcommands

identity

Deletes a user identity.

oc delete identity htpasswd:user1