MachineDrainRule [cluster.x-k8s.io/v1beta1]
- Description
- MachineDrainRule is the Schema for the MachineDrainRule API.
- Type
object- Required
metadataspec
Specification
.spec
- Description
- spec defines the spec of a MachineDrainRule.
- Type
object- Required
drain
.spec.drain
- Description
- drain configures if and how Pods are drained.
- Type
object- Required
behavior
.spec.machines
- Description
- machines defines to which Machines this MachineDrainRule should be applied. If machines is not set, the MachineDrainRule applies to all Machines in the Namespace. If machines contains multiple selectors, the results are ORed. Within a single Machine selector the results of selector and clusterSelector are ANDed. Machines will be selected from all Clusters in the Namespace unless otherwise restricted with the clusterSelector. Example: Selects control plane Machines in all Clusters or Machines with label "os" == "linux" in Clusters with label "stage" == "production". - selector: matchExpressions: - key: cluster.x-k8s.io/control-plane operator: Exists - selector: matchLabels: os: linux clusterSelector: matchExpressions: - key: stage operator: In values: - production
- Type
array
.spec.machines[]
- Description
- MachineDrainRuleMachineSelector defines to which Machines this MachineDrainRule should be applied.
- Type
object
.spec.machines[].clusterSelector
- Description
- clusterSelector is a label selector which selects Machines by the labels of their Clusters. This field follows standard label selector semantics; if not present or empty, it selects Machines of all Clusters. If selector is also set, then the selector as a whole selects Machines matching selector belonging to Clusters selected by clusterSelector. If selector is not set, it selects all Machines belonging to Clusters selected by clusterSelector.
- Type
object
.spec.machines[].clusterSelector.matchExpressions
- Description
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- Type
array
.spec.machines[].clusterSelector.matchExpressions[]
- Description
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- Type
object- Required
keyoperator
.spec.machines[].clusterSelector.matchExpressions[].values
- Description
- values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- Type
array
.spec.machines[].clusterSelector.matchExpressions[].values[]
- Type
string
.spec.machines[].clusterSelector.matchLabels
- Description
- 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.
- Type
object
.spec.machines[].selector
- Description
- selector is a label selector which selects Machines by their labels. This field follows standard label selector semantics; if not present or empty, it selects all Machines. If clusterSelector is also set, then the selector as a whole selects Machines matching selector belonging to Clusters selected by clusterSelector. If clusterSelector is not set, it selects all Machines matching selector in all Clusters.
- Type
object
.spec.machines[].selector.matchExpressions
- Description
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- Type
array
.spec.machines[].selector.matchExpressions[]
- Description
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- Type
object- Required
keyoperator
.spec.machines[].selector.matchExpressions[].values
- Description
- values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- Type
array
.spec.machines[].selector.matchExpressions[].values[]
- Type
string
.spec.machines[].selector.matchLabels
- Description
- 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.
- Type
object
.spec.pods
- Description
- pods defines to which Pods this MachineDrainRule should be applied. If pods is not set, the MachineDrainRule applies to all Pods in all Namespaces. If pods contains multiple selectors, the results are ORed. Within a single Pod selector the results of selector and namespaceSelector are ANDed. Pods will be selected from all Namespaces unless otherwise restricted with the namespaceSelector. Example: Selects Pods with label "app" == "logging" in all Namespaces or Pods with label "app" == "prometheus" in the "monitoring" Namespace. - selector: matchExpressions: - key: app operator: In values: - logging - selector: matchLabels: app: prometheus namespaceSelector: matchLabels: kubernetes.io/metadata.name: monitoring
- Type
array
.spec.pods[]
- Description
- MachineDrainRulePodSelector defines to which Pods this MachineDrainRule should be applied.
- Type
object
.spec.pods[].namespaceSelector
- Description
- namespaceSelector is a label selector which selects Pods by the labels of their Namespaces. This field follows standard label selector semantics; if not present or empty, it selects Pods of all Namespaces. If selector is also set, then the selector as a whole selects Pods matching selector in Namespaces selected by namespaceSelector. If selector is not set, it selects all Pods in Namespaces selected by namespaceSelector.
- Type
object
.spec.pods[].namespaceSelector.matchExpressions
- Description
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- Type
array
.spec.pods[].namespaceSelector.matchExpressions[]
- Description
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- Type
object- Required
keyoperator
.spec.pods[].namespaceSelector.matchExpressions[].values
- Description
- values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- Type
array
.spec.pods[].namespaceSelector.matchExpressions[].values[]
- Type
string
.spec.pods[].namespaceSelector.matchLabels
- Description
- 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.
- Type
object
.spec.pods[].selector
- Description
- selector is a label selector which selects Pods by their labels. This field follows standard label selector semantics; if not present or empty, it selects all Pods. If namespaceSelector is also set, then the selector as a whole selects Pods matching selector in Namespaces selected by namespaceSelector. If namespaceSelector is not set, it selects all Pods matching selector in all Namespaces.
- Type
object
.spec.pods[].selector.matchExpressions
- Description
- matchExpressions is a list of label selector requirements. The requirements are ANDed.
- Type
array
.spec.pods[].selector.matchExpressions[]
- Description
- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- Type
object- Required
keyoperator
.spec.pods[].selector.matchExpressions[].values
- Description
- values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- Type
array
.spec.pods[].selector.matchExpressions[].values[]
- Type
string
.spec.pods[].selector.matchLabels
- Description
- 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.
- Type
object
API Endpoints
The following API endpoints are available:
/apis/cluster.x-k8s.io/v1beta1/namespaces/{namespace}/machinedrainrulesDELETE: delete collection of MachineDrainRuleGET: list objects of kind MachineDrainRulePOST: create a new MachineDrainRule
/apis/cluster.x-k8s.io/v1beta1/namespaces/{namespace}/machinedrainrules/{name}DELETE: delete the specified MachineDrainRuleGET: read the specified MachineDrainRulePATCH: partially update the specified MachineDrainRulePUT: replace the specified MachineDrainRule
/apis/cluster.x-k8s.io/v1beta1/namespaces/{namespace}/machinedrainrules
- HTTP method
DELETE- Description
- delete collection of MachineDrainRule
- HTTP responses
- HTTP method
GET- Description
- list objects of kind MachineDrainRule
- HTTP responses
- HTTP method
POST- Description
- create a new MachineDrainRule
- Query parameters
- Body parameters
- HTTP responses
/apis/cluster.x-k8s.io/v1beta1/namespaces/{namespace}/machinedrainrules/{name}
- HTTP method
DELETE- Description
- delete the specified MachineDrainRule
- Query parameters
- HTTP responses
- HTTP method
GET- Description
- read the specified MachineDrainRule
- HTTP responses
- HTTP method
PATCH- Description
- partially update the specified MachineDrainRule
- Query parameters
- HTTP responses
- HTTP method
PUT- Description
- replace the specified MachineDrainRule
- Query parameters
- Body parameters
- HTTP responses