Open
Description
For example namespaceSelector
contains a lot of
, but there are other html tags in our documentation.
~ kubectl explain cap.spec.namespaceSelector
GROUP: policies.kubewarden.io
KIND: ClusterAdmissionPolicy
VERSION: v1
FIELD: namespaceSelector <Object>
DESCRIPTION:
NamespaceSelector decides whether to run the webhook on an object based
on whether the namespace for that object matches the selector. If the
object itself is a namespace, the matching is performed on
object.metadata.labels. If the object is another cluster scoped resource,
it never skips the webhook.
<br/><br/>
For example, to run the webhook on any objects whose namespace is not
associated with "runlevel" of "0" or "1"; you will set the selector as
follows:
<pre>
"namespaceSelector": \{<br/>
"matchExpressions": [<br/>
\{<br/>
"key": "runlevel",<br/>
"operator": "NotIn",<br/>
"values": [<br/>
"0",<br/>
"1"<br/>
]<br/>
\}<br/>
]<br/>
\}
</pre>
If instead you want to only run the webhook on any objects whose
namespace is associated with the "environment" of "prod" or "staging";
you will set the selector as follows:
<pre>
"namespaceSelector": \{<br/>
"matchExpressions": [<br/>
\{<br/>
"key": "environment",<br/>
"operator": "In",<br/>
"values": [<br/>
"prod",<br/>
"staging"<br/>
]<br/>
\}<br/>
]<br/>
\}
</pre>
See
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
for more examples of label selectors.
<br/><br/>
Default to the empty LabelSelector, which matches everything.
FIELDS:
matchExpressions <[]Object>
matchExpressions is a list of label selector requirements. The requirements
are ANDed.
matchLabels <map[string]string>
matchLabels is a map of {key,value} pairs. A single {key,value} in the
matchLabels
map is equivalent to an element of matchExpressions, whose key field is
"key", the
operator is "In", and the values array contains only "value". The
requirements are ANDed.
Metadata
Metadata
Assignees
Type
Projects
Status