Skip to content

cluster.v1beta2.machineHealthCheck

"MachineHealthCheck is the Schema for the machinehealthchecks API."

Index

Fields

fn new

new(name)

new returns an instance of MachineHealthCheck

obj metadata

"ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create."

fn metadata.withAnnotations

withAnnotations(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"

fn metadata.withAnnotationsMixin

withAnnotationsMixin(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"

Note: This function appends passed data to existing values

fn metadata.withClusterName

withClusterName(clusterName)

"The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request."

fn metadata.withCreationTimestamp

withCreationTimestamp(creationTimestamp)

"Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers."

fn metadata.withDeletionGracePeriodSeconds

withDeletionGracePeriodSeconds(deletionGracePeriodSeconds)

"Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only."

fn metadata.withDeletionTimestamp

withDeletionTimestamp(deletionTimestamp)

"Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers."

fn metadata.withFinalizers

withFinalizers(finalizers)

"Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list."

fn metadata.withFinalizersMixin

withFinalizersMixin(finalizers)

"Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list."

Note: This function appends passed data to existing values

fn metadata.withGenerateName

withGenerateName(generateName)

"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.\n\nIf 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).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency"

fn metadata.withGeneration

withGeneration(generation)

"A sequence number representing a specific generation of the desired state. Populated by the system. Read-only."

fn metadata.withLabels

withLabels(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"

fn metadata.withLabelsMixin

withLabelsMixin(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"

Note: This function appends passed data to existing values

fn metadata.withName

withName(name)

"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"

fn metadata.withNamespace

withNamespace(namespace)

"Namespace defines the space within which 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.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces"

fn metadata.withOwnerReferences

withOwnerReferences(ownerReferences)

"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."

fn metadata.withOwnerReferencesMixin

withOwnerReferencesMixin(ownerReferences)

"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."

Note: This function appends passed data to existing values

fn metadata.withResourceVersion

withResourceVersion(resourceVersion)

"An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency"

withSelfLink(selfLink)

"SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release."

fn metadata.withUid

withUid(uid)

"UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids"

obj spec

"spec is the specification of machine health check policy"

fn spec.withClusterName

withClusterName(clusterName)

"clusterName is the name of the Cluster this object belongs to."

obj spec.checks

"checks are the checks that are used to evaluate if a Machine is healthy.\n\nIndependent of this configuration the MachineHealthCheck controller will always\nflag Machines with cluster.x-k8s.io/remediate-machine annotation and\nMachines with deleted Nodes as unhealthy.\n\nFurthermore, if checks.nodeStartupTimeoutSeconds is not set it\nis defaulted to 10 minutes and evaluated accordingly."

fn spec.checks.withNodeStartupTimeoutSeconds

withNodeStartupTimeoutSeconds(nodeStartupTimeoutSeconds)

"nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck\nto consider a Machine unhealthy if a corresponding Node isn't associated\nthrough a Spec.ProviderID field.\n\nThe duration set in this field is compared to the greatest of:\n- Cluster's infrastructure ready condition timestamp (if and when available)\n- Control Plane's initialized condition timestamp (if and when available)\n- Machine's infrastructure ready condition timestamp (if and when available)\n- Machine's metadata creation timestamp\n\nDefaults to 10 minutes.\nIf you wish to disable this feature, set the value explicitly to 0."

fn spec.checks.withUnhealthyMachineConditions

withUnhealthyMachineConditions(unhealthyMachineConditions)

"unhealthyMachineConditions contains a list of the machine conditions that determine\nwhether a machine is considered unhealthy. The conditions are combined in a\nlogical OR, i.e. if any of the conditions is met, the machine is unhealthy."

fn spec.checks.withUnhealthyMachineConditionsMixin

withUnhealthyMachineConditionsMixin(unhealthyMachineConditions)

"unhealthyMachineConditions contains a list of the machine conditions that determine\nwhether a machine is considered unhealthy. The conditions are combined in a\nlogical OR, i.e. if any of the conditions is met, the machine is unhealthy."

Note: This function appends passed data to existing values

fn spec.checks.withUnhealthyNodeConditions

withUnhealthyNodeConditions(unhealthyNodeConditions)

"unhealthyNodeConditions contains a list of conditions that determine\nwhether a node is considered unhealthy. The conditions are combined in a\nlogical OR, i.e. if any of the conditions is met, the node is unhealthy."

fn spec.checks.withUnhealthyNodeConditionsMixin

withUnhealthyNodeConditionsMixin(unhealthyNodeConditions)

"unhealthyNodeConditions contains a list of conditions that determine\nwhether a node is considered unhealthy. The conditions are combined in a\nlogical OR, i.e. if any of the conditions is met, the node is unhealthy."

Note: This function appends passed data to existing values

obj spec.checks.unhealthyMachineConditions

"unhealthyMachineConditions contains a list of the machine conditions that determine\nwhether a machine is considered unhealthy. The conditions are combined in a\nlogical OR, i.e. if any of the conditions is met, the machine is unhealthy."

fn spec.checks.unhealthyMachineConditions.withTimeoutSeconds

withTimeoutSeconds(timeoutSeconds)

"timeoutSeconds is the duration that a machine must be in a given status for,\nafter which the machine is considered unhealthy.\nFor example, with a value of \"3600\", the machine must match the status\nfor at least 1 hour before being considered unhealthy."

fn spec.checks.unhealthyMachineConditions.withType

withType(type)

"type of Machine condition"

obj spec.checks.unhealthyNodeConditions

"unhealthyNodeConditions contains a list of conditions that determine\nwhether a node is considered unhealthy. The conditions are combined in a\nlogical OR, i.e. if any of the conditions is met, the node is unhealthy."

fn spec.checks.unhealthyNodeConditions.withTimeoutSeconds

withTimeoutSeconds(timeoutSeconds)

"timeoutSeconds is the duration that a node must be in a given status for,\nafter which the node is considered unhealthy.\nFor example, with a value of \"3600\", the node must match the status\nfor at least 1 hour before being considered unhealthy."

fn spec.checks.unhealthyNodeConditions.withType

withType(type)

"type of Node condition"

obj spec.remediation

"remediation configures if and how remediations are triggered if a Machine is unhealthy.\n\nIf remediation or remediation.triggerIf is not set,\nremediation will always be triggered for unhealthy Machines.\n\nIf remediation or remediation.templateRef is not set,\nthe OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via\nthe owner of the Machines, for example a MachineSet or a KubeadmControlPlane."

obj spec.remediation.templateRef

"templateRef is a reference to a remediation template\nprovided by an infrastructure provider.\n\nThis field is completely optional, when filled, the MachineHealthCheck controller\ncreates a new object from the template referenced and hands off remediation of the machine to\na controller that lives outside of Cluster API."

fn spec.remediation.templateRef.withApiVersion

withApiVersion(apiVersion)

"apiVersion of the remediation template.\napiVersion must be fully qualified domain name followed by / and a version.\nNOTE: This field must be kept in sync with the APIVersion of the remediation template."

fn spec.remediation.templateRef.withKind

withKind(kind)

"kind of the remediation template.\nkind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character."

fn spec.remediation.templateRef.withName

withName(name)

"name of the remediation template.\nname must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character."

obj spec.remediation.triggerIf

"triggerIf configures if remediations are triggered.\nIf this field is not set, remediations are always triggered."

fn spec.remediation.triggerIf.withUnhealthyInRange

withUnhealthyInRange(unhealthyInRange)

"unhealthyInRange specifies that remediations are only triggered if the number of\nunhealthy Machines is in the configured range.\nTakes precedence over unhealthyLessThanOrEqualTo.\nEg. \"[3-5]\" - This means that remediation will be allowed only when:\n(a) there are at least 3 unhealthy Machines (and)\n(b) there are at most 5 unhealthy Machines"

fn spec.remediation.triggerIf.withUnhealthyLessThanOrEqualTo

withUnhealthyLessThanOrEqualTo(unhealthyLessThanOrEqualTo)

"unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of\nunhealthy Machines is less than or equal to the configured value.\nunhealthyInRange takes precedence if set."

obj spec.selector

"selector is a label selector to match machines whose health will be exercised"

fn spec.selector.withMatchExpressions

withMatchExpressions(matchExpressions)

"matchExpressions is a list of label selector requirements. The requirements are ANDed."

fn spec.selector.withMatchExpressionsMixin

withMatchExpressionsMixin(matchExpressions)

"matchExpressions is a list of label selector requirements. The requirements are ANDed."

Note: This function appends passed data to existing values

fn spec.selector.withMatchLabels

withMatchLabels(matchLabels)

"matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels\nmap is equivalent to an element of matchExpressions, whose key field is \"key\", the\noperator is \"In\", and the values array contains only \"value\". The requirements are ANDed."

fn spec.selector.withMatchLabelsMixin

withMatchLabelsMixin(matchLabels)

"matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels\nmap is equivalent to an element of matchExpressions, whose key field is \"key\", the\noperator is \"In\", and the values array contains only \"value\". The requirements are ANDed."

Note: This function appends passed data to existing values

obj spec.selector.matchExpressions

"matchExpressions is a list of label selector requirements. The requirements are ANDed."

fn spec.selector.matchExpressions.withKey

withKey(key)

"key is the label key that the selector applies to."

fn spec.selector.matchExpressions.withOperator

withOperator(operator)

"operator represents a key's relationship to a set of values.\nValid operators are In, NotIn, Exists and DoesNotExist."

fn spec.selector.matchExpressions.withValues

withValues(values)

"values is an array of string values. If the operator is In or NotIn,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. This array is replaced during a strategic\nmerge patch."

fn spec.selector.matchExpressions.withValuesMixin

withValuesMixin(values)

"values is an array of string values. If the operator is In or NotIn,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. This array is replaced during a strategic\nmerge patch."

Note: This function appends passed data to existing values