metacontroller
metacontroller copied to clipboard
Allow selecting DecoratorController objects by field selector
DecoratorController can already select objects by label selector and annotation selector. It would be convenient to select objects by field value as well.
An example is the schedulerName
field allowing a Pod
resource to specify an alternate scheduler for itself. Here's a DecoratorController that acts only on Pods specifying the foo
scheduler:
apiVersion: metacontroller.k8s.io/v1alpha1
kind: DecoratorController
metadata:
name: foo-pods
spec:
resources:
- apiVersion: v1
resource: pods
fieldSelector:
matchExpressions:
- {key: spec.schedulerName, operator: In, values: [foo]}
Oooh I like that!