Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the healthchecking v1beta1 API group +k8s:deepcopy-gen=package,register +groupName=machine.openshift.io
Package v1alpha1 contains API Schema definitions for the healthchecking v1beta1 API group +k8s:deepcopy-gen=package,register +groupName=machine.openshift.io
Index ¶
- Constants
- Variables
- func Kind(kind string) schema.GroupKind
- func MachineMutatingWebhook() admissionregistrationv1.MutatingWebhook
- func MachineSetMutatingWebhook() admissionregistrationv1.MutatingWebhook
- func MachineSetValidatingWebhook() admissionregistrationv1.ValidatingWebhook
- func MachineValidatingWebhook() admissionregistrationv1.ValidatingWebhook
- func NewMachineDefaulter() (*machineDefaulterHandler, error)
- func NewMachineSetDefaulter() (*machineSetDefaulterHandler, error)
- func NewMachineSetValidator(client client.Client) (*machineSetValidatorHandler, error)
- func NewMachineValidator(client client.Client) (*machineValidatorHandler, error)
- func NewMutatingWebhookConfiguration() *admissionregistrationv1.MutatingWebhookConfiguration
- func NewValidatingWebhookConfiguration() *admissionregistrationv1.ValidatingWebhookConfiguration
- func Resource(resource string) schema.GroupResource
- type ClusterStatusError
- type Condition
- type ConditionSeverity
- type ConditionType
- type Conditions
- type LastOperation
- type Machine
- type MachineDeploymentStrategyType
- type MachineHealthCheck
- func (in *MachineHealthCheck) DeepCopy() *MachineHealthCheck
- func (in *MachineHealthCheck) DeepCopyInto(out *MachineHealthCheck)
- func (in *MachineHealthCheck) DeepCopyObject() runtime.Object
- func (m *MachineHealthCheck) GetConditions() Conditions
- func (m *MachineHealthCheck) SetConditions(conditions Conditions)
- type MachineHealthCheckList
- type MachineHealthCheckSpec
- type MachineHealthCheckStatus
- type MachineList
- type MachineSet
- type MachineSetDeletePolicy
- type MachineSetList
- type MachineSetSpec
- type MachineSetStatus
- type MachineSetStatusError
- type MachineSpec
- type MachineStatus
- type MachineStatusError
- type MachineTemplateSpec
- type ObjectMeta
- type ProviderSpec
- type RemediationStrategyType
- type UnhealthyCondition
Constants ¶
const ( // RemediationAllowedCondition is set on MachineHealthChecks to show the status of whether the MachineHealthCheck is // allowed to remediate any Machines or whether it is blocked from remediating any further. RemediationAllowedCondition ConditionType = "RemediationAllowed" // TooManyUnhealthy is the reason used when too many Machines are unhealthy and the MachineHealthCheck is blocked // from making any further remediations. TooManyUnhealthyReason = "TooManyUnhealthy" // ExternalRemediationTemplateAvailable is set on machinehealthchecks when MachineHealthCheck controller uses external remediation. // ExternalRemediationTemplateAvailable is set to false if external remediation template is not found. ExternalRemediationTemplateAvailable ConditionType = "ExternalRemediationTemplateAvailable" // ExternalRemediationTemplateNotFound is the reason used when a machine health check fails to find external remediation template. ExternalRemediationTemplateNotFound = "ExternalRemediationTemplateNotFound" // ExternalRemediationRequestAvailable is set on machinehealthchecks when MachineHealthCheck controller uses external remediation. // ExternalRemediationRequestAvailable is set to false if creating external remediation request fails. ExternalRemediationRequestAvailable ConditionType = "ExternalRemediationRequestAvailable" // ExternalRemediationRequestCreationFailed is the reason used when a machine health check fails to create external remediation request. ExternalRemediationRequestCreationFailed = "ExternalRemediationRequestCreationFailed" )
Conditions and condition Reasons for the MachineHealthCheck object
const ( // InstanceExistsCondition is set on the Machine to show whether a virtual mahcine has been created by the cloud provider. InstanceExistsCondition ConditionType = "InstanceExists" // ErrorCheckingProviderReason is the reason used when the exist operation fails. // This would normally be because we cannot contact the provider. ErrorCheckingProviderReason = "ErrorCheckingProvider" // InstanceMissingReason is the reason used when the machine was provisioned, but the instance has gone missing. InstanceMissingReason = "InstanceMissing" // InstanceNotCreatedReason is the reason used when the machine has not yet been provisioned. InstanceNotCreatedReason = "InstanceNotCreated" )
const ( // MachineFinalizer is set on PrepareForCreate callback. MachineFinalizer = "machine.machine.openshift.io" // MachineClusterLabelName is the label set on machines linked to a cluster. MachineClusterLabelName = "cluster.k8s.io/cluster-name" // MachineClusterIDLabel is the label that a machine must have to identify the // cluster to which it belongs. MachineClusterIDLabel = "machine.openshift.io/cluster-api-cluster" )
const ( DefaultMachineMutatingHookPath = "/mutate-machine-openshift-io-v1beta1-machine" DefaultMachineValidatingHookPath = "/validate-machine-openshift-io-v1beta1-machine" DefaultMachineSetMutatingHookPath = "/mutate-machine-openshift-io-v1beta1-machineset" DefaultMachineSetValidatingHookPath = "/validate-machine-openshift-io-v1beta1-machineset" )
Variables ¶
var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: machine.GroupName, Version: "v1beta1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func MachineMutatingWebhook ¶
func MachineMutatingWebhook() admissionregistrationv1.MutatingWebhook
MachineMutatingWebhook returns mutating webhooks for machine to apply in configuration
func MachineSetMutatingWebhook ¶
func MachineSetMutatingWebhook() admissionregistrationv1.MutatingWebhook
MachineSetMutatingWebhook returns mutating webhook for machineSet to apply in configuration
func MachineSetValidatingWebhook ¶
func MachineSetValidatingWebhook() admissionregistrationv1.ValidatingWebhook
MachineSetValidatingWebhook returns validating webhooks for machineSet to populate the configuration
func MachineValidatingWebhook ¶
func MachineValidatingWebhook() admissionregistrationv1.ValidatingWebhook
MachineValidatingWebhook returns validating webhooks for machine to populate the configuration
func NewMachineDefaulter ¶
func NewMachineDefaulter() (*machineDefaulterHandler, error)
NewDefaulter returns a new machineDefaulterHandler.
func NewMachineSetDefaulter ¶
func NewMachineSetDefaulter() (*machineSetDefaulterHandler, error)
NewMachineSetDefaulter returns a new machineSetDefaulterHandler.
func NewMachineSetValidator ¶
NewMachineSetValidator returns a new machineSetValidatorHandler.
func NewMachineValidator ¶
NewValidator returns a new machineValidatorHandler.
func NewMutatingWebhookConfiguration ¶
func NewMutatingWebhookConfiguration() *admissionregistrationv1.MutatingWebhookConfiguration
NewMutatingWebhookConfiguration creates a mutating webhook configuration with configured Machine and MachineSet webhooks
func NewValidatingWebhookConfiguration ¶
func NewValidatingWebhookConfiguration() *admissionregistrationv1.ValidatingWebhookConfiguration
NewValidatingWebhookConfiguration creates a validation webhook configuration with configured Machine and MachineSet webhooks
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type ClusterStatusError ¶
type ClusterStatusError string
const ( // InvalidConfigurationClusterError indicates that the cluster // configuration is invalid. InvalidConfigurationClusterError ClusterStatusError = "InvalidConfiguration" // UnsupportedChangeClusterError indicates that the cluster // spec has been updated in an unsupported way. That cannot be // reconciled. UnsupportedChangeClusterError ClusterStatusError = "UnsupportedChange" // CreateClusterError indicates that an error was encountered // when trying to create the cluster. CreateClusterError ClusterStatusError = "CreateError" // UpdateClusterError indicates that an error was encountered // when trying to update the cluster. UpdateClusterError ClusterStatusError = "UpdateError" // DeleteClusterError indicates that an error was encountered // when trying to delete the cluster. DeleteClusterError ClusterStatusError = "DeleteError" )
type Condition ¶
type Condition struct { // Type of condition in CamelCase or in foo.example.com/CamelCase. // Many .condition.type values are consistent across resources like Available, but because arbitrary conditions // can be useful (see .node.status.conditions), the ability to deconflict is important. // +required Type ConditionType `json:"type"` // Status of the condition, one of True, False, Unknown. // +required Status corev1.ConditionStatus `json:"status"` // Severity provides an explicit classification of Reason code, so the users or machines can immediately // understand the current situation and act accordingly. // The Severity field MUST be set only when Status=False. // +optional Severity ConditionSeverity `json:"severity,omitempty"` // Last time the condition transitioned from one status to another. // This should be when the underlying condition changed. If that is not known, then using the time when // the API field changed is acceptable. // +required LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` // The reason for the condition's last transition in CamelCase. // The specific API may choose whether or not this field is considered a guaranteed API. // This field may not be empty. // +optional Reason string `json:"reason,omitempty"` // A human readable message indicating details about the transition. // This field may be empty. // +optional Message string `json:"message,omitempty"` }
Condition defines an observation of a Machine API resource operational state.
func (*Condition) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (*Condition) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ConditionSeverity ¶
type ConditionSeverity string
ConditionSeverity expresses the severity of a Condition Type failing.
const ( // ConditionSeverityError specifies that a condition with `Status=False` is an error. ConditionSeverityError ConditionSeverity = "Error" // ConditionSeverityWarning specifies that a condition with `Status=False` is a warning. ConditionSeverityWarning ConditionSeverity = "Warning" // ConditionSeverityInfo specifies that a condition with `Status=False` is informative. ConditionSeverityInfo ConditionSeverity = "Info" // ConditionSeverityNone should apply only to conditions with `Status=True`. ConditionSeverityNone ConditionSeverity = "" )
type Conditions ¶
type Conditions []Condition
Conditions provide observations of the operational state of a Machine API resource.
func (Conditions) DeepCopy ¶
func (in Conditions) DeepCopy() Conditions
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Conditions.
func (Conditions) DeepCopyInto ¶
func (in Conditions) DeepCopyInto(out *Conditions)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LastOperation ¶
type LastOperation struct { // Description is the human-readable description of the last operation. Description *string `json:"description,omitempty"` // LastUpdated is the timestamp at which LastOperation API was last-updated. LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` // State is the current status of the last performed operation. // E.g. Processing, Failed, Successful etc State *string `json:"state,omitempty"` // Type is the type of operation which was last performed. // E.g. Create, Delete, Update etc Type *string `json:"type,omitempty"` }
LastOperation represents the detail of the last performed operation on the MachineObject.
func (*LastOperation) DeepCopy ¶
func (in *LastOperation) DeepCopy() *LastOperation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LastOperation.
func (*LastOperation) DeepCopyInto ¶
func (in *LastOperation) DeepCopyInto(out *LastOperation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Machine ¶
type Machine struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec MachineSpec `json:"spec,omitempty"` Status MachineStatus `json:"status,omitempty"` }
Machine is the Schema for the machines API +k8s:openapi-gen=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Phase of machine" +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".metadata.labels['machine\\.openshift\\.io/instance-type']",description="Type of instance" +kubebuilder:printcolumn:name="Region",type="string",JSONPath=".metadata.labels['machine\\.openshift\\.io/region']",description="Region associated with machine" +kubebuilder:printcolumn:name="Zone",type="string",JSONPath=".metadata.labels['machine\\.openshift\\.io/zone']",description="Zone associated with machine" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Machine age" +kubebuilder:printcolumn:name="Node",type="string",JSONPath=".status.nodeRef.name",description="Node associated with machine",priority=1 +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID of machine created in cloud provider",priority=1 +kubebuilder:printcolumn:name="State",type="string",JSONPath=".metadata.annotations['machine\\.openshift\\.io/instance-state']",description="State of instance",priority=1
func (*Machine) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine.
func (*Machine) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Machine) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Machine) GetConditions ¶
func (m *Machine) GetConditions() Conditions
func (*Machine) SetConditions ¶
func (m *Machine) SetConditions(conditions Conditions)
type MachineDeploymentStrategyType ¶
type MachineDeploymentStrategyType string
const ( // Replace the old MachineSet by new one using rolling update // i.e. gradually scale down the old MachineSet and scale up the new one. RollingUpdateMachineDeploymentStrategyType MachineDeploymentStrategyType = "RollingUpdate" )
type MachineHealthCheck ¶
type MachineHealthCheck struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Specification of machine health check policy Spec MachineHealthCheckSpec `json:"spec,omitempty"` // Most recently observed status of MachineHealthCheck resource Status MachineHealthCheckStatus `json:"status,omitempty"` }
MachineHealthCheck is the Schema for the machinehealthchecks API +kubebuilder:subresource:status +kubebuilder:resource:shortName=mhc;mhcs +k8s:openapi-gen=true +kubebuilder:printcolumn:name="MaxUnhealthy",type="string",JSONPath=".spec.maxUnhealthy",description="Maximum number of unhealthy machines allowed" +kubebuilder:printcolumn:name="ExpectedMachines",type="integer",JSONPath=".status.expectedMachines",description="Number of machines currently monitored" +kubebuilder:printcolumn:name="CurrentHealthy",type="integer",JSONPath=".status.currentHealthy",description="Current observed healthy machines"
func (*MachineHealthCheck) DeepCopy ¶
func (in *MachineHealthCheck) DeepCopy() *MachineHealthCheck
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheck.
func (*MachineHealthCheck) DeepCopyInto ¶
func (in *MachineHealthCheck) DeepCopyInto(out *MachineHealthCheck)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*MachineHealthCheck) DeepCopyObject ¶
func (in *MachineHealthCheck) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*MachineHealthCheck) GetConditions ¶
func (m *MachineHealthCheck) GetConditions() Conditions
func (*MachineHealthCheck) SetConditions ¶
func (m *MachineHealthCheck) SetConditions(conditions Conditions)
type MachineHealthCheckList ¶
type MachineHealthCheckList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []MachineHealthCheck `json:"items"` }
MachineHealthCheckList contains a list of MachineHealthCheck
func (*MachineHealthCheckList) DeepCopy ¶
func (in *MachineHealthCheckList) DeepCopy() *MachineHealthCheckList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckList.
func (*MachineHealthCheckList) DeepCopyInto ¶
func (in *MachineHealthCheckList) DeepCopyInto(out *MachineHealthCheckList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*MachineHealthCheckList) DeepCopyObject ¶
func (in *MachineHealthCheckList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type MachineHealthCheckSpec ¶
type MachineHealthCheckSpec struct { // Label selector to match machines whose health will be exercised. // Note: An empty selector will match all machines. Selector metav1.LabelSelector `json:"selector"` // UnhealthyConditions contains a list of the conditions that determine // whether a node is considered unhealthy. The conditions are combined in a // logical OR, i.e. if any of the conditions is met, the node is unhealthy. // // +kubebuilder:validation:MinItems=1 UnhealthyConditions []UnhealthyCondition `json:"unhealthyConditions"` // Any farther remediation is only allowed if at most "MaxUnhealthy" machines selected by // "selector" are not healthy. // Expects either a postive integer value or a percentage value. // Percentage values must be positive whole numbers and are capped at 100%. // Both 0 and 0% are valid and will block all remediation. // +kubebuilder:default:="100%" // +kubebuilder:validation:XIntOrString // +kubebuilder:validation:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$" MaxUnhealthy *intstr.IntOrString `json:"maxUnhealthy,omitempty"` // Machines older than this duration without a node will be considered to have // failed and will be remediated. // To prevent Machines without Nodes from being removed, disable startup checks // by setting this value explicitly to "0". // Expects an unsigned duration string of decimal numbers each with optional // fraction and a unit suffix, eg "300ms", "1.5h" or "2h45m". // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". // +optional // +kubebuilder:default:="10m" // +kubebuilder:validation:Pattern="^0|([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$" // +kubebuilder:validation:Type:=string NodeStartupTimeout *metav1.Duration `json:"nodeStartupTimeout,omitempty"` // RemediationTemplate is a reference to a remediation template // provided by an infrastructure provider. // // This field is completely optional, when filled, the MachineHealthCheck controller // creates a new object from the template referenced and hands off remediation of the machine to // a controller that lives outside of Machine API Operator. // +optional RemediationTemplate *corev1.ObjectReference `json:"remediationTemplate,omitempty"` }
MachineHealthCheckSpec defines the desired state of MachineHealthCheck
func (*MachineHealthCheckSpec) DeepCopy ¶
func (in *MachineHealthCheckSpec) DeepCopy() *MachineHealthCheckSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckSpec.
func (*MachineHealthCheckSpec) DeepCopyInto ¶
func (in *MachineHealthCheckSpec) DeepCopyInto(out *MachineHealthCheckSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MachineHealthCheckStatus ¶
type MachineHealthCheckStatus struct { // total number of machines counted by this machine health check // +kubebuilder:validation:Minimum=0 ExpectedMachines *int `json:"expectedMachines"` // total number of machines counted by this machine health check // +kubebuilder:validation:Minimum=0 CurrentHealthy *int `json:"currentHealthy" protobuf:"varint,4,opt,name=currentHealthy"` // RemediationsAllowed is the number of further remediations allowed by this machine health check before // maxUnhealthy short circuiting will be applied // +kubebuilder:validation:Minimum=0 // +optional RemediationsAllowed int32 `json:"remediationsAllowed"` // Conditions defines the current state of the MachineHealthCheck Conditions Conditions `json:"conditions,omitempty"` }
MachineHealthCheckStatus defines the observed state of MachineHealthCheck
func (*MachineHealthCheckStatus) DeepCopy ¶
func (in *MachineHealthCheckStatus) DeepCopy() *MachineHealthCheckStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckStatus.
func (*MachineHealthCheckStatus) DeepCopyInto ¶
func (in *MachineHealthCheckStatus) DeepCopyInto(out *MachineHealthCheckStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MachineList ¶
type MachineList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Machine `json:"items"` }
MachineList contains a list of Machine
func (*MachineList) DeepCopy ¶
func (in *MachineList) DeepCopy() *MachineList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineList.
func (*MachineList) DeepCopyInto ¶
func (in *MachineList) DeepCopyInto(out *MachineList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*MachineList) DeepCopyObject ¶
func (in *MachineList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type MachineSet ¶
type MachineSet struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec MachineSetSpec `json:"spec,omitempty"` Status MachineSetStatus `json:"status,omitempty"` }
MachineSet ensures that a specified number of machines replicas are running at any given time. +k8s:openapi-gen=true +kubebuilder:subresource:status +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector +kubebuilder:printcolumn:name="Desired",type="integer",JSONPath=".spec.replicas",description="Desired Replicas" +kubebuilder:printcolumn:name="Current",type="integer",JSONPath=".status.replicas",description="Current Replicas" +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Ready Replicas" +kubebuilder:printcolumn:name="Available",type="string",JSONPath=".status.availableReplicas",description="Observed number of available replicas" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Machineset age"
func (*MachineSet) DeepCopy ¶
func (in *MachineSet) DeepCopy() *MachineSet
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSet.
func (*MachineSet) DeepCopyInto ¶
func (in *MachineSet) DeepCopyInto(out *MachineSet)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*MachineSet) DeepCopyObject ¶
func (in *MachineSet) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*MachineSet) Default ¶
func (m *MachineSet) Default()
DefaultingFunction sets default MachineSet field values
func (*MachineSet) Validate ¶
func (m *MachineSet) Validate() field.ErrorList
type MachineSetDeletePolicy ¶
type MachineSetDeletePolicy string
MachineSetDeletePolicy defines how priority is assigned to nodes to delete when downscaling a MachineSet. Defaults to "Random".
const ( // RandomMachineSetDeletePolicy prioritizes both Machines that have the annotation // "cluster.k8s.io/delete-machine=yes" and Machines that are unhealthy // (Status.ErrorReason or Status.ErrorMessage are set to a non-empty value). // Finally, it picks Machines at random to delete. RandomMachineSetDeletePolicy MachineSetDeletePolicy = "Random" // NewestMachineSetDeletePolicy prioritizes both Machines that have the annotation // "cluster.k8s.io/delete-machine=yes" and Machines that are unhealthy // (Status.ErrorReason or Status.ErrorMessage are set to a non-empty value). // It then prioritizes the newest Machines for deletion based on the Machine's CreationTimestamp. NewestMachineSetDeletePolicy MachineSetDeletePolicy = "Newest" // OldestMachineSetDeletePolicy prioritizes both Machines that have the annotation // "cluster.k8s.io/delete-machine=yes" and Machines that are unhealthy // (Status.ErrorReason or Status.ErrorMessage are set to a non-empty value). // It then prioritizes the oldest Machines for deletion based on the Machine's CreationTimestamp. OldestMachineSetDeletePolicy MachineSetDeletePolicy = "Oldest" )
type MachineSetList ¶
type MachineSetList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []MachineSet `json:"items"` }
MachineSetList contains a list of MachineSet
func (*MachineSetList) DeepCopy ¶
func (in *MachineSetList) DeepCopy() *MachineSetList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetList.
func (*MachineSetList) DeepCopyInto ¶
func (in *MachineSetList) DeepCopyInto(out *MachineSetList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*MachineSetList) DeepCopyObject ¶
func (in *MachineSetList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type MachineSetSpec ¶
type MachineSetSpec struct { // Replicas is the number of desired replicas. // This is a pointer to distinguish between explicit zero and unspecified. // Defaults to 1. // +kubebuilder:default=1 Replicas *int32 `json:"replicas,omitempty"` // 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) // +optional MinReadySeconds int32 `json:"minReadySeconds,omitempty"` // DeletePolicy defines the policy used to identify nodes to delete when downscaling. // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" // +kubebuilder:validation:Enum=Random;Newest;Oldest DeletePolicy string `json:"deletePolicy,omitempty"` // 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 Selector metav1.LabelSelector `json:"selector"` // Template is the object that describes the machine that will be created if // insufficient replicas are detected. // +optional Template MachineTemplateSpec `json:"template,omitempty"` }
MachineSetSpec defines the desired state of MachineSet
func (*MachineSetSpec) DeepCopy ¶
func (in *MachineSetSpec) DeepCopy() *MachineSetSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetSpec.
func (*MachineSetSpec) DeepCopyInto ¶
func (in *MachineSetSpec) DeepCopyInto(out *MachineSetSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MachineSetStatus ¶
type MachineSetStatus struct { // Replicas is the most recently observed number of replicas. Replicas int32 `json:"replicas"` // The number of replicas that have labels matching the labels of the machine template of the MachineSet. // +optional FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"` // The number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready". // +optional ReadyReplicas int32 `json:"readyReplicas,omitempty"` // The number of available replicas (ready for at least minReadySeconds) for this MachineSet. // +optional AvailableReplicas int32 `json:"availableReplicas,omitempty"` // ObservedGeneration reflects the generation of the most recently observed MachineSet. // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty"` // In the event that there is a terminal problem reconciling the // replicas, both ErrorReason and ErrorMessage will be set. ErrorReason // will be populated with a succinct value suitable for machine // interpretation, while ErrorMessage will contain a more verbose // string suitable for logging and human consumption. // // These fields should not be set for transitive errors that a // controller faces that are expected to be fixed automatically over // time (like service outages), but instead indicate that something is // fundamentally wrong with the MachineTemplate's spec or the configuration of // the machine controller, and that manual intervention is required. Examples // of terminal errors would be invalid combinations of settings in the // spec, values that are unsupported by the machine controller, or the // responsible machine controller itself being critically misconfigured. // // Any transient errors that occur during the reconciliation of Machines // can be added as events to the MachineSet object and/or logged in the // controller's output. // +optional ErrorReason *MachineSetStatusError `json:"errorReason,omitempty"` // +optional ErrorMessage *string `json:"errorMessage,omitempty"` }
MachineSetStatus defines the observed state of MachineSet
func (*MachineSetStatus) DeepCopy ¶
func (in *MachineSetStatus) DeepCopy() *MachineSetStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetStatus.
func (*MachineSetStatus) DeepCopyInto ¶
func (in *MachineSetStatus) DeepCopyInto(out *MachineSetStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MachineSetStatusError ¶
type MachineSetStatusError string
const ( // Represents that the combination of configuration in the MachineTemplateSpec // is not supported by this cluster. This is not a transient error, but // indicates a state that must be fixed before progress can be made. // // Example: the ProviderSpec specifies an instance type that doesn't exist. InvalidConfigurationMachineSetError MachineSetStatusError = "InvalidConfiguration" )
type MachineSpec ¶
type MachineSpec struct { // ObjectMeta will autopopulate the Node created. Use this to // indicate what labels, annotations, name prefix, etc., should be used // when creating the Node. // +optional ObjectMeta `json:"metadata,omitempty"` // The list of the taints to be applied to the corresponding Node in additive // manner. This list will not overwrite any other taints added to the Node on // an ongoing basis by other entities. These taints should be actively reconciled // e.g. if you ask the machine controller to apply a taint and then manually remove // the taint the machine controller will put it back) but not have the machine controller // remove any taints // +optional Taints []corev1.Taint `json:"taints,omitempty"` // ProviderSpec details Provider-specific configuration to use during node creation. // +optional ProviderSpec ProviderSpec `json:"providerSpec"` // 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. // +optional ProviderID *string `json:"providerID,omitempty"` }
MachineSpec defines the desired state of Machine
func (*MachineSpec) DeepCopy ¶
func (in *MachineSpec) DeepCopy() *MachineSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpec.
func (*MachineSpec) DeepCopyInto ¶
func (in *MachineSpec) DeepCopyInto(out *MachineSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MachineStatus ¶
type MachineStatus struct { // NodeRef will point to the corresponding Node if it exists. // +optional NodeRef *corev1.ObjectReference `json:"nodeRef,omitempty"` // LastUpdated identifies when this status was last observed. // +optional LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` // ErrorReason will be set in the event that there is a terminal problem // reconciling the Machine and will contain a succinct value suitable // for machine interpretation. // // This field should not be set for transitive errors that a controller // faces that are expected to be fixed automatically over // time (like service outages), but instead indicate that something is // fundamentally wrong with the Machine's spec or the configuration of // the controller, and that manual intervention is required. Examples // of terminal errors would be invalid combinations of settings in the // spec, values that are unsupported by the controller, or the // responsible controller itself being critically misconfigured. // // Any transient errors that occur during the reconciliation of Machines // can be added as events to the Machine object and/or logged in the // controller's output. // +optional ErrorReason *MachineStatusError `json:"errorReason,omitempty"` // ErrorMessage will be set in the event that there is a terminal problem // reconciling the Machine and will contain a more verbose string suitable // for logging and human consumption. // // This field should not be set for transitive errors that a controller // faces that are expected to be fixed automatically over // time (like service outages), but instead indicate that something is // fundamentally wrong with the Machine's spec or the configuration of // the controller, and that manual intervention is required. Examples // of terminal errors would be invalid combinations of settings in the // spec, values that are unsupported by the controller, or the // responsible controller itself being critically misconfigured. // // Any transient errors that occur during the reconciliation of Machines // can be added as events to the Machine object and/or logged in the // controller's output. // +optional ErrorMessage *string `json:"errorMessage,omitempty"` // ProviderStatus details a Provider-specific status. // It is recommended that providers maintain their // own versioned API types that should be // serialized/deserialized from this field. // +optional // +kubebuilder:validation:XPreserveUnknownFields ProviderStatus *runtime.RawExtension `json:"providerStatus,omitempty"` // Addresses is a list of addresses assigned to the machine. Queried from cloud provider, if available. // +optional Addresses []corev1.NodeAddress `json:"addresses,omitempty"` // LastOperation describes the last-operation performed by the machine-controller. // This API should be useful as a history in terms of the latest operation performed on the // specific machine. It should also convey the state of the latest-operation for example if // it is still on-going, failed or completed successfully. // +optional LastOperation *LastOperation `json:"lastOperation,omitempty"` // Phase represents the current phase of machine actuation. // One of: Failed, Provisioning, Provisioned, Running, Deleting // +optional Phase *string `json:"phase,omitempty"` // Conditions defines the current state of the Machine Conditions Conditions `json:"conditions,omitempty"` }
MachineStatus defines the observed state of Machine
func (*MachineStatus) DeepCopy ¶
func (in *MachineStatus) DeepCopy() *MachineStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineStatus.
func (*MachineStatus) DeepCopyInto ¶
func (in *MachineStatus) DeepCopyInto(out *MachineStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MachineStatusError ¶
type MachineStatusError string
Constants aren't automatically generated for unversioned packages. Instead share the same constant for all versioned packages
const ( // Represents that the combination of configuration in the MachineSpec // is not supported by this cluster. This is not a transient error, but // indicates a state that must be fixed before progress can be made. // // Example: the ProviderSpec specifies an instance type that doesn't exist, InvalidConfigurationMachineError MachineStatusError = "InvalidConfiguration" // This indicates that the MachineSpec has been updated in a way that // is not supported for reconciliation on this cluster. The spec may be // completely valid from a configuration standpoint, but the controller // does not support changing the real world state to match the new // spec. // // Example: the responsible controller is not capable of changing the // container runtime from docker to rkt. UnsupportedChangeMachineError MachineStatusError = "UnsupportedChange" // This generally refers to exceeding one's quota in a cloud provider, // or running out of physical machines in an on-premise environment. InsufficientResourcesMachineError MachineStatusError = "InsufficientResources" // There was an error while trying to create a Node to match this // Machine. This may indicate a transient problem that will be fixed // automatically with time, such as a service outage, or a terminal // error during creation that doesn't match a more specific // MachineStatusError value. // // Example: timeout trying to connect to GCE. CreateMachineError MachineStatusError = "CreateError" // There was an error while trying to update a Node that this // Machine represents. This may indicate a transient problem that will be // fixed automatically with time, such as a service outage, // // Example: error updating load balancers UpdateMachineError MachineStatusError = "UpdateError" // An error was encountered while trying to delete the Node that this // Machine represents. This could be a transient or terminal error, but // will only be observable if the provider's Machine controller has // added a finalizer to the object to more gracefully handle deletions. // // Example: cannot resolve EC2 IP address. DeleteMachineError MachineStatusError = "DeleteError" // TemplateClonedFromGroupKindAnnotation is the infrastructure machine // annotation that stores the group-kind of the infrastructure template resource // that was cloned for the machine. This annotation is set only during cloning a // template. Older/adopted machines will not have this annotation. TemplateClonedFromGroupKindAnnotation = "machine.openshift.io/cloned-from-groupkind" // TemplateClonedFromNameAnnotation is the infrastructure machine annotation that // stores the name of the infrastructure template resource // that was cloned for the machine. This annotation is set only during cloning a // template. Older/adopted machines will not have this annotation. TemplateClonedFromNameAnnotation = "machine.openshift.io/cloned-from-name" // This error indicates that the machine did not join the cluster // as a new node within the expected timeframe after instance // creation at the provider succeeded // // Example use case: A controller that deletes Machines which do // not result in a Node joining the cluster within a given timeout // and that are managed by a MachineSet JoinClusterTimeoutMachineError = "JoinClusterTimeoutError" )
type MachineTemplateSpec ¶
type MachineTemplateSpec struct { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional ObjectMeta `json:"metadata,omitempty"` // 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 // +optional Spec MachineSpec `json:"spec,omitempty"` }
MachineTemplateSpec describes the data needed to create a Machine from a template
func (*MachineTemplateSpec) DeepCopy ¶
func (in *MachineTemplateSpec) DeepCopy() *MachineTemplateSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineTemplateSpec.
func (*MachineTemplateSpec) DeepCopyInto ¶
func (in *MachineTemplateSpec) DeepCopyInto(out *MachineTemplateSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ObjectMeta ¶
type ObjectMeta struct { // Name must be unique within a namespace. Is required when creating resources, although // some resources may allow a client to request the generation of an appropriate name // automatically. Name is primarily intended for creation idempotence and configuration // definition. // Cannot be updated. // More info: http://kubernetes.io/docs/user-guide/identifiers#names // +optional Name string `json:"name,omitempty"` // GenerateName is an optional prefix, used by the server, to generate a unique // name ONLY IF the Name field has not been provided. // If this field is used, the name returned to the client will be different // than the name passed. This value will also be combined with a unique suffix. // The provided value has the same validation rules as the Name field, // and may be truncated by the length of the suffix required to make the value // unique on the server. // // If this field is specified and the generated name exists, the server will // NOT return a 409 - instead, it will either return 201 Created or 500 with Reason // ServerTimeout indicating a unique name could not be found in the time allotted, and the client // should retry (optionally after the time indicated in the Retry-After header). // // Applied only if Name is not specified. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency // +optional GenerateName string `json:"generateName,omitempty"` // Namespace defines the space within each name must be unique. An empty namespace is // equivalent to the "default" namespace, but "default" is the canonical representation. // Not all objects are required to be scoped to a namespace - the value of this field for // those objects will be empty. // // Must be a DNS_LABEL. // Cannot be updated. // More info: http://kubernetes.io/docs/user-guide/namespaces // +optional Namespace string `json:"namespace,omitempty"` // 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 // +optional Labels map[string]string `json:"labels,omitempty"` // 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 // +optional Annotations map[string]string `json:"annotations,omitempty"` // List of objects depended by this object. If ALL objects in the list have // been deleted, this object will be garbage collected. If this object is managed by a controller, // then an entry in this list will point to this controller, with the controller field set to true. // There cannot be more than one managing controller. // +optional // +patchMergeKey=uid // +patchStrategy=merge OwnerReferences []metav1.OwnerReference `json:"ownerReferences,omitempty" patchStrategy:"merge" patchMergeKey:"uid"` }
ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. This is a copy of customizable fields from metav1.ObjectMeta.
ObjectMeta is embedded in `Machine.Spec`, `MachineDeployment.Template` and `MachineSet.Template`, which are not top-level Kubernetes objects. Given that metav1.ObjectMeta has lots of special cases and read-only fields which end up in the generated CRD validation, having it as a subset simplifies the API and some issues that can impact user experience.
During the [upgrade to controller-tools@v2](https://github.com/kubernetes-sigs/cluster-api/pull/1054) for v1alpha2, we noticed a failure would occur running Cluster API test suite against the new CRDs, specifically `spec.metadata.creationTimestamp in body must be of type string: "null"`. The investigation showed that `controller-tools@v2` behaves differently than its previous version when handling types from metav1(k8s.io/apimachinery/pkg/apis/meta/v1) package.
In more details, we found that embedded (non-top level) types that embedded `metav1.ObjectMeta` had validation properties, including for `creationTimestamp` (metav1.Time). The `metav1.Time` type specifies a custom json marshaller that, when IsZero() is true, returns `null` which breaks validation because the field isn't marked as nullable.
In future versions, controller-tools@v2 might allow overriding the type and validation for embedded types. When that happens, this hack should be revisited.
func (*ObjectMeta) DeepCopy ¶
func (in *ObjectMeta) DeepCopy() *ObjectMeta
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMeta.
func (*ObjectMeta) DeepCopyInto ¶
func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ProviderSpec ¶
type ProviderSpec struct { // Value is an inlined, serialized representation of the resource // configuration. It is recommended that providers maintain their own // versioned API types that should be serialized/deserialized from this // field, akin to component config. // +optional // +kubebuilder:validation:XPreserveUnknownFields Value *runtime.RawExtension `json:"value,omitempty"` }
ProviderSpec defines the configuration to use during node creation.
func (*ProviderSpec) DeepCopy ¶
func (in *ProviderSpec) DeepCopy() *ProviderSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderSpec.
func (*ProviderSpec) DeepCopyInto ¶
func (in *ProviderSpec) DeepCopyInto(out *ProviderSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RemediationStrategyType ¶
type RemediationStrategyType string
RemediationStrategyType contains remediation strategy type
type UnhealthyCondition ¶
type UnhealthyCondition struct { // +kubebuilder:validation:Type=string // +kubebuilder:validation:MinLength=1 Type corev1.NodeConditionType `json:"type"` // +kubebuilder:validation:Type=string // +kubebuilder:validation:MinLength=1 Status corev1.ConditionStatus `json:"status"` // Expects an unsigned duration string of decimal numbers each with optional // fraction and a unit suffix, eg "300ms", "1.5h" or "2h45m". // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". // +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$" // +kubebuilder:validation:Type:=string Timeout metav1.Duration `json:"timeout"` }
UnhealthyCondition represents a Node condition type and value with a timeout specified as a duration. When the named condition has been in the given status for at least the timeout value, a node is considered unhealthy.
func (*UnhealthyCondition) DeepCopy ¶
func (in *UnhealthyCondition) DeepCopy() *UnhealthyCondition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnhealthyCondition.
func (*UnhealthyCondition) DeepCopyInto ¶
func (in *UnhealthyCondition) DeepCopyInto(out *UnhealthyCondition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.