MachineSet
Scope: Namespaced
Version: v1beta1
MachineSet is the Schema for the machinesets API.
- apiVersion
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
- kind
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
- metadata
- spec
MachineSetSpec defines the desired state of MachineSet.
- spec.clusterName
Required value
ClusterName is the name of the Cluster this object belongs to.
- spec.deletePolicy
DeletePolicy defines the policy used to identify nodes to delete when downscaling. Defaults to “Random”. Valid values are “Random, “Newest”, “Oldest”
Allowed values:
Random
,Newest
,Oldest
- spec.minReadySeconds
MinReadySeconds is the minimum number of seconds for which a newly created machine should be ready. Defaults to 0 (machine will be considered available as soon as it is ready)
- spec.replicas
Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1.
Default:
1
- spec.selector
Required value
Selector is a label query over machines that should match the replica count. Label keys and values that must match in order to be controlled by this MachineSet. It must match the machine template’s labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
- spec.selector.matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
- spec.selector.matchExpressions.key
Required value
key is the label key that the selector applies to.
- spec.selector.matchExpressions.operator
Required value
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- spec.selector.matchExpressions.values
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.
- spec.selector.matchLabels
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.
- spec.template
Template is the object that describes the machine that will be created if insufficient replicas are detected. Object references to custom resources are treated as templates.
- spec.template.metadata
Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- spec.template.metadata.annotations
Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations
- spec.template.metadata.labels
Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels
- spec.template.spec
Specification of the desired behavior of the machine. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
- spec.template.spec.bootstrap
Required value
Bootstrap is a reference to a local struct which encapsulates fields to configure the Machine’s bootstrapping mechanism.
- spec.template.spec.bootstrap.configRef
ConfigRef is a reference to a bootstrap provider-specific resource that holds configuration details. The reference is optional to allow users/operators to specify Bootstrap.DataSecretName without the need of a controller.
- spec.template.spec.bootstrap.configRef.apiVersion
API version of the referent.
- spec.template.spec.bootstrap.configRef.fieldPath
If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: “spec.containers{name}” (where “name” refers to the name of the container that triggered the event) or if no container name is specified “spec.containers[2]” (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.
- spec.template.spec.bootstrap.configRef.kind
Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
- spec.template.spec.bootstrap.configRef.name
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- spec.template.spec.bootstrap.configRef.namespace
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
- spec.template.spec.bootstrap.configRef.resourceVersion
Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
- spec.template.spec.bootstrap.configRef.uid
UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
- spec.template.spec.bootstrap.dataSecretName
DataSecretName is the name of the secret that stores the bootstrap data script. If nil, the Machine should remain in the Pending state.
- spec.template.spec.clusterName
Required value
ClusterName is the name of the Cluster this object belongs to.
- spec.template.spec.failureDomain
FailureDomain is the failure domain the machine will be created in. Must match a key in the FailureDomains map stored on the cluster object.
- spec.template.spec.infrastructureRef
Required value
InfrastructureRef is a required reference to a custom resource offered by an infrastructure provider.
- spec.template.spec.infrastructureRef.apiVersion
API version of the referent.
- spec.template.spec.infrastructureRef.fieldPath
If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: “spec.containers{name}” (where “name” refers to the name of the container that triggered the event) or if no container name is specified “spec.containers[2]” (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.
- spec.template.spec.infrastructureRef.kind
Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
- spec.template.spec.infrastructureRef.name
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- spec.template.spec.infrastructureRef.namespace
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
- spec.template.spec.infrastructureRef.resourceVersion
Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
- spec.template.spec.infrastructureRef.uid
UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
- spec.template.spec.nodeDeletionTimeout
NodeDeletionTimeout defines how long the controller will attempt to delete the Node that the Machine hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. Defaults to 10 seconds.
- spec.template.spec.nodeDrainTimeout
NodeDrainTimeout is the total amount of time that the controller will spend on draining a node. The default value is 0, meaning that the node can be drained without any time limitations. NOTE: NodeDrainTimeout is different from
kubectl drain --timeout
- spec.template.spec.nodeVolumeDetachTimeout
NodeVolumeDetachTimeout is the total amount of time that the controller will spend on waiting for all volumes to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.
- spec.template.spec.providerID
ProviderID is the identification ID of the machine provided by the provider. This field must match the provider ID as seen on the node object corresponding to this machine. This field is required by higher level consumers of cluster-api. Example use case is cluster autoscaler with cluster-api as provider. Clean-up logic in the autoscaler compares machines to nodes to find out machines at provider which could not get registered as Kubernetes nodes. With cluster-api as a generic out-of-tree provider for autoscaler, this field is required by autoscaler to be able to have a provider view of the list of machines. Another list of nodes is queried from the k8s apiserver and then a comparison is done to find out unregistered machines and are marked for delete. This field will be set by the actuators and consumed by higher level entities like autoscaler that will be interfacing with cluster-api as generic provider.
- spec.template.spec.version
Version defines the desired Kubernetes version. This field is meant to be optionally used by bootstrap providers.