cue.dev/x/k8s.io@v0.7.0

api/resource/v1alpha3/schema.cue raw

  1package v1alpha3
  2
  3import "cue.dev/x/k8s.io/apimachinery/pkg/apis/meta/v1"
  4
  5// The device this taint is attached to has the "effect" on any
  6// claim which does not tolerate the taint and, through the
  7// claim, to pods using the claim.
  8#DeviceTaint: {
  9	// The effect of the taint on claims that do not tolerate the
 10	// taint and through such claims on the pods using them.
 11	//
 12	// Valid effects are None, NoSchedule and NoExecute.
 13	// PreferNoSchedule as used for nodes is not valid here. More
 14	// effects may get added in the future. Consumers must treat
 15	// unknown effects like None.
 16	"effect"!: string
 17
 18	// The taint key to be applied to a device. Must be a label name.
 19	"key"!: string
 20
 21	// TimeAdded represents the time at which the taint was added.
 22	// Added automatically during create or update if not set.
 23	"timeAdded"?: v1.#Time
 24
 25	// The taint value corresponding to the taint key. Must be a label
 26	// value.
 27	"value"?: string
 28}
 29
 30// DeviceTaintRule adds one taint to all devices which match the
 31// selector. This has the same effect as if the taint was
 32// specified directly in the ResourceSlice by the DRA driver.
 33#DeviceTaintRule: {
 34	// APIVersion defines the versioned schema of this representation
 35	// of an object. Servers should convert recognized schemas to the
 36	// latest internal value, and may reject unrecognized values.
 37	// More info:
 38	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
 39	"apiVersion": "resource.k8s.io/v1alpha3"
 40
 41	// Kind is a string value representing the REST resource this
 42	// object represents. Servers may infer this from the endpoint
 43	// the client submits requests to. Cannot be updated. In
 44	// CamelCase. More info:
 45	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
 46	"kind": "DeviceTaintRule"
 47
 48	// Standard object metadata
 49	"metadata"?: v1.#ObjectMeta
 50
 51	// Spec specifies the selector and one taint.
 52	//
 53	// Changing the spec automatically increments the
 54	// metadata.generation number.
 55	"spec"!: #DeviceTaintRuleSpec
 56
 57	// Status provides information about what was requested in the
 58	// spec.
 59	"status"?: #DeviceTaintRuleStatus
 60}
 61
 62// DeviceTaintRuleList is a collection of DeviceTaintRules.
 63#DeviceTaintRuleList: {
 64	// APIVersion defines the versioned schema of this representation
 65	// of an object. Servers should convert recognized schemas to the
 66	// latest internal value, and may reject unrecognized values.
 67	// More info:
 68	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
 69	"apiVersion": "resource.k8s.io/v1alpha3"
 70
 71	// Items is the list of DeviceTaintRules.
 72	"items"!: [...#DeviceTaintRule]
 73
 74	// Kind is a string value representing the REST resource this
 75	// object represents. Servers may infer this from the endpoint
 76	// the client submits requests to. Cannot be updated. In
 77	// CamelCase. More info:
 78	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
 79	"kind": "DeviceTaintRuleList"
 80
 81	// Standard list metadata
 82	"metadata"?: v1.#ListMeta
 83}
 84
 85// DeviceTaintRuleSpec specifies the selector and one taint.
 86#DeviceTaintRuleSpec: {
 87	// DeviceSelector defines which device(s) the taint is applied to.
 88	// All selector criteria must be satisfied for a device to match.
 89	// The empty selector matches all devices. Without a selector, no
 90	// devices are matches.
 91	"deviceSelector"?: #DeviceTaintSelector
 92
 93	// The taint that gets applied to matching devices.
 94	"taint"!: #DeviceTaint
 95}
 96
 97// DeviceTaintRuleStatus provides information about an on-going
 98// pod eviction.
 99#DeviceTaintRuleStatus: {
100	// Conditions provide information about the state of the
101	// DeviceTaintRule and the cluster at some point in time, in a
102	// machine-readable and human-readable format.
103	//
104	// The following condition is currently defined as part of this
105	// API, more may get added: - Type: EvictionInProgress - Status:
106	// True if there are currently pods which need to be evicted,
107	// False otherwise
108	// (includes the effects which don't cause eviction).
109	// - Reason: not specified, may change - Message: includes
110	// information about number of pending pods and already evicted
111	// pods
112	// in a human-readable format, updated periodically, may change
113	//
114	// For `effect: None`, the condition above gets set once for each
115	// change to the spec, with the message containing information
116	// about what would happen if the effect was `NoExecute`. This
117	// feedback can be used to decide whether changing the effect to
118	// `NoExecute` will work as intended. It only gets set once to
119	// avoid having to constantly update the status.
120	//
121	// Must have 8 or fewer entries.
122	"conditions"?: [...v1.#Condition]
123}
124
125// DeviceTaintSelector defines which device(s) a DeviceTaintRule
126// applies to. The empty selector matches all devices. Without a
127// selector, no devices are matched.
128#DeviceTaintSelector: {
129	// If device is set, only devices with that name are selected.
130	// This field corresponds to slice.spec.devices[].name.
131	//
132	// Setting also driver and pool may be required to avoid
133	// ambiguity, but is not required.
134	"device"?: string
135
136	// If driver is set, only devices from that driver are selected.
137	// This fields corresponds to slice.spec.driver.
138	"driver"?: string
139
140	// If pool is set, only devices in that pool are selected.
141	//
142	// Also setting the driver name may be useful to avoid ambiguity
143	// when different drivers use the same pool name, but this is not
144	// required because selecting pools from different drivers may
145	// also be useful, for example when drivers with node-local
146	// devices use the node name as their pool name.
147	"pool"?: string
148}