diff --git a/api/scheme.go b/api/scheme.go index 624e8b3e89f..9f52e135c50 100644 --- a/api/scheme.go +++ b/api/scheme.go @@ -13,7 +13,7 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" capiv1 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha4" - capiaws "github.com/openshift/hypershift/thirdparty/clusterapiprovideraws/v1alpha3" + capiaws "github.com/openshift/hypershift/thirdparty/clusterapiprovideraws/v1alpha4" etcd "github.com/openshift/hypershift/thirdparty/etcd/v1beta2" hyperv1 "github.com/openshift/hypershift/api/v1alpha1" diff --git a/api/v1alpha1/externalinfracluster.go b/api/v1alpha1/externalinfracluster.go deleted file mode 100644 index 958f0aadca9..00000000000 --- a/api/v1alpha1/externalinfracluster.go +++ /dev/null @@ -1,59 +0,0 @@ -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func init() { - SchemeBuilder.Register(&ExternalInfraCluster{}) - SchemeBuilder.Register(&ExternalInfraClusterList{}) -} - -// +kubebuilder:resource:path=externalinfraclusters,shortName=eic;eics,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status -// ExternalInfraCluster is the Schema for the ExternalInfraCluster API -type ExternalInfraCluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ExternalInfraClusterSpec `json:"spec,omitempty"` - Status ExternalInfraClusterStatus `json:"status,omitempty"` -} - -// ExternalInfraClusterSpec defines the desired state of ExternalInfraCluster -type ExternalInfraClusterSpec struct { - // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. - // +optional - ControlPlaneEndpoint APIEndpoint `json:"controlPlaneEndpoint,omitempty"` - - // +optional - ComputeReplicas int `json:"computeReplicas,omitempty"` - - // TODO (alberto): populate the API and create/consume infrastructure via aws sdk - // role profile, sg, vpc, subnets. - Region string `json:"region"` -} - -type APIEndpoint struct { - // Host is the hostname on which the API server is serving. - Host string `json:"host"` - - // Port is the port on which the API server is serving. - Port int32 `json:"port"` -} - -// ExternalInfraClusterStatus defines the observed state of ExternalInfraCluster -type ExternalInfraClusterStatus struct { - // +optional - Ready bool `json:"ready,omitempty"` -} - -// +kubebuilder:object:root=true -// ExternalInfraClusterList contains a list of ExternalInfraClusters. -type ExternalInfraClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ExternalInfraCluster `json:"items"` -} diff --git a/api/v1alpha1/hosted_controlplane.go b/api/v1alpha1/hosted_controlplane.go index 3f7b69e04ac..bbc779709f2 100644 --- a/api/v1alpha1/hosted_controlplane.go +++ b/api/v1alpha1/hosted_controlplane.go @@ -146,6 +146,14 @@ type HostedControlPlaneStatus struct { Conditions []HostedControlPlaneCondition `json:"conditions"` } +type APIEndpoint struct { + // Host is the hostname on which the API server is serving. + Host string `json:"host"` + + // Port is the port on which the API server is serving. + Port int32 `json:"port"` +} + // +kubebuilder:object:root=true // HostedControlPlaneList contains a list of HostedControlPlanes. type HostedControlPlaneList struct { diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 7143f7795c4..993f48b1ac2 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -246,96 +246,6 @@ func (in *DNSSpec) DeepCopy() *DNSSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalInfraCluster) DeepCopyInto(out *ExternalInfraCluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalInfraCluster. -func (in *ExternalInfraCluster) DeepCopy() *ExternalInfraCluster { - if in == nil { - return nil - } - out := new(ExternalInfraCluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ExternalInfraCluster) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalInfraClusterList) DeepCopyInto(out *ExternalInfraClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ExternalInfraCluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalInfraClusterList. -func (in *ExternalInfraClusterList) DeepCopy() *ExternalInfraClusterList { - if in == nil { - return nil - } - out := new(ExternalInfraClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ExternalInfraClusterList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalInfraClusterSpec) DeepCopyInto(out *ExternalInfraClusterSpec) { - *out = *in - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalInfraClusterSpec. -func (in *ExternalInfraClusterSpec) DeepCopy() *ExternalInfraClusterSpec { - if in == nil { - return nil - } - out := new(ExternalInfraClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalInfraClusterStatus) DeepCopyInto(out *ExternalInfraClusterStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalInfraClusterStatus. -func (in *ExternalInfraClusterStatus) DeepCopy() *ExternalInfraClusterStatus { - if in == nil { - return nil - } - out := new(ExternalInfraClusterStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Filter) DeepCopyInto(out *Filter) { *out = *in diff --git a/cmd/cluster/dump.go b/cmd/cluster/dump.go index fd4b20afcf0..0b17f9a6555 100644 --- a/cmd/cluster/dump.go +++ b/cmd/cluster/dump.go @@ -23,7 +23,7 @@ import ( "github.com/openshift/hypershift/cmd/util" "github.com/openshift/hypershift/hypershift-operator/controllers/manifests" capiv1 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha4" - capiaws "github.com/openshift/hypershift/thirdparty/clusterapiprovideraws/v1alpha3" + capiaws "github.com/openshift/hypershift/thirdparty/clusterapiprovideraws/v1alpha4" ) type DumpOptions struct { @@ -110,8 +110,8 @@ func DumpCluster(ctx context.Context, opts *DumpOptions) error { &capiv1.MachineSet{}, &capiaws.AWSMachine{}, &capiaws.AWSMachineTemplate{}, + &capiaws.AWSCluster{}, &hyperv1.HostedControlPlane{}, - &hyperv1.ExternalInfraCluster{}, } resourceList := strings.Join(resourceTypes(resources), ",") cmd.WithNamespace(controlPlaneNamespace).Run(resourceList) diff --git a/cmd/install/assets/cluster-api/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml b/cmd/install/assets/cluster-api/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml new file mode 100644 index 00000000000..14e0146afe6 --- /dev/null +++ b/cmd/install/assets/cluster-api/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml @@ -0,0 +1,192 @@ + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.6.0-beta.0 + creationTimestamp: null + name: clusterresourcesetbindings.addons.cluster.x-k8s.io +spec: + group: addons.cluster.x-k8s.io + names: + categories: + - cluster-api + kind: ClusterResourceSetBinding + listKind: ClusterResourceSetBindingList + plural: clusterresourcesetbindings + singular: clusterresourcesetbinding + scope: Namespaced + versions: + - name: v1alpha3 + schema: + openAPIV3Schema: + description: ClusterResourceSetBinding lists all matching ClusterResourceSets + with the cluster it belongs to. + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: ClusterResourceSetBindingSpec defines the desired state of + ClusterResourceSetBinding. + properties: + bindings: + description: Bindings is a list of ClusterResourceSets and their resources. + items: + description: ResourceSetBinding keeps info on all of the resources + in a ClusterResourceSet. + properties: + clusterResourceSetName: + description: ClusterResourceSetName is the name of the ClusterResourceSet + that is applied to the owner cluster of the binding. + type: string + resources: + description: Resources is a list of resources that the ClusterResourceSet + has. + items: + description: ResourceBinding shows the status of a resource + that belongs to a ClusterResourceSet matched by the owner + cluster of the ClusterResourceSetBinding object. + properties: + applied: + description: Applied is to track if a resource is applied + to the cluster or not. + type: boolean + hash: + description: Hash is the hash of a resource's data. This + can be used to decide if a resource is changed. For + "ApplyOnce" ClusterResourceSet.spec.strategy, this is + no-op as that strategy does not act on change. + type: string + kind: + description: 'Kind of the resource. Supported kinds are: + Secrets and ConfigMaps.' + enum: + - Secret + - ConfigMap + type: string + lastAppliedTime: + description: LastAppliedTime identifies when this resource + was last applied to the cluster. + format: date-time + type: string + name: + description: Name of the resource that is in the same + namespace with ClusterResourceSet object. + minLength: 1 + type: string + required: + - applied + - kind + - name + type: object + type: array + required: + - clusterResourceSetName + type: object + type: array + type: object + type: object + served: true + storage: false + subresources: + status: {} + - name: v1alpha4 + schema: + openAPIV3Schema: + description: ClusterResourceSetBinding lists all matching ClusterResourceSets + with the cluster it belongs to. + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: ClusterResourceSetBindingSpec defines the desired state of + ClusterResourceSetBinding. + properties: + bindings: + description: Bindings is a list of ClusterResourceSets and their resources. + items: + description: ResourceSetBinding keeps info on all of the resources + in a ClusterResourceSet. + properties: + clusterResourceSetName: + description: ClusterResourceSetName is the name of the ClusterResourceSet + that is applied to the owner cluster of the binding. + type: string + resources: + description: Resources is a list of resources that the ClusterResourceSet + has. + items: + description: ResourceBinding shows the status of a resource + that belongs to a ClusterResourceSet matched by the owner + cluster of the ClusterResourceSetBinding object. + properties: + applied: + description: Applied is to track if a resource is applied + to the cluster or not. + type: boolean + hash: + description: Hash is the hash of a resource's data. This + can be used to decide if a resource is changed. For + "ApplyOnce" ClusterResourceSet.spec.strategy, this is + no-op as that strategy does not act on change. + type: string + kind: + description: 'Kind of the resource. Supported kinds are: + Secrets and ConfigMaps.' + enum: + - Secret + - ConfigMap + type: string + lastAppliedTime: + description: LastAppliedTime identifies when this resource + was last applied to the cluster. + format: date-time + type: string + name: + description: Name of the resource that is in the same + namespace with ClusterResourceSet object. + minLength: 1 + type: string + required: + - applied + - kind + - name + type: object + type: array + required: + - clusterResourceSetName + type: object + type: array + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/cmd/install/assets/cluster-api/addons.cluster.x-k8s.io_clusterresourcesets.yaml b/cmd/install/assets/cluster-api/addons.cluster.x-k8s.io_clusterresourcesets.yaml new file mode 100644 index 00000000000..9cbc7dd5d14 --- /dev/null +++ b/cmd/install/assets/cluster-api/addons.cluster.x-k8s.io_clusterresourcesets.yaml @@ -0,0 +1,340 @@ + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.6.0-beta.0 + creationTimestamp: null + name: clusterresourcesets.addons.cluster.x-k8s.io +spec: + group: addons.cluster.x-k8s.io + names: + categories: + - cluster-api + kind: ClusterResourceSet + listKind: ClusterResourceSetList + plural: clusterresourcesets + singular: clusterresourceset + scope: Namespaced + versions: + - name: v1alpha3 + schema: + openAPIV3Schema: + description: ClusterResourceSet is the Schema for the clusterresourcesets + API. + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: ClusterResourceSetSpec defines the desired state of ClusterResourceSet. + properties: + clusterSelector: + description: Label selector for Clusters. The Clusters that are selected + by this will be the ones affected by this ClusterResourceSet. It + must match the Cluster labels. This field is immutable. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + 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. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + 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 + type: object + resources: + description: Resources is a list of Secrets/ConfigMaps where each + contains 1 or more resources to be applied to remote clusters. + items: + description: ResourceRef specifies a resource. + properties: + kind: + description: 'Kind of the resource. Supported kinds are: Secrets + and ConfigMaps.' + enum: + - Secret + - ConfigMap + type: string + name: + description: Name of the resource that is in the same namespace + with ClusterResourceSet object. + minLength: 1 + type: string + required: + - kind + - name + type: object + type: array + strategy: + description: Strategy is the strategy to be used during applying resources. + Defaults to ApplyOnce. This field is immutable. + enum: + - ApplyOnce + type: string + required: + - clusterSelector + type: object + status: + description: ClusterResourceSetStatus defines the observed state of ClusterResourceSet. + properties: + conditions: + description: Conditions defines current state of the ClusterResourceSet. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: 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. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: 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. + type: string + severity: + description: 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. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: 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. + type: string + required: + - status + - type + type: object + type: array + observedGeneration: + description: ObservedGeneration reflects the generation of the most + recently observed ClusterResourceSet. + format: int64 + type: integer + type: object + type: object + served: true + storage: false + subresources: + status: {} + - name: v1alpha4 + schema: + openAPIV3Schema: + description: ClusterResourceSet is the Schema for the clusterresourcesets + API. + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: ClusterResourceSetSpec defines the desired state of ClusterResourceSet. + properties: + clusterSelector: + description: Label selector for Clusters. The Clusters that are selected + by this will be the ones affected by this ClusterResourceSet. It + must match the Cluster labels. This field is immutable. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + 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. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + 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 + type: object + resources: + description: Resources is a list of Secrets/ConfigMaps where each + contains 1 or more resources to be applied to remote clusters. + items: + description: ResourceRef specifies a resource. + properties: + kind: + description: 'Kind of the resource. Supported kinds are: Secrets + and ConfigMaps.' + enum: + - Secret + - ConfigMap + type: string + name: + description: Name of the resource that is in the same namespace + with ClusterResourceSet object. + minLength: 1 + type: string + required: + - kind + - name + type: object + type: array + strategy: + description: Strategy is the strategy to be used during applying resources. + Defaults to ApplyOnce. This field is immutable. + enum: + - ApplyOnce + type: string + required: + - clusterSelector + type: object + status: + description: ClusterResourceSetStatus defines the observed state of ClusterResourceSet. + properties: + conditions: + description: Conditions defines current state of the ClusterResourceSet. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: 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. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: 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. + type: string + severity: + description: 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. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: 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. + type: string + required: + - status + - type + type: object + type: array + observedGeneration: + description: ObservedGeneration reflects the generation of the most + recently observed ClusterResourceSet. + format: int64 + type: integer + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/cmd/install/assets/cluster-api/cluster.x-k8s.io_clusters.yaml b/cmd/install/assets/cluster-api/cluster.x-k8s.io_clusters.yaml index ae4b56da551..1f163f338d5 100644 --- a/cmd/install/assets/cluster-api/cluster.x-k8s.io_clusters.yaml +++ b/cmd/install/assets/cluster-api/cluster.x-k8s.io_clusters.yaml @@ -1,8 +1,10 @@ + +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.4.1-0.20201002000720-57250aac17f6 + controller-gen.kubebuilder.io/version: v0.6.0-beta.0 creationTimestamp: null name: clusters.cluster.x-k8s.io spec: @@ -26,24 +28,29 @@ spec: name: v1alpha3 schema: openAPIV3Schema: - description: Cluster is the Schema for the clusters API + description: Cluster is the Schema for the clusters API. properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object spec: - description: ClusterSpec defines the desired state of Cluster + description: ClusterSpec defines the desired state of Cluster. properties: clusterNetwork: description: Cluster network configuration. properties: apiServerPort: - description: APIServerPort specifies the port the API Server should bind to. Defaults to 6443. + description: APIServerPort specifies the port the API Server should + bind to. Defaults to 6443. format: int32 type: integer pods: @@ -71,7 +78,8 @@ spec: type: object type: object controlPlaneEndpoint: - description: ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + description: ControlPlaneEndpoint represents the endpoint used to + communicate with the control plane. properties: host: description: The hostname on which the API server is serving. @@ -85,13 +93,25 @@ spec: - port type: object controlPlaneRef: - description: ControlPlaneRef is an optional reference to a provider-specific resource that holds the details for provisioning the Control Plane for a Cluster. + description: ControlPlaneRef is an optional reference to a provider-specific + resource that holds the details for provisioning the Control Plane + for a Cluster. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -103,20 +123,33 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object infrastructureRef: - description: InfrastructureRef is a reference to a provider-specific resource that holds the details for provisioning infrastructure for a cluster in said provider. + description: InfrastructureRef is a reference to a provider-specific + resource that holds the details for provisioning infrastructure + for a cluster in said provider. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -128,42 +161,59 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object paused: - description: Paused can be used to prevent controllers from processing the Cluster and all its associated objects. + description: Paused can be used to prevent controllers from processing + the Cluster and all its associated objects. type: boolean type: object status: - description: ClusterStatus defines the observed state of Cluster + description: ClusterStatus defines the observed state of Cluster. properties: conditions: description: Conditions defines current service state of the cluster. items: - description: Condition defines an observation of a Cluster API resource operational state. + description: Condition defines an observation of a Cluster API resource + operational state. properties: lastTransitionTime: - description: 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. + description: 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. format: date-time type: string message: - description: A human readable message indicating details about the transition. This field may be empty. + description: A human readable message indicating details about + the transition. This field may be empty. type: string reason: - description: 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. + description: 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. type: string severity: - description: 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. + description: 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. type: string status: description: Status of the condition, one of True, False, Unknown. type: string type: - description: 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. + description: 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. type: string required: - status @@ -171,41 +221,53 @@ spec: type: object type: array controlPlaneInitialized: - description: ControlPlaneInitialized defines if the control plane has been initialized. + description: ControlPlaneInitialized defines if the control plane + has been initialized. type: boolean controlPlaneReady: description: ControlPlaneReady defines if the control plane is ready. type: boolean failureDomains: additionalProperties: - description: FailureDomainSpec is the Schema for Cluster API failure domains. It allows controllers to understand how many failure domains a cluster can optionally span across. + description: FailureDomainSpec is the Schema for Cluster API failure + domains. It allows controllers to understand how many failure + domains a cluster can optionally span across. properties: attributes: additionalProperties: type: string - description: Attributes is a free form map of attributes an infrastructure provider might use or require. + description: Attributes is a free form map of attributes an + infrastructure provider might use or require. type: object controlPlane: - description: ControlPlane determines if this failure domain is suitable for use by control plane machines. + description: ControlPlane determines if this failure domain + is suitable for use by control plane machines. type: boolean type: object - description: FailureDomains is a slice of failure domain objects synced from the infrastructure provider. + description: FailureDomains is a slice of failure domain objects synced + from the infrastructure provider. type: object failureMessage: - description: FailureMessage indicates that there is a fatal problem reconciling the state, and will be set to a descriptive error message. + description: FailureMessage indicates that there is a fatal problem + reconciling the state, and will be set to a descriptive error message. type: string failureReason: - description: FailureReason indicates that there is a fatal problem reconciling the state, and will be set to a token value suitable for programmatic interpretation. + description: FailureReason indicates that there is a fatal problem + reconciling the state, and will be set to a token value suitable + for programmatic interpretation. type: string infrastructureReady: - description: InfrastructureReady is the state of the infrastructure provider. + description: InfrastructureReady is the state of the infrastructure + provider. type: boolean observedGeneration: - description: ObservedGeneration is the latest generation observed by the controller. + description: ObservedGeneration is the latest generation observed + by the controller. format: int64 type: integer phase: - description: Phase represents the current phase of cluster actuation. E.g. Pending, Running, Terminating, Failed etc. + description: Phase represents the current phase of cluster actuation. + E.g. Pending, Running, Terminating, Failed etc. type: string type: object type: object @@ -221,24 +283,29 @@ spec: name: v1alpha4 schema: openAPIV3Schema: - description: Cluster is the Schema for the clusters API + description: Cluster is the Schema for the clusters API. properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object spec: - description: ClusterSpec defines the desired state of Cluster + description: ClusterSpec defines the desired state of Cluster. properties: clusterNetwork: description: Cluster network configuration. properties: apiServerPort: - description: APIServerPort specifies the port the API Server should bind to. Defaults to 6443. + description: APIServerPort specifies the port the API Server should + bind to. Defaults to 6443. format: int32 type: integer pods: @@ -266,7 +333,8 @@ spec: type: object type: object controlPlaneEndpoint: - description: ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + description: ControlPlaneEndpoint represents the endpoint used to + communicate with the control plane. properties: host: description: The hostname on which the API server is serving. @@ -280,13 +348,25 @@ spec: - port type: object controlPlaneRef: - description: ControlPlaneRef is an optional reference to a provider-specific resource that holds the details for provisioning the Control Plane for a Cluster. + description: ControlPlaneRef is an optional reference to a provider-specific + resource that holds the details for provisioning the Control Plane + for a Cluster. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -298,20 +378,33 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object infrastructureRef: - description: InfrastructureRef is a reference to a provider-specific resource that holds the details for provisioning infrastructure for a cluster in said provider. + description: InfrastructureRef is a reference to a provider-specific + resource that holds the details for provisioning infrastructure + for a cluster in said provider. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -323,84 +416,109 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object paused: - description: Paused can be used to prevent controllers from processing the Cluster and all its associated objects. + description: Paused can be used to prevent controllers from processing + the Cluster and all its associated objects. type: boolean type: object status: - description: ClusterStatus defines the observed state of Cluster + description: ClusterStatus defines the observed state of Cluster. properties: conditions: description: Conditions defines current service state of the cluster. items: - description: Condition defines an observation of a Cluster API resource operational state. + description: Condition defines an observation of a Cluster API resource + operational state. properties: lastTransitionTime: - description: 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. + description: 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. format: date-time type: string message: - description: A human readable message indicating details about the transition. This field may be empty. + description: A human readable message indicating details about + the transition. This field may be empty. type: string reason: - description: 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. + description: 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. type: string severity: - description: 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. + description: 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. type: string status: description: Status of the condition, one of True, False, Unknown. type: string type: - description: 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. + description: 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. type: string required: - status - type type: object type: array - controlPlaneInitialized: - description: ControlPlaneInitialized defines if the control plane has been initialized. - type: boolean controlPlaneReady: description: ControlPlaneReady defines if the control plane is ready. type: boolean failureDomains: additionalProperties: - description: FailureDomainSpec is the Schema for Cluster API failure domains. It allows controllers to understand how many failure domains a cluster can optionally span across. + description: FailureDomainSpec is the Schema for Cluster API failure + domains. It allows controllers to understand how many failure + domains a cluster can optionally span across. properties: attributes: additionalProperties: type: string - description: Attributes is a free form map of attributes an infrastructure provider might use or require. + description: Attributes is a free form map of attributes an + infrastructure provider might use or require. type: object controlPlane: - description: ControlPlane determines if this failure domain is suitable for use by control plane machines. + description: ControlPlane determines if this failure domain + is suitable for use by control plane machines. type: boolean type: object - description: FailureDomains is a slice of failure domain objects synced from the infrastructure provider. + description: FailureDomains is a slice of failure domain objects synced + from the infrastructure provider. type: object failureMessage: - description: FailureMessage indicates that there is a fatal problem reconciling the state, and will be set to a descriptive error message. + description: FailureMessage indicates that there is a fatal problem + reconciling the state, and will be set to a descriptive error message. type: string failureReason: - description: FailureReason indicates that there is a fatal problem reconciling the state, and will be set to a token value suitable for programmatic interpretation. + description: FailureReason indicates that there is a fatal problem + reconciling the state, and will be set to a token value suitable + for programmatic interpretation. type: string infrastructureReady: - description: InfrastructureReady is the state of the infrastructure provider. + description: InfrastructureReady is the state of the infrastructure + provider. type: boolean observedGeneration: - description: ObservedGeneration is the latest generation observed by the controller. + description: ObservedGeneration is the latest generation observed + by the controller. format: int64 type: integer phase: - description: Phase represents the current phase of cluster actuation. E.g. Pending, Running, Terminating, Failed etc. + description: Phase represents the current phase of cluster actuation. + E.g. Pending, Running, Terminating, Failed etc. type: string type: object type: object diff --git a/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinedeployments.yaml b/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinedeployments.yaml index dd5145bf0ed..b85de2bc4c2 100644 --- a/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinedeployments.yaml +++ b/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinedeployments.yaml @@ -1,8 +1,10 @@ + +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.4.1-0.20201002000720-57250aac17f6 + controller-gen.kubebuilder.io/version: v0.6.0-beta.0 creationTimestamp: null name: machinedeployments.cluster.x-k8s.io spec: @@ -31,7 +33,8 @@ spec: jsonPath: .status.readyReplicas name: Ready type: integer - - description: Total number of non-terminated machines targeted by this deployment that have the desired template spec + - description: Total number of non-terminated machines targeted by this deployment + that have the desired template spec jsonPath: .status.updatedReplicas name: Updated type: integer @@ -42,58 +45,85 @@ spec: name: v1alpha3 schema: openAPIV3Schema: - description: MachineDeployment is the Schema for the machinedeployments API + description: MachineDeployment is the Schema for the machinedeployments API. properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object spec: - description: MachineDeploymentSpec defines the desired state of MachineDeployment + description: MachineDeploymentSpec defines the desired state of MachineDeployment. properties: clusterName: - description: ClusterName is the name of the Cluster this object belongs to. + description: ClusterName is the name of the Cluster this object belongs + to. minLength: 1 type: string minReadySeconds: - description: 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) + description: 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) format: int32 type: integer paused: description: Indicates that the deployment is paused. type: boolean progressDeadlineSeconds: - description: The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s. + description: The maximum time in seconds for a deployment to make + progress before it is considered to be failed. The deployment controller + will continue to process failed deployments and a condition with + a ProgressDeadlineExceeded reason will be surfaced in the deployment + status. Note that progress will not be estimated during the time + a deployment is paused. Defaults to 600s. format: int32 type: integer replicas: - description: Number of desired machines. Defaults to 1. This is a pointer to distinguish between explicit zero and not specified. + description: Number of desired machines. Defaults to 1. This is a + pointer to distinguish between explicit zero and not specified. format: int32 type: integer revisionHistoryLimit: - description: The number of old MachineSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. + description: The number of old MachineSets to retain to allow rollback. + This is a pointer to distinguish between explicit zero and not specified. + Defaults to 1. format: int32 type: integer selector: - description: Label selector for machines. Existing MachineSets whose machines are selected by this will be the ones affected by this deployment. It must match the machine template's labels. + description: Label selector for machines. Existing MachineSets whose + machines are selected by this will be the ones affected by this + deployment. It must match the machine template's labels. properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key that the selector applies + to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. type: string 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. + 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. items: type: string type: array @@ -105,30 +135,59 @@ spec: matchLabels: additionalProperties: type: string - 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. + 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 type: object strategy: - description: The deployment strategy to use to replace existing machines with new ones. + description: The deployment strategy to use to replace existing machines + with new ones. properties: rollingUpdate: - description: Rolling update config params. Present only if MachineDeploymentStrategyType = RollingUpdate. + description: Rolling update config params. Present only if MachineDeploymentStrategyType + = RollingUpdate. properties: maxSurge: anyOf: - type: integer - type: string - description: 'The maximum number of machines that can be scheduled above the desired number of machines. Value can be an absolute number (ex: 5) or a percentage of desired machines (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 1. Example: when this is set to 30%, the new MachineSet can be scaled up immediately when the rolling update starts, such that the total number of old and new machines do not exceed 130% of desired machines. Once old machines have been killed, new MachineSet can be scaled up further, ensuring that total number of machines running at any time during the update is at most 130% of desired machines.' + description: 'The maximum number of machines that can be scheduled + above the desired number of machines. Value can be an absolute + number (ex: 5) or a percentage of desired machines (ex: + 10%). This can not be 0 if MaxUnavailable is 0. Absolute + number is calculated from percentage by rounding up. Defaults + to 1. Example: when this is set to 30%, the new MachineSet + can be scaled up immediately when the rolling update starts, + such that the total number of old and new machines do not + exceed 130% of desired machines. Once old machines have + been killed, new MachineSet can be scaled up further, ensuring + that total number of machines running at any time during + the update is at most 130% of desired machines.' x-kubernetes-int-or-string: true maxUnavailable: anyOf: - type: integer - type: string - description: 'The maximum number of machines that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired machines (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 0. Example: when this is set to 30%, the old MachineSet can be scaled down to 70% of desired machines immediately when the rolling update starts. Once new machines are ready, old MachineSet can be scaled down further, followed by scaling up the new MachineSet, ensuring that the total number of machines available at all times during the update is at least 70% of desired machines.' + description: 'The maximum number of machines that can be unavailable + during the update. Value can be an absolute number (ex: + 5) or a percentage of desired machines (ex: 10%). Absolute + number is calculated from percentage by rounding down. This + can not be 0 if MaxSurge is 0. Defaults to 0. Example: when + this is set to 30%, the old MachineSet can be scaled down + to 70% of desired machines immediately when the rolling + update starts. Once new machines are ready, old MachineSet + can be scaled down further, followed by scaling up the new + MachineSet, ensuring that the total number of machines available + at all times during the update is at least 70% of desired + machines.' x-kubernetes-int-or-string: true type: object type: - description: Type of deployment. Currently the only supported strategy is "RollingUpdate". Default is RollingUpdate. + description: Type of deployment. Currently the only supported + strategy is "RollingUpdate". Default is RollingUpdate. type: string type: object template: @@ -140,35 +199,88 @@ spec: annotations: additionalProperties: type: string - description: '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' + description: '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' type: object generateName: - description: "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 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). \n Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency" + description: "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 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). \n Applied only if Name is not specified. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + \n Deprecated: This field has no function and is going to + be removed in a next release." type: string labels: additionalProperties: type: string - description: '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' + description: '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' type: object name: - description: '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' + description: "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 \n + Deprecated: This field has no function and is going to be + removed in a next release." type: string namespace: - description: "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. \n Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + description: "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. \n Must be a DNS_LABEL. Cannot be updated. + More info: http://kubernetes.io/docs/user-guide/namespaces + \n Deprecated: This field has no function and is going to + be removed in a next release." type: string ownerReferences: - description: 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. + description: "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. \n Deprecated: This field + has no function and is going to be removed in a next release." items: - description: OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field. + description: OwnerReference contains enough information + to let you identify an owning object. An owning object + must be in the same namespace as the dependent, or be + cluster-scoped, so there is no namespace field. properties: apiVersion: description: API version of the referent. type: string blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned. + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the + key-value store until this reference is removed. Defaults + to false. To set this field, a user needs "delete" + permission of the owner, otherwise 422 (Unprocessable + Entity) will be returned. type: boolean controller: - description: If true, this reference points to the managing controller. + description: If true, this reference points to the managing + controller. type: boolean kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -188,19 +300,37 @@ spec: type: array type: object spec: - description: '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' + description: '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' properties: bootstrap: - description: Bootstrap is a reference to a local struct which encapsulates fields to configure the Machine’s bootstrapping mechanism. + description: Bootstrap is a reference to a local struct which + encapsulates fields to configure the Machine’s bootstrapping + mechanism. properties: configRef: - description: 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.Data without the need of a controller. + description: 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.Data + without the need of a controller. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -209,37 +339,59 @@ spec: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + description: 'Namespace of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object data: - description: "Data contains the bootstrap data, such as cloud-init details scripts. If nil, the Machine should remain in the Pending state. \n Deprecated: This field has been deprecated in v1alpha3 and will be removed in a future version. Switch to DataSecretName." + description: "Data contains the bootstrap data, such as + cloud-init details scripts. If nil, the Machine should + remain in the Pending state. \n Deprecated: Switch to + DataSecretName." type: string dataSecretName: - description: DataSecretName is the name of the secret that stores the bootstrap data script. If nil, the Machine should remain in the Pending state. + description: DataSecretName is the name of the secret + that stores the bootstrap data script. If nil, the Machine + should remain in the Pending state. type: string type: object clusterName: - description: ClusterName is the name of the Cluster this object belongs to. + description: ClusterName is the name of the Cluster this object + belongs to. minLength: 1 type: string failureDomain: - description: FailureDomain is the failure domain the machine will be created in. Must match a key in the FailureDomains map stored on the cluster object. + description: FailureDomain is the failure domain the machine + will be created in. Must match a key in the FailureDomains + map stored on the cluster object. type: string infrastructureRef: - description: InfrastructureRef is a required reference to a custom resource offered by an infrastructure provider. + description: InfrastructureRef is a required reference to + a custom resource offered by an infrastructure provider. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -251,20 +403,41 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object nodeDrainTimeout: - description: '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`' + description: '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`' type: string providerID: - description: 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. + description: 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. type: string version: - description: Version defines the desired Kubernetes version. This field is meant to be optionally used by bootstrap providers. + description: Version defines the desired Kubernetes version. + This field is meant to be optionally used by bootstrap providers. type: string required: - bootstrap @@ -278,10 +451,11 @@ spec: - template type: object status: - description: MachineDeploymentStatus defines the observed state of MachineDeployment + description: MachineDeploymentStatus defines the observed state of MachineDeployment. properties: availableReplicas: - description: Total number of available machines (ready for at least minReadySeconds) targeted by this deployment. + description: Total number of available machines (ready for at least + minReadySeconds) targeted by this deployment. format: int32 type: integer observedGeneration: @@ -289,25 +463,35 @@ spec: format: int64 type: integer phase: - description: Phase represents the current phase of a MachineDeployment (ScalingUp, ScalingDown, Running, Failed, or Unknown). + description: Phase represents the current phase of a MachineDeployment + (ScalingUp, ScalingDown, Running, Failed, or Unknown). type: string readyReplicas: description: Total number of ready machines targeted by this deployment. format: int32 type: integer replicas: - description: Total number of non-terminated machines targeted by this deployment (their labels match the selector). + description: Total number of non-terminated machines targeted by this + deployment (their labels match the selector). format: int32 type: integer selector: - description: 'Selector is the same as the label selector but in the string format to avoid introspection by clients. The string will be in the same format as the query-param syntax. More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors' + description: 'Selector is the same as the label selector but in the + string format to avoid introspection by clients. The string will + be in the same format as the query-param syntax. More info about + label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors' type: string unavailableReplicas: - description: Total number of unavailable machines targeted by this deployment. This is the total number of machines that are still required for the deployment to have 100% available capacity. They may either be machines that are running but not yet available or machines that still have not been created. + description: Total number of unavailable machines targeted by this + deployment. This is the total number of machines that are still + required for the deployment to have 100% available capacity. They + may either be machines that are running but not yet available or + machines that still have not been created. format: int32 type: integer updatedReplicas: - description: Total number of non-terminated machines targeted by this deployment that have the desired template spec. + description: Total number of non-terminated machines targeted by this + deployment that have the desired template spec. format: int32 type: integer type: object @@ -333,7 +517,8 @@ spec: jsonPath: .status.readyReplicas name: Ready type: integer - - description: Total number of non-terminated machines targeted by this deployment that have the desired template spec + - description: Total number of non-terminated machines targeted by this deployment + that have the desired template spec jsonPath: .status.updatedReplicas name: Updated type: integer @@ -344,58 +529,86 @@ spec: name: v1alpha4 schema: openAPIV3Schema: - description: MachineDeployment is the Schema for the machinedeployments API + description: MachineDeployment is the Schema for the machinedeployments API. properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object spec: - description: MachineDeploymentSpec defines the desired state of MachineDeployment + description: MachineDeploymentSpec defines the desired state of MachineDeployment. properties: clusterName: - description: ClusterName is the name of the Cluster this object belongs to. + description: ClusterName is the name of the Cluster this object belongs + to. minLength: 1 type: string minReadySeconds: - description: 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) + description: 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) format: int32 type: integer paused: description: Indicates that the deployment is paused. type: boolean progressDeadlineSeconds: - description: The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s. + description: The maximum time in seconds for a deployment to make + progress before it is considered to be failed. The deployment controller + will continue to process failed deployments and a condition with + a ProgressDeadlineExceeded reason will be surfaced in the deployment + status. Note that progress will not be estimated during the time + a deployment is paused. Defaults to 600s. format: int32 type: integer replicas: - description: Number of desired machines. Defaults to 1. This is a pointer to distinguish between explicit zero and not specified. + default: 1 + description: Number of desired machines. Defaults to 1. This is a + pointer to distinguish between explicit zero and not specified. format: int32 type: integer revisionHistoryLimit: - description: The number of old MachineSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. + description: The number of old MachineSets to retain to allow rollback. + This is a pointer to distinguish between explicit zero and not specified. + Defaults to 1. format: int32 type: integer selector: - description: Label selector for machines. Existing MachineSets whose machines are selected by this will be the ones affected by this deployment. It must match the machine template's labels. + description: Label selector for machines. Existing MachineSets whose + machines are selected by this will be the ones affected by this + deployment. It must match the machine template's labels. properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key that the selector applies + to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. type: string 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. + 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. items: type: string type: array @@ -407,30 +620,71 @@ spec: matchLabels: additionalProperties: type: string - 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. + 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 type: object strategy: - description: The deployment strategy to use to replace existing machines with new ones. + description: The deployment strategy to use to replace existing machines + with new ones. properties: rollingUpdate: - description: Rolling update config params. Present only if MachineDeploymentStrategyType = RollingUpdate. + description: Rolling update config params. Present only if MachineDeploymentStrategyType + = RollingUpdate. properties: + deletePolicy: + description: DeletePolicy defines the policy used by the MachineDeployment + to identify nodes to delete when downscaling. Valid values + are "Random, "Newest", "Oldest" When no value is supplied, + the default DeletePolicy of MachineSet is used + enum: + - Random + - Newest + - Oldest + type: string maxSurge: anyOf: - type: integer - type: string - description: 'The maximum number of machines that can be scheduled above the desired number of machines. Value can be an absolute number (ex: 5) or a percentage of desired machines (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 1. Example: when this is set to 30%, the new MachineSet can be scaled up immediately when the rolling update starts, such that the total number of old and new machines do not exceed 130% of desired machines. Once old machines have been killed, new MachineSet can be scaled up further, ensuring that total number of machines running at any time during the update is at most 130% of desired machines.' + description: 'The maximum number of machines that can be scheduled + above the desired number of machines. Value can be an absolute + number (ex: 5) or a percentage of desired machines (ex: + 10%). This can not be 0 if MaxUnavailable is 0. Absolute + number is calculated from percentage by rounding up. Defaults + to 1. Example: when this is set to 30%, the new MachineSet + can be scaled up immediately when the rolling update starts, + such that the total number of old and new machines do not + exceed 130% of desired machines. Once old machines have + been killed, new MachineSet can be scaled up further, ensuring + that total number of machines running at any time during + the update is at most 130% of desired machines.' x-kubernetes-int-or-string: true maxUnavailable: anyOf: - type: integer - type: string - description: 'The maximum number of machines that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired machines (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 0. Example: when this is set to 30%, the old MachineSet can be scaled down to 70% of desired machines immediately when the rolling update starts. Once new machines are ready, old MachineSet can be scaled down further, followed by scaling up the new MachineSet, ensuring that the total number of machines available at all times during the update is at least 70% of desired machines.' + description: 'The maximum number of machines that can be unavailable + during the update. Value can be an absolute number (ex: + 5) or a percentage of desired machines (ex: 10%). Absolute + number is calculated from percentage by rounding down. This + can not be 0 if MaxSurge is 0. Defaults to 0. Example: when + this is set to 30%, the old MachineSet can be scaled down + to 70% of desired machines immediately when the rolling + update starts. Once new machines are ready, old MachineSet + can be scaled down further, followed by scaling up the new + MachineSet, ensuring that the total number of machines available + at all times during the update is at least 70% of desired + machines.' x-kubernetes-int-or-string: true type: object type: - description: Type of deployment. Currently the only supported strategy is "RollingUpdate". Default is RollingUpdate. + description: Type of deployment. Default is RollingUpdate. + enum: + - RollingUpdate + - OnDelete type: string type: object template: @@ -442,67 +696,53 @@ spec: annotations: additionalProperties: type: string - description: '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' + description: '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' type: object - generateName: - description: "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 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). \n Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency" - type: string labels: additionalProperties: type: string - description: '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' + description: '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' type: object - name: - description: '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' - type: string - namespace: - description: "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. \n Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: 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. - items: - description: OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field. - properties: - apiVersion: - description: API version of the referent. - type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned. - type: boolean - controller: - description: If true, this reference points to the managing controller. - type: boolean - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' - type: string - required: - - apiVersion - - kind - - name - - uid - type: object - type: array type: object spec: - description: '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' + description: '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' properties: bootstrap: - description: Bootstrap is a reference to a local struct which encapsulates fields to configure the Machine’s bootstrapping mechanism. + description: Bootstrap is a reference to a local struct which + encapsulates fields to configure the Machine’s bootstrapping + mechanism. properties: configRef: - description: 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.Data without the need of a controller. + description: 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. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -511,37 +751,53 @@ spec: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + description: 'Namespace of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object - data: - description: "Data contains the bootstrap data, such as cloud-init details scripts. If nil, the Machine should remain in the Pending state. \n Deprecated: This field has been deprecated in v1alpha4 and will be removed in a future version. Switch to DataSecretName." - type: string dataSecretName: - description: DataSecretName is the name of the secret that stores the bootstrap data script. If nil, the Machine should remain in the Pending state. + description: DataSecretName is the name of the secret + that stores the bootstrap data script. If nil, the Machine + should remain in the Pending state. type: string type: object clusterName: - description: ClusterName is the name of the Cluster this object belongs to. + description: ClusterName is the name of the Cluster this object + belongs to. minLength: 1 type: string failureDomain: - description: FailureDomain is the failure domain the machine will be created in. Must match a key in the FailureDomains map stored on the cluster object. + description: FailureDomain is the failure domain the machine + will be created in. Must match a key in the FailureDomains + map stored on the cluster object. type: string infrastructureRef: - description: InfrastructureRef is a required reference to a custom resource offered by an infrastructure provider. + description: InfrastructureRef is a required reference to + a custom resource offered by an infrastructure provider. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -553,20 +809,41 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object nodeDrainTimeout: - description: '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`' + description: '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`' type: string providerID: - description: 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. + description: 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. type: string version: - description: Version defines the desired Kubernetes version. This field is meant to be optionally used by bootstrap providers. + description: Version defines the desired Kubernetes version. + This field is meant to be optionally used by bootstrap providers. type: string required: - bootstrap @@ -580,10 +857,11 @@ spec: - template type: object status: - description: MachineDeploymentStatus defines the observed state of MachineDeployment + description: MachineDeploymentStatus defines the observed state of MachineDeployment. properties: availableReplicas: - description: Total number of available machines (ready for at least minReadySeconds) targeted by this deployment. + description: Total number of available machines (ready for at least + minReadySeconds) targeted by this deployment. format: int32 type: integer observedGeneration: @@ -591,25 +869,35 @@ spec: format: int64 type: integer phase: - description: Phase represents the current phase of a MachineDeployment (ScalingUp, ScalingDown, Running, Failed, or Unknown). + description: Phase represents the current phase of a MachineDeployment + (ScalingUp, ScalingDown, Running, Failed, or Unknown). type: string readyReplicas: description: Total number of ready machines targeted by this deployment. format: int32 type: integer replicas: - description: Total number of non-terminated machines targeted by this deployment (their labels match the selector). + description: Total number of non-terminated machines targeted by this + deployment (their labels match the selector). format: int32 type: integer selector: - description: 'Selector is the same as the label selector but in the string format to avoid introspection by clients. The string will be in the same format as the query-param syntax. More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors' + description: 'Selector is the same as the label selector but in the + string format to avoid introspection by clients. The string will + be in the same format as the query-param syntax. More info about + label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors' type: string unavailableReplicas: - description: Total number of unavailable machines targeted by this deployment. This is the total number of machines that are still required for the deployment to have 100% available capacity. They may either be machines that are running but not yet available or machines that still have not been created. + description: Total number of unavailable machines targeted by this + deployment. This is the total number of machines that are still + required for the deployment to have 100% available capacity. They + may either be machines that are running but not yet available or + machines that still have not been created. format: int32 type: integer updatedReplicas: - description: Total number of non-terminated machines targeted by this deployment that have the desired template spec. + description: Total number of non-terminated machines targeted by this + deployment that have the desired template spec. format: int32 type: integer type: object diff --git a/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinehealthchecks.yaml b/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinehealthchecks.yaml index af66f81a5a1..9f49e01b6f8 100644 --- a/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinehealthchecks.yaml +++ b/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinehealthchecks.yaml @@ -1,8 +1,10 @@ + +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.4.1-0.20201002000720-57250aac17f6 + controller-gen.kubebuilder.io/version: v0.6.0-beta.0 creationTimestamp: null name: machinehealthchecks.cluster.x-k8s.io spec: @@ -35,13 +37,18 @@ spec: name: v1alpha3 schema: openAPIV3Schema: - description: MachineHealthCheck is the Schema for the machinehealthchecks API + description: MachineHealthCheck is the Schema for the machinehealthchecks + API. properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object @@ -49,34 +56,89 @@ spec: description: Specification of machine health check policy properties: clusterName: - description: ClusterName is the name of the Cluster this object belongs to. + description: ClusterName is the name of the Cluster this object belongs + to. minLength: 1 type: string maxUnhealthy: anyOf: - type: integer - type: string - description: Any further remediation is only allowed if at most "MaxUnhealthy" machines selected by "selector" are not healthy. + description: Any further remediation is only allowed if at most "MaxUnhealthy" + machines selected by "selector" are not healthy. x-kubernetes-int-or-string: true nodeStartupTimeout: - description: Machines older than this duration without a node will be considered to have failed and will be remediated. + description: Machines older than this duration without a node will + be considered to have failed and will be remediated. type: string + remediationTemplate: + description: "RemediationTemplate is a reference to a remediation + template provided by an infrastructure provider. \n 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 + Cluster API." + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: '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.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: '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' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object selector: - description: Label selector to match machines whose health will be exercised + description: Label selector to match machines whose health will be + exercised properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key that the selector applies + to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. type: string 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. + 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. items: type: string type: array @@ -88,13 +150,23 @@ spec: matchLabels: additionalProperties: type: string - 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. + 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 type: object unhealthyConditions: - description: 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. + description: 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. items: - description: 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. + description: 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. properties: status: minLength: 1 @@ -119,22 +191,77 @@ spec: status: description: Most recently observed status of MachineHealthCheck resource properties: + conditions: + description: Conditions defines current service state of the MachineHealthCheck. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: 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. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: 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. + type: string + severity: + description: 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. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: 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. + type: string + required: + - status + - type + type: object + type: array currentHealthy: - description: total number of healthy machines counted by this machine health check + description: total number of healthy machines counted by this machine + health check format: int32 minimum: 0 type: integer expectedMachines: - description: total number of machines counted by this machine health check + description: total number of machines counted by this machine health + check format: int32 minimum: 0 type: integer observedGeneration: - description: ObservedGeneration is the latest generation observed by the controller. + description: ObservedGeneration is the latest generation observed + by the controller. format: int64 type: integer + remediationsAllowed: + description: RemediationsAllowed is the number of further remediations + allowed by this machine health check before maxUnhealthy short circuiting + will be applied + format: int32 + minimum: 0 + type: integer targets: - description: Targets shows the current list of machines the machine health check is watching + description: Targets shows the current list of machines the machine + health check is watching items: type: string type: array @@ -160,13 +287,18 @@ spec: name: v1alpha4 schema: openAPIV3Schema: - description: MachineHealthCheck is the Schema for the machinehealthchecks API + description: MachineHealthCheck is the Schema for the machinehealthchecks + API. properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object @@ -174,34 +306,91 @@ spec: description: Specification of machine health check policy properties: clusterName: - description: ClusterName is the name of the Cluster this object belongs to. + description: ClusterName is the name of the Cluster this object belongs + to. minLength: 1 type: string maxUnhealthy: anyOf: - type: integer - type: string - description: Any further remediation is only allowed if at most "MaxUnhealthy" machines selected by "selector" are not healthy. + description: Any further remediation is only allowed if at most "MaxUnhealthy" + machines selected by "selector" are not healthy. x-kubernetes-int-or-string: true nodeStartupTimeout: - description: Machines older than this duration without a node will be considered to have failed and will be remediated. + description: Machines older than this duration without a node will + be considered to have failed and will be remediated. If not set, + this value is defaulted to 10 minutes. If you wish to disable this + feature, set the value explicitly to 0. type: string + remediationTemplate: + description: "RemediationTemplate is a reference to a remediation + template provided by an infrastructure provider. \n 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 + Cluster API." + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: '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.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: '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' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object selector: - description: Label selector to match machines whose health will be exercised + description: Label selector to match machines whose health will be + exercised properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key that the selector applies + to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. type: string 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. + 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. items: type: string type: array @@ -213,13 +402,23 @@ spec: matchLabels: additionalProperties: type: string - 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. + 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 type: object unhealthyConditions: - description: 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. + description: 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. items: - description: 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. + description: 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. properties: status: minLength: 1 @@ -236,6 +435,15 @@ spec: type: object minItems: 1 type: array + unhealthyRange: + description: 'Any further remediation is only allowed if the number + of machines selected by "selector" as not healthy is within the + range of "UnhealthyRange". Takes precedence over MaxUnhealthy. Eg. + "[3-5]" - This means that remediation will be allowed only when: + (a) there are at least 3 unhealthy machines (and) (b) there are + at most 5 unhealthy machines' + pattern: ^\[[0-9]+-[0-9]+\]$ + type: string required: - clusterName - selector @@ -244,22 +452,77 @@ spec: status: description: Most recently observed status of MachineHealthCheck resource properties: + conditions: + description: Conditions defines current service state of the MachineHealthCheck. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: 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. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: 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. + type: string + severity: + description: 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. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: 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. + type: string + required: + - status + - type + type: object + type: array currentHealthy: - description: total number of healthy machines counted by this machine health check + description: total number of healthy machines counted by this machine + health check format: int32 minimum: 0 type: integer expectedMachines: - description: total number of machines counted by this machine health check + description: total number of machines counted by this machine health + check format: int32 minimum: 0 type: integer observedGeneration: - description: ObservedGeneration is the latest generation observed by the controller. + description: ObservedGeneration is the latest generation observed + by the controller. format: int64 type: integer + remediationsAllowed: + description: RemediationsAllowed is the number of further remediations + allowed by this machine health check before maxUnhealthy short circuiting + will be applied + format: int32 + minimum: 0 + type: integer targets: - description: Targets shows the current list of machines the machine health check is watching + description: Targets shows the current list of machines the machine + health check is watching items: type: string type: array diff --git a/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinepools.yaml b/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinepools.yaml new file mode 100644 index 00000000000..95c3409a91e --- /dev/null +++ b/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinepools.yaml @@ -0,0 +1,969 @@ + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.6.0-beta.0 + creationTimestamp: null + name: machinepools.cluster.x-k8s.io +spec: + group: cluster.x-k8s.io + names: + categories: + - cluster-api + kind: MachinePool + listKind: MachinePoolList + plural: machinepools + shortNames: + - mp + singular: machinepool + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: MachinePool replicas count + jsonPath: .status.replicas + name: Replicas + type: string + - description: MachinePool status such as Terminating/Pending/Provisioning/Running/Failed + etc + jsonPath: .status.phase + name: Phase + type: string + - description: Kubernetes version associated with this MachinePool + jsonPath: .spec.template.spec.version + name: Version + type: string + name: v1alpha3 + schema: + openAPIV3Schema: + description: MachinePool is the Schema for the machinepools API. + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: MachinePoolSpec defines the desired state of MachinePool. + properties: + clusterName: + description: ClusterName is the name of the Cluster this object belongs + to. + minLength: 1 + type: string + failureDomains: + description: FailureDomains is the list of failure domains this MachinePool + should be attached to. + items: + type: string + type: array + minReadySeconds: + description: Minimum number of seconds for which a newly created machine + instances should be ready. Defaults to 0 (machine instance will + be considered available as soon as it is ready) + format: int32 + type: integer + providerIDList: + description: ProviderIDList are the identification IDs of machine + instances provided by the provider. This field must match the provider + IDs as seen on the node objects corresponding to a machine pool's + machine instances. + items: + type: string + type: array + replicas: + description: Number of desired machines. Defaults to 1. This is a + pointer to distinguish between explicit zero and not specified. + format: int32 + type: integer + strategy: + description: The deployment strategy to use to replace existing machine + instances with new ones. + properties: + rollingUpdate: + description: Rolling update config params. Present only if MachineDeploymentStrategyType + = RollingUpdate. + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of machines that can be scheduled + above the desired number of machines. Value can be an absolute + number (ex: 5) or a percentage of desired machines (ex: + 10%). This can not be 0 if MaxUnavailable is 0. Absolute + number is calculated from percentage by rounding up. Defaults + to 1. Example: when this is set to 30%, the new MachineSet + can be scaled up immediately when the rolling update starts, + such that the total number of old and new machines do not + exceed 130% of desired machines. Once old machines have + been killed, new MachineSet can be scaled up further, ensuring + that total number of machines running at any time during + the update is at most 130% of desired machines.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of machines that can be unavailable + during the update. Value can be an absolute number (ex: + 5) or a percentage of desired machines (ex: 10%). Absolute + number is calculated from percentage by rounding down. This + can not be 0 if MaxSurge is 0. Defaults to 0. Example: when + this is set to 30%, the old MachineSet can be scaled down + to 70% of desired machines immediately when the rolling + update starts. Once new machines are ready, old MachineSet + can be scaled down further, followed by scaling up the new + MachineSet, ensuring that the total number of machines available + at all times during the update is at least 70% of desired + machines.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of deployment. Currently the only supported + strategy is "RollingUpdate". Default is RollingUpdate. + type: string + type: object + template: + description: Template describes the machines that will be created. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' + properties: + annotations: + additionalProperties: + type: string + description: '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' + type: object + generateName: + description: "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 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). \n Applied only if Name is not specified. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + \n Deprecated: This field has no function and is going to + be removed in a next release." + type: string + labels: + additionalProperties: + type: string + description: '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' + type: object + name: + description: "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 \n + Deprecated: This field has no function and is going to be + removed in a next release." + type: string + namespace: + description: "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. \n Must be a DNS_LABEL. Cannot be updated. + More info: http://kubernetes.io/docs/user-guide/namespaces + \n Deprecated: This field has no function and is going to + be removed in a next release." + type: string + ownerReferences: + description: "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. \n Deprecated: This field + has no function and is going to be removed in a next release." + items: + description: OwnerReference contains enough information + to let you identify an owning object. An owning object + must be in the same namespace as the dependent, or be + cluster-scoped, so there is no namespace field. + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the + key-value store until this reference is removed. Defaults + to false. To set this field, a user needs "delete" + permission of the owner, otherwise 422 (Unprocessable + Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + type: array + type: object + spec: + description: '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' + properties: + bootstrap: + description: Bootstrap is a reference to a local struct which + encapsulates fields to configure the Machine’s bootstrapping + mechanism. + properties: + configRef: + description: 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.Data + without the need of a controller. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: '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.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: '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' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + data: + description: "Data contains the bootstrap data, such as + cloud-init details scripts. If nil, the Machine should + remain in the Pending state. \n Deprecated: Switch to + DataSecretName." + type: string + dataSecretName: + description: DataSecretName is the name of the secret + that stores the bootstrap data script. If nil, the Machine + should remain in the Pending state. + type: string + type: object + clusterName: + description: ClusterName is the name of the Cluster this object + belongs to. + minLength: 1 + type: string + failureDomain: + description: FailureDomain is the failure domain the machine + will be created in. Must match a key in the FailureDomains + map stored on the cluster object. + type: string + infrastructureRef: + description: InfrastructureRef is a required reference to + a custom resource offered by an infrastructure provider. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: '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.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: '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' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + nodeDrainTimeout: + description: '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`' + type: string + providerID: + description: 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. + type: string + version: + description: Version defines the desired Kubernetes version. + This field is meant to be optionally used by bootstrap providers. + type: string + required: + - bootstrap + - clusterName + - infrastructureRef + type: object + type: object + required: + - clusterName + - template + type: object + status: + description: MachinePoolStatus defines the observed state of MachinePool. + properties: + availableReplicas: + description: The number of available replicas (ready for at least + minReadySeconds) for this MachinePool. + format: int32 + type: integer + bootstrapReady: + description: BootstrapReady is the state of the bootstrap provider. + type: boolean + conditions: + description: Conditions define the current service state of the MachinePool. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: 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. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: 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. + type: string + severity: + description: 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. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: 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. + type: string + required: + - status + - type + type: object + type: array + failureMessage: + description: FailureMessage indicates that there is a problem reconciling + the state, and will be set to a descriptive error message. + type: string + failureReason: + description: FailureReason indicates that there is a problem reconciling + the state, and will be set to a token value suitable for programmatic + interpretation. + type: string + infrastructureReady: + description: InfrastructureReady is the state of the infrastructure + provider. + type: boolean + nodeRefs: + description: NodeRefs will point to the corresponding Nodes if it + they exist. + items: + description: 'ObjectReference contains enough information to let + you inspect or modify the referred object. --- New uses of this + type are discouraged because of difficulty describing its usage + when embedded in APIs. 1. Ignored fields. It includes many fields + which are not generally honored. For instance, ResourceVersion + and FieldPath are both very rarely valid in actual usage. 2. + Invalid usage help. It is impossible to add specific help for + individual usage. In most embedded usages, there are particular restrictions + like, "must refer only to types A and B" or "UID not honored" + or "name must be restricted". Those cannot be well described + when embedded. 3. Inconsistent validation. Because the usages + are different, the validation rules are different by usage, which + makes it hard for users to predict what will happen. 4. The fields + are both imprecise and overly precise. Kind is not a precise + mapping to a URL. This can produce ambiguity during interpretation + and require a REST mapping. In most cases, the dependency is + on the group,resource tuple and the version of the actual + struct is irrelevant. 5. We cannot easily change it. Because + this type is embedded in many locations, updates to this type will + affect numerous schemas. Don''t make new APIs embed an underspecified + API type they do not control. Instead of using this type, create + a locally provided and used type that is well-focused on your + reference. For example, ServiceReferences for admission registration: + https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 + .' + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: '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.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: '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' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + type: array + observedGeneration: + description: ObservedGeneration is the latest generation observed + by the controller. + format: int64 + type: integer + phase: + description: Phase represents the current phase of cluster actuation. + E.g. Pending, Running, Terminating, Failed etc. + type: string + readyReplicas: + description: The number of ready replicas for this MachinePool. A + machine is considered ready when the node has been created and is + "Ready". + format: int32 + type: integer + replicas: + description: Replicas is the most recently observed number of replicas. + format: int32 + type: integer + unavailableReplicas: + description: Total number of unavailable machine instances targeted + by this machine pool. This is the total number of machine instances + that are still required for the machine pool to have 100% available + capacity. They may either be machine instances that are running + but not yet available or machine instances that still have not been + created. + format: int32 + type: integer + type: object + type: object + served: true + storage: false + subresources: + scale: + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} + - additionalPrinterColumns: + - description: MachinePool replicas count + jsonPath: .status.replicas + name: Replicas + type: string + - description: MachinePool status such as Terminating/Pending/Provisioning/Running/Failed + etc + jsonPath: .status.phase + name: Phase + type: string + - description: Kubernetes version associated with this MachinePool + jsonPath: .spec.template.spec.version + name: Version + type: string + name: v1alpha4 + schema: + openAPIV3Schema: + description: MachinePool is the Schema for the machinepools API. + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: MachinePoolSpec defines the desired state of MachinePool. + properties: + clusterName: + description: ClusterName is the name of the Cluster this object belongs + to. + minLength: 1 + type: string + failureDomains: + description: FailureDomains is the list of failure domains this MachinePool + should be attached to. + items: + type: string + type: array + minReadySeconds: + description: Minimum number of seconds for which a newly created machine + instances should be ready. Defaults to 0 (machine instance will + be considered available as soon as it is ready) + format: int32 + type: integer + providerIDList: + description: ProviderIDList are the identification IDs of machine + instances provided by the provider. This field must match the provider + IDs as seen on the node objects corresponding to a machine pool's + machine instances. + items: + type: string + type: array + replicas: + description: Number of desired machines. Defaults to 1. This is a + pointer to distinguish between explicit zero and not specified. + format: int32 + type: integer + template: + description: Template describes the machines that will be created. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' + properties: + annotations: + additionalProperties: + type: string + description: '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' + type: object + labels: + additionalProperties: + type: string + description: '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' + type: object + type: object + spec: + description: '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' + properties: + bootstrap: + description: Bootstrap is a reference to a local struct which + encapsulates fields to configure the Machine’s bootstrapping + mechanism. + properties: + configRef: + description: 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. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: '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.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: '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' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + dataSecretName: + description: DataSecretName is the name of the secret + that stores the bootstrap data script. If nil, the Machine + should remain in the Pending state. + type: string + type: object + clusterName: + description: ClusterName is the name of the Cluster this object + belongs to. + minLength: 1 + type: string + failureDomain: + description: FailureDomain is the failure domain the machine + will be created in. Must match a key in the FailureDomains + map stored on the cluster object. + type: string + infrastructureRef: + description: InfrastructureRef is a required reference to + a custom resource offered by an infrastructure provider. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: '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.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: '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' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + nodeDrainTimeout: + description: '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`' + type: string + providerID: + description: 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. + type: string + version: + description: Version defines the desired Kubernetes version. + This field is meant to be optionally used by bootstrap providers. + type: string + required: + - bootstrap + - clusterName + - infrastructureRef + type: object + type: object + required: + - clusterName + - template + type: object + status: + description: MachinePoolStatus defines the observed state of MachinePool. + properties: + availableReplicas: + description: The number of available replicas (ready for at least + minReadySeconds) for this MachinePool. + format: int32 + type: integer + bootstrapReady: + description: BootstrapReady is the state of the bootstrap provider. + type: boolean + conditions: + description: Conditions define the current service state of the MachinePool. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: 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. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: 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. + type: string + severity: + description: 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. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: 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. + type: string + required: + - status + - type + type: object + type: array + failureMessage: + description: FailureMessage indicates that there is a problem reconciling + the state, and will be set to a descriptive error message. + type: string + failureReason: + description: FailureReason indicates that there is a problem reconciling + the state, and will be set to a token value suitable for programmatic + interpretation. + type: string + infrastructureReady: + description: InfrastructureReady is the state of the infrastructure + provider. + type: boolean + nodeRefs: + description: NodeRefs will point to the corresponding Nodes if it + they exist. + items: + description: 'ObjectReference contains enough information to let + you inspect or modify the referred object. --- New uses of this + type are discouraged because of difficulty describing its usage + when embedded in APIs. 1. Ignored fields. It includes many fields + which are not generally honored. For instance, ResourceVersion + and FieldPath are both very rarely valid in actual usage. 2. + Invalid usage help. It is impossible to add specific help for + individual usage. In most embedded usages, there are particular restrictions + like, "must refer only to types A and B" or "UID not honored" + or "name must be restricted". Those cannot be well described + when embedded. 3. Inconsistent validation. Because the usages + are different, the validation rules are different by usage, which + makes it hard for users to predict what will happen. 4. The fields + are both imprecise and overly precise. Kind is not a precise + mapping to a URL. This can produce ambiguity during interpretation + and require a REST mapping. In most cases, the dependency is + on the group,resource tuple and the version of the actual + struct is irrelevant. 5. We cannot easily change it. Because + this type is embedded in many locations, updates to this type will + affect numerous schemas. Don''t make new APIs embed an underspecified + API type they do not control. Instead of using this type, create + a locally provided and used type that is well-focused on your + reference. For example, ServiceReferences for admission registration: + https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 + .' + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: '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.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: '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' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + type: array + observedGeneration: + description: ObservedGeneration is the latest generation observed + by the controller. + format: int64 + type: integer + phase: + description: Phase represents the current phase of cluster actuation. + E.g. Pending, Running, Terminating, Failed etc. + type: string + readyReplicas: + description: The number of ready replicas for this MachinePool. A + machine is considered ready when the node has been created and is + "Ready". + format: int32 + type: integer + replicas: + description: Replicas is the most recently observed number of replicas. + format: int32 + type: integer + unavailableReplicas: + description: Total number of unavailable machine instances targeted + by this machine pool. This is the total number of machine instances + that are still required for the machine pool to have 100% available + capacity. They may either be machine instances that are running + but not yet available or machine instances that still have not been + created. + format: int32 + type: integer + type: object + type: object + served: true + storage: true + subresources: + scale: + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/cmd/install/assets/cluster-api/cluster.x-k8s.io_machines.yaml b/cmd/install/assets/cluster-api/cluster.x-k8s.io_machines.yaml index 3c734734de2..b08b53bac31 100644 --- a/cmd/install/assets/cluster-api/cluster.x-k8s.io_machines.yaml +++ b/cmd/install/assets/cluster-api/cluster.x-k8s.io_machines.yaml @@ -1,8 +1,10 @@ + +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.4.1-0.20201002000720-57250aac17f6 + controller-gen.kubebuilder.io/version: v0.6.0-beta.0 creationTimestamp: null name: machines.cluster.x-k8s.io spec: @@ -39,30 +41,48 @@ spec: name: v1alpha3 schema: openAPIV3Schema: - description: Machine is the Schema for the machines API + description: Machine is the Schema for the machines API. properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object spec: - description: MachineSpec defines the desired state of Machine + description: MachineSpec defines the desired state of Machine. properties: bootstrap: - description: Bootstrap is a reference to a local struct which encapsulates fields to configure the Machine’s bootstrapping mechanism. + description: Bootstrap is a reference to a local struct which encapsulates + fields to configure the Machine’s bootstrapping mechanism. properties: configRef: - description: 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.Data without the need of a controller. + description: 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.Data + without the need of a controller. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -74,34 +94,53 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object data: - description: "Data contains the bootstrap data, such as cloud-init details scripts. If nil, the Machine should remain in the Pending state. \n Deprecated: This field has been deprecated in v1alpha3 and will be removed in a future version. Switch to DataSecretName." + description: "Data contains the bootstrap data, such as cloud-init + details scripts. If nil, the Machine should remain in the Pending + state. \n Deprecated: Switch to DataSecretName." type: string dataSecretName: - description: DataSecretName is the name of the secret that stores the bootstrap data script. If nil, the Machine should remain in the Pending state. + description: DataSecretName is the name of the secret that stores + the bootstrap data script. If nil, the Machine should remain + in the Pending state. type: string type: object clusterName: - description: ClusterName is the name of the Cluster this object belongs to. + description: ClusterName is the name of the Cluster this object belongs + to. minLength: 1 type: string failureDomain: - description: FailureDomain is the failure domain the machine will be created in. Must match a key in the FailureDomains map stored on the cluster object. + description: FailureDomain is the failure domain the machine will + be created in. Must match a key in the FailureDomains map stored + on the cluster object. type: string infrastructureRef: - description: InfrastructureRef is a required reference to a custom resource offered by an infrastructure provider. + description: InfrastructureRef is a required reference to a custom + resource offered by an infrastructure provider. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -113,20 +152,38 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object nodeDrainTimeout: - description: '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`' + description: '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`' type: string providerID: - description: 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. + description: 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. type: string version: - description: Version defines the desired Kubernetes version. This field is meant to be optionally used by bootstrap providers. + description: Version defines the desired Kubernetes version. This + field is meant to be optionally used by bootstrap providers. type: string required: - bootstrap @@ -134,18 +191,21 @@ spec: - infrastructureRef type: object status: - description: MachineStatus defines the observed state of Machine + description: MachineStatus defines the observed state of Machine. properties: addresses: - description: Addresses is a list of addresses assigned to the machine. This field is copied from the infrastructure provider reference. + description: Addresses is a list of addresses assigned to the machine. + This field is copied from the infrastructure provider reference. items: - description: MachineAddress contains information for the node's address. + description: MachineAddress contains information for the node's + address. properties: address: description: The machine address. type: string type: - description: Machine address type, one of Hostname, ExternalIP or InternalIP. + description: Machine address type, one of Hostname, ExternalIP + or InternalIP. type: string required: - address @@ -158,26 +218,41 @@ spec: conditions: description: Conditions defines current service state of the Machine. items: - description: Condition defines an observation of a Cluster API resource operational state. + description: Condition defines an observation of a Cluster API resource + operational state. properties: lastTransitionTime: - description: 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. + description: 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. format: date-time type: string message: - description: A human readable message indicating details about the transition. This field may be empty. + description: A human readable message indicating details about + the transition. This field may be empty. type: string reason: - description: 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. + description: 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. type: string severity: - description: 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. + description: 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. type: string status: description: Status of the condition, one of True, False, Unknown. type: string type: - description: 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. + description: 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. type: string required: - status @@ -185,16 +260,42 @@ spec: type: object type: array failureMessage: - description: "FailureMessage 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. \n 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. \n 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." + description: "FailureMessage 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. \n 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. \n 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." type: string failureReason: - description: "FailureReason 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. \n 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. \n 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." + description: "FailureReason 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. \n 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. \n 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." type: string infrastructureReady: - description: InfrastructureReady is the state of the infrastructure provider. + description: InfrastructureReady is the state of the infrastructure + provider. type: boolean lastUpdated: - description: LastUpdated identifies when the phase of the Machine last transitioned. + description: LastUpdated identifies when the phase of the Machine + last transitioned. format: date-time type: string nodeRef: @@ -204,7 +305,17 @@ spec: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -216,21 +327,27 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object observedGeneration: - description: ObservedGeneration is the latest generation observed by the controller. + description: ObservedGeneration is the latest generation observed + by the controller. format: int64 type: integer phase: - description: Phase represents the current phase of machine actuation. E.g. Pending, Running, Terminating, Failed etc. + description: Phase represents the current phase of machine actuation. + E.g. Pending, Running, Terminating, Failed etc. type: string version: - description: Version specifies the current version of Kubernetes running on the corresponding Node. This is meant to be a means of bubbling up status from the Node to the Machine. It is entirely optional, but useful for end-user UX if it’s present. + description: Version specifies the current version of Kubernetes running + on the corresponding Node. This is meant to be a means of bubbling + up status from the Node to the Machine. It is entirely optional, + but useful for end-user UX if it’s present. type: string type: object type: object @@ -259,30 +376,48 @@ spec: name: v1alpha4 schema: openAPIV3Schema: - description: Machine is the Schema for the machines API + description: Machine is the Schema for the machines API. properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object spec: - description: MachineSpec defines the desired state of Machine + description: MachineSpec defines the desired state of Machine. properties: bootstrap: - description: Bootstrap is a reference to a local struct which encapsulates fields to configure the Machine’s bootstrapping mechanism. + description: Bootstrap is a reference to a local struct which encapsulates + fields to configure the Machine’s bootstrapping mechanism. properties: configRef: - description: 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.Data without the need of a controller. + description: 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. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -294,34 +429,48 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object - data: - description: "Data contains the bootstrap data, such as cloud-init details scripts. If nil, the Machine should remain in the Pending state. \n Deprecated: This field has been deprecated in v1alpha4 and will be removed in a future version. Switch to DataSecretName." - type: string dataSecretName: - description: DataSecretName is the name of the secret that stores the bootstrap data script. If nil, the Machine should remain in the Pending state. + description: DataSecretName is the name of the secret that stores + the bootstrap data script. If nil, the Machine should remain + in the Pending state. type: string type: object clusterName: - description: ClusterName is the name of the Cluster this object belongs to. + description: ClusterName is the name of the Cluster this object belongs + to. minLength: 1 type: string failureDomain: - description: FailureDomain is the failure domain the machine will be created in. Must match a key in the FailureDomains map stored on the cluster object. + description: FailureDomain is the failure domain the machine will + be created in. Must match a key in the FailureDomains map stored + on the cluster object. type: string infrastructureRef: - description: InfrastructureRef is a required reference to a custom resource offered by an infrastructure provider. + description: InfrastructureRef is a required reference to a custom + resource offered by an infrastructure provider. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -333,20 +482,38 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object nodeDrainTimeout: - description: '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`' + description: '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`' type: string providerID: - description: 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. + description: 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. type: string version: - description: Version defines the desired Kubernetes version. This field is meant to be optionally used by bootstrap providers. + description: Version defines the desired Kubernetes version. This + field is meant to be optionally used by bootstrap providers. type: string required: - bootstrap @@ -354,18 +521,21 @@ spec: - infrastructureRef type: object status: - description: MachineStatus defines the observed state of Machine + description: MachineStatus defines the observed state of Machine. properties: addresses: - description: Addresses is a list of addresses assigned to the machine. This field is copied from the infrastructure provider reference. + description: Addresses is a list of addresses assigned to the machine. + This field is copied from the infrastructure provider reference. items: - description: MachineAddress contains information for the node's address. + description: MachineAddress contains information for the node's + address. properties: address: description: The machine address. type: string type: - description: Machine address type, one of Hostname, ExternalIP or InternalIP. + description: Machine address type, one of Hostname, ExternalIP + or InternalIP. type: string required: - address @@ -378,26 +548,41 @@ spec: conditions: description: Conditions defines current service state of the Machine. items: - description: Condition defines an observation of a Cluster API resource operational state. + description: Condition defines an observation of a Cluster API resource + operational state. properties: lastTransitionTime: - description: 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. + description: 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. format: date-time type: string message: - description: A human readable message indicating details about the transition. This field may be empty. + description: A human readable message indicating details about + the transition. This field may be empty. type: string reason: - description: 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. + description: 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. type: string severity: - description: 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. + description: 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. type: string status: description: Status of the condition, one of True, False, Unknown. type: string type: - description: 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. + description: 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. type: string required: - status @@ -405,16 +590,42 @@ spec: type: object type: array failureMessage: - description: "FailureMessage 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. \n 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. \n 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." + description: "FailureMessage 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. \n 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. \n 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." type: string failureReason: - description: "FailureReason 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. \n 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. \n 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." + description: "FailureReason 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. \n 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. \n 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." type: string infrastructureReady: - description: InfrastructureReady is the state of the infrastructure provider. + description: InfrastructureReady is the state of the infrastructure + provider. type: boolean lastUpdated: - description: LastUpdated identifies when the phase of the Machine last transitioned. + description: LastUpdated identifies when the phase of the Machine + last transitioned. format: date-time type: string nodeRef: @@ -424,7 +635,17 @@ spec: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -436,21 +657,27 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object observedGeneration: - description: ObservedGeneration is the latest generation observed by the controller. + description: ObservedGeneration is the latest generation observed + by the controller. format: int64 type: integer phase: - description: Phase represents the current phase of machine actuation. E.g. Pending, Running, Terminating, Failed etc. + description: Phase represents the current phase of machine actuation. + E.g. Pending, Running, Terminating, Failed etc. type: string version: - description: Version specifies the current version of Kubernetes running on the corresponding Node. This is meant to be a means of bubbling up status from the Node to the Machine. It is entirely optional, but useful for end-user UX if it’s present. + description: Version specifies the current version of Kubernetes running + on the corresponding Node. This is meant to be a means of bubbling + up status from the Node to the Machine. It is entirely optional, + but useful for end-user UX if it’s present. type: string type: object type: object diff --git a/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinesets.yaml b/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinesets.yaml index 4dad9595b92..af1304c93fc 100644 --- a/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinesets.yaml +++ b/cmd/install/assets/cluster-api/cluster.x-k8s.io_machinesets.yaml @@ -1,8 +1,10 @@ + +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.4.1-0.20201002000720-57250aac17f6 + controller-gen.kubebuilder.io/version: v0.6.0-beta.0 creationTimestamp: null name: machinesets.cluster.x-k8s.io spec: @@ -34,54 +36,78 @@ spec: name: v1alpha3 schema: openAPIV3Schema: - description: MachineSet is the Schema for the machinesets API + description: MachineSet is the Schema for the machinesets API. properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object spec: - description: MachineSetSpec defines the desired state of MachineSet + description: MachineSetSpec defines the desired state of MachineSet. properties: clusterName: - description: ClusterName is the name of the Cluster this object belongs to. + description: ClusterName is the name of the Cluster this object belongs + to. minLength: 1 type: string deletePolicy: - description: DeletePolicy defines the policy used to identify nodes to delete when downscaling. Defaults to "Random". Valid values are "Random, "Newest", "Oldest" + description: DeletePolicy defines the policy used to identify nodes + to delete when downscaling. Defaults to "Random". Valid values + are "Random, "Newest", "Oldest" enum: - Random - Newest - Oldest type: string minReadySeconds: - description: 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) + description: 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) format: int32 type: integer replicas: - description: Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. + description: Replicas is the number of desired replicas. This is a + pointer to distinguish between explicit zero and unspecified. Defaults + to 1. format: int32 type: integer selector: - description: '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' + description: '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' properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key that the selector applies + to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. type: string 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. + 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. items: type: string type: array @@ -93,11 +119,17 @@ spec: matchLabels: additionalProperties: type: string - 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. + 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 type: object template: - description: Template is the object that describes the machine that will be created if insufficient replicas are detected. Object references to custom resources resources are treated as templates. + description: Template is the object that describes the machine that + will be created if insufficient replicas are detected. Object references + to custom resources resources are treated as templates. properties: metadata: description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' @@ -105,35 +137,88 @@ spec: annotations: additionalProperties: type: string - description: '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' + description: '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' type: object generateName: - description: "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 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). \n Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency" + description: "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 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). \n Applied only if Name is not specified. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + \n Deprecated: This field has no function and is going to + be removed in a next release." type: string labels: additionalProperties: type: string - description: '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' + description: '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' type: object name: - description: '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' + description: "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 \n + Deprecated: This field has no function and is going to be + removed in a next release." type: string namespace: - description: "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. \n Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + description: "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. \n Must be a DNS_LABEL. Cannot be updated. + More info: http://kubernetes.io/docs/user-guide/namespaces + \n Deprecated: This field has no function and is going to + be removed in a next release." type: string ownerReferences: - description: 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. + description: "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. \n Deprecated: This field + has no function and is going to be removed in a next release." items: - description: OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field. + description: OwnerReference contains enough information + to let you identify an owning object. An owning object + must be in the same namespace as the dependent, or be + cluster-scoped, so there is no namespace field. properties: apiVersion: description: API version of the referent. type: string blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned. + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the + key-value store until this reference is removed. Defaults + to false. To set this field, a user needs "delete" + permission of the owner, otherwise 422 (Unprocessable + Entity) will be returned. type: boolean controller: - description: If true, this reference points to the managing controller. + description: If true, this reference points to the managing + controller. type: boolean kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -153,19 +238,37 @@ spec: type: array type: object spec: - description: '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' + description: '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' properties: bootstrap: - description: Bootstrap is a reference to a local struct which encapsulates fields to configure the Machine’s bootstrapping mechanism. + description: Bootstrap is a reference to a local struct which + encapsulates fields to configure the Machine’s bootstrapping + mechanism. properties: configRef: - description: 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.Data without the need of a controller. + description: 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.Data + without the need of a controller. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -174,37 +277,59 @@ spec: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + description: 'Namespace of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object data: - description: "Data contains the bootstrap data, such as cloud-init details scripts. If nil, the Machine should remain in the Pending state. \n Deprecated: This field has been deprecated in v1alpha3 and will be removed in a future version. Switch to DataSecretName." + description: "Data contains the bootstrap data, such as + cloud-init details scripts. If nil, the Machine should + remain in the Pending state. \n Deprecated: Switch to + DataSecretName." type: string dataSecretName: - description: DataSecretName is the name of the secret that stores the bootstrap data script. If nil, the Machine should remain in the Pending state. + description: DataSecretName is the name of the secret + that stores the bootstrap data script. If nil, the Machine + should remain in the Pending state. type: string type: object clusterName: - description: ClusterName is the name of the Cluster this object belongs to. + description: ClusterName is the name of the Cluster this object + belongs to. minLength: 1 type: string failureDomain: - description: FailureDomain is the failure domain the machine will be created in. Must match a key in the FailureDomains map stored on the cluster object. + description: FailureDomain is the failure domain the machine + will be created in. Must match a key in the FailureDomains + map stored on the cluster object. type: string infrastructureRef: - description: InfrastructureRef is a required reference to a custom resource offered by an infrastructure provider. + description: InfrastructureRef is a required reference to + a custom resource offered by an infrastructure provider. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -216,20 +341,41 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object nodeDrainTimeout: - description: '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`' + description: '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`' type: string providerID: - description: 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. + description: 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. type: string version: - description: Version defines the desired Kubernetes version. This field is meant to be optionally used by bootstrap providers. + description: Version defines the desired Kubernetes version. + This field is meant to be optionally used by bootstrap providers. type: string required: - bootstrap @@ -242,27 +388,46 @@ spec: - selector type: object status: - description: MachineSetStatus defines the observed state of MachineSet + description: MachineSetStatus defines the observed state of MachineSet. properties: availableReplicas: - description: The number of available replicas (ready for at least minReadySeconds) for this MachineSet. + description: The number of available replicas (ready for at least + minReadySeconds) for this MachineSet. format: int32 type: integer failureMessage: type: string failureReason: - description: "In the event that there is a terminal problem reconciling the replicas, both FailureReason and FailureMessage will be set. FailureReason will be populated with a succinct value suitable for machine interpretation, while FailureMessage will contain a more verbose string suitable for logging and human consumption. \n 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. \n 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." + description: "In the event that there is a terminal problem reconciling + the replicas, both FailureReason and FailureMessage will be set. + FailureReason will be populated with a succinct value suitable for + machine interpretation, while FailureMessage will contain a more + verbose string suitable for logging and human consumption. \n 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. + \n 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." type: string fullyLabeledReplicas: - description: The number of replicas that have labels matching the labels of the machine template of the MachineSet. + description: The number of replicas that have labels matching the + labels of the machine template of the MachineSet. format: int32 type: integer observedGeneration: - description: ObservedGeneration reflects the generation of the most recently observed MachineSet. + description: ObservedGeneration reflects the generation of the most + recently observed MachineSet. format: int64 type: integer readyReplicas: - description: The number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready". + description: The number of ready replicas for this MachineSet. A machine + is considered ready when the node has been created and is "Ready". format: int32 type: integer replicas: @@ -270,7 +435,10 @@ spec: format: int32 type: integer selector: - description: 'Selector is the same as the label selector but in the string format to avoid introspection by clients. The string will be in the same format as the query-param syntax. More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors' + description: 'Selector is the same as the label selector but in the + string format to avoid introspection by clients. The string will + be in the same format as the query-param syntax. More info about + label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors' type: string type: object type: object @@ -298,54 +466,79 @@ spec: name: v1alpha4 schema: openAPIV3Schema: - description: MachineSet is the Schema for the machinesets API + description: MachineSet is the Schema for the machinesets API. properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object spec: - description: MachineSetSpec defines the desired state of MachineSet + description: MachineSetSpec defines the desired state of MachineSet. properties: clusterName: - description: ClusterName is the name of the Cluster this object belongs to. + description: ClusterName is the name of the Cluster this object belongs + to. minLength: 1 type: string deletePolicy: - description: DeletePolicy defines the policy used to identify nodes to delete when downscaling. Defaults to "Random". Valid values are "Random, "Newest", "Oldest" + description: DeletePolicy defines the policy used to identify nodes + to delete when downscaling. Defaults to "Random". Valid values + are "Random, "Newest", "Oldest" enum: - Random - Newest - Oldest type: string minReadySeconds: - description: 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) + description: 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) format: int32 type: integer replicas: - description: Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. + default: 1 + description: Replicas is the number of desired replicas. This is a + pointer to distinguish between explicit zero and unspecified. Defaults + to 1. format: int32 type: integer selector: - description: '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' + description: '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' properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key that the selector applies + to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. type: string 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. + 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. items: type: string type: array @@ -357,11 +550,17 @@ spec: matchLabels: additionalProperties: type: string - 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. + 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 type: object template: - description: Template is the object that describes the machine that will be created if insufficient replicas are detected. Object references to custom resources resources are treated as templates. + description: Template is the object that describes the machine that + will be created if insufficient replicas are detected. Object references + to custom resources resources are treated as templates. properties: metadata: description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' @@ -369,67 +568,53 @@ spec: annotations: additionalProperties: type: string - description: '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' + description: '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' type: object - generateName: - description: "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 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). \n Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency" - type: string labels: additionalProperties: type: string - description: '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' + description: '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' type: object - name: - description: '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' - type: string - namespace: - description: "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. \n Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: 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. - items: - description: OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field. - properties: - apiVersion: - description: API version of the referent. - type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned. - type: boolean - controller: - description: If true, this reference points to the managing controller. - type: boolean - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' - type: string - required: - - apiVersion - - kind - - name - - uid - type: object - type: array type: object spec: - description: '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' + description: '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' properties: bootstrap: - description: Bootstrap is a reference to a local struct which encapsulates fields to configure the Machine’s bootstrapping mechanism. + description: Bootstrap is a reference to a local struct which + encapsulates fields to configure the Machine’s bootstrapping + mechanism. properties: configRef: - description: 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.Data without the need of a controller. + description: 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. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -438,37 +623,53 @@ spec: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + description: 'Namespace of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object - data: - description: "Data contains the bootstrap data, such as cloud-init details scripts. If nil, the Machine should remain in the Pending state. \n Deprecated: This field has been deprecated in v1alpha4 and will be removed in a future version. Switch to DataSecretName." - type: string dataSecretName: - description: DataSecretName is the name of the secret that stores the bootstrap data script. If nil, the Machine should remain in the Pending state. + description: DataSecretName is the name of the secret + that stores the bootstrap data script. If nil, the Machine + should remain in the Pending state. type: string type: object clusterName: - description: ClusterName is the name of the Cluster this object belongs to. + description: ClusterName is the name of the Cluster this object + belongs to. minLength: 1 type: string failureDomain: - description: FailureDomain is the failure domain the machine will be created in. Must match a key in the FailureDomains map stored on the cluster object. + description: FailureDomain is the failure domain the machine + will be created in. Must match a key in the FailureDomains + map stored on the cluster object. type: string infrastructureRef: - description: InfrastructureRef is a required reference to a custom resource offered by an infrastructure provider. + description: InfrastructureRef is a required reference to + a custom resource offered by an infrastructure provider. properties: apiVersion: description: API version of the referent. type: string fieldPath: - description: '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.' + description: '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.' type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' @@ -480,20 +681,41 @@ spec: description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string resourceVersion: - description: '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' + description: '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' type: string uid: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object nodeDrainTimeout: - description: '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`' + description: '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`' type: string providerID: - description: 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. + description: 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. type: string version: - description: Version defines the desired Kubernetes version. This field is meant to be optionally used by bootstrap providers. + description: Version defines the desired Kubernetes version. + This field is meant to be optionally used by bootstrap providers. type: string required: - bootstrap @@ -506,27 +728,46 @@ spec: - selector type: object status: - description: MachineSetStatus defines the observed state of MachineSet + description: MachineSetStatus defines the observed state of MachineSet. properties: availableReplicas: - description: The number of available replicas (ready for at least minReadySeconds) for this MachineSet. + description: The number of available replicas (ready for at least + minReadySeconds) for this MachineSet. format: int32 type: integer failureMessage: type: string failureReason: - description: "In the event that there is a terminal problem reconciling the replicas, both FailureReason and FailureMessage will be set. FailureReason will be populated with a succinct value suitable for machine interpretation, while FailureMessage will contain a more verbose string suitable for logging and human consumption. \n 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. \n 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." + description: "In the event that there is a terminal problem reconciling + the replicas, both FailureReason and FailureMessage will be set. + FailureReason will be populated with a succinct value suitable for + machine interpretation, while FailureMessage will contain a more + verbose string suitable for logging and human consumption. \n 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. + \n 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." type: string fullyLabeledReplicas: - description: The number of replicas that have labels matching the labels of the machine template of the MachineSet. + description: The number of replicas that have labels matching the + labels of the machine template of the MachineSet. format: int32 type: integer observedGeneration: - description: ObservedGeneration reflects the generation of the most recently observed MachineSet. + description: ObservedGeneration reflects the generation of the most + recently observed MachineSet. format: int64 type: integer readyReplicas: - description: The number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready". + description: The number of ready replicas for this MachineSet. A machine + is considered ready when the node has been created and is "Ready". format: int32 type: integer replicas: @@ -534,7 +775,10 @@ spec: format: int32 type: integer selector: - description: 'Selector is the same as the label selector but in the string format to avoid introspection by clients. The string will be in the same format as the query-param syntax. More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors' + description: 'Selector is the same as the label selector but in the + string format to avoid introspection by clients. The string will + be in the same format as the query-param syntax. More info about + label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors' type: string type: object type: object diff --git a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsclustercontrolleridentities.yaml b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsclustercontrolleridentities.yaml new file mode 100644 index 00000000000..116699941e4 --- /dev/null +++ b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsclustercontrolleridentities.yaml @@ -0,0 +1,214 @@ + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.5.0 + creationTimestamp: null + name: awsclustercontrolleridentities.infrastructure.cluster.x-k8s.io +spec: + group: infrastructure.cluster.x-k8s.io + names: + categories: + - cluster-api + kind: AWSClusterControllerIdentity + listKind: AWSClusterControllerIdentityList + plural: awsclustercontrolleridentities + singular: awsclustercontrolleridentity + scope: Cluster + versions: + - name: v1alpha3 + schema: + openAPIV3Schema: + description: AWSClusterControllerIdentity is the Schema for the awsclustercontrolleridentities + API It is used to grant access to use Cluster API Provider AWS Controller + credentials. + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: Spec for this AWSClusterControllerIdentity. + properties: + allowedNamespaces: + description: AllowedNamespaces is used to identify which namespaces + are allowed to use the identity from. Namespaces can be selected + either using an array of namespaces or with label selector. An empty + allowedNamespaces object indicates that AWSClusters can use this + identity from any namespace. If this object is nil, no namespaces + will be allowed (default behaviour, if this field is not provided) + A namespace should be either in the NamespaceList or match with + Selector to use the identity. + nullable: true + properties: + list: + description: An nil or empty list indicates that AWSClusters cannot + use the identity from any namespace. + items: + type: string + nullable: true + type: array + selector: + description: "AllowedNamespaces is a selector of namespaces that + AWSClusters can use this ClusterPrincipal from. This is a standard + Kubernetes LabelSelector, a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. \n + An empty selector indicates that AWSClusters cannot use this + AWSClusterIdentity from any namespace." + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + 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. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + 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 + type: object + type: object + type: object + type: object + served: true + storage: false + - name: v1alpha4 + schema: + openAPIV3Schema: + description: AWSClusterControllerIdentity is the Schema for the awsclustercontrolleridentities + API It is used to grant access to use Cluster API Provider AWS Controller + credentials. + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: Spec for this AWSClusterControllerIdentity. + properties: + allowedNamespaces: + description: AllowedNamespaces is used to identify which namespaces + are allowed to use the identity from. Namespaces can be selected + either using an array of namespaces or with label selector. An empty + allowedNamespaces object indicates that AWSClusters can use this + identity from any namespace. If this object is nil, no namespaces + will be allowed (default behaviour, if this field is not provided) + A namespace should be either in the NamespaceList or match with + Selector to use the identity. + nullable: true + properties: + list: + description: An nil or empty list indicates that AWSClusters cannot + use the identity from any namespace. + items: + type: string + nullable: true + type: array + selector: + description: "AllowedNamespaces is a selector of namespaces that + AWSClusters can use this ClusterPrincipal from. This is a standard + Kubernetes LabelSelector, a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. \n + An empty selector indicates that AWSClusters cannot use this + AWSClusterIdentity from any namespace." + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + 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. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + 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 + type: object + type: object + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsclusterroleidentities.yaml b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsclusterroleidentities.yaml new file mode 100644 index 00000000000..1229de4fd7e --- /dev/null +++ b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsclusterroleidentities.yaml @@ -0,0 +1,330 @@ + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.5.0 + creationTimestamp: null + name: awsclusterroleidentities.infrastructure.cluster.x-k8s.io +spec: + group: infrastructure.cluster.x-k8s.io + names: + categories: + - cluster-api + kind: AWSClusterRoleIdentity + listKind: AWSClusterRoleIdentityList + plural: awsclusterroleidentities + singular: awsclusterroleidentity + scope: Cluster + versions: + - name: v1alpha3 + schema: + openAPIV3Schema: + description: AWSClusterRoleIdentity is the Schema for the awsclusterroleidentities + API It is used to assume a role using the provided sourceRef. + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: Spec for this AWSClusterRoleIdentity. + properties: + allowedNamespaces: + description: AllowedNamespaces is used to identify which namespaces + are allowed to use the identity from. Namespaces can be selected + either using an array of namespaces or with label selector. An empty + allowedNamespaces object indicates that AWSClusters can use this + identity from any namespace. If this object is nil, no namespaces + will be allowed (default behaviour, if this field is not provided) + A namespace should be either in the NamespaceList or match with + Selector to use the identity. + nullable: true + properties: + list: + description: An nil or empty list indicates that AWSClusters cannot + use the identity from any namespace. + items: + type: string + nullable: true + type: array + selector: + description: "AllowedNamespaces is a selector of namespaces that + AWSClusters can use this ClusterPrincipal from. This is a standard + Kubernetes LabelSelector, a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. \n + An empty selector indicates that AWSClusters cannot use this + AWSClusterIdentity from any namespace." + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + 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. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + 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 + type: object + type: object + durationSeconds: + description: The duration, in seconds, of the role session before + it is renewed. + format: int32 + maximum: 43200 + minimum: 900 + type: integer + externalID: + description: A unique identifier that might be required when you assume + a role in another account. If the administrator of the account to + which the role belongs provided you with an external ID, then provide + that value in the ExternalId parameter. This value can be any string, + such as a passphrase or account number. A cross-account role is + usually set up to trust everyone in an account. Therefore, the administrator + of the trusting account might send an external ID to the administrator + of the trusted account. That way, only someone with the ID can assume + the role, rather than everyone in the account. For more information + about the external ID, see How to Use an External ID When Granting + Access to Your AWS Resources to a Third Party in the IAM User Guide. + type: string + inlinePolicy: + description: An IAM policy as a JSON-encoded string that you want + to use as an inline session policy. + type: string + policyARNs: + description: The Amazon Resource Names (ARNs) of the IAM managed policies + that you want to use as managed session policies. The policies must + exist in the same account as the role. + items: + type: string + type: array + roleARN: + description: The Amazon Resource Name (ARN) of the role to assume. + type: string + sessionName: + description: An identifier for the assumed role session + type: string + sourceIdentityRef: + description: SourceIdentityRef is a reference to another identity + which will be chained to do role assumption. All identity types + are accepted. + properties: + kind: + description: Kind of the identity. + enum: + - AWSClusterControllerIdentity + - AWSClusterRoleIdentity + - AWSClusterStaticIdentity + type: string + name: + description: Name of the identity. + minLength: 1 + type: string + required: + - kind + - name + type: object + required: + - roleARN + type: object + type: object + served: true + storage: false + - name: v1alpha4 + schema: + openAPIV3Schema: + description: AWSClusterRoleIdentity is the Schema for the awsclusterroleidentities + API It is used to assume a role using the provided sourceRef. + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: Spec for this AWSClusterRoleIdentity. + properties: + allowedNamespaces: + description: AllowedNamespaces is used to identify which namespaces + are allowed to use the identity from. Namespaces can be selected + either using an array of namespaces or with label selector. An empty + allowedNamespaces object indicates that AWSClusters can use this + identity from any namespace. If this object is nil, no namespaces + will be allowed (default behaviour, if this field is not provided) + A namespace should be either in the NamespaceList or match with + Selector to use the identity. + nullable: true + properties: + list: + description: An nil or empty list indicates that AWSClusters cannot + use the identity from any namespace. + items: + type: string + nullable: true + type: array + selector: + description: "AllowedNamespaces is a selector of namespaces that + AWSClusters can use this ClusterPrincipal from. This is a standard + Kubernetes LabelSelector, a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. \n + An empty selector indicates that AWSClusters cannot use this + AWSClusterIdentity from any namespace." + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + 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. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + 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 + type: object + type: object + durationSeconds: + description: The duration, in seconds, of the role session before + it is renewed. + format: int32 + maximum: 43200 + minimum: 900 + type: integer + externalID: + description: A unique identifier that might be required when you assume + a role in another account. If the administrator of the account to + which the role belongs provided you with an external ID, then provide + that value in the ExternalId parameter. This value can be any string, + such as a passphrase or account number. A cross-account role is + usually set up to trust everyone in an account. Therefore, the administrator + of the trusting account might send an external ID to the administrator + of the trusted account. That way, only someone with the ID can assume + the role, rather than everyone in the account. For more information + about the external ID, see How to Use an External ID When Granting + Access to Your AWS Resources to a Third Party in the IAM User Guide. + type: string + inlinePolicy: + description: An IAM policy as a JSON-encoded string that you want + to use as an inline session policy. + type: string + policyARNs: + description: The Amazon Resource Names (ARNs) of the IAM managed policies + that you want to use as managed session policies. The policies must + exist in the same account as the role. + items: + type: string + type: array + roleARN: + description: The Amazon Resource Name (ARN) of the role to assume. + type: string + sessionName: + description: An identifier for the assumed role session + type: string + sourceIdentityRef: + description: SourceIdentityRef is a reference to another identity + which will be chained to do role assumption. All identity types + are accepted. + properties: + kind: + description: Kind of the identity. + enum: + - AWSClusterControllerIdentity + - AWSClusterRoleIdentity + - AWSClusterStaticIdentity + type: string + name: + description: Name of the identity. + minLength: 1 + type: string + required: + - kind + - name + type: object + required: + - roleARN + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsclusters.yaml b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsclusters.yaml index 9e19d5df961..bbf57cd7853 100644 --- a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsclusters.yaml +++ b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsclusters.yaml @@ -1,10 +1,12 @@ + +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: labels: - cluster.x-k8s.io/v1alpha4: v1alpha3 + cluster.x-k8s.io/v1alpha4: v1alpha4 annotations: - controller-gen.kubebuilder.io/version: v0.2.9 + controller-gen.kubebuilder.io/version: v0.5.0 creationTimestamp: null name: awsclusters.infrastructure.cluster.x-k8s.io spec: @@ -18,16 +20,42 @@ spec: singular: awscluster scope: Namespaced versions: - - name: v1alpha2 + - additionalPrinterColumns: + - description: Cluster to which this AWSCluster belongs + jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name + name: Cluster + type: string + - description: Cluster infrastructure is ready for EC2 instances + jsonPath: .status.ready + name: Ready + type: string + - description: AWS VPC the cluster is using + jsonPath: .spec.networkSpec.vpc.id + name: VPC + type: string + - description: API Endpoint + jsonPath: .status.apiEndpoints[0] + name: Endpoint + priority: 1 + type: string + - description: Bastion IP address for breakglass access + jsonPath: .status.bastion.publicIp + name: Bastion IP + type: string + name: v1alpha3 schema: openAPIV3Schema: description: AWSCluster is the Schema for the awsclusters API properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object @@ -37,62 +65,258 @@ spec: additionalTags: additionalProperties: type: string - description: AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the ones added by default. + description: AdditionalTags is an optional set of tags to add to AWS + resources managed by the AWS provider, in addition to the ones added + by default. + type: object + bastion: + description: Bastion contains options to configure the bastion host. + properties: + allowedCIDRBlocks: + description: AllowedCIDRBlocks is a list of CIDR blocks allowed + to access the bastion host. They are set as ingress rules for + the Bastion host's Security Group (defaults to 0.0.0.0/0). + items: + type: string + type: array + ami: + description: AMI will use the specified AMI to boot the bastion. + If not specified, the AMI will default to one picked out in + public space. + type: string + disableIngressRules: + description: DisableIngressRules will ensure there are no Ingress + rules in the bastion host's security group. Requires AllowedCIDRBlocks + to be empty. + type: boolean + enabled: + description: Enabled allows this provider to create a bastion + host instance with a public ip to access the VPC private network. + type: boolean + instanceType: + description: InstanceType will use the specified instance type + for the bastion. If not specified, Cluster API Provider AWS + will use t3.micro for all regions except us-east-1, where t2.micro + will be the default. + type: string + type: object + controlPlaneEndpoint: + description: ControlPlaneEndpoint represents the endpoint used to + communicate with the control plane. + properties: + host: + description: The hostname on which the API server is serving. + type: string + port: + description: The port on which the API server is serving. + format: int32 + type: integer + required: + - host + - port type: object controlPlaneLoadBalancer: - description: ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior + description: ControlPlaneLoadBalancer is optional configuration for + customizing control plane behavior. properties: + additionalSecurityGroups: + description: AdditionalSecurityGroups sets the security groups + used by the load balancer. Expected to be security group IDs. + This is optional - if not provided new security groups will + be created for the load balancer + items: + type: string + type: array + crossZoneLoadBalancing: + description: "CrossZoneLoadBalancing enables the classic ELB cross + availability zone balancing. \n With cross-zone load balancing, + each load balancer node for your Classic Load Balancer distributes + requests evenly across the registered instances in all enabled + Availability Zones. If cross-zone load balancing is disabled, + each load balancer node distributes requests evenly across the + registered instances in its Availability Zone only. \n Defaults + to false." + type: boolean scheme: - description: Scheme sets the scheme of the load balancer (defaults to Internet-facing) + default: Internet-facing + description: Scheme sets the scheme of the load balancer (defaults + to Internet-facing) + enum: + - Internet-facing + - internal type: string + subnets: + description: Subnets sets the subnets that should be applied to + the control plane load balancer (defaults to discovered subnets + for managed VPCs or an empty set for unmanaged VPCs) + items: + type: string + type: array type: object - disableBastionHost: - description: DisableBastionHost is an optional configuration field to prevent the creation of a bastion host instance. - type: boolean + identityRef: + description: IdentityRef is a reference to a identity to be used when + reconciling this cluster + properties: + kind: + description: Kind of the identity. + enum: + - AWSClusterControllerIdentity + - AWSClusterRoleIdentity + - AWSClusterStaticIdentity + type: string + name: + description: Name of the identity. + minLength: 1 + type: string + required: + - kind + - name + type: object + imageLookupBaseOS: + description: ImageLookupBaseOS is the name of the base operating system + used to look up machine images when a machine does not specify an + AMI. When set, this will be used for all cluster machines unless + a machine specifies a different ImageLookupBaseOS. + type: string + imageLookupFormat: + description: 'ImageLookupFormat is the AMI naming format to look up + machine images when a machine does not specify an AMI. When set, + this will be used for all cluster machines unless a machine specifies + a different ImageLookupOrg. Supports substitutions for {{.BaseOS}} + and {{.K8sVersion}} with the base OS and kubernetes version, respectively. + The BaseOS will be the value in ImageLookupBaseOS or ubuntu (the + default), and the kubernetes version as defined by the packages + produced by kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, + or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the ubuntu + base OS. See also: https://golang.org/pkg/text/template/' + type: string + imageLookupOrg: + description: ImageLookupOrg is the AWS Organization ID to look up + machine images when a machine does not specify an AMI. When set, + this will be used for all cluster machines unless a machine specifies + a different ImageLookupOrg. + type: string networkSpec: description: NetworkSpec encapsulates all things related to AWS network. properties: + cni: + description: CNI configuration + properties: + cniIngressRules: + description: CNIIngressRules specify rules to apply to control + plane and worker node security groups. The source for the + rule will be set to control plane and worker security group + IDs. + items: + description: CNIIngressRule defines an AWS ingress rule + for CNI requirements. + properties: + description: + type: string + fromPort: + format: int64 + type: integer + protocol: + description: SecurityGroupProtocol defines the protocol + type for a security group rule. + type: string + toPort: + format: int64 + type: integer + required: + - description + - fromPort + - protocol + - toPort + type: object + type: array + type: object + securityGroupOverrides: + additionalProperties: + type: string + description: SecurityGroupOverrides is an optional set of security + groups to use for cluster instances This is optional - if not + provided new security groups will be created for the cluster + type: object subnets: description: Subnets configuration. items: description: SubnetSpec configures an AWS Subnet. properties: availabilityZone: - description: AvailabilityZone defines the availability zone to use for this subnet in the cluster's region. + description: AvailabilityZone defines the availability zone + to use for this subnet in the cluster's region. type: string cidrBlock: - description: CidrBlock is the CIDR block to be used when the provider creates a managed VPC. + description: CidrBlock is the CIDR block to be used when + the provider creates a managed VPC. type: string id: - description: ID defines a unique identifier to reference this resource. + description: ID defines a unique identifier to reference + this resource. type: string isPublic: - description: IsPublic defines the subnet as a public subnet. A subnet is public when it is associated with a route table that has a route to an internet gateway. + description: IsPublic defines the subnet as a public subnet. + A subnet is public when it is associated with a route + table that has a route to an internet gateway. type: boolean natGatewayId: - description: NatGatewayID is the NAT gateway id associated with the subnet. Ignored unless the subnet is managed by the provider, in which case this is set on the public subnet where the NAT gateway resides. It is then used to determine routes for private subnets in the same AZ as the public subnet. + description: NatGatewayID is the NAT gateway id associated + with the subnet. Ignored unless the subnet is managed + by the provider, in which case this is set on the public + subnet where the NAT gateway resides. It is then used + to determine routes for private subnets in the same AZ + as the public subnet. type: string routeTableId: - description: RouteTableID is the routing table id associated with the subnet. + description: RouteTableID is the routing table id associated + with the subnet. type: string tags: additionalProperties: type: string - description: Tags is a collection of tags describing the resource. + description: Tags is a collection of tags describing the + resource. type: object type: object type: array vpc: description: VPC configuration. properties: + availabilityZoneSelection: + default: Ordered + description: 'AvailabilityZoneSelection specifies how AZs + should be selected if there are more AZs in a region than + specified by AvailabilityZoneUsageLimit. There are 2 selection + schemes: Ordered - selects based on alphabetical order Random + - selects AZs randomly in a region Defaults to Ordered' + enum: + - Ordered + - Random + type: string + availabilityZoneUsageLimit: + default: 3 + description: AvailabilityZoneUsageLimit specifies the maximum + number of availability zones (AZ) that should be used in + a region when automatically creating subnets. If a region + has more than this number of AZs then this number of AZs + will be picked randomly when creating default subnets. Defaults + to 3 + minimum: 1 + type: integer cidrBlock: - description: CidrBlock is the CIDR block to be used when the provider creates a managed VPC. Defaults to 10.0.0.0/16. + description: CidrBlock is the CIDR block to be used when the + provider creates a managed VPC. Defaults to 10.0.0.0/16. type: string id: - description: ID is the vpc-id of the VPC this provider should use to create resources. + description: ID is the vpc-id of the VPC this provider should + use to create resources. type: string internetGatewayId: - description: InternetGatewayID is the id of the internet gateway associated with the VPC. + description: InternetGatewayID is the id of the internet gateway + associated with the VPC. type: string tags: additionalProperties: @@ -105,55 +329,49 @@ spec: description: The AWS Region the cluster lives in. type: string sshKeyName: - description: SSHKeyName is the name of the ssh key to attach to the bastion host. + description: SSHKeyName is the name of the ssh key to attach to the + bastion host. Valid values are empty string (do not use SSH keys), + a valid SSH key name, or omitted (use the default SSH key name) type: string type: object status: description: AWSClusterStatus defines the observed state of AWSCluster properties: - apiEndpoints: - description: APIEndpoints represents the endpoints to communicate with the control plane. - items: - description: APIEndpoint represents a reachable Kubernetes API endpoint. - properties: - host: - description: The hostname on which the API server is serving. - type: string - port: - description: The port on which the API server is serving. - type: integer - required: - - host - - port - type: object - type: array bastion: description: Instance describes an AWS instance. properties: addresses: description: Addresses contains the AWS instance associated addresses. items: - description: MachineAddress contains information for the node's address. + description: MachineAddress contains information for the node's + address. properties: address: description: The machine address. type: string type: - description: Machine address type, one of Hostname, ExternalIP or InternalIP. + description: Machine address type, one of Hostname, ExternalIP + or InternalIP. type: string required: - address - type type: object type: array + availabilityZone: + description: Availability zone of instance + type: string ebsOptimized: - description: Indicates whether the instance is optimized for Amazon EBS I/O. + description: Indicates whether the instance is optimized for Amazon + EBS I/O. type: boolean enaSupport: - description: Specifies whether enhanced networking with ENA is enabled. + description: Specifies whether enhanced networking with ENA is + enabled. type: boolean iamProfile: - description: The name of the IAM instance profile associated with the instance, if applicable. + description: The name of the IAM instance profile associated with + the instance, if applicable. type: string id: type: string @@ -168,21 +386,104 @@ spec: items: type: string type: array + nonRootVolumes: + description: Configuration options for the non root storage volumes. + items: + description: Volume encapsulates the configuration options for + the storage device + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be encrypted + or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be + used. The key must already exist and be accessible by + the controller. + type: string + iops: + description: IOPS is the number of IOPS requested for the + disk. Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage + device. Must be greater than the image snapshot size or + 8 (whichever is greater). + format: int64 + minimum: 8 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, io1, + etc...). + type: string + required: + - size + type: object + type: array privateIp: description: The private IPv4 address assigned to the instance. type: string publicIp: - description: The public IPv4 address assigned to the instance, if applicable. + description: The public IPv4 address assigned to the instance, + if applicable. type: string - rootDeviceSize: - description: Specifies size (in Gi) of the root storage device - format: int64 - type: integer + rootVolume: + description: Configuration options for the root storage volume. + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be encrypted + or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be + used. The key must already exist and be accessible by the + controller. + type: string + iops: + description: IOPS is the number of IOPS requested for the + disk. Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage device. + Must be greater than the image snapshot size or 8 (whichever + is greater). + format: int64 + minimum: 8 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, io1, + etc...). + type: string + required: + - size + type: object securityGroupIds: - description: SecurityGroupIDs are one or more security group IDs this instance belongs to. + description: SecurityGroupIDs are one or more security group IDs + this instance belongs to. items: type: string type: array + spotMarketOptions: + description: SpotMarketOptions option for configuring instances + to be run using AWS Spot instances. + properties: + maxPrice: + description: MaxPrice defines the maximum price the user is + willing to pay for Spot VM instances + type: string + type: object sshKeyName: description: The name of the SSH key pair. type: string @@ -194,46 +495,137 @@ spec: type: string description: The tags associated with the instance. type: object + tenancy: + description: Tenancy indicates if instance should run on shared + or single-tenant hardware. + type: string type: description: The instance type. type: string userData: - description: UserData is the raw data script passed to the instance which is run upon bootstrap. This field must not be base64 encoded and should only be used when running a new instance. + description: UserData is the raw data script passed to the instance + which is run upon bootstrap. This field must not be base64 encoded + and should only be used when running a new instance. type: string required: - id type: object + conditions: + description: Conditions provide observations of the operational state + of a Cluster API resource. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: 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. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: 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. + type: string + severity: + description: 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. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: 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. + type: string + required: + - status + - type + type: object + type: array + failureDomains: + additionalProperties: + description: FailureDomainSpec is the Schema for Cluster API failure + domains. It allows controllers to understand how many failure + domains a cluster can optionally span across. + properties: + attributes: + additionalProperties: + type: string + description: Attributes is a free form map of attributes an + infrastructure provider might use or require. + type: object + controlPlane: + description: ControlPlane determines if this failure domain + is suitable for use by control plane machines. + type: boolean + type: object + description: FailureDomains is a slice of FailureDomains. + type: object network: description: Network encapsulates AWS networking resources. properties: apiServerElb: - description: APIServerELB is the Kubernetes api server classic load balancer. + description: APIServerELB is the Kubernetes api server classic + load balancer. properties: attributes: - description: Attributes defines extra attributes associated with the load balancer. + description: Attributes defines extra attributes associated + with the load balancer. properties: + crossZoneLoadBalancing: + description: CrossZoneLoadBalancing enables the classic + load balancer load balancing. + type: boolean idleTimeout: - description: IdleTimeout is time that the connection is allowed to be idle (no data has been sent over the connection) before it is closed by the load balancer. + description: IdleTimeout is time that the connection is + allowed to be idle (no data has been sent over the connection) + before it is closed by the load balancer. format: int64 type: integer type: object + availabilityZones: + description: AvailabilityZones is an array of availability + zones in the VPC attached to the load balancer. + items: + type: string + type: array dnsName: description: DNSName is the dns name of the load balancer. type: string healthChecks: - description: HealthCheck is the classic elb health check associated with the load balancer. + description: HealthCheck is the classic elb health check associated + with the load balancer. properties: healthyThreshold: format: int64 type: integer interval: - description: A Duration represents the elapsed time between two instants as an int64 nanosecond count. The representation limits the largest representable duration to approximately 290 years. + description: A Duration represents the elapsed time between + two instants as an int64 nanosecond count. The representation + limits the largest representable duration to approximately + 290 years. format: int64 type: integer target: type: string timeout: - description: A Duration represents the elapsed time between two instants as an int64 nanosecond count. The representation limits the largest representable duration to approximately 290 years. + description: A Duration represents the elapsed time between + two instants as an int64 nanosecond count. The representation + limits the largest representable duration to approximately + 290 years. format: int64 type: integer unhealthyThreshold: @@ -247,21 +639,26 @@ spec: - unhealthyThreshold type: object listeners: - description: Listeners is an array of classic elb listeners associated with the load balancer. There must be at least one. + description: Listeners is an array of classic elb listeners + associated with the load balancer. There must be at least + one. items: - description: ClassicELBListener defines an AWS classic load balancer listener. + description: ClassicELBListener defines an AWS classic load + balancer listener. properties: instancePort: format: int64 type: integer instanceProtocol: - description: ClassicELBProtocol defines listener protocols for a classic load balancer. + description: ClassicELBProtocol defines listener protocols + for a classic load balancer. type: string port: format: int64 type: integer protocol: - description: ClassicELBProtocol defines listener protocols for a classic load balancer. + description: ClassicELBProtocol defines listener protocols + for a classic load balancer. type: string required: - instancePort @@ -271,25 +668,31 @@ spec: type: object type: array name: - description: The name of the load balancer. It must be unique within the set of load balancers defined in the region. It also serves as identifier. + description: The name of the load balancer. It must be unique + within the set of load balancers defined in the region. + It also serves as identifier. type: string scheme: - description: Scheme is the load balancer scheme, either internet-facing or private. + description: Scheme is the load balancer scheme, either internet-facing + or private. type: string securityGroupIds: - description: SecurityGroupIDs is an array of security groups assigned to the load balancer. + description: SecurityGroupIDs is an array of security groups + assigned to the load balancer. items: type: string type: array subnetIds: - description: SubnetIDs is an array of subnets in the VPC attached to the load balancer. + description: SubnetIDs is an array of subnets in the VPC attached + to the load balancer. items: type: string type: array tags: additionalProperties: type: string - description: Tags is a map of tags associated with the load balancer. + description: Tags is a map of tags associated with the load + balancer. type: object type: object securityGroups: @@ -300,12 +703,15 @@ spec: description: ID is a unique identifier. type: string ingressRule: - description: IngressRules is the inbound rules associated with the security group. + description: IngressRules is the inbound rules associated + with the security group. items: - description: IngressRule defines an AWS ingress rule for security groups. + description: IngressRule defines an AWS ingress rule for + security groups. properties: cidrBlocks: - description: List of CIDR blocks to allow access from. Cannot be specified with SourceSecurityGroupID. + description: List of CIDR blocks to allow access from. + Cannot be specified with SourceSecurityGroupID. items: type: string type: array @@ -315,10 +721,12 @@ spec: format: int64 type: integer protocol: - description: SecurityGroupProtocol defines the protocol type for a security group rule. + description: SecurityGroupProtocol defines the protocol + type for a security group rule. type: string sourceSecurityGroupIds: - description: The security group id to allow access from. Cannot be specified with CidrBlocks. + description: The security group id to allow access + from. Cannot be specified with CidrBlocks. items: type: string type: array @@ -338,16 +746,19 @@ spec: tags: additionalProperties: type: string - description: Tags is a map of tags associated with the security group. + description: Tags is a map of tags associated with the security + group. type: object required: - id - name type: object - description: SecurityGroups is a map from the role/kind of the security group to its unique name, if any. + description: SecurityGroups is a map from the role/kind of the + security group to its unique name, if any. type: object type: object ready: + default: false type: boolean required: - ready @@ -379,16 +790,20 @@ spec: jsonPath: .status.bastion.publicIp name: Bastion IP type: string - name: v1alpha3 + name: v1alpha4 schema: openAPIV3Schema: description: AWSCluster is the Schema for the awsclusters API properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object @@ -398,31 +813,44 @@ spec: additionalTags: additionalProperties: type: string - description: AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the ones added by default. + description: AdditionalTags is an optional set of tags to add to AWS + resources managed by the AWS provider, in addition to the ones added + by default. type: object bastion: description: Bastion contains options to configure the bastion host. properties: allowedCIDRBlocks: - description: AllowedCIDRBlocks is a list of CIDR blocks allowed to access the bastion host. They are set as ingress rules for the Bastion host's Security Group (defaults to 0.0.0.0/0). + description: AllowedCIDRBlocks is a list of CIDR blocks allowed + to access the bastion host. They are set as ingress rules for + the Bastion host's Security Group (defaults to 0.0.0.0/0). items: type: string type: array ami: - description: AMI will use the specified AMI to boot the bastion. If not specified, the AMI will default to one picked out in public space. + description: AMI will use the specified AMI to boot the bastion. + If not specified, the AMI will default to one picked out in + public space. type: string disableIngressRules: - description: DisableIngressRules will ensure there are no Ingress rules in the bastion host's security group. Requires AllowedCIDRBlocks to be empty. + description: DisableIngressRules will ensure there are no Ingress + rules in the bastion host's security group. Requires AllowedCIDRBlocks + to be empty. type: boolean enabled: - description: Enabled allows this provider to create a bastion host instance with a public ip to access the VPC private network. + description: Enabled allows this provider to create a bastion + host instance with a public ip to access the VPC private network. type: boolean instanceType: - description: InstanceType will use the specified instance type for the bastion. If not specified, Cluster API Provider AWS will use t3.micro for all regions except us-east-1, where t2.micro will be the default. + description: InstanceType will use the specified instance type + for the bastion. If not specified, Cluster API Provider AWS + will use t3.micro for all regions except us-east-1, where t2.micro + will be the default. type: string type: object controlPlaneEndpoint: - description: ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + description: ControlPlaneEndpoint represents the endpoint used to + communicate with the control plane. properties: host: description: The hostname on which the API server is serving. @@ -436,28 +864,87 @@ spec: - port type: object controlPlaneLoadBalancer: - description: ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior. + description: ControlPlaneLoadBalancer is optional configuration for + customizing control plane behavior. properties: + additionalSecurityGroups: + description: AdditionalSecurityGroups sets the security groups + used by the load balancer. Expected to be security group IDs. + This is optional - if not provided new security groups will + be created for the load balancer + items: + type: string + type: array crossZoneLoadBalancing: - description: "CrossZoneLoadBalancing enables the classic ELB cross availability zone balancing. \n With cross-zone load balancing, each load balancer node for your Classic Load Balancer distributes requests evenly across the registered instances in all enabled Availability Zones. If cross-zone load balancing is disabled, each load balancer node distributes requests evenly across the registered instances in its Availability Zone only. \n Defaults to false." + description: "CrossZoneLoadBalancing enables the classic ELB cross + availability zone balancing. \n With cross-zone load balancing, + each load balancer node for your Classic Load Balancer distributes + requests evenly across the registered instances in all enabled + Availability Zones. If cross-zone load balancing is disabled, + each load balancer node distributes requests evenly across the + registered instances in its Availability Zone only. \n Defaults + to false." type: boolean scheme: - description: Scheme sets the scheme of the load balancer (defaults to Internet-facing) + default: Internet-facing + description: Scheme sets the scheme of the load balancer (defaults + to Internet-facing) + enum: + - Internet-facing + - internal type: string subnets: - description: Subnets sets the subnets that should be applied to the control plane load balancer (defaults to discovered subnets for managed VPCs or an empty set for unmanaged VPCs) + description: Subnets sets the subnets that should be applied to + the control plane load balancer (defaults to discovered subnets + for managed VPCs or an empty set for unmanaged VPCs) items: type: string type: array type: object + identityRef: + description: IdentityRef is a reference to a identity to be used when + reconciling this cluster + properties: + kind: + description: Kind of the identity. + enum: + - AWSClusterControllerIdentity + - AWSClusterRoleIdentity + - AWSClusterStaticIdentity + type: string + name: + description: Name of the identity. + minLength: 1 + type: string + required: + - kind + - name + type: object imageLookupBaseOS: - description: ImageLookupBaseOS is the name of the base operating system used to look up machine images when a machine does not specify an AMI. When set, this will be used for all cluster machines unless a machine specifies a different ImageLookupBaseOS. + description: ImageLookupBaseOS is the name of the base operating system + used to look up machine images when a machine does not specify an + AMI. When set, this will be used for all cluster machines unless + a machine specifies a different ImageLookupBaseOS. type: string imageLookupFormat: - description: 'ImageLookupFormat is the AMI naming format to look up machine images when a machine does not specify an AMI. When set, this will be used for all cluster machines unless a machine specifies a different ImageLookupOrg. Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base OS and kubernetes version, respectively. The BaseOS will be the value in ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as defined by the packages produced by kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See also: https://golang.org/pkg/text/template/' + description: 'ImageLookupFormat is the AMI naming format to look up + machine images when a machine does not specify an AMI. When set, + this will be used for all cluster machines unless a machine specifies + a different ImageLookupOrg. Supports substitutions for {{.BaseOS}} + and {{.K8sVersion}} with the base OS and kubernetes version, respectively. + The BaseOS will be the value in ImageLookupBaseOS or ubuntu (the + default), and the kubernetes version as defined by the packages + produced by kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, + or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the ubuntu + base OS. See also: https://golang.org/pkg/text/template/' type: string imageLookupOrg: - description: ImageLookupOrg is the AWS Organization ID to look up machine images when a machine does not specify an AMI. When set, this will be used for all cluster machines unless a machine specifies a different ImageLookupOrg. + description: ImageLookupOrg is the AWS Organization ID to look up + machine images when a machine does not specify an AMI. When set, + this will be used for all cluster machines unless a machine specifies + a different ImageLookupOrg. type: string networkSpec: description: NetworkSpec encapsulates all things related to AWS network. @@ -466,9 +953,13 @@ spec: description: CNI configuration properties: cniIngressRules: - description: CNIIngressRules specify rules to apply to control plane and worker node security groups. The source for the rule will be set to control plane and worker security group IDs. + description: CNIIngressRules specify rules to apply to control + plane and worker node security groups. The source for the + rule will be set to control plane and worker security group + IDs. items: - description: CNIIngressRule defines an AWS ingress rule for CNI requirements. + description: CNIIngressRule defines an AWS ingress rule + for CNI requirements. properties: description: type: string @@ -476,7 +967,8 @@ spec: format: int64 type: integer protocol: - description: SecurityGroupProtocol defines the protocol type for a security group rule. + description: SecurityGroupProtocol defines the protocol + type for a security group rule. type: string toPort: format: int64 @@ -489,33 +981,52 @@ spec: type: object type: array type: object + securityGroupOverrides: + additionalProperties: + type: string + description: SecurityGroupOverrides is an optional set of security + groups to use for cluster instances This is optional - if not + provided new security groups will be created for the cluster + type: object subnets: description: Subnets configuration. items: description: SubnetSpec configures an AWS Subnet. properties: availabilityZone: - description: AvailabilityZone defines the availability zone to use for this subnet in the cluster's region. + description: AvailabilityZone defines the availability zone + to use for this subnet in the cluster's region. type: string cidrBlock: - description: CidrBlock is the CIDR block to be used when the provider creates a managed VPC. + description: CidrBlock is the CIDR block to be used when + the provider creates a managed VPC. type: string id: - description: ID defines a unique identifier to reference this resource. + description: ID defines a unique identifier to reference + this resource. type: string isPublic: - description: IsPublic defines the subnet as a public subnet. A subnet is public when it is associated with a route table that has a route to an internet gateway. + description: IsPublic defines the subnet as a public subnet. + A subnet is public when it is associated with a route + table that has a route to an internet gateway. type: boolean natGatewayId: - description: NatGatewayID is the NAT gateway id associated with the subnet. Ignored unless the subnet is managed by the provider, in which case this is set on the public subnet where the NAT gateway resides. It is then used to determine routes for private subnets in the same AZ as the public subnet. + description: NatGatewayID is the NAT gateway id associated + with the subnet. Ignored unless the subnet is managed + by the provider, in which case this is set on the public + subnet where the NAT gateway resides. It is then used + to determine routes for private subnets in the same AZ + as the public subnet. type: string routeTableId: - description: RouteTableID is the routing table id associated with the subnet. + description: RouteTableID is the routing table id associated + with the subnet. type: string tags: additionalProperties: type: string - description: Tags is a collection of tags describing the resource. + description: Tags is a collection of tags describing the + resource. type: object type: object type: array @@ -524,24 +1035,36 @@ spec: properties: availabilityZoneSelection: default: Ordered - description: 'AvailabilityZoneSelection specifies how AZs should be selected if there are more AZs in a region than specified by AvailabilityZoneUsageLimit. There are 2 selection schemes: Ordered - selects based on alphabetical order Random - selects AZs randomly in a region Defaults to Ordered' + description: 'AvailabilityZoneSelection specifies how AZs + should be selected if there are more AZs in a region than + specified by AvailabilityZoneUsageLimit. There are 2 selection + schemes: Ordered - selects based on alphabetical order Random + - selects AZs randomly in a region Defaults to Ordered' enum: - Ordered - Random type: string availabilityZoneUsageLimit: default: 3 - description: AvailabilityZoneUsageLimit specifies the maximum number of availability zones (AZ) that should be used in a region when automatically creating subnets. If a region has more than this number of AZs then this number of AZs will be picked randomly when creating default subnets. Defaults to 3 + description: AvailabilityZoneUsageLimit specifies the maximum + number of availability zones (AZ) that should be used in + a region when automatically creating subnets. If a region + has more than this number of AZs then this number of AZs + will be picked randomly when creating default subnets. Defaults + to 3 minimum: 1 type: integer cidrBlock: - description: CidrBlock is the CIDR block to be used when the provider creates a managed VPC. Defaults to 10.0.0.0/16. + description: CidrBlock is the CIDR block to be used when the + provider creates a managed VPC. Defaults to 10.0.0.0/16. type: string id: - description: ID is the vpc-id of the VPC this provider should use to create resources. + description: ID is the vpc-id of the VPC this provider should + use to create resources. type: string internetGatewayId: - description: InternetGatewayID is the id of the internet gateway associated with the VPC. + description: InternetGatewayID is the id of the internet gateway + associated with the VPC. type: string tags: additionalProperties: @@ -554,7 +1077,9 @@ spec: description: The AWS Region the cluster lives in. type: string sshKeyName: - description: SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name) + description: SSHKeyName is the name of the ssh key to attach to the + bastion host. Valid values are empty string (do not use SSH keys), + a valid SSH key name, or omitted (use the default SSH key name) type: string type: object status: @@ -566,13 +1091,15 @@ spec: addresses: description: Addresses contains the AWS instance associated addresses. items: - description: MachineAddress contains information for the node's address. + description: MachineAddress contains information for the node's + address. properties: address: description: The machine address. type: string type: - description: Machine address type, one of Hostname, ExternalIP or InternalIP. + description: Machine address type, one of Hostname, ExternalIP + or InternalIP. type: string required: - address @@ -583,13 +1110,16 @@ spec: description: Availability zone of instance type: string ebsOptimized: - description: Indicates whether the instance is optimized for Amazon EBS I/O. + description: Indicates whether the instance is optimized for Amazon + EBS I/O. type: boolean enaSupport: - description: Specifies whether enhanced networking with ENA is enabled. + description: Specifies whether enhanced networking with ENA is + enabled. type: boolean iamProfile: - description: The name of the IAM instance profile associated with the instance, if applicable. + description: The name of the IAM instance profile associated with + the instance, if applicable. type: string id: type: string @@ -607,28 +1137,38 @@ spec: nonRootVolumes: description: Configuration options for the non root storage volumes. items: - description: Volume encapsulates the configuration options for the storage device + description: Volume encapsulates the configuration options for + the storage device properties: deviceName: description: Device name type: string encrypted: - description: Encrypted is whether the volume should be encrypted or not. + description: Encrypted is whether the volume should be encrypted + or not. type: boolean encryptionKey: - description: EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN. If Encrypted is set and this is omitted, the default AWS key will be used. The key must already exist and be accessible by the controller. + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be + used. The key must already exist and be accessible by + the controller. type: string iops: - description: IOPS is the number of IOPS requested for the disk. Not applicable to all types. + description: IOPS is the number of IOPS requested for the + disk. Not applicable to all types. format: int64 type: integer size: - description: Size specifies size (in Gi) of the storage device. Must be greater than the image snapshot size or 8 (whichever is greater). + description: Size specifies size (in Gi) of the storage + device. Must be greater than the image snapshot size or + 8 (whichever is greater). format: int64 minimum: 8 type: integer type: - description: Type is the type of the volume (e.g. gp2, io1, etc...). + description: Type is the type of the volume (e.g. gp2, io1, + etc...). type: string required: - size @@ -638,7 +1178,8 @@ spec: description: The private IPv4 address assigned to the instance. type: string publicIp: - description: The public IPv4 address assigned to the instance, if applicable. + description: The public IPv4 address assigned to the instance, + if applicable. type: string rootVolume: description: Configuration options for the root storage volume. @@ -647,36 +1188,48 @@ spec: description: Device name type: string encrypted: - description: Encrypted is whether the volume should be encrypted or not. + description: Encrypted is whether the volume should be encrypted + or not. type: boolean encryptionKey: - description: EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN. If Encrypted is set and this is omitted, the default AWS key will be used. The key must already exist and be accessible by the controller. + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be + used. The key must already exist and be accessible by the + controller. type: string iops: - description: IOPS is the number of IOPS requested for the disk. Not applicable to all types. + description: IOPS is the number of IOPS requested for the + disk. Not applicable to all types. format: int64 type: integer size: - description: Size specifies size (in Gi) of the storage device. Must be greater than the image snapshot size or 8 (whichever is greater). + description: Size specifies size (in Gi) of the storage device. + Must be greater than the image snapshot size or 8 (whichever + is greater). format: int64 minimum: 8 type: integer type: - description: Type is the type of the volume (e.g. gp2, io1, etc...). + description: Type is the type of the volume (e.g. gp2, io1, + etc...). type: string required: - size type: object securityGroupIds: - description: SecurityGroupIDs are one or more security group IDs this instance belongs to. + description: SecurityGroupIDs are one or more security group IDs + this instance belongs to. items: type: string type: array spotMarketOptions: - description: SpotMarketOptions option for configuring instances to be run using AWS Spot instances. + description: SpotMarketOptions option for configuring instances + to be run using AWS Spot instances. properties: maxPrice: - description: MaxPrice defines the maximum price the user is willing to pay for Spot VM instances + description: MaxPrice defines the maximum price the user is + willing to pay for Spot VM instances type: string type: object sshKeyName: @@ -691,40 +1244,59 @@ spec: description: The tags associated with the instance. type: object tenancy: - description: Tenancy indicates if instance should run on shared or single-tenant hardware. + description: Tenancy indicates if instance should run on shared + or single-tenant hardware. type: string type: description: The instance type. type: string userData: - description: UserData is the raw data script passed to the instance which is run upon bootstrap. This field must not be base64 encoded and should only be used when running a new instance. + description: UserData is the raw data script passed to the instance + which is run upon bootstrap. This field must not be base64 encoded + and should only be used when running a new instance. type: string required: - id type: object conditions: - description: Conditions provide observations of the operational state of a Cluster API resource. + description: Conditions provide observations of the operational state + of a Cluster API resource. items: - description: Condition defines an observation of a Cluster API resource operational state. + description: Condition defines an observation of a Cluster API resource + operational state. properties: lastTransitionTime: - description: 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. + description: 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. format: date-time type: string message: - description: A human readable message indicating details about the transition. This field may be empty. + description: A human readable message indicating details about + the transition. This field may be empty. type: string reason: - description: 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. + description: 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. type: string severity: - description: 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. + description: 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. type: string status: description: Status of the condition, one of True, False, Unknown. type: string type: - description: 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. + description: 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. type: string required: - status @@ -733,15 +1305,19 @@ spec: type: array failureDomains: additionalProperties: - description: FailureDomainSpec is the Schema for Cluster API failure domains. It allows controllers to understand how many failure domains a cluster can optionally span across. + description: FailureDomainSpec is the Schema for Cluster API failure + domains. It allows controllers to understand how many failure + domains a cluster can optionally span across. properties: attributes: additionalProperties: type: string - description: Attributes is a free form map of attributes an infrastructure provider might use or require. + description: Attributes is a free form map of attributes an + infrastructure provider might use or require. type: object controlPlane: - description: ControlPlane determines if this failure domain is suitable for use by control plane machines. + description: ControlPlane determines if this failure domain + is suitable for use by control plane machines. type: boolean type: object description: FailureDomains is a slice of FailureDomains. @@ -750,21 +1326,27 @@ spec: description: Network encapsulates AWS networking resources. properties: apiServerElb: - description: APIServerELB is the Kubernetes api server classic load balancer. + description: APIServerELB is the Kubernetes api server classic + load balancer. properties: attributes: - description: Attributes defines extra attributes associated with the load balancer. + description: Attributes defines extra attributes associated + with the load balancer. properties: crossZoneLoadBalancing: - description: CrossZoneLoadBalancing enables the classic load balancer load balancing. + description: CrossZoneLoadBalancing enables the classic + load balancer load balancing. type: boolean idleTimeout: - description: IdleTimeout is time that the connection is allowed to be idle (no data has been sent over the connection) before it is closed by the load balancer. + description: IdleTimeout is time that the connection is + allowed to be idle (no data has been sent over the connection) + before it is closed by the load balancer. format: int64 type: integer type: object availabilityZones: - description: AvailabilityZones is an array of availability zones in the VPC attached to the load balancer. + description: AvailabilityZones is an array of availability + zones in the VPC attached to the load balancer. items: type: string type: array @@ -772,19 +1354,26 @@ spec: description: DNSName is the dns name of the load balancer. type: string healthChecks: - description: HealthCheck is the classic elb health check associated with the load balancer. + description: HealthCheck is the classic elb health check associated + with the load balancer. properties: healthyThreshold: format: int64 type: integer interval: - description: A Duration represents the elapsed time between two instants as an int64 nanosecond count. The representation limits the largest representable duration to approximately 290 years. + description: A Duration represents the elapsed time between + two instants as an int64 nanosecond count. The representation + limits the largest representable duration to approximately + 290 years. format: int64 type: integer target: type: string timeout: - description: A Duration represents the elapsed time between two instants as an int64 nanosecond count. The representation limits the largest representable duration to approximately 290 years. + description: A Duration represents the elapsed time between + two instants as an int64 nanosecond count. The representation + limits the largest representable duration to approximately + 290 years. format: int64 type: integer unhealthyThreshold: @@ -798,21 +1387,26 @@ spec: - unhealthyThreshold type: object listeners: - description: Listeners is an array of classic elb listeners associated with the load balancer. There must be at least one. + description: Listeners is an array of classic elb listeners + associated with the load balancer. There must be at least + one. items: - description: ClassicELBListener defines an AWS classic load balancer listener. + description: ClassicELBListener defines an AWS classic load + balancer listener. properties: instancePort: format: int64 type: integer instanceProtocol: - description: ClassicELBProtocol defines listener protocols for a classic load balancer. + description: ClassicELBProtocol defines listener protocols + for a classic load balancer. type: string port: format: int64 type: integer protocol: - description: ClassicELBProtocol defines listener protocols for a classic load balancer. + description: ClassicELBProtocol defines listener protocols + for a classic load balancer. type: string required: - instancePort @@ -822,25 +1416,31 @@ spec: type: object type: array name: - description: The name of the load balancer. It must be unique within the set of load balancers defined in the region. It also serves as identifier. + description: The name of the load balancer. It must be unique + within the set of load balancers defined in the region. + It also serves as identifier. type: string scheme: - description: Scheme is the load balancer scheme, either internet-facing or private. + description: Scheme is the load balancer scheme, either internet-facing + or private. type: string securityGroupIds: - description: SecurityGroupIDs is an array of security groups assigned to the load balancer. + description: SecurityGroupIDs is an array of security groups + assigned to the load balancer. items: type: string type: array subnetIds: - description: SubnetIDs is an array of subnets in the VPC attached to the load balancer. + description: SubnetIDs is an array of subnets in the VPC attached + to the load balancer. items: type: string type: array tags: additionalProperties: type: string - description: Tags is a map of tags associated with the load balancer. + description: Tags is a map of tags associated with the load + balancer. type: object type: object securityGroups: @@ -851,12 +1451,15 @@ spec: description: ID is a unique identifier. type: string ingressRule: - description: IngressRules is the inbound rules associated with the security group. + description: IngressRules is the inbound rules associated + with the security group. items: - description: IngressRule defines an AWS ingress rule for security groups. + description: IngressRule defines an AWS ingress rule for + security groups. properties: cidrBlocks: - description: List of CIDR blocks to allow access from. Cannot be specified with SourceSecurityGroupID. + description: List of CIDR blocks to allow access from. + Cannot be specified with SourceSecurityGroupID. items: type: string type: array @@ -866,10 +1469,12 @@ spec: format: int64 type: integer protocol: - description: SecurityGroupProtocol defines the protocol type for a security group rule. + description: SecurityGroupProtocol defines the protocol + type for a security group rule. type: string sourceSecurityGroupIds: - description: The security group id to allow access from. Cannot be specified with CidrBlocks. + description: The security group id to allow access + from. Cannot be specified with CidrBlocks. items: type: string type: array @@ -889,13 +1494,15 @@ spec: tags: additionalProperties: type: string - description: Tags is a map of tags associated with the security group. + description: Tags is a map of tags associated with the security + group. type: object required: - id - name type: object - description: SecurityGroups is a map from the role/kind of the security group to its unique name, if any. + description: SecurityGroups is a map from the role/kind of the + security group to its unique name, if any. type: object type: object ready: diff --git a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsclusterstaticidentities.yaml b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsclusterstaticidentities.yaml new file mode 100644 index 00000000000..f673e0b6ad5 --- /dev/null +++ b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsclusterstaticidentities.yaml @@ -0,0 +1,246 @@ + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.5.0 + creationTimestamp: null + name: awsclusterstaticidentities.infrastructure.cluster.x-k8s.io +spec: + group: infrastructure.cluster.x-k8s.io + names: + categories: + - cluster-api + kind: AWSClusterStaticIdentity + listKind: AWSClusterStaticIdentityList + plural: awsclusterstaticidentities + singular: awsclusterstaticidentity + scope: Cluster + versions: + - name: v1alpha3 + schema: + openAPIV3Schema: + description: AWSClusterStaticIdentity is the Schema for the awsclusterstaticidentities + API It represents a reference to an AWS access key ID and secret access + key, stored in a secret. + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: Spec for this AWSClusterStaticIdentity + properties: + allowedNamespaces: + description: AllowedNamespaces is used to identify which namespaces + are allowed to use the identity from. Namespaces can be selected + either using an array of namespaces or with label selector. An empty + allowedNamespaces object indicates that AWSClusters can use this + identity from any namespace. If this object is nil, no namespaces + will be allowed (default behaviour, if this field is not provided) + A namespace should be either in the NamespaceList or match with + Selector to use the identity. + nullable: true + properties: + list: + description: An nil or empty list indicates that AWSClusters cannot + use the identity from any namespace. + items: + type: string + nullable: true + type: array + selector: + description: "AllowedNamespaces is a selector of namespaces that + AWSClusters can use this ClusterPrincipal from. This is a standard + Kubernetes LabelSelector, a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. \n + An empty selector indicates that AWSClusters cannot use this + AWSClusterIdentity from any namespace." + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + 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. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + 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 + type: object + type: object + secretRef: + description: 'Reference to a secret containing the credentials. The + secret should contain the following data keys: AccessKeyID: AKIAIOSFODNN7EXAMPLE SecretAccessKey: + wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY SessionToken: Optional' + properties: + name: + description: Name is unique within a namespace to reference a + secret resource. + type: string + namespace: + description: Namespace defines the space within which the secret + name must be unique. + type: string + type: object + required: + - secretRef + type: object + type: object + served: true + storage: false + - name: v1alpha4 + schema: + openAPIV3Schema: + description: AWSClusterStaticIdentity is the Schema for the awsclusterstaticidentities + API It represents a reference to an AWS access key ID and secret access + key, stored in a secret. + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: Spec for this AWSClusterStaticIdentity + properties: + allowedNamespaces: + description: AllowedNamespaces is used to identify which namespaces + are allowed to use the identity from. Namespaces can be selected + either using an array of namespaces or with label selector. An empty + allowedNamespaces object indicates that AWSClusters can use this + identity from any namespace. If this object is nil, no namespaces + will be allowed (default behaviour, if this field is not provided) + A namespace should be either in the NamespaceList or match with + Selector to use the identity. + nullable: true + properties: + list: + description: An nil or empty list indicates that AWSClusters cannot + use the identity from any namespace. + items: + type: string + nullable: true + type: array + selector: + description: "AllowedNamespaces is a selector of namespaces that + AWSClusters can use this ClusterPrincipal from. This is a standard + Kubernetes LabelSelector, a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. \n + An empty selector indicates that AWSClusters cannot use this + AWSClusterIdentity from any namespace." + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + 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. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + 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 + type: object + type: object + secretRef: + description: 'Reference to a secret containing the credentials. The + secret should contain the following data keys: AccessKeyID: AKIAIOSFODNN7EXAMPLE SecretAccessKey: + wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY SessionToken: Optional' + properties: + name: + description: Name is unique within a namespace to reference a + secret resource. + type: string + namespace: + description: Namespace defines the space within which the secret + name must be unique. + type: string + type: object + required: + - secretRef + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmachinepools.yaml b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmachinepools.yaml index 4fba93192ae..35fc3382e62 100644 --- a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmachinepools.yaml +++ b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmachinepools.yaml @@ -1,10 +1,10 @@ + +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - labels: - cluster.x-k8s.io/v1alpha4: v1alpha3 annotations: - controller-gen.kubebuilder.io/version: v0.2.9 + controller-gen.kubebuilder.io/version: v0.5.0 creationTimestamp: null name: awsmachinepools.infrastructure.cluster.x-k8s.io spec: @@ -45,10 +45,14 @@ spec: description: AWSMachinePool is the Schema for the awsmachinepools API properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object @@ -58,34 +62,48 @@ spec: additionalTags: additionalProperties: type: string - description: AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the AWS provider. + description: AdditionalTags is an optional set of tags to add to an + instance, in addition to the ones added by default by the AWS provider. type: object availabilityZones: - description: AvailabilityZones is an array of availability zones instances can run in + description: AvailabilityZones is an array of availability zones instances + can run in items: type: string type: array awsLaunchTemplate: - description: AWSLaunchTemplate specifies the launch template and version to use when an instance is launched. + description: AWSLaunchTemplate specifies the launch template and version + to use when an instance is launched. properties: additionalSecurityGroups: - description: AdditionalSecurityGroups is an array of references to security groups that should be applied to the instances. These security groups would be set in addition to any security groups defined at the cluster level or in the actuator. + description: AdditionalSecurityGroups is an array of references + to security groups that should be applied to the instances. + These security groups would be set in addition to any security + groups defined at the cluster level or in the actuator. items: - description: AWSResourceReference is a reference to a specific AWS resource by ID, ARN, or filters. Only one of ID, ARN or Filters may be specified. Specifying more than one will result in a validation error. + description: AWSResourceReference is a reference to a specific + AWS resource by ID, ARN, or filters. Only one of ID, ARN or + Filters may be specified. Specifying more than one will result + in a validation error. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used to + identify a resource They are applied according to the + rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: - description: Filter is a filter used to identify an AWS resource + description: Filter is a filter used to identify an AWS + resource properties: name: - description: Name of the filter. Filter names are case-sensitive. + description: Name of the filter. Filter names are + case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter values. + Filter values are case-sensitive. items: type: string type: array @@ -100,21 +118,26 @@ spec: type: object type: array ami: - description: AMI is the reference to the AMI from which to create the machine instance. + description: AMI is the reference to the AMI from which to create + the machine instance. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used to + identify a resource They are applied according to the rules + defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: - description: Filter is a filter used to identify an AWS resource + description: Filter is a filter used to identify an AWS + resource properties: name: description: Name of the filter. Filter names are case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter values. + Filter values are case-sensitive. items: type: string type: array @@ -128,63 +151,570 @@ spec: type: string type: object iamInstanceProfile: - description: The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. The instance profile contains the IAM role. + description: The name or the Amazon Resource Name (ARN) of the + instance profile associated with the IAM role for the instance. + The instance profile contains the IAM role. type: string - id: - description: The ID of the launch template. + imageLookupBaseOS: + description: ImageLookupBaseOS is the name of the base operating + system to use for image lookup the AMI is not set. + type: string + imageLookupFormat: + description: 'ImageLookupFormat is the AMI naming format to look + up the image for this machine It will be ignored if an explicit + AMI is set. Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} + with the base OS and kubernetes version, respectively. The BaseOS + will be the value in ImageLookupBaseOS or ubuntu (the default), + and the kubernetes version as defined by the packages produced + by kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, + or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the ubuntu + base OS. See also: https://golang.org/pkg/text/template/' + type: string + imageLookupOrg: + description: ImageLookupOrg is the AWS Organization ID to use + for image lookup if AMI is not set. + type: string + instanceType: + description: 'InstanceType is the type of instance to create. + Example: m4.xlarge' + type: string + name: + description: The name of the launch template. + type: string + rootVolume: + description: RootVolume encapsulates the configuration options + for the root volume + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be encrypted + or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be + used. The key must already exist and be accessible by the + controller. + type: string + iops: + description: IOPS is the number of IOPS requested for the + disk. Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage device. + Must be greater than the image snapshot size or 8 (whichever + is greater). + format: int64 + minimum: 8 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, io1, + etc...). + type: string + required: + - size + type: object + sshKeyName: + description: SSHKeyName is the name of the ssh key to attach to + the instance. Valid values are empty string (do not use SSH + keys), a valid SSH key name, or omitted (use the default SSH + key name) + type: string + versionNumber: + description: 'VersionNumber is the version of the launch template + that is applied. Typically a new version is created when at + least one of the following happens: 1) A new launch template + spec is applied. 2) One or more parameters in an existing template + is changed. 3) A new AMI is discovered.' + format: int64 + type: integer + type: object + capacityRebalance: + description: Enable or disable the capacity rebalance autoscaling + group feature + type: boolean + defaultCoolDown: + description: The amount of time, in seconds, after a scaling activity + completes before another scaling activity can start. If no value + is supplied by user a default value of 300 seconds is set + type: string + maxSize: + default: 1 + description: The maximum size of the group. + format: int32 + minimum: 1 + type: integer + minSize: + default: 1 + description: The minimum size of the group. + format: int32 + minimum: 1 + type: integer + mixedInstancesPolicy: + description: MixedInstancesPolicy describes how multiple instance + types will be used by the ASG. + properties: + instancesDistribution: + description: InstancesDistribution to configure distribution of + On-Demand Instances and Spot Instances. + properties: + onDemandAllocationStrategy: + default: prioritized + description: OnDemandAllocationStrategy indicates how to allocate + instance types to fulfill On-Demand capacity. + enum: + - prioritized + type: string + onDemandBaseCapacity: + default: 0 + format: int64 + type: integer + onDemandPercentageAboveBaseCapacity: + default: 100 + format: int64 + type: integer + spotAllocationStrategy: + default: lowest-price + description: SpotAllocationStrategy indicates how to allocate + instances across Spot Instance pools. + enum: + - lowest-price + - capacity-optimized + type: string + type: object + overrides: + items: + description: Overrides are used to override the instance type + specified by the launch template with multiple instance types + that can be used to launch On-Demand Instances and Spot Instances. + properties: + instanceType: + type: string + required: + - instanceType + type: object + type: array + type: object + providerID: + description: ProviderID is the ARN of the associated ASG + type: string + providerIDList: + description: ProviderIDList are the identification IDs of machine + instances provided by the provider. This field must match the provider + IDs as seen on the node objects corresponding to a machine pool's + machine instances. + items: + type: string + type: array + refreshPreferences: + description: RefreshPreferences describes set of preferences associated + with the instance refresh request. + properties: + instanceWarmup: + description: The number of seconds until a newly launched instance + is configured and ready to use. During this time, the next replacement + will not be initiated. The default is to use the value for the + health check grace period defined for the group. + format: int64 + type: integer + minHealthyPercentage: + description: The amount of capacity as a percentage in ASG that + must remain healthy during an instance refresh. The default + is 90. + format: int64 + type: integer + strategy: + description: The strategy to use for the instance refresh. The + only valid value is Rolling. A rolling update is an update that + is applied to all instances in an Auto Scaling group until all + instances have been updated. + type: string + type: object + subnets: + description: Subnets is an array of subnet configurations + items: + description: AWSResourceReference is a reference to a specific AWS + resource by ID, ARN, or filters. Only one of ID, ARN or Filters + may be specified. Specifying more than one will result in a validation + error. + properties: + arn: + description: ARN of resource + type: string + filters: + description: 'Filters is a set of key/value pairs used to identify + a resource They are applied according to the rules defined + by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + items: + description: Filter is a filter used to identify an AWS resource + properties: + name: + description: Name of the filter. Filter names are case-sensitive. + type: string + values: + description: Values includes one or more filter values. + Filter values are case-sensitive. + items: + type: string + type: array + required: + - name + - values + type: object + type: array + id: + description: ID of resource + type: string + type: object + type: array + required: + - awsLaunchTemplate + - maxSize + - minSize + type: object + status: + description: AWSMachinePoolStatus defines the observed state of AWSMachinePool + properties: + asgStatus: + description: ASGStatus is a status string returned by the autoscaling + API + type: string + conditions: + description: Conditions defines current service state of the AWSMachinePool. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: 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. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: 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. + type: string + severity: + description: 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. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: 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. + type: string + required: + - status + - type + type: object + type: array + failureMessage: + description: "FailureMessage 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. \n 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. \n 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." + type: string + failureReason: + description: "FailureReason 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. \n 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. \n 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." + type: string + instances: + description: Instances contains the status for each instance in the + pool + items: + properties: + instanceID: + description: InstanceID is the identification of the Machine + Instance within ASG + type: string + version: + description: Version defines the Kubernetes version for the + Machine Instance + type: string + type: object + type: array + launchTemplateID: + description: The ID of the launch template + type: string + ready: + description: Ready is true when the provider resource is ready. + type: boolean + replicas: + description: Replicas is the most recently observed number of replicas + format: int32 + type: integer + type: object + type: object + served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Machine ready status + jsonPath: .status.ready + name: Ready + type: string + - description: Machine ready status + jsonPath: .status.replicas + name: Replicas + type: integer + - description: Minimum instanes in ASG + jsonPath: .spec.minSize + name: MinSize + type: integer + - description: Maximum instanes in ASG + jsonPath: .spec.maxSize + name: MaxSize + type: integer + - description: Launch Template ID + jsonPath: .status.launchTemplateID + name: LaunchTemplate ID + type: string + name: v1alpha4 + schema: + openAPIV3Schema: + description: AWSMachinePool is the Schema for the awsmachinepools API + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: AWSMachinePoolSpec defines the desired state of AWSMachinePool + properties: + additionalTags: + additionalProperties: + type: string + description: AdditionalTags is an optional set of tags to add to an + instance, in addition to the ones added by default by the AWS provider. + type: object + availabilityZones: + description: AvailabilityZones is an array of availability zones instances + can run in + items: + type: string + type: array + awsLaunchTemplate: + description: AWSLaunchTemplate specifies the launch template and version + to use when an instance is launched. + properties: + additionalSecurityGroups: + description: AdditionalSecurityGroups is an array of references + to security groups that should be applied to the instances. + These security groups would be set in addition to any security + groups defined at the cluster level or in the actuator. + items: + description: AWSResourceReference is a reference to a specific + AWS resource by ID, ARN, or filters. Only one of ID, ARN or + Filters may be specified. Specifying more than one will result + in a validation error. + properties: + arn: + description: ARN of resource + type: string + filters: + description: 'Filters is a set of key/value pairs used to + identify a resource They are applied according to the + rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + items: + description: Filter is a filter used to identify an AWS + resource + properties: + name: + description: Name of the filter. Filter names are + case-sensitive. + type: string + values: + description: Values includes one or more filter values. + Filter values are case-sensitive. + items: + type: string + type: array + required: + - name + - values + type: object + type: array + id: + description: ID of resource + type: string + type: object + type: array + ami: + description: AMI is the reference to the AMI from which to create + the machine instance. + properties: + arn: + description: ARN of resource + type: string + filters: + description: 'Filters is a set of key/value pairs used to + identify a resource They are applied according to the rules + defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + items: + description: Filter is a filter used to identify an AWS + resource + properties: + name: + description: Name of the filter. Filter names are case-sensitive. + type: string + values: + description: Values includes one or more filter values. + Filter values are case-sensitive. + items: + type: string + type: array + required: + - name + - values + type: object + type: array + id: + description: ID of resource + type: string + type: object + iamInstanceProfile: + description: The name or the Amazon Resource Name (ARN) of the + instance profile associated with the IAM role for the instance. + The instance profile contains the IAM role. type: string imageLookupBaseOS: - description: ImageLookupBaseOS is the name of the base operating system to use for image lookup the AMI is not set. + description: ImageLookupBaseOS is the name of the base operating + system to use for image lookup the AMI is not set. type: string imageLookupFormat: - description: 'ImageLookupFormat is the AMI naming format to look up the image for this machine It will be ignored if an explicit AMI is set. Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base OS and kubernetes version, respectively. The BaseOS will be the value in ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as defined by the packages produced by kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See also: https://golang.org/pkg/text/template/' + description: 'ImageLookupFormat is the AMI naming format to look + up the image for this machine It will be ignored if an explicit + AMI is set. Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} + with the base OS and kubernetes version, respectively. The BaseOS + will be the value in ImageLookupBaseOS or ubuntu (the default), + and the kubernetes version as defined by the packages produced + by kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, + or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the ubuntu + base OS. See also: https://golang.org/pkg/text/template/' type: string imageLookupOrg: - description: ImageLookupOrg is the AWS Organization ID to use for image lookup if AMI is not set. + description: ImageLookupOrg is the AWS Organization ID to use + for image lookup if AMI is not set. type: string instanceType: - description: 'InstanceType is the type of instance to create. Example: m4.xlarge' + description: 'InstanceType is the type of instance to create. + Example: m4.xlarge' type: string name: description: The name of the launch template. type: string rootVolume: - description: RootVolume encapsulates the configuration options for the root volume + description: RootVolume encapsulates the configuration options + for the root volume properties: deviceName: description: Device name type: string encrypted: - description: Encrypted is whether the volume should be encrypted or not. + description: Encrypted is whether the volume should be encrypted + or not. type: boolean encryptionKey: - description: EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN. If Encrypted is set and this is omitted, the default AWS key will be used. The key must already exist and be accessible by the controller. + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be + used. The key must already exist and be accessible by the + controller. type: string iops: - description: IOPS is the number of IOPS requested for the disk. Not applicable to all types. + description: IOPS is the number of IOPS requested for the + disk. Not applicable to all types. format: int64 type: integer size: - description: Size specifies size (in Gi) of the storage device. Must be greater than the image snapshot size or 8 (whichever is greater). + description: Size specifies size (in Gi) of the storage device. + Must be greater than the image snapshot size or 8 (whichever + is greater). format: int64 minimum: 8 type: integer type: - description: Type is the type of the volume (e.g. gp2, io1, etc...). + description: Type is the type of the volume (e.g. gp2, io1, + etc...). type: string required: - size type: object sshKeyName: - description: SSHKeyName is the name of the ssh key to attach to the instance. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name) + description: SSHKeyName is the name of the ssh key to attach to + the instance. Valid values are empty string (do not use SSH + keys), a valid SSH key name, or omitted (use the default SSH + key name) type: string versionNumber: - description: 'VersionNumber is the version of the launch template that is applied. Typically a new version is created when at least one of the following happens: 1) A new launch template spec is applied. 2) One or more parameters in an existing template is changed. 3) A new AMI is discovered.' + description: 'VersionNumber is the version of the launch template + that is applied. Typically a new version is created when at + least one of the following happens: 1) A new launch template + spec is applied. 2) One or more parameters in an existing template + is changed. 3) A new AMI is discovered.' format: int64 type: integer type: object + capacityRebalance: + description: Enable or disable the capacity rebalance autoscaling + group feature + type: boolean defaultCoolDown: - description: The amount of time, in seconds, after a scaling activity completes before another scaling activity can start. If no value is supplied by user a default value of 300 seconds is set + description: The amount of time, in seconds, after a scaling activity + completes before another scaling activity can start. If no value + is supplied by user a default value of 300 seconds is set type: string maxSize: default: 1 @@ -199,14 +729,17 @@ spec: minimum: 1 type: integer mixedInstancesPolicy: - description: MixedInstancesPolicy describes how multiple instance types will be used by the ASG. + description: MixedInstancesPolicy describes how multiple instance + types will be used by the ASG. properties: instancesDistribution: - description: InstancesDistribution to configure distribution of On-Demand Instances and Spot Instances. + description: InstancesDistribution to configure distribution of + On-Demand Instances and Spot Instances. properties: onDemandAllocationStrategy: default: prioritized - description: OnDemandAllocationStrategy indicates how to allocate instance types to fulfill On-Demand capacity. + description: OnDemandAllocationStrategy indicates how to allocate + instance types to fulfill On-Demand capacity. enum: - prioritized type: string @@ -220,7 +753,8 @@ spec: type: integer spotAllocationStrategy: default: lowest-price - description: SpotAllocationStrategy indicates how to allocate instances across Spot Instance pools. + description: SpotAllocationStrategy indicates how to allocate + instances across Spot Instance pools. enum: - lowest-price - capacity-optimized @@ -228,7 +762,9 @@ spec: type: object overrides: items: - description: Overrides are used to override the instance type specified by the launch template with multiple instance types that can be used to launch On-Demand Instances and Spot Instances. + description: Overrides are used to override the instance type + specified by the launch template with multiple instance types + that can be used to launch On-Demand Instances and Spot Instances. properties: instanceType: type: string @@ -241,20 +777,52 @@ spec: description: ProviderID is the ARN of the associated ASG type: string providerIDList: - description: ProviderIDList are the identification IDs of machine instances provided by the provider. This field must match the provider IDs as seen on the node objects corresponding to a machine pool's machine instances. + description: ProviderIDList are the identification IDs of machine + instances provided by the provider. This field must match the provider + IDs as seen on the node objects corresponding to a machine pool's + machine instances. items: type: string type: array + refreshPreferences: + description: RefreshPreferences describes set of preferences associated + with the instance refresh request. + properties: + instanceWarmup: + description: The number of seconds until a newly launched instance + is configured and ready to use. During this time, the next replacement + will not be initiated. The default is to use the value for the + health check grace period defined for the group. + format: int64 + type: integer + minHealthyPercentage: + description: The amount of capacity as a percentage in ASG that + must remain healthy during an instance refresh. The default + is 90. + format: int64 + type: integer + strategy: + description: The strategy to use for the instance refresh. The + only valid value is Rolling. A rolling update is an update that + is applied to all instances in an Auto Scaling group until all + instances have been updated. + type: string + type: object subnets: description: Subnets is an array of subnet configurations items: - description: AWSResourceReference is a reference to a specific AWS resource by ID, ARN, or filters. Only one of ID, ARN or Filters may be specified. Specifying more than one will result in a validation error. + description: AWSResourceReference is a reference to a specific AWS + resource by ID, ARN, or filters. Only one of ID, ARN or Filters + may be specified. Specifying more than one will result in a validation + error. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used to identify + a resource They are applied according to the rules defined + by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: description: Filter is a filter used to identify an AWS resource properties: @@ -262,7 +830,8 @@ spec: description: Name of the filter. Filter names are case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter values. + Filter values are case-sensitive. items: type: string type: array @@ -285,31 +854,47 @@ spec: description: AWSMachinePoolStatus defines the observed state of AWSMachinePool properties: asgStatus: - description: ASGStatus is a status string returned by the autoscaling API + description: ASGStatus is a status string returned by the autoscaling + API type: string conditions: description: Conditions defines current service state of the AWSMachinePool. items: - description: Condition defines an observation of a Cluster API resource operational state. + description: Condition defines an observation of a Cluster API resource + operational state. properties: lastTransitionTime: - description: 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. + description: 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. format: date-time type: string message: - description: A human readable message indicating details about the transition. This field may be empty. + description: A human readable message indicating details about + the transition. This field may be empty. type: string reason: - description: 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. + description: 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. type: string severity: - description: 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. + description: 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. type: string status: description: Status of the condition, one of True, False, Unknown. type: string type: - description: 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. + description: 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. type: string required: - status @@ -317,11 +902,50 @@ spec: type: object type: array failureMessage: - description: "FailureMessage 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. \n 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. \n 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." + description: "FailureMessage 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. \n 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. \n 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." type: string failureReason: - description: "FailureReason 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. \n 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. \n 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." + description: "FailureReason 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. \n 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. \n 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." type: string + instances: + description: Instances contains the status for each instance in the + pool + items: + properties: + instanceID: + description: InstanceID is the identification of the Machine + Instance within ASG + type: string + version: + description: Version defines the Kubernetes version for the + Machine Instance + type: string + type: object + type: array launchTemplateID: description: The ID of the launch template type: string diff --git a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmachines.yaml b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmachines.yaml index e6ec221978a..53612ca689f 100644 --- a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmachines.yaml +++ b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmachines.yaml @@ -1,10 +1,12 @@ + +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: labels: - cluster.x-k8s.io/v1alpha4: v1alpha3 + cluster.x-k8s.io/v1alpha4: v1alpha4 annotations: - controller-gen.kubebuilder.io/version: v0.2.9 + controller-gen.kubebuilder.io/version: v0.5.0 creationTimestamp: null name: awsmachines.infrastructure.cluster.x-k8s.io spec: @@ -18,16 +20,41 @@ spec: singular: awsmachine scope: Namespaced versions: - - name: v1alpha2 + - additionalPrinterColumns: + - description: Cluster to which this AWSMachine belongs + jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name + name: Cluster + type: string + - description: EC2 instance state + jsonPath: .status.instanceState + name: State + type: string + - description: Machine ready status + jsonPath: .status.ready + name: Ready + type: string + - description: EC2 instance ID + jsonPath: .spec.providerID + name: InstanceID + type: string + - description: Machine object which owns with this AWSMachine + jsonPath: .metadata.ownerReferences[?(@.kind=="Machine")].name + name: Machine + type: string + name: v1alpha3 schema: openAPIV3Schema: description: AWSMachine is the Schema for the awsmachines API properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object @@ -35,15 +62,26 @@ spec: description: AWSMachineSpec defines the desired state of AWSMachine properties: additionalSecurityGroups: - description: AdditionalSecurityGroups is an array of references to security groups that should be applied to the instance. These security groups would be set in addition to any security groups defined at the cluster level or in the actuator. + description: AdditionalSecurityGroups is an array of references to + security groups that should be applied to the instance. These security + groups would be set in addition to any security groups defined at + the cluster level or in the actuator. It is possible to specify + either IDs of Filters. Using Filters will cause additional requests + to AWS API and if tags change the attached security groups might + change too. items: - description: AWSResourceReference is a reference to a specific AWS resource by ID, ARN, or filters. Only one of ID, ARN or Filters may be specified. Specifying more than one will result in a validation error. + description: AWSResourceReference is a reference to a specific AWS + resource by ID, ARN, or filters. Only one of ID, ARN or Filters + may be specified. Specifying more than one will result in a validation + error. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used to identify + a resource They are applied according to the rules defined + by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: description: Filter is a filter used to identify an AWS resource properties: @@ -51,7 +89,8 @@ spec: description: Name of the filter. Filter names are case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter values. + Filter values are case-sensitive. items: type: string type: array @@ -68,16 +107,22 @@ spec: additionalTags: additionalProperties: type: string - description: AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the AWS provider. If both the AWSCluster and the AWSMachine specify the same tag name with different values, the AWSMachine's value takes precedence. + description: AdditionalTags is an optional set of tags to add to an + instance, in addition to the ones added by default by the AWS provider. + If both the AWSCluster and the AWSMachine specify the same tag name + with different values, the AWSMachine's value takes precedence. type: object ami: - description: AMI is the reference to the AMI from which to create the machine instance. + description: AMI is the reference to the AMI from which to create + the machine instance. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used to identify + a resource They are applied according to the rules defined by + the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: description: Filter is a filter used to identify an AWS resource properties: @@ -85,7 +130,8 @@ spec: description: Name of the filter. Filter names are case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter values. + Filter values are case-sensitive. items: type: string type: array @@ -98,59 +144,191 @@ spec: description: ID of resource type: string type: object - availabilityZone: - description: AvailabilityZone is references the AWS availability zone to use for this instance. If multiple subnets are matched for the availability zone, the first one return is picked. - type: string cloudInit: - description: CloudInit defines options related to the bootstrapping systems where CloudInit is used. + description: CloudInit defines options related to the bootstrapping + systems where CloudInit is used. properties: - enableSecureSecretsManager: - description: enableSecureSecretsManager, when set to true will use AWS Secrets Manager to ensure userdata privacy. A cloud-init boothook shell script is prepended to download the userdata from Secrets Manager and additionally delete the secret. + insecureSkipSecretsManager: + description: InsecureSkipSecretsManager, when set to true will + not use AWS Secrets Manager or AWS Systems Manager Parameter + Store to ensure privacy of userdata. By default, a cloud-init + boothook shell script is prepended to download the userdata + from Secrets Manager and additionally delete the secret. type: boolean secretCount: - description: SecretCount is the number of secrets used to form the complete secret + description: SecretCount is the number of secrets used to form + the complete secret format: int32 type: integer secretPrefix: - description: SecretPrefix is the prefix for the secret name. This is stored temporarily, and deleted when the machine registers as a node against the workload cluster. + description: SecretPrefix is the prefix for the secret name. This + is stored temporarily, and deleted when the machine registers + as a node against the workload cluster. + type: string + secureSecretsBackend: + description: SecureSecretsBackend, when set to parameter-store + will utilize the AWS Systems Manager Parameter Storage to distribute + secrets. By default or with the value of secrets-manager, will + use AWS Secrets Manager instead. + enum: + - secrets-manager + - ssm-parameter-store type: string type: object + failureDomain: + description: FailureDomain is the failure domain unique identifier + this Machine should be attached to, as defined in Cluster API. For + this infrastructure provider, the ID is equivalent to an AWS Availability + Zone. If multiple subnets are matched for the availability zone, + the first one returned is picked. + type: string iamInstanceProfile: - description: IAMInstanceProfile is a name of an IAM instance profile to assign to the instance + description: IAMInstanceProfile is a name of an IAM instance profile + to assign to the instance + type: string + imageLookupBaseOS: + description: ImageLookupBaseOS is the name of the base operating system + to use for image lookup the AMI is not set. + type: string + imageLookupFormat: + description: 'ImageLookupFormat is the AMI naming format to look up + the image for this machine It will be ignored if an explicit AMI + is set. Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} + with the base OS and kubernetes version, respectively. The BaseOS + will be the value in ImageLookupBaseOS or ubuntu (the default), + and the kubernetes version as defined by the packages produced by + kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, + or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the ubuntu + base OS. See also: https://golang.org/pkg/text/template/' type: string imageLookupOrg: - description: ImageLookupOrg is the AWS Organization ID to use for image lookup if AMI is not set. + description: ImageLookupOrg is the AWS Organization ID to use for + image lookup if AMI is not set. + type: string + instanceID: + description: InstanceID is the EC2 instance ID for this machine. type: string instanceType: - description: 'InstanceType is the type of instance to create. Example: m4.xlarge' + description: 'InstanceType is the type of instance to create. Example: + m4.xlarge' type: string networkInterfaces: - description: NetworkInterfaces is a list of ENIs to associate with the instance. A maximum of 2 may be specified. + description: NetworkInterfaces is a list of ENIs to associate with + the instance. A maximum of 2 may be specified. items: type: string maxItems: 2 type: array + nonRootVolumes: + description: Configuration options for the non root storage volumes. + items: + description: Volume encapsulates the configuration options for the + storage device + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be encrypted + or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be used. + The key must already exist and be accessible by the controller. + type: string + iops: + description: IOPS is the number of IOPS requested for the disk. + Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage device. + Must be greater than the image snapshot size or 8 (whichever + is greater). + format: int64 + minimum: 8 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, io1, + etc...). + type: string + required: + - size + type: object + type: array providerID: - description: ProviderID is the unique identifier as specified by the cloud provider. + description: ProviderID is the unique identifier as specified by the + cloud provider. type: string publicIP: - description: 'PublicIP specifies whether the instance should get a public IP. Precedence for this setting is as follows: 1. This field if set 2. Cluster/flavor setting 3. Subnet default' + description: 'PublicIP specifies whether the instance should get a + public IP. Precedence for this setting is as follows: 1. This field + if set 2. Cluster/flavor setting 3. Subnet default' type: boolean - rootDeviceSize: - description: RootDeviceSize is the size of the root volume in gigabytes(GB). - format: int64 - type: integer + rootVolume: + description: RootVolume encapsulates the configuration options for + the root volume + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be encrypted + or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt the + volume. Can be either a KMS key ID or ARN. If Encrypted is set + and this is omitted, the default AWS key will be used. The key + must already exist and be accessible by the controller. + type: string + iops: + description: IOPS is the number of IOPS requested for the disk. + Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage device. + Must be greater than the image snapshot size or 8 (whichever + is greater). + format: int64 + minimum: 8 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, io1, etc...). + type: string + required: + - size + type: object + spotMarketOptions: + description: SpotMarketOptions allows users to configure instances + to be run using AWS Spot instances. + properties: + maxPrice: + description: MaxPrice defines the maximum price the user is willing + to pay for Spot VM instances + type: string + type: object sshKeyName: - description: SSHKeyName is the name of the ssh key to attach to the instance. + description: SSHKeyName is the name of the ssh key to attach to the + instance. Valid values are empty string (do not use SSH keys), a + valid SSH key name, or omitted (use the default SSH key name) type: string subnet: - description: Subnet is a reference to the subnet to use for this instance. If not specified, the cluster subnet will be used. + description: Subnet is a reference to the subnet to use for this instance. + If not specified, the cluster subnet will be used. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used to identify + a resource They are applied according to the rules defined by + the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: description: Filter is a filter used to identify an AWS resource properties: @@ -158,7 +336,8 @@ spec: description: Name of the filter. Filter names are case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter values. + Filter values are case-sensitive. items: type: string type: array @@ -171,6 +350,20 @@ spec: description: ID of resource type: string type: object + tenancy: + description: Tenancy indicates if instance should run on shared or + single-tenant hardware. + enum: + - default + - dedicated + - host + type: string + uncompressedUserData: + description: UncompressedUserData specify whether the user data is + gzip-compressed before it is sent to ec2 instance. cloud-init has + built-in support for gzip-compressed user data user data stored + in aws secret manager is always gzip-compressed. + type: boolean type: object status: description: AWSMachineStatus defines the observed state of AWSMachine @@ -178,28 +371,106 @@ spec: addresses: description: Addresses contains the AWS instance associated addresses. items: - description: MachineAddress contains information for the node's address. + description: MachineAddress contains information for the node's + address. properties: address: description: The machine address. type: string type: - description: Machine address type, one of Hostname, ExternalIP or InternalIP. + description: Machine address type, one of Hostname, ExternalIP + or InternalIP. type: string required: - address - type type: object type: array - errorMessage: - description: "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. \n 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. \n 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." + conditions: + description: Conditions defines current service state of the AWSMachine. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: 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. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: 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. + type: string + severity: + description: 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. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: 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. + type: string + required: + - status + - type + type: object + type: array + failureMessage: + description: "FailureMessage 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. \n 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. \n 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." type: string - errorReason: - description: "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. \n 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. \n 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." + failureReason: + description: "FailureReason 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. \n 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. \n 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." type: string instanceState: - description: InstanceState is the state of the AWS instance for this machine. + description: InstanceState is the state of the AWS instance for this + machine. type: string + interruptible: + description: Interruptible reports that this machine is using spot + instances and can therefore be interrupted by CAPI when it receives + a notice that the spot instance is to be terminated by AWS. This + will be set to true when SpotMarketOptions is not nil (i.e. this + machine is using a spot instance). + type: boolean ready: description: Ready is true when the provider resource is ready. type: boolean @@ -230,16 +501,20 @@ spec: jsonPath: .metadata.ownerReferences[?(@.kind=="Machine")].name name: Machine type: string - name: v1alpha3 + name: v1alpha4 schema: openAPIV3Schema: description: AWSMachine is the Schema for the awsmachines API properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object @@ -247,15 +522,26 @@ spec: description: AWSMachineSpec defines the desired state of AWSMachine properties: additionalSecurityGroups: - description: AdditionalSecurityGroups is an array of references to security groups that should be applied to the instance. These security groups would be set in addition to any security groups defined at the cluster level or in the actuator. + description: AdditionalSecurityGroups is an array of references to + security groups that should be applied to the instance. These security + groups would be set in addition to any security groups defined at + the cluster level or in the actuator. It is possible to specify + either IDs of Filters. Using Filters will cause additional requests + to AWS API and if tags change the attached security groups might + change too. items: - description: AWSResourceReference is a reference to a specific AWS resource by ID, ARN, or filters. Only one of ID, ARN or Filters may be specified. Specifying more than one will result in a validation error. + description: AWSResourceReference is a reference to a specific AWS + resource by ID, ARN, or filters. Only one of ID, ARN or Filters + may be specified. Specifying more than one will result in a validation + error. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used to identify + a resource They are applied according to the rules defined + by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: description: Filter is a filter used to identify an AWS resource properties: @@ -263,7 +549,8 @@ spec: description: Name of the filter. Filter names are case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter values. + Filter values are case-sensitive. items: type: string type: array @@ -280,16 +567,22 @@ spec: additionalTags: additionalProperties: type: string - description: AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the AWS provider. If both the AWSCluster and the AWSMachine specify the same tag name with different values, the AWSMachine's value takes precedence. + description: AdditionalTags is an optional set of tags to add to an + instance, in addition to the ones added by default by the AWS provider. + If both the AWSCluster and the AWSMachine specify the same tag name + with different values, the AWSMachine's value takes precedence. type: object ami: - description: AMI is the reference to the AMI from which to create the machine instance. + description: AMI is the reference to the AMI from which to create + the machine instance. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used to identify + a resource They are applied according to the rules defined by + the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: description: Filter is a filter used to identify an AWS resource properties: @@ -297,7 +590,8 @@ spec: description: Name of the filter. Filter names are case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter values. + Filter values are case-sensitive. items: type: string type: array @@ -311,46 +605,78 @@ spec: type: string type: object cloudInit: - description: CloudInit defines options related to the bootstrapping systems where CloudInit is used. + description: CloudInit defines options related to the bootstrapping + systems where CloudInit is used. properties: insecureSkipSecretsManager: - description: InsecureSkipSecretsManager, when set to true will not use AWS Secrets Manager or AWS Systems Manager Parameter Store to ensure privacy of userdata. By default, a cloud-init boothook shell script is prepended to download the userdata from Secrets Manager and additionally delete the secret. + description: InsecureSkipSecretsManager, when set to true will + not use AWS Secrets Manager or AWS Systems Manager Parameter + Store to ensure privacy of userdata. By default, a cloud-init + boothook shell script is prepended to download the userdata + from Secrets Manager and additionally delete the secret. type: boolean secretCount: - description: SecretCount is the number of secrets used to form the complete secret + description: SecretCount is the number of secrets used to form + the complete secret format: int32 type: integer secretPrefix: - description: SecretPrefix is the prefix for the secret name. This is stored temporarily, and deleted when the machine registers as a node against the workload cluster. + description: SecretPrefix is the prefix for the secret name. This + is stored temporarily, and deleted when the machine registers + as a node against the workload cluster. type: string secureSecretsBackend: - default: secrets-manager - description: SecureSecretsBackend, when set to parameter-store will utilize the AWS Systems Manager Parameter Storage to distribute secrets. By default or with the value of secrets-manager, will use AWS Secrets Manager instead. + description: SecureSecretsBackend, when set to parameter-store + will utilize the AWS Systems Manager Parameter Storage to distribute + secrets. By default or with the value of secrets-manager, will + use AWS Secrets Manager instead. enum: - secrets-manager - ssm-parameter-store type: string type: object failureDomain: - description: FailureDomain is the failure domain unique identifier this Machine should be attached to, as defined in Cluster API. For this infrastructure provider, the ID is equivalent to an AWS Availability Zone. If multiple subnets are matched for the availability zone, the first one returned is picked. + description: FailureDomain is the failure domain unique identifier + this Machine should be attached to, as defined in Cluster API. For + this infrastructure provider, the ID is equivalent to an AWS Availability + Zone. If multiple subnets are matched for the availability zone, + the first one returned is picked. type: string iamInstanceProfile: - description: IAMInstanceProfile is a name of an IAM instance profile to assign to the instance + description: IAMInstanceProfile is a name of an IAM instance profile + to assign to the instance type: string imageLookupBaseOS: - description: ImageLookupBaseOS is the name of the base operating system to use for image lookup the AMI is not set. + description: ImageLookupBaseOS is the name of the base operating system + to use for image lookup the AMI is not set. type: string imageLookupFormat: - description: 'ImageLookupFormat is the AMI naming format to look up the image for this machine It will be ignored if an explicit AMI is set. Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base OS and kubernetes version, respectively. The BaseOS will be the value in ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as defined by the packages produced by kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See also: https://golang.org/pkg/text/template/' + description: 'ImageLookupFormat is the AMI naming format to look up + the image for this machine It will be ignored if an explicit AMI + is set. Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} + with the base OS and kubernetes version, respectively. The BaseOS + will be the value in ImageLookupBaseOS or ubuntu (the default), + and the kubernetes version as defined by the packages produced by + kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, + or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the ubuntu + base OS. See also: https://golang.org/pkg/text/template/' type: string imageLookupOrg: - description: ImageLookupOrg is the AWS Organization ID to use for image lookup if AMI is not set. + description: ImageLookupOrg is the AWS Organization ID to use for + image lookup if AMI is not set. + type: string + instanceID: + description: InstanceID is the EC2 instance ID for this machine. type: string instanceType: - description: 'InstanceType is the type of instance to create. Example: m4.xlarge' + description: 'InstanceType is the type of instance to create. Example: + m4.xlarge' type: string networkInterfaces: - description: NetworkInterfaces is a list of ENIs to associate with the instance. A maximum of 2 may be specified. + description: NetworkInterfaces is a list of ENIs to associate with + the instance. A maximum of 2 may be specified. items: type: string maxItems: 2 @@ -358,57 +684,77 @@ spec: nonRootVolumes: description: Configuration options for the non root storage volumes. items: - description: Volume encapsulates the configuration options for the storage device + description: Volume encapsulates the configuration options for the + storage device properties: deviceName: description: Device name type: string encrypted: - description: Encrypted is whether the volume should be encrypted or not. + description: Encrypted is whether the volume should be encrypted + or not. type: boolean encryptionKey: - description: EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN. If Encrypted is set and this is omitted, the default AWS key will be used. The key must already exist and be accessible by the controller. + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be used. + The key must already exist and be accessible by the controller. type: string iops: - description: IOPS is the number of IOPS requested for the disk. Not applicable to all types. + description: IOPS is the number of IOPS requested for the disk. + Not applicable to all types. format: int64 type: integer size: - description: Size specifies size (in Gi) of the storage device. Must be greater than the image snapshot size or 8 (whichever is greater). + description: Size specifies size (in Gi) of the storage device. + Must be greater than the image snapshot size or 8 (whichever + is greater). format: int64 minimum: 8 type: integer type: - description: Type is the type of the volume (e.g. gp2, io1, etc...). + description: Type is the type of the volume (e.g. gp2, io1, + etc...). type: string required: - size type: object type: array providerID: - description: ProviderID is the unique identifier as specified by the cloud provider. + description: ProviderID is the unique identifier as specified by the + cloud provider. type: string publicIP: - description: 'PublicIP specifies whether the instance should get a public IP. Precedence for this setting is as follows: 1. This field if set 2. Cluster/flavor setting 3. Subnet default' + description: 'PublicIP specifies whether the instance should get a + public IP. Precedence for this setting is as follows: 1. This field + if set 2. Cluster/flavor setting 3. Subnet default' type: boolean rootVolume: - description: RootVolume encapsulates the configuration options for the root volume + description: RootVolume encapsulates the configuration options for + the root volume properties: deviceName: description: Device name type: string encrypted: - description: Encrypted is whether the volume should be encrypted or not. + description: Encrypted is whether the volume should be encrypted + or not. type: boolean encryptionKey: - description: EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN. If Encrypted is set and this is omitted, the default AWS key will be used. The key must already exist and be accessible by the controller. + description: EncryptionKey is the KMS key to use to encrypt the + volume. Can be either a KMS key ID or ARN. If Encrypted is set + and this is omitted, the default AWS key will be used. The key + must already exist and be accessible by the controller. type: string iops: - description: IOPS is the number of IOPS requested for the disk. Not applicable to all types. + description: IOPS is the number of IOPS requested for the disk. + Not applicable to all types. format: int64 type: integer size: - description: Size specifies size (in Gi) of the storage device. Must be greater than the image snapshot size or 8 (whichever is greater). + description: Size specifies size (in Gi) of the storage device. + Must be greater than the image snapshot size or 8 (whichever + is greater). format: int64 minimum: 8 type: integer @@ -419,23 +765,30 @@ spec: - size type: object spotMarketOptions: - description: SpotMarketOptions allows users to configure instances to be run using AWS Spot instances. + description: SpotMarketOptions allows users to configure instances + to be run using AWS Spot instances. properties: maxPrice: - description: MaxPrice defines the maximum price the user is willing to pay for Spot VM instances + description: MaxPrice defines the maximum price the user is willing + to pay for Spot VM instances type: string type: object sshKeyName: - description: SSHKeyName is the name of the ssh key to attach to the instance. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name) + description: SSHKeyName is the name of the ssh key to attach to the + instance. Valid values are empty string (do not use SSH keys), a + valid SSH key name, or omitted (use the default SSH key name) type: string subnet: - description: Subnet is a reference to the subnet to use for this instance. If not specified, the cluster subnet will be used. + description: Subnet is a reference to the subnet to use for this instance. + If not specified, the cluster subnet will be used. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used to identify + a resource They are applied according to the rules defined by + the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: description: Filter is a filter used to identify an AWS resource properties: @@ -443,7 +796,8 @@ spec: description: Name of the filter. Filter names are case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter values. + Filter values are case-sensitive. items: type: string type: array @@ -457,14 +811,18 @@ spec: type: string type: object tenancy: - description: Tenancy indicates if instance should run on shared or single-tenant hardware. + description: Tenancy indicates if instance should run on shared or + single-tenant hardware. enum: - default - dedicated - host type: string uncompressedUserData: - description: UncompressedUserData specify whether the user data is gzip-compressed before it is sent to ec2 instance. cloud-init has built-in support for gzip-compressed user data user data stored in aws secret manager is always gzip-compressed. + description: UncompressedUserData specify whether the user data is + gzip-compressed before it is sent to ec2 instance. cloud-init has + built-in support for gzip-compressed user data user data stored + in aws secret manager is always gzip-compressed. type: boolean type: object status: @@ -473,13 +831,15 @@ spec: addresses: description: Addresses contains the AWS instance associated addresses. items: - description: MachineAddress contains information for the node's address. + description: MachineAddress contains information for the node's + address. properties: address: description: The machine address. type: string type: - description: Machine address type, one of Hostname, ExternalIP or InternalIP. + description: Machine address type, one of Hostname, ExternalIP + or InternalIP. type: string required: - address @@ -489,26 +849,41 @@ spec: conditions: description: Conditions defines current service state of the AWSMachine. items: - description: Condition defines an observation of a Cluster API resource operational state. + description: Condition defines an observation of a Cluster API resource + operational state. properties: lastTransitionTime: - description: 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. + description: 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. format: date-time type: string message: - description: A human readable message indicating details about the transition. This field may be empty. + description: A human readable message indicating details about + the transition. This field may be empty. type: string reason: - description: 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. + description: 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. type: string severity: - description: 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. + description: 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. type: string status: description: Status of the condition, one of True, False, Unknown. type: string type: - description: 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. + description: 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. type: string required: - status @@ -516,16 +891,45 @@ spec: type: object type: array failureMessage: - description: "FailureMessage 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. \n 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. \n 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." + description: "FailureMessage 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. \n 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. \n 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." type: string failureReason: - description: "FailureReason 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. \n 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. \n 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." + description: "FailureReason 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. \n 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. \n 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." type: string instanceState: - description: InstanceState is the state of the AWS instance for this machine. + description: InstanceState is the state of the AWS instance for this + machine. type: string interruptible: - description: Interruptible reports that this machine is using spot instances and can therefore be interrupted by CAPI when it receives a notice that the spot instance is to be terminated by AWS. This will be set to true when SpotMarketOptions is not nil (i.e. this machine is using a spot instance). + description: Interruptible reports that this machine is using spot + instances and can therefore be interrupted by CAPI when it receives + a notice that the spot instance is to be terminated by AWS. This + will be set to true when SpotMarketOptions is not nil (i.e. this + machine is using a spot instance). type: boolean ready: description: Ready is true when the provider resource is ready. diff --git a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml index 03edb1f1428..3b363a4e0de 100644 --- a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml +++ b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml @@ -1,10 +1,12 @@ + +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: labels: - cluster.x-k8s.io/v1alpha4: v1alpha3 + cluster.x-k8s.io/v1alpha4: v1alpha4 annotations: - controller-gen.kubebuilder.io/version: v0.2.9 + controller-gen.kubebuilder.io/version: v0.5.0 creationTimestamp: null name: awsmachinetemplates.infrastructure.cluster.x-k8s.io spec: @@ -18,16 +20,21 @@ spec: singular: awsmachinetemplate scope: Namespaced versions: - - name: v1alpha2 + - name: v1alpha3 schema: openAPIV3Schema: - description: AWSMachineTemplate is the Schema for the awsmachinetemplates API + description: AWSMachineTemplate is the Schema for the awsmachinetemplates + API properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object @@ -35,29 +42,45 @@ spec: description: AWSMachineTemplateSpec defines the desired state of AWSMachineTemplate properties: template: - description: AWSMachineTemplateResource describes the data needed to create am AWSMachine from a template + description: AWSMachineTemplateResource describes the data needed + to create am AWSMachine from a template properties: spec: - description: Spec is the specification of the desired behavior of the machine. + description: Spec is the specification of the desired behavior + of the machine. properties: additionalSecurityGroups: - description: AdditionalSecurityGroups is an array of references to security groups that should be applied to the instance. These security groups would be set in addition to any security groups defined at the cluster level or in the actuator. + description: AdditionalSecurityGroups is an array of references + to security groups that should be applied to the instance. + These security groups would be set in addition to any security + groups defined at the cluster level or in the actuator. + It is possible to specify either IDs of Filters. Using Filters + will cause additional requests to AWS API and if tags change + the attached security groups might change too. items: - description: AWSResourceReference is a reference to a specific AWS resource by ID, ARN, or filters. Only one of ID, ARN or Filters may be specified. Specifying more than one will result in a validation error. + description: AWSResourceReference is a reference to a specific + AWS resource by ID, ARN, or filters. Only one of ID, ARN + or Filters may be specified. Specifying more than one + will result in a validation error. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used + to identify a resource They are applied according + to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: - description: Filter is a filter used to identify an AWS resource + description: Filter is a filter used to identify an + AWS resource properties: name: - description: Name of the filter. Filter names are case-sensitive. + description: Name of the filter. Filter names + are case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter + values. Filter values are case-sensitive. items: type: string type: array @@ -74,24 +97,34 @@ spec: additionalTags: additionalProperties: type: string - description: AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the AWS provider. If both the AWSCluster and the AWSMachine specify the same tag name with different values, the AWSMachine's value takes precedence. + description: AdditionalTags is an optional set of tags to + add to an instance, in addition to the ones added by default + by the AWS provider. If both the AWSCluster and the AWSMachine + specify the same tag name with different values, the AWSMachine's + value takes precedence. type: object ami: - description: AMI is the reference to the AMI from which to create the machine instance. + description: AMI is the reference to the AMI from which to + create the machine instance. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used + to identify a resource They are applied according to + the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: - description: Filter is a filter used to identify an AWS resource + description: Filter is a filter used to identify an + AWS resource properties: name: - description: Name of the filter. Filter names are case-sensitive. + description: Name of the filter. Filter names are + case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter + values. Filter values are case-sensitive. items: type: string type: array @@ -104,67 +137,211 @@ spec: description: ID of resource type: string type: object - availabilityZone: - description: AvailabilityZone is references the AWS availability zone to use for this instance. If multiple subnets are matched for the availability zone, the first one return is picked. - type: string cloudInit: - description: CloudInit defines options related to the bootstrapping systems where CloudInit is used. + description: CloudInit defines options related to the bootstrapping + systems where CloudInit is used. properties: - enableSecureSecretsManager: - description: enableSecureSecretsManager, when set to true will use AWS Secrets Manager to ensure userdata privacy. A cloud-init boothook shell script is prepended to download the userdata from Secrets Manager and additionally delete the secret. + insecureSkipSecretsManager: + description: InsecureSkipSecretsManager, when set to true + will not use AWS Secrets Manager or AWS Systems Manager + Parameter Store to ensure privacy of userdata. By default, + a cloud-init boothook shell script is prepended to download + the userdata from Secrets Manager and additionally delete + the secret. type: boolean secretCount: - description: SecretCount is the number of secrets used to form the complete secret + description: SecretCount is the number of secrets used + to form the complete secret format: int32 type: integer secretPrefix: - description: SecretPrefix is the prefix for the secret name. This is stored temporarily, and deleted when the machine registers as a node against the workload cluster. + description: SecretPrefix is the prefix for the secret + name. This is stored temporarily, and deleted when the + machine registers as a node against the workload cluster. + type: string + secureSecretsBackend: + description: SecureSecretsBackend, when set to parameter-store + will utilize the AWS Systems Manager Parameter Storage + to distribute secrets. By default or with the value + of secrets-manager, will use AWS Secrets Manager instead. + enum: + - secrets-manager + - ssm-parameter-store type: string type: object + failureDomain: + description: FailureDomain is the failure domain unique identifier + this Machine should be attached to, as defined in Cluster + API. For this infrastructure provider, the ID is equivalent + to an AWS Availability Zone. If multiple subnets are matched + for the availability zone, the first one returned is picked. + type: string iamInstanceProfile: - description: IAMInstanceProfile is a name of an IAM instance profile to assign to the instance + description: IAMInstanceProfile is a name of an IAM instance + profile to assign to the instance + type: string + imageLookupBaseOS: + description: ImageLookupBaseOS is the name of the base operating + system to use for image lookup the AMI is not set. + type: string + imageLookupFormat: + description: 'ImageLookupFormat is the AMI naming format to + look up the image for this machine It will be ignored if + an explicit AMI is set. Supports substitutions for {{.BaseOS}} + and {{.K8sVersion}} with the base OS and kubernetes version, + respectively. The BaseOS will be the value in ImageLookupBaseOS + or ubuntu (the default), and the kubernetes version as defined + by the packages produced by kubernetes/release without v + as a prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, + the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the + ubuntu base OS. See also: https://golang.org/pkg/text/template/' type: string imageLookupOrg: - description: ImageLookupOrg is the AWS Organization ID to use for image lookup if AMI is not set. + description: ImageLookupOrg is the AWS Organization ID to + use for image lookup if AMI is not set. + type: string + instanceID: + description: InstanceID is the EC2 instance ID for this machine. type: string instanceType: - description: 'InstanceType is the type of instance to create. Example: m4.xlarge' + description: 'InstanceType is the type of instance to create. + Example: m4.xlarge' type: string networkInterfaces: - description: NetworkInterfaces is a list of ENIs to associate with the instance. A maximum of 2 may be specified. + description: NetworkInterfaces is a list of ENIs to associate + with the instance. A maximum of 2 may be specified. items: type: string maxItems: 2 type: array + nonRootVolumes: + description: Configuration options for the non root storage + volumes. + items: + description: Volume encapsulates the configuration options + for the storage device + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should + be encrypted or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to + encrypt the volume. Can be either a KMS key ID or + ARN. If Encrypted is set and this is omitted, the + default AWS key will be used. The key must already + exist and be accessible by the controller. + type: string + iops: + description: IOPS is the number of IOPS requested for + the disk. Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage + device. Must be greater than the image snapshot size + or 8 (whichever is greater). + format: int64 + minimum: 8 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, + io1, etc...). + type: string + required: + - size + type: object + type: array providerID: - description: ProviderID is the unique identifier as specified by the cloud provider. + description: ProviderID is the unique identifier as specified + by the cloud provider. type: string publicIP: - description: 'PublicIP specifies whether the instance should get a public IP. Precedence for this setting is as follows: 1. This field if set 2. Cluster/flavor setting 3. Subnet default' + description: 'PublicIP specifies whether the instance should + get a public IP. Precedence for this setting is as follows: + 1. This field if set 2. Cluster/flavor setting 3. Subnet + default' type: boolean - rootDeviceSize: - description: RootDeviceSize is the size of the root volume in gigabytes(GB). - format: int64 - type: integer + rootVolume: + description: RootVolume encapsulates the configuration options + for the root volume + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be + encrypted or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will + be used. The key must already exist and be accessible + by the controller. + type: string + iops: + description: IOPS is the number of IOPS requested for + the disk. Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage + device. Must be greater than the image snapshot size + or 8 (whichever is greater). + format: int64 + minimum: 8 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, + io1, etc...). + type: string + required: + - size + type: object + spotMarketOptions: + description: SpotMarketOptions allows users to configure instances + to be run using AWS Spot instances. + properties: + maxPrice: + description: MaxPrice defines the maximum price the user + is willing to pay for Spot VM instances + type: string + type: object sshKeyName: - description: SSHKeyName is the name of the ssh key to attach to the instance. + description: SSHKeyName is the name of the ssh key to attach + to the instance. Valid values are empty string (do not use + SSH keys), a valid SSH key name, or omitted (use the default + SSH key name) type: string subnet: - description: Subnet is a reference to the subnet to use for this instance. If not specified, the cluster subnet will be used. + description: Subnet is a reference to the subnet to use for + this instance. If not specified, the cluster subnet will + be used. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used + to identify a resource They are applied according to + the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: - description: Filter is a filter used to identify an AWS resource + description: Filter is a filter used to identify an + AWS resource properties: name: - description: Name of the filter. Filter names are case-sensitive. + description: Name of the filter. Filter names are + case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter + values. Filter values are case-sensitive. items: type: string type: array @@ -177,6 +354,20 @@ spec: description: ID of resource type: string type: object + tenancy: + description: Tenancy indicates if instance should run on shared + or single-tenant hardware. + enum: + - default + - dedicated + - host + type: string + uncompressedUserData: + description: UncompressedUserData specify whether the user + data is gzip-compressed before it is sent to ec2 instance. + cloud-init has built-in support for gzip-compressed user + data user data stored in aws secret manager is always gzip-compressed. + type: boolean type: object required: - spec @@ -187,16 +378,21 @@ spec: type: object served: true storage: false - - name: v1alpha3 + - name: v1alpha4 schema: openAPIV3Schema: - description: AWSMachineTemplate is the Schema for the awsmachinetemplates API + description: AWSMachineTemplate is the Schema for the awsmachinetemplates + API properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object @@ -204,29 +400,45 @@ spec: description: AWSMachineTemplateSpec defines the desired state of AWSMachineTemplate properties: template: - description: AWSMachineTemplateResource describes the data needed to create am AWSMachine from a template + description: AWSMachineTemplateResource describes the data needed + to create am AWSMachine from a template properties: spec: - description: Spec is the specification of the desired behavior of the machine. + description: Spec is the specification of the desired behavior + of the machine. properties: additionalSecurityGroups: - description: AdditionalSecurityGroups is an array of references to security groups that should be applied to the instance. These security groups would be set in addition to any security groups defined at the cluster level or in the actuator. + description: AdditionalSecurityGroups is an array of references + to security groups that should be applied to the instance. + These security groups would be set in addition to any security + groups defined at the cluster level or in the actuator. + It is possible to specify either IDs of Filters. Using Filters + will cause additional requests to AWS API and if tags change + the attached security groups might change too. items: - description: AWSResourceReference is a reference to a specific AWS resource by ID, ARN, or filters. Only one of ID, ARN or Filters may be specified. Specifying more than one will result in a validation error. + description: AWSResourceReference is a reference to a specific + AWS resource by ID, ARN, or filters. Only one of ID, ARN + or Filters may be specified. Specifying more than one + will result in a validation error. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used + to identify a resource They are applied according + to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: - description: Filter is a filter used to identify an AWS resource + description: Filter is a filter used to identify an + AWS resource properties: name: - description: Name of the filter. Filter names are case-sensitive. + description: Name of the filter. Filter names + are case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter + values. Filter values are case-sensitive. items: type: string type: array @@ -243,24 +455,34 @@ spec: additionalTags: additionalProperties: type: string - description: AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the AWS provider. If both the AWSCluster and the AWSMachine specify the same tag name with different values, the AWSMachine's value takes precedence. + description: AdditionalTags is an optional set of tags to + add to an instance, in addition to the ones added by default + by the AWS provider. If both the AWSCluster and the AWSMachine + specify the same tag name with different values, the AWSMachine's + value takes precedence. type: object ami: - description: AMI is the reference to the AMI from which to create the machine instance. + description: AMI is the reference to the AMI from which to + create the machine instance. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used + to identify a resource They are applied according to + the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: - description: Filter is a filter used to identify an AWS resource + description: Filter is a filter used to identify an + AWS resource properties: name: - description: Name of the filter. Filter names are case-sensitive. + description: Name of the filter. Filter names are + case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter + values. Filter values are case-sensitive. items: type: string type: array @@ -274,139 +496,210 @@ spec: type: string type: object cloudInit: - description: CloudInit defines options related to the bootstrapping systems where CloudInit is used. + description: CloudInit defines options related to the bootstrapping + systems where CloudInit is used. properties: insecureSkipSecretsManager: - description: InsecureSkipSecretsManager, when set to true will not use AWS Secrets Manager or AWS Systems Manager Parameter Store to ensure privacy of userdata. By default, a cloud-init boothook shell script is prepended to download the userdata from Secrets Manager and additionally delete the secret. + description: InsecureSkipSecretsManager, when set to true + will not use AWS Secrets Manager or AWS Systems Manager + Parameter Store to ensure privacy of userdata. By default, + a cloud-init boothook shell script is prepended to download + the userdata from Secrets Manager and additionally delete + the secret. type: boolean secretCount: - description: SecretCount is the number of secrets used to form the complete secret + description: SecretCount is the number of secrets used + to form the complete secret format: int32 type: integer secretPrefix: - description: SecretPrefix is the prefix for the secret name. This is stored temporarily, and deleted when the machine registers as a node against the workload cluster. + description: SecretPrefix is the prefix for the secret + name. This is stored temporarily, and deleted when the + machine registers as a node against the workload cluster. type: string secureSecretsBackend: - default: secrets-manager - description: SecureSecretsBackend, when set to parameter-store will utilize the AWS Systems Manager Parameter Storage to distribute secrets. By default or with the value of secrets-manager, will use AWS Secrets Manager instead. + description: SecureSecretsBackend, when set to parameter-store + will utilize the AWS Systems Manager Parameter Storage + to distribute secrets. By default or with the value + of secrets-manager, will use AWS Secrets Manager instead. enum: - secrets-manager - ssm-parameter-store type: string type: object failureDomain: - description: FailureDomain is the failure domain unique identifier this Machine should be attached to, as defined in Cluster API. For this infrastructure provider, the ID is equivalent to an AWS Availability Zone. If multiple subnets are matched for the availability zone, the first one returned is picked. + description: FailureDomain is the failure domain unique identifier + this Machine should be attached to, as defined in Cluster + API. For this infrastructure provider, the ID is equivalent + to an AWS Availability Zone. If multiple subnets are matched + for the availability zone, the first one returned is picked. type: string iamInstanceProfile: - description: IAMInstanceProfile is a name of an IAM instance profile to assign to the instance + description: IAMInstanceProfile is a name of an IAM instance + profile to assign to the instance type: string imageLookupBaseOS: - description: ImageLookupBaseOS is the name of the base operating system to use for image lookup the AMI is not set. + description: ImageLookupBaseOS is the name of the base operating + system to use for image lookup the AMI is not set. type: string imageLookupFormat: - description: 'ImageLookupFormat is the AMI naming format to look up the image for this machine It will be ignored if an explicit AMI is set. Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base OS and kubernetes version, respectively. The BaseOS will be the value in ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as defined by the packages produced by kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See also: https://golang.org/pkg/text/template/' + description: 'ImageLookupFormat is the AMI naming format to + look up the image for this machine It will be ignored if + an explicit AMI is set. Supports substitutions for {{.BaseOS}} + and {{.K8sVersion}} with the base OS and kubernetes version, + respectively. The BaseOS will be the value in ImageLookupBaseOS + or ubuntu (the default), and the kubernetes version as defined + by the packages produced by kubernetes/release without v + as a prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, + the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the + ubuntu base OS. See also: https://golang.org/pkg/text/template/' type: string imageLookupOrg: - description: ImageLookupOrg is the AWS Organization ID to use for image lookup if AMI is not set. + description: ImageLookupOrg is the AWS Organization ID to + use for image lookup if AMI is not set. + type: string + instanceID: + description: InstanceID is the EC2 instance ID for this machine. type: string instanceType: - description: 'InstanceType is the type of instance to create. Example: m4.xlarge' + description: 'InstanceType is the type of instance to create. + Example: m4.xlarge' type: string networkInterfaces: - description: NetworkInterfaces is a list of ENIs to associate with the instance. A maximum of 2 may be specified. + description: NetworkInterfaces is a list of ENIs to associate + with the instance. A maximum of 2 may be specified. items: type: string maxItems: 2 type: array nonRootVolumes: - description: Configuration options for the non root storage volumes. + description: Configuration options for the non root storage + volumes. items: - description: Volume encapsulates the configuration options for the storage device + description: Volume encapsulates the configuration options + for the storage device properties: deviceName: description: Device name type: string encrypted: - description: Encrypted is whether the volume should be encrypted or not. + description: Encrypted is whether the volume should + be encrypted or not. type: boolean encryptionKey: - description: EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN. If Encrypted is set and this is omitted, the default AWS key will be used. The key must already exist and be accessible by the controller. + description: EncryptionKey is the KMS key to use to + encrypt the volume. Can be either a KMS key ID or + ARN. If Encrypted is set and this is omitted, the + default AWS key will be used. The key must already + exist and be accessible by the controller. type: string iops: - description: IOPS is the number of IOPS requested for the disk. Not applicable to all types. + description: IOPS is the number of IOPS requested for + the disk. Not applicable to all types. format: int64 type: integer size: - description: Size specifies size (in Gi) of the storage device. Must be greater than the image snapshot size or 8 (whichever is greater). + description: Size specifies size (in Gi) of the storage + device. Must be greater than the image snapshot size + or 8 (whichever is greater). format: int64 minimum: 8 type: integer type: - description: Type is the type of the volume (e.g. gp2, io1, etc...). + description: Type is the type of the volume (e.g. gp2, + io1, etc...). type: string required: - size type: object type: array providerID: - description: ProviderID is the unique identifier as specified by the cloud provider. + description: ProviderID is the unique identifier as specified + by the cloud provider. type: string publicIP: - description: 'PublicIP specifies whether the instance should get a public IP. Precedence for this setting is as follows: 1. This field if set 2. Cluster/flavor setting 3. Subnet default' + description: 'PublicIP specifies whether the instance should + get a public IP. Precedence for this setting is as follows: + 1. This field if set 2. Cluster/flavor setting 3. Subnet + default' type: boolean rootVolume: - description: RootVolume encapsulates the configuration options for the root volume + description: RootVolume encapsulates the configuration options + for the root volume properties: deviceName: description: Device name type: string encrypted: - description: Encrypted is whether the volume should be encrypted or not. + description: Encrypted is whether the volume should be + encrypted or not. type: boolean encryptionKey: - description: EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN. If Encrypted is set and this is omitted, the default AWS key will be used. The key must already exist and be accessible by the controller. + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will + be used. The key must already exist and be accessible + by the controller. type: string iops: - description: IOPS is the number of IOPS requested for the disk. Not applicable to all types. + description: IOPS is the number of IOPS requested for + the disk. Not applicable to all types. format: int64 type: integer size: - description: Size specifies size (in Gi) of the storage device. Must be greater than the image snapshot size or 8 (whichever is greater). + description: Size specifies size (in Gi) of the storage + device. Must be greater than the image snapshot size + or 8 (whichever is greater). format: int64 minimum: 8 type: integer type: - description: Type is the type of the volume (e.g. gp2, io1, etc...). + description: Type is the type of the volume (e.g. gp2, + io1, etc...). type: string required: - size type: object spotMarketOptions: - description: SpotMarketOptions allows users to configure instances to be run using AWS Spot instances. + description: SpotMarketOptions allows users to configure instances + to be run using AWS Spot instances. properties: maxPrice: - description: MaxPrice defines the maximum price the user is willing to pay for Spot VM instances + description: MaxPrice defines the maximum price the user + is willing to pay for Spot VM instances type: string type: object sshKeyName: - description: SSHKeyName is the name of the ssh key to attach to the instance. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name) + description: SSHKeyName is the name of the ssh key to attach + to the instance. Valid values are empty string (do not use + SSH keys), a valid SSH key name, or omitted (use the default + SSH key name) type: string subnet: - description: Subnet is a reference to the subnet to use for this instance. If not specified, the cluster subnet will be used. + description: Subnet is a reference to the subnet to use for + this instance. If not specified, the cluster subnet will + be used. properties: arn: description: ARN of resource type: string filters: - description: 'Filters is a set of key/value pairs used to identify a resource They are applied according to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + description: 'Filters is a set of key/value pairs used + to identify a resource They are applied according to + the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' items: - description: Filter is a filter used to identify an AWS resource + description: Filter is a filter used to identify an + AWS resource properties: name: - description: Name of the filter. Filter names are case-sensitive. + description: Name of the filter. Filter names are + case-sensitive. type: string values: - description: Values includes one or more filter values. Filter values are case-sensitive. + description: Values includes one or more filter + values. Filter values are case-sensitive. items: type: string type: array @@ -420,14 +713,18 @@ spec: type: string type: object tenancy: - description: Tenancy indicates if instance should run on shared or single-tenant hardware. + description: Tenancy indicates if instance should run on shared + or single-tenant hardware. enum: - default - dedicated - host type: string uncompressedUserData: - description: UncompressedUserData specify whether the user data is gzip-compressed before it is sent to ec2 instance. cloud-init has built-in support for gzip-compressed user data user data stored in aws secret manager is always gzip-compressed. + description: UncompressedUserData specify whether the user + data is gzip-compressed before it is sent to ec2 instance. + cloud-init has built-in support for gzip-compressed user + data user data stored in aws secret manager is always gzip-compressed. type: boolean type: object required: diff --git a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmanagedclusters.yaml b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmanagedclusters.yaml index 7de9b4d53a1..ecd75e83900 100644 --- a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmanagedclusters.yaml +++ b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmanagedclusters.yaml @@ -1,10 +1,10 @@ + +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - labels: - cluster.x-k8s.io/v1alpha4: v1alpha3 annotations: - controller-gen.kubebuilder.io/version: v0.2.9 + controller-gen.kubebuilder.io/version: v0.5.0 creationTimestamp: null name: awsmanagedclusters.infrastructure.cluster.x-k8s.io spec: @@ -44,10 +44,14 @@ spec: description: AWSManagedCluster is the Schema for the awsmanagedclusters API properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object @@ -55,7 +59,8 @@ spec: description: AWSManagedClusterSpec defines the desired state of AWSManagedCluster properties: controlPlaneEndpoint: - description: ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + description: ControlPlaneEndpoint represents the endpoint used to + communicate with the control plane. properties: host: description: The hostname on which the API server is serving. @@ -74,21 +79,114 @@ spec: properties: failureDomains: additionalProperties: - description: FailureDomainSpec is the Schema for Cluster API failure domains. It allows controllers to understand how many failure domains a cluster can optionally span across. + description: FailureDomainSpec is the Schema for Cluster API failure + domains. It allows controllers to understand how many failure + domains a cluster can optionally span across. properties: attributes: additionalProperties: type: string - description: Attributes is a free form map of attributes an infrastructure provider might use or require. + description: Attributes is a free form map of attributes an + infrastructure provider might use or require. type: object controlPlane: - description: ControlPlane determines if this failure domain is suitable for use by control plane machines. + description: ControlPlane determines if this failure domain + is suitable for use by control plane machines. type: boolean type: object - description: FailureDomains specifies a list fo available availability zones that can be used + description: FailureDomains specifies a list fo available availability + zones that can be used type: object ready: - description: Ready is when the AWSManagedControlPlane has a API server URL. + description: Ready is when the AWSManagedControlPlane has a API server + URL. + type: boolean + type: object + type: object + served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Cluster to which this AWSManagedControl belongs + jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name + name: Cluster + type: string + - description: Control plane infrastructure is ready for worker nodes + jsonPath: .status.ready + name: Ready + type: string + - description: AWS VPC the control plane is using + jsonPath: .spec.networkSpec.vpc.id + name: VPC + type: string + - description: API Endpoint + jsonPath: .spec.controlPlaneEndpoint.host + name: Endpoint + priority: 1 + type: string + name: v1alpha4 + schema: + openAPIV3Schema: + description: AWSManagedCluster is the Schema for the awsmanagedclusters API + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: AWSManagedClusterSpec defines the desired state of AWSManagedCluster + properties: + controlPlaneEndpoint: + description: ControlPlaneEndpoint represents the endpoint used to + communicate with the control plane. + properties: + host: + description: The hostname on which the API server is serving. + type: string + port: + description: The port on which the API server is serving. + format: int32 + type: integer + required: + - host + - port + type: object + type: object + status: + description: AWSManagedClusterStatus defines the observed state of AWSManagedCluster + properties: + failureDomains: + additionalProperties: + description: FailureDomainSpec is the Schema for Cluster API failure + domains. It allows controllers to understand how many failure + domains a cluster can optionally span across. + properties: + attributes: + additionalProperties: + type: string + description: Attributes is a free form map of attributes an + infrastructure provider might use or require. + type: object + controlPlane: + description: ControlPlane determines if this failure domain + is suitable for use by control plane machines. + type: boolean + type: object + description: FailureDomains specifies a list fo available availability + zones that can be used + type: object + ready: + description: Ready is when the AWSManagedControlPlane has a API server + URL. type: boolean type: object type: object diff --git a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml index 546fb3e5e4f..e67a584544a 100644 --- a/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml +++ b/cmd/install/assets/cluster-api/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml @@ -1,10 +1,10 @@ + +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - labels: - cluster.x-k8s.io/v1alpha4: v1alpha3 annotations: - controller-gen.kubebuilder.io/version: v0.2.9 + controller-gen.kubebuilder.io/version: v0.5.0 creationTimestamp: null name: awsmanagedmachinepools.infrastructure.cluster.x-k8s.io spec: @@ -30,13 +30,18 @@ spec: name: v1alpha3 schema: openAPIV3Schema: - description: AWSManagedMachinePool is the Schema for the awsmanagedmachinepools API + description: AWSManagedMachinePool is the Schema for the awsmanagedmachinepools + API properties: apiVersion: - description: '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' + description: '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' type: string kind: - description: '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' + description: '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' type: string metadata: type: object @@ -46,7 +51,9 @@ spec: additionalTags: additionalProperties: type: string - description: AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the ones added by default. + description: AdditionalTags is an optional set of tags to add to AWS + resources managed by the AWS provider, in addition to the ones added + by default. type: object amiType: default: AL2_x86_64 @@ -57,15 +64,248 @@ spec: - AL2_ARM_64 type: string amiVersion: - description: AMIVersion defines the desired AMI release version. If no version number is supplied then the latest version for the Kubernetes version will be used + description: AMIVersion defines the desired AMI release version. If + no version number is supplied then the latest version for the Kubernetes + version will be used minLength: 2 type: string + availabilityZones: + description: AvailabilityZones is an array of availability zones instances + can run in + items: + type: string + type: array + diskSize: + description: DiskSize specifies the root disk size + format: int32 + type: integer + eksNodegroupName: + description: EKSNodegroupName specifies the name of the nodegroup + in AWS corresponding to this MachinePool. If you don't specify a + name then a default name will be created based on the namespace + and name of the managed machine pool. + type: string + instanceType: + description: InstanceType specifies the AWS instance type + type: string + labels: + additionalProperties: + type: string + description: Labels specifies labels for the Kubernetes node objects + type: object + providerIDList: + description: ProviderIDList are the provider IDs of instances in the + autoscaling group corresponding to the nodegroup represented by + this machine pool + items: + type: string + type: array + remoteAccess: + description: RemoteAccess specifies how machines can be accessed remotely + properties: + public: + description: Public specifies whether to open port 22 to the public + internet + type: boolean + sourceSecurityGroups: + description: SourceSecurityGroups specifies which security groups + are allowed access + items: + type: string + type: array + sshKeyName: + description: SSHKeyName specifies which EC2 SSH key can be used + to access machines. If left empty, the key from the control + plane is used. + type: string + type: object + roleName: + description: RoleName specifies the name of IAM role for the node + group. If the role is pre-existing we will treat it as unmanaged + and not delete it on deletion. If the EKSEnableIAM feature flag + is true and no name is supplied then a role is created. + type: string + scaling: + description: Scaling specifies scaling for the ASG behind this pool + properties: + maxSize: + format: int32 + type: integer + minSize: + format: int32 + type: integer + type: object + subnetIDs: + description: SubnetIDs specifies which subnets are used for the auto + scaling group of this nodegroup + items: + type: string + type: array + type: object + status: + description: AWSManagedMachinePoolStatus defines the observed state of + AWSManagedMachinePool + properties: + conditions: + description: Conditions defines current service state of the managed + machine pool + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: 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. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: 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. + type: string + severity: + description: 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. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: 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. + type: string + required: + - status + - type + type: object + type: array + failureMessage: + description: "FailureMessage will be set in the event that there is + a terminal problem reconciling the MachinePool and will contain + a more verbose string suitable for logging and human consumption. + \n 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 MachinePool'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. \n Any transient errors that + occur during the reconciliation of MachinePools can be added as + events to the MachinePool object and/or logged in the controller's + output." + type: string + failureReason: + description: "FailureReason will be set in the event that there is + a terminal problem reconciling the MachinePool and will contain + a succinct value suitable for machine interpretation. \n 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. \n Any transient errors that + occur during the reconciliation of MachinePools can be added as + events to the MachinePool object and/or logged in the controller's + output." + type: string + ready: + default: false + description: Ready denotes that the AWSManagedMachinePool nodegroup + has joined the cluster + type: boolean + replicas: + description: Replicas is the most recently observed number of replicas. + format: int32 + type: integer + required: + - ready + type: object + type: object + served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: MachinePool ready status + jsonPath: .status.ready + name: Ready + type: string + - description: Number of replicas + jsonPath: .status.replicas + name: Replicas + type: integer + name: v1alpha4 + schema: + openAPIV3Schema: + description: AWSManagedMachinePool is the Schema for the awsmanagedmachinepools + API + properties: + apiVersion: + description: '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' + type: string + kind: + description: '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' + type: string + metadata: + type: object + spec: + description: AWSManagedMachinePoolSpec defines the desired state of AWSManagedMachinePool + properties: + additionalTags: + additionalProperties: + type: string + description: AdditionalTags is an optional set of tags to add to AWS + resources managed by the AWS provider, in addition to the ones added + by default. + type: object + amiType: + default: AL2_x86_64 + description: AMIType defines the AMI type + enum: + - AL2_x86_64 + - AL2_x86_64_GPU + - AL2_ARM_64 + type: string + amiVersion: + description: AMIVersion defines the desired AMI release version. If + no version number is supplied then the latest version for the Kubernetes + version will be used + minLength: 2 + type: string + availabilityZones: + description: AvailabilityZones is an array of availability zones instances + can run in + items: + type: string + type: array diskSize: description: DiskSize specifies the root disk size format: int32 type: integer eksNodegroupName: - description: EKSNodegroupName specifies the name of the nodegroup in AWS corresponding to this MachinePool. If you don't specify a name then a default name will be created based on the namespace and name of the managed machine pool. + description: EKSNodegroupName specifies the name of the nodegroup + in AWS corresponding to this MachinePool. If you don't specify a + name then a default name will be created based on the namespace + and name of the managed machine pool. type: string instanceType: description: InstanceType specifies the AWS instance type @@ -76,24 +316,36 @@ spec: description: Labels specifies labels for the Kubernetes node objects type: object providerIDList: - description: ProviderIDList are the provider IDs of instances in the autoscaling group corresponding to the nodegroup represented by this machine pool + description: ProviderIDList are the provider IDs of instances in the + autoscaling group corresponding to the nodegroup represented by + this machine pool items: type: string type: array remoteAccess: description: RemoteAccess specifies how machines can be accessed remotely properties: + public: + description: Public specifies whether to open port 22 to the public + internet + type: boolean sourceSecurityGroups: - description: SourceSecurityGroups specifies which security groups are allowed access An empty array opens port 22 to the public internet + description: SourceSecurityGroups specifies which security groups + are allowed access items: type: string type: array sshKeyName: - description: SSHKeyName specifies which EC2 SSH key can be used to access machines. If left empty, the key from the control plane is used. + description: SSHKeyName specifies which EC2 SSH key can be used + to access machines. If left empty, the key from the control + plane is used. type: string type: object roleName: - description: RoleName specifies the name of IAM role for the node group. If the role is pre-existing we will treat it as unmanaged and not delete it on deletion. If the EKSEnableIAM feature flag is true and no name is supplied then a role is created. + description: RoleName specifies the name of IAM role for the node + group. If the role is pre-existing we will treat it as unmanaged + and not delete it on deletion. If the EKSEnableIAM feature flag + is true and no name is supplied then a role is created. type: string scaling: description: Scaling specifies scaling for the ASG behind this pool @@ -106,37 +358,55 @@ spec: type: integer type: object subnetIDs: - description: SubnetIDs specifies which subnets are used for the auto scaling group of this nodegroup + description: SubnetIDs specifies which subnets are used for the auto + scaling group of this nodegroup items: type: string type: array type: object status: - description: AWSManagedMachinePoolStatus defines the observed state of AWSManagedMachinePool + description: AWSManagedMachinePoolStatus defines the observed state of + AWSManagedMachinePool properties: conditions: - description: Conditions defines current service state of the managed machine pool + description: Conditions defines current service state of the managed + machine pool items: - description: Condition defines an observation of a Cluster API resource operational state. + description: Condition defines an observation of a Cluster API resource + operational state. properties: lastTransitionTime: - description: 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. + description: 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. format: date-time type: string message: - description: A human readable message indicating details about the transition. This field may be empty. + description: A human readable message indicating details about + the transition. This field may be empty. type: string reason: - description: 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. + description: 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. type: string severity: - description: 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. + description: 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. type: string status: description: Status of the condition, one of True, False, Unknown. type: string type: - description: 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. + description: 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. type: string required: - status @@ -144,14 +414,41 @@ spec: type: object type: array failureMessage: - description: "FailureMessage will be set in the event that there is a terminal problem reconciling the MachinePool and will contain a more verbose string suitable for logging and human consumption. \n 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 MachinePool'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. \n Any transient errors that occur during the reconciliation of MachinePools can be added as events to the MachinePool object and/or logged in the controller's output." + description: "FailureMessage will be set in the event that there is + a terminal problem reconciling the MachinePool and will contain + a more verbose string suitable for logging and human consumption. + \n 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 MachinePool'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. \n Any transient errors that + occur during the reconciliation of MachinePools can be added as + events to the MachinePool object and/or logged in the controller's + output." type: string failureReason: - description: "FailureReason will be set in the event that there is a terminal problem reconciling the MachinePool and will contain a succinct value suitable for machine interpretation. \n 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. \n Any transient errors that occur during the reconciliation of MachinePools can be added as events to the MachinePool object and/or logged in the controller's output." + description: "FailureReason will be set in the event that there is + a terminal problem reconciling the MachinePool and will contain + a succinct value suitable for machine interpretation. \n 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. \n Any transient errors that + occur during the reconciliation of MachinePools can be added as + events to the MachinePool object and/or logged in the controller's + output." type: string ready: default: false - description: Ready denotes that the AWSManagedMachinePool nodegroup has joined the cluster + description: Ready denotes that the AWSManagedMachinePool nodegroup + has joined the cluster type: boolean replicas: description: Replicas is the most recently observed number of replicas. diff --git a/cmd/install/assets/cluster_api.go b/cmd/install/assets/cluster_api.go index 0662ecfcfdd..fcb6c808d2a 100644 --- a/cmd/install/assets/cluster_api.go +++ b/cmd/install/assets/cluster_api.go @@ -4,6 +4,18 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" ) +type ClusterAPIClusterResourceSetBindingsCustomResourceDefinition struct{} + +func (o ClusterAPIClusterResourceSetBindingsCustomResourceDefinition) Build() *apiextensionsv1.CustomResourceDefinition { + return getCustomResourceDefinition("cluster-api/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml") +} + +type ClusterAPIClusterResourceSetsCustomResourceDefinition struct{} + +func (o ClusterAPIClusterResourceSetsCustomResourceDefinition) Build() *apiextensionsv1.CustomResourceDefinition { + return getCustomResourceDefinition("cluster-api/addons.cluster.x-k8s.io_clusterresourcesets.yaml") +} + type ClusterAPIClustersCustomResourceDefinition struct{} func (o ClusterAPIClustersCustomResourceDefinition) Build() *apiextensionsv1.CustomResourceDefinition { @@ -28,6 +40,24 @@ func (o ClusterAPIMachinesCustomResourceDefinition) Build() *apiextensionsv1.Cus return getCustomResourceDefinition("cluster-api/cluster.x-k8s.io_machines.yaml") } +type ClusterAPIAWSClusterControllerIdentitiesCustomResourceDefinition struct{} + +func (o ClusterAPIAWSClusterControllerIdentitiesCustomResourceDefinition) Build() *apiextensionsv1.CustomResourceDefinition { + return getCustomResourceDefinition("cluster-api/infrastructure.cluster.x-k8s.io_awsclustercontrolleridentities.yaml") +} + +type ClusterAPIAWSClusterRoleIdentitiesCustomResourceDefinition struct{} + +func (o ClusterAPIAWSClusterRoleIdentitiesCustomResourceDefinition) Build() *apiextensionsv1.CustomResourceDefinition { + return getCustomResourceDefinition("cluster-api/infrastructure.cluster.x-k8s.io_awsclusterroleidentities.yaml") +} + +type ClusterAPIAWSClusterStaticIdentitiesCustomResourceDefinition struct{} + +func (o ClusterAPIAWSClusterStaticIdentitiesCustomResourceDefinition) Build() *apiextensionsv1.CustomResourceDefinition { + return getCustomResourceDefinition("cluster-api/infrastructure.cluster.x-k8s.io_awsclusterstaticidentities.yaml") +} + type ClusterAPIMachineSetsCustomResourceDefinition struct{} func (o ClusterAPIMachineSetsCustomResourceDefinition) Build() *apiextensionsv1.CustomResourceDefinition { diff --git a/cmd/install/install.go b/cmd/install/install.go index 1783bd2bb41..afdd84b1627 100644 --- a/cmd/install/install.go +++ b/cmd/install/install.go @@ -147,12 +147,17 @@ func hyperShiftOperatorManifests(opts Options) []crclient.Object { } func clusterAPIManifests() []crclient.Object { - clustersCRD := assets.ClusterAPIClustersCustomResourceDefinition{}.Build() + clusterResourceSetBindingsCRD := assets.ClusterAPIClusterResourceSetBindingsCustomResourceDefinition{}.Build() + clustersCRD := assets.ClusterAPIClusterResourceSetsCustomResourceDefinition{}.Build() + clusterResourceSetsCRD := assets.ClusterAPIClustersCustomResourceDefinition{}.Build() machineDeploymentsCRD := assets.ClusterAPIMachineDeploymentsCustomResourceDefinition{}.Build() machineHealthChecksCRD := assets.ClusterAPIMachineHealthChecksCustomResourceDefinition{}.Build() machinesCRD := assets.ClusterAPIMachinesCustomResourceDefinition{}.Build() machineSetsCRD := assets.ClusterAPIMachineSetsCustomResourceDefinition{}.Build() + awsClusterControllerIdentitiesCRD := assets.ClusterAPIAWSClusterControllerIdentitiesCustomResourceDefinition{}.Build() + awsClusterRoleIdentitiesCRD := assets.ClusterAPIAWSClusterRoleIdentitiesCustomResourceDefinition{}.Build() awsClustersCRD := assets.ClusterAPIAWSClustersCustomResourceDefinition{}.Build() + awsClusterStaticIdentitiesCRD := assets.ClusterAPIAWSClusterStaticIdentitiesCustomResourceDefinition{}.Build() awsMachinePoolsCRD := assets.ClusterAPIAWSMachinePoolsCustomResourceDefinition{}.Build() awsMachinesCRD := assets.ClusterAPIAWSMachinesCustomResourceDefinition{}.Build() awsMachineTemplatesCRD := assets.ClusterAPIAWSMachineTemplatesCustomResourceDefinition{}.Build() @@ -160,6 +165,8 @@ func clusterAPIManifests() []crclient.Object { awsManagedMachinePoolsCRD := assets.ClusterAPIAWSManagedMachinePoolsCustomResourceDefinition{}.Build() return []crclient.Object{ + clusterResourceSetBindingsCRD, + clusterResourceSetsCRD, clustersCRD, machineDeploymentsCRD, machineHealthChecksCRD, @@ -171,6 +178,9 @@ func clusterAPIManifests() []crclient.Object { awsMachineTemplatesCRD, awsManagedClustersCRD, awsManagedMachinePoolsCRD, + awsClusterControllerIdentitiesCRD, + awsClusterRoleIdentitiesCRD, + awsClusterStaticIdentitiesCRD, } } diff --git a/thirdparty/clusterapi/api/v1alpha3/cluster_phase_types.go b/thirdparty/clusterapi/api/v1alpha3/cluster_phase_types.go deleted file mode 100644 index d79a4b1a1e5..00000000000 --- a/thirdparty/clusterapi/api/v1alpha3/cluster_phase_types.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -// ClusterPhase is a string representation of a Cluster Phase. -// -// This type is a high-level indicator of the status of the Cluster as it is provisioned, -// from the API user’s perspective. -// -// The value should not be interpreted by any software components as a reliable indication -// of the actual state of the Cluster, and controllers should not use the Cluster Phase field -// value when making decisions about what action to take. -// -// Controllers should always look at the actual state of the Cluster’s fields to make those decisions. -type ClusterPhase string - -const ( - // ClusterPhasePending is the first state a Cluster is assigned by - // Cluster API Cluster controller after being created. - ClusterPhasePending = ClusterPhase("Pending") - - // ClusterPhaseProvisioning is the state when the Cluster has a provider infrastructure - // object associated and can start provisioning. - ClusterPhaseProvisioning = ClusterPhase("Provisioning") - - // ClusterPhaseProvisioned is the state when its - // infrastructure has been created and configured. - ClusterPhaseProvisioned = ClusterPhase("Provisioned") - - // ClusterPhaseDeleting is the Cluster state when a delete - // request has been sent to the API Server, - // but its infrastructure has not yet been fully deleted. - ClusterPhaseDeleting = ClusterPhase("Deleting") - - // ClusterPhaseFailed is the Cluster state when the system - // might require user intervention. - ClusterPhaseFailed = ClusterPhase("Failed") - - // ClusterPhaseUnknown is returned if the Cluster state cannot be determined. - ClusterPhaseUnknown = ClusterPhase("Unknown") -) diff --git a/thirdparty/clusterapi/api/v1alpha3/cluster_types.go b/thirdparty/clusterapi/api/v1alpha3/cluster_types.go deleted file mode 100644 index a60a6143758..00000000000 --- a/thirdparty/clusterapi/api/v1alpha3/cluster_types.go +++ /dev/null @@ -1,268 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "fmt" - "net" - "strings" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/pointer" - - capierrors "github.com/openshift/hypershift/thirdparty/clusterapi/errors" -) - -const ( - ClusterFinalizer = "cluster.cluster.x-k8s.io" -) - -// ANCHOR: ClusterSpec - -// ClusterSpec defines the desired state of Cluster -type ClusterSpec struct { - // Paused can be used to prevent controllers from processing the Cluster and all its associated objects. - // +optional - Paused bool `json:"paused,omitempty"` - - // Cluster network configuration. - // +optional - ClusterNetwork *ClusterNetwork `json:"clusterNetwork,omitempty"` - - // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. - // +optional - ControlPlaneEndpoint APIEndpoint `json:"controlPlaneEndpoint"` - - // ControlPlaneRef is an optional reference to a provider-specific resource that holds - // the details for provisioning the Control Plane for a Cluster. - // +optional - ControlPlaneRef *corev1.ObjectReference `json:"controlPlaneRef,omitempty"` - - // InfrastructureRef is a reference to a provider-specific resource that holds the details - // for provisioning infrastructure for a cluster in said provider. - // +optional - InfrastructureRef *corev1.ObjectReference `json:"infrastructureRef,omitempty"` -} - -// ANCHOR_END: ClusterSpec - -// ANCHOR: ClusterNetwork - -// ClusterNetwork specifies the different networking -// parameters for a cluster. -type ClusterNetwork struct { - // APIServerPort specifies the port the API Server should bind to. - // Defaults to 6443. - // +optional - APIServerPort *int32 `json:"apiServerPort,omitempty"` - - // The network ranges from which service VIPs are allocated. - // +optional - Services *NetworkRanges `json:"services,omitempty"` - - // The network ranges from which Pod networks are allocated. - // +optional - Pods *NetworkRanges `json:"pods,omitempty"` - - // Domain name for services. - // +optional - ServiceDomain string `json:"serviceDomain,omitempty"` -} - -// ANCHOR_END: ClusterNetwork - -// ANCHOR: NetworkRanges -// NetworkRanges represents ranges of network addresses. -type NetworkRanges struct { - CIDRBlocks []string `json:"cidrBlocks"` -} - -func (n *NetworkRanges) String() string { - if n == nil { - return "" - } - return strings.Join(n.CIDRBlocks, ",") -} - -// ANCHOR_END: NetworkRanges - -// ANCHOR: ClusterStatus - -// ClusterStatus defines the observed state of Cluster -type ClusterStatus struct { - // FailureDomains is a slice of failure domain objects synced from the infrastructure provider. - FailureDomains FailureDomains `json:"failureDomains,omitempty"` - - // FailureReason indicates that there is a fatal problem reconciling the - // state, and will be set to a token value suitable for - // programmatic interpretation. - // +optional - FailureReason *capierrors.ClusterStatusError `json:"failureReason,omitempty"` - - // FailureMessage indicates that there is a fatal problem reconciling the - // state, and will be set to a descriptive error message. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - // Phase represents the current phase of cluster actuation. - // E.g. Pending, Running, Terminating, Failed etc. - // +optional - Phase string `json:"phase,omitempty"` - - // InfrastructureReady is the state of the infrastructure provider. - // +optional - InfrastructureReady bool `json:"infrastructureReady"` - - // ControlPlaneInitialized defines if the control plane has been initialized. - // +optional - ControlPlaneInitialized bool `json:"controlPlaneInitialized"` - - // ControlPlaneReady defines if the control plane is ready. - // +optional - ControlPlaneReady bool `json:"controlPlaneReady,omitempty"` - - // Conditions defines current service state of the cluster. - // +optional - Conditions Conditions `json:"conditions,omitempty"` - - // ObservedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` -} - -// ANCHOR_END: ClusterStatus - -// SetTypedPhase sets the Phase field to the string representation of ClusterPhase. -func (c *ClusterStatus) SetTypedPhase(p ClusterPhase) { - c.Phase = string(p) -} - -// GetTypedPhase attempts to parse the Phase field and return -// the typed ClusterPhase representation as described in `machine_phase_types.go`. -func (c *ClusterStatus) GetTypedPhase() ClusterPhase { - switch phase := ClusterPhase(c.Phase); phase { - case - ClusterPhasePending, - ClusterPhaseProvisioning, - ClusterPhaseProvisioned, - ClusterPhaseDeleting, - ClusterPhaseFailed: - return phase - default: - return ClusterPhaseUnknown - } -} - -// ANCHOR: APIEndpoint - -// APIEndpoint represents a reachable Kubernetes API endpoint. -type APIEndpoint struct { - // The hostname on which the API server is serving. - Host string `json:"host"` - - // The port on which the API server is serving. - Port int32 `json:"port"` -} - -// IsZero returns true if both host and port are zero values. -func (v APIEndpoint) IsZero() bool { - return v.Host == "" && v.Port == 0 -} - -// IsValid returns true if both host and port are non-zero values. -func (v APIEndpoint) IsValid() bool { - return v.Host != "" && v.Port != 0 -} - -// String returns a formatted version HOST:PORT of this APIEndpoint. -func (v APIEndpoint) String() string { - return net.JoinHostPort(v.Host, fmt.Sprintf("%d", v.Port)) -} - -// ANCHOR_END: APIEndpoint - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=clusters,shortName=cl,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Cluster status such as Pending/Provisioning/Provisioned/Deleting/Failed" - -// Cluster is the Schema for the clusters API -type Cluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterSpec `json:"spec,omitempty"` - Status ClusterStatus `json:"status,omitempty"` -} - -func (c *Cluster) GetConditions() Conditions { - return c.Status.Conditions -} - -func (c *Cluster) SetConditions(conditions Conditions) { - c.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// ClusterList contains a list of Cluster -type ClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Cluster `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Cluster{}, &ClusterList{}) -} - -// FailureDomains is a slice of FailureDomains. -type FailureDomains map[string]FailureDomainSpec - -// FilterControlPlane returns a FailureDomain slice containing only the domains suitable to be used -// for control plane nodes. -func (in FailureDomains) FilterControlPlane() FailureDomains { - res := make(FailureDomains) - for id, spec := range in { - if spec.ControlPlane { - res[id] = spec - } - } - return res -} - -// GetIDs returns a slice containing the ids for failure domains -func (in FailureDomains) GetIDs() []*string { - ids := make([]*string, 0, len(in)) - for id := range in { - ids = append(ids, pointer.StringPtr(id)) - } - return ids -} - -// FailureDomainSpec is the Schema for Cluster API failure domains. -// It allows controllers to understand how many failure domains a cluster can optionally span across. -type FailureDomainSpec struct { - // ControlPlane determines if this failure domain is suitable for use by control plane machines. - // +optional - ControlPlane bool `json:"controlPlane"` - - // Attributes is a free form map of attributes an infrastructure provider might use or require. - // +optional - Attributes map[string]string `json:"attributes,omitempty"` -} diff --git a/thirdparty/clusterapi/api/v1alpha3/common_types.go b/thirdparty/clusterapi/api/v1alpha3/common_types.go deleted file mode 100644 index bcace3cc398..00000000000 --- a/thirdparty/clusterapi/api/v1alpha3/common_types.go +++ /dev/null @@ -1,161 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // ClusterLabelName is the label set on machines linked to a cluster and - // external objects(bootstrap and infrastructure providers) - ClusterLabelName = "cluster.x-k8s.io/cluster-name" - - // ProviderLabelName is the label set on components in the provider manifest. - // This label allows to easily identify all the components belonging to a provider; the clusterctl - // tool uses this label for implementing provider's lifecycle operations. - ProviderLabelName = "cluster.x-k8s.io/provider" - - // PausedAnnotation is an annotation that can be applied to any Cluster API - // object to prevent a controller from processing a resource. - // - // Controllers working with Cluster API objects must check the existence of this annotation - // on the reconciled object. - PausedAnnotation = "cluster.x-k8s.io/paused" - - // 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 = "cluster.x-k8s.io/cloned-from-name" - - // 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 = "cluster.x-k8s.io/cloned-from-groupkind" - - // ClusterSecretType defines the type of secret created by core components - ClusterSecretType corev1.SecretType = "cluster.x-k8s.io/secret" //nolint:gosec -) - -// MachineAddressType describes a valid MachineAddress type. -type MachineAddressType string - -const ( - MachineHostName MachineAddressType = "Hostname" - MachineExternalIP MachineAddressType = "ExternalIP" - MachineInternalIP MachineAddressType = "InternalIP" - MachineExternalDNS MachineAddressType = "ExternalDNS" - MachineInternalDNS MachineAddressType = "InternalDNS" - - // MachineNodeNameIndex is used by the Machine Controller to index Machines by Node name, and add a watch on Nodes. - MachineNodeNameIndex = "status.nodeRef.name" -) - -// MachineAddress contains information for the node's address. -type MachineAddress struct { - // Machine address type, one of Hostname, ExternalIP or InternalIP. - Type MachineAddressType `json:"type"` - - // The machine address. - Address string `json:"address"` -} - -// MachineAddresses is a slice of MachineAddress items to be used by infrastructure providers. -type MachineAddresses []MachineAddress - -// 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. -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"` -} diff --git a/thirdparty/clusterapi/api/v1alpha3/condition_consts.go b/thirdparty/clusterapi/api/v1alpha3/condition_consts.go deleted file mode 100644 index 8122516eb3a..00000000000 --- a/thirdparty/clusterapi/api/v1alpha3/condition_consts.go +++ /dev/null @@ -1,179 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -// ANCHOR: CommonConditions - -// Common ConditionTypes used by Cluster API objects. -const ( - // ReadyCondition defines the Ready condition type that summarizes the operational state of a Cluster API object. - ReadyCondition ConditionType = "Ready" -) - -// Common ConditionReason used by Cluster API objects. -const ( - // DeletingReason (Severity=Info) documents an condition not in Status=True because the underlying object it is currently being deleted. - DeletingReason = "Deleting" - - // DeletionFailedReason (Severity=Warning) documents an condition not in Status=True because the underlying object - // encountered problems during deletion. This is a warning because the reconciler will retry deletion. - DeletionFailedReason = "DeletionFailed" - - // DeletedReason (Severity=Info) documents an condition not in Status=True because the underlying object was deleted. - DeletedReason = "Deleted" -) - -const ( - // InfrastructureReadyCondition reports a summary of current status of the infrastructure object defined for this cluster/machine/machinepool. - // This condition is mirrored from the Ready condition in the infrastructure ref object, and - // the absence of this condition might signal problems in the reconcile external loops or the fact that - // the infrastructure provider does not implement the Ready condition yet. - InfrastructureReadyCondition ConditionType = "InfrastructureReady" - - // WaitingForInfrastructureFallbackReason (Severity=Info) documents a cluster/machine/machinepool waiting for the underlying infrastructure - // to be available. - // NOTE: This reason is used only as a fallback when the infrastructure object is not reporting its own ready condition. - WaitingForInfrastructureFallbackReason = "WaitingForInfrastructure" -) - -// ANCHOR_END: CommonConditions - -// Conditions and condition Reasons for the Cluster object - -const ( - // ControlPlaneReady reports the ready condition from the control plane object defined for this cluster. - // This condition is mirrored from the Ready condition in the control plane ref object, and - // the absence of this condition might signal problems in the reconcile external loops or the fact that - // the control plane provider does not not implements the Ready condition yet. - ControlPlaneReadyCondition ConditionType = "ControlPlaneReady" - - // WaitingForControlPlaneFallbackReason (Severity=Info) documents a cluster waiting for the control plane - // to be available. - // NOTE: This reason is used only as a fallback when the control plane object is not reporting its own ready condition. - WaitingForControlPlaneFallbackReason = "WaitingForControlPlane" -) - -// Conditions and condition Reasons for the Machine object - -const ( - // BootstrapReadyCondition reports a summary of current status of the bootstrap object defined for this machine. - // This condition is mirrored from the Ready condition in the bootstrap ref object, and - // the absence of this condition might signal problems in the reconcile external loops or the fact that - // the bootstrap provider does not implement the Ready condition yet. - BootstrapReadyCondition ConditionType = "BootstrapReady" - - // WaitingForDataSecretFallbackReason (Severity=Info) documents a machine waiting for the bootstrap data secret - // to be available. - // NOTE: This reason is used only as a fallback when the bootstrap object is not reporting its own ready condition. - WaitingForDataSecretFallbackReason = "WaitingForDataSecret" - - // DrainingSucceededCondition provide evidence of the status of the node drain operation which happens during the machine - // deletion process. - DrainingSucceededCondition ConditionType = "DrainingSucceeded" - - // DrainingReason (Severity=Info) documents a machine node being drained. - DrainingReason = "Draining" - - // DrainingFailedReason (Severity=Warning) documents a machine node drain operation failed. - DrainingFailedReason = "DrainingFailed" - - // PreDrainDeleteHookSucceededCondition reports a machine waiting for a PreDrainDeleteHook before being delete. - PreDrainDeleteHookSucceededCondition ConditionType = "PreDrainDeleteHookSucceeded" - - // PreTerminateDeleteHookSucceededCondition reports a machine waiting for a PreDrainDeleteHook before being delete. - PreTerminateDeleteHookSucceededCondition ConditionType = "PreTerminateDeleteHookSucceeded" - - // WaitingExternalHookReason (Severity=Info) provide evidence that we are waiting for an external hook to complete. - WaitingExternalHookReason = "WaitingExternalHook" -) - -const ( - // MachineHealthCheckSuccededCondition is set on machines that have passed a healthcheck by the MachineHealthCheck controller. - // In the event that the health check fails it will be set to False. - MachineHealthCheckSuccededCondition ConditionType = "HealthCheckSucceeded" - - // MachineHasFailureReason is the reason used when a machine has either a FailureReason or a FailureMessage set on its status. - MachineHasFailureReason = "MachineHasFailure" - - // NodeStartupTimeoutReason is the reason used when a machine's node does not appear within the specified timeout. - NodeStartupTimeoutReason = "NodeStartupTimeout" - - // UnhealthyNodeConditionReason is the reason used when a machine's node has one of the MachineHealthCheck's unhealthy conditions. - UnhealthyNodeConditionReason = "UnhealthyNode" -) - -const ( - // MachineOwnerRemediatedCondition is set on machines that have failed a healthcheck by the MachineHealthCheck controller. - // MachineOwnerRemediatedCondition is set to False after a health check fails, but should be changed to True by the owning controller after remediation succeeds. - MachineOwnerRemediatedCondition ConditionType = "OwnerRemediated" - - // WaitingForRemediationReason is the reason used when a machine fails a health check and remediation is needed. - WaitingForRemediationReason = "WaitingForRemediation" - - // RemediationFailedReason is the reason used when a remediation owner fails to remediate an unhealthy machine. - RemediationFailedReason = "RemediationFailed" - - // RemediationInProgressReason is the reason used when an unhealthy machine is being remediated by the remediation owner. - RemediationInProgressReason = "RemediationInProgress" - - // 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 Machine's Node object -const ( - // MachineNodeHealthyCondition provides info about the operational state of the Kubernetes node hosted on the machine by summarizing node conditions. - // If the conditions defined in a Kubernetes node (i.e., NodeReady, NodeMemoryPressure, NodeDiskPressure, NodePIDPressure, and NodeNetworkUnavailable) are in a healthy state, it will be set to True. - MachineNodeHealthyCondition ConditionType = "NodeHealthy" - - // WaitingForNodeRefReason (Severity=Info) documents a machine.spec.providerId is not assigned yet. - WaitingForNodeRefReason = "WaitingForNodeRef" - - // NodeProvisioningReason (Severity=Info) documents machine in the process of provisioning a node. - // NB. provisioning --> NodeRef == "" - NodeProvisioningReason = "NodeProvisioning" - - // NodeNotFoundReason (Severity=Error) documents a machine's node has previously been observed but is now gone. - // NB. provisioned --> NodeRef != "" - NodeNotFoundReason = "NodeNotFound" - - // NodeConditionsFailedReason (Severity=Warning) documents a node is not in a healthy state due to the failed state of at least 1 Kubelet condition. - NodeConditionsFailedReason = "NodeConditionsFailed" -) - -// Conditions and condition Reasons for the MachineHealthCheck object - -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" -) diff --git a/thirdparty/clusterapi/api/v1alpha3/condition_types.go b/thirdparty/clusterapi/api/v1alpha3/condition_types.go deleted file mode 100644 index 51a67f6edff..00000000000 --- a/thirdparty/clusterapi/api/v1alpha3/condition_types.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// ANCHOR: ConditionSeverity - -// ConditionSeverity expresses the severity of a Condition Type failing. -type ConditionSeverity string - -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 = "" -) - -// ANCHOR_END: ConditionSeverity - -// ANCHOR: ConditionType - -// ConditionType is a valid value for Condition.Type. -type ConditionType string - -// ANCHOR_END: ConditionType - -// ANCHOR: Condition - -// Condition defines an observation of a Cluster API resource operational state. -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"` -} - -// ANCHOR_END: Condition - -// ANCHOR: Conditions - -// Conditions provide observations of the operational state of a Cluster API resource. -type Conditions []Condition - -// ANCHOR_END: Conditions diff --git a/thirdparty/clusterapi/api/v1alpha3/groupversion_info.go b/thirdparty/clusterapi/api/v1alpha3/groupversion_info.go deleted file mode 100644 index a4cc23271a7..00000000000 --- a/thirdparty/clusterapi/api/v1alpha3/groupversion_info.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha3 contains API Schema definitions for the cluster v1alpha3 API group -// +kubebuilder:object:generate=true -// +groupName=cluster.x-k8s.io -package v1alpha3 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "cluster.x-k8s.io", Version: "v1alpha3"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme - - localSchemeBuilder = SchemeBuilder.SchemeBuilder -) diff --git a/thirdparty/clusterapi/api/v1alpha3/machine_phase_types.go b/thirdparty/clusterapi/api/v1alpha3/machine_phase_types.go deleted file mode 100644 index 6614436d153..00000000000 --- a/thirdparty/clusterapi/api/v1alpha3/machine_phase_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -// MachinePhase is a string representation of a Machine Phase. -// -// This type is a high-level indicator of the status of the Machine as it is provisioned, -// from the API user’s perspective. -// -// The value should not be interpreted by any software components as a reliable indication -// of the actual state of the Machine, and controllers should not use the Machine Phase field -// value when making decisions about what action to take. -// -// Controllers should always look at the actual state of the Machine’s fields to make those decisions. -type MachinePhase string - -const ( - // MachinePhasePending is the first state a Machine is assigned by - // Cluster API Machine controller after being created. - MachinePhasePending = MachinePhase("Pending") - - // MachinePhaseProvisioning is the state when the - // Machine infrastructure is being created. - MachinePhaseProvisioning = MachinePhase("Provisioning") - - // MachinePhaseProvisioned is the state when its - // infrastructure has been created and configured. - MachinePhaseProvisioned = MachinePhase("Provisioned") - - // MachinePhaseRunning is the Machine state when it has - // become a Kubernetes Node in a Ready state. - MachinePhaseRunning = MachinePhase("Running") - - // MachinePhaseDeleting is the Machine state when a delete - // request has been sent to the API Server, - // but its infrastructure has not yet been fully deleted. - MachinePhaseDeleting = MachinePhase("Deleting") - - // MachinePhaseDeleted is the Machine state when the object - // and the related infrastructure is deleted and - // ready to be garbage collected by the API Server. - MachinePhaseDeleted = MachinePhase("Deleted") - - // MachinePhaseFailed is the Machine state when the system - // might require user intervention. - MachinePhaseFailed = MachinePhase("Failed") - - // MachinePhaseUnknown is returned if the Machine state cannot be determined. - MachinePhaseUnknown = MachinePhase("Unknown") -) diff --git a/thirdparty/clusterapi/api/v1alpha3/machine_types.go b/thirdparty/clusterapi/api/v1alpha3/machine_types.go deleted file mode 100644 index 6215c82f6ab..00000000000 --- a/thirdparty/clusterapi/api/v1alpha3/machine_types.go +++ /dev/null @@ -1,276 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - capierrors "github.com/openshift/hypershift/thirdparty/clusterapi/errors" -) - -const ( - // MachineFinalizer is set on PrepareForCreate callback. - MachineFinalizer = "machine.cluster.x-k8s.io" - - // MachineControlPlaneLabelName is the label set on machines or related objects that are part of a control plane. - MachineControlPlaneLabelName = "cluster.x-k8s.io/control-plane" - - // ExcludeNodeDrainingAnnotation annotation explicitly skips node draining if set - ExcludeNodeDrainingAnnotation = "machine.cluster.x-k8s.io/exclude-node-draining" - - // MachineSetLabelName is the label set on machines if they're controlled by MachineSet - MachineSetLabelName = "cluster.x-k8s.io/set-name" - - // MachineDeploymentLabelName is the label set on machines if they're controlled by MachineDeployment - MachineDeploymentLabelName = "cluster.x-k8s.io/deployment-name" - - // PreDrainDeleteHookAnnotationPrefix annotation specifies the prefix we - // search each annotation for during the pre-drain.delete lifecycle hook - // to pause reconciliation of deletion. These hooks will prevent removal of - // draining the associated node until all are removed. - PreDrainDeleteHookAnnotationPrefix = "pre-drain.delete.hook.machine.cluster.x-k8s.io" - - // PreTerminateDeleteHookAnnotationPrefix annotation specifies the prefix we - // search each annotation for during the pre-terminate.delete lifecycle hook - // to pause reconciliation of deletion. These hooks will prevent removal of - // an instance from an infrastructure provider until all are removed. - PreTerminateDeleteHookAnnotationPrefix = "pre-terminate.delete.hook.machine.cluster.x-k8s.io" -) - -// ANCHOR: MachineSpec - -// MachineSpec defines the desired state of Machine -type MachineSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // Bootstrap is a reference to a local struct which encapsulates - // fields to configure the Machine’s bootstrapping mechanism. - Bootstrap Bootstrap `json:"bootstrap"` - - // InfrastructureRef is a required reference to a custom resource - // offered by an infrastructure provider. - InfrastructureRef corev1.ObjectReference `json:"infrastructureRef"` - - // Version defines the desired Kubernetes version. - // This field is meant to be optionally used by bootstrap providers. - // +optional - Version *string `json:"version,omitempty"` - - // 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"` - - // FailureDomain is the failure domain the machine will be created in. - // Must match a key in the FailureDomains map stored on the cluster object. - // +optional - FailureDomain *string `json:"failureDomain,omitempty"` - - // 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` - // +optional - NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"` -} - -// ANCHOR_END: MachineSpec - -// ANCHOR: MachineStatus - -// MachineStatus defines the observed state of Machine -type MachineStatus struct { - // NodeRef will point to the corresponding Node if it exists. - // +optional - NodeRef *corev1.ObjectReference `json:"nodeRef,omitempty"` - - // LastUpdated identifies when the phase of the Machine last transitioned. - // +optional - LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` - - // Version specifies the current version of Kubernetes running - // on the corresponding Node. This is meant to be a means of bubbling - // up status from the Node to the Machine. - // It is entirely optional, but useful for end-user UX if it’s present. - // +optional - Version *string `json:"version,omitempty"` - - // FailureReason 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 - FailureReason *capierrors.MachineStatusError `json:"failureReason,omitempty"` - - // FailureMessage 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 - FailureMessage *string `json:"failureMessage,omitempty"` - - // Addresses is a list of addresses assigned to the machine. - // This field is copied from the infrastructure provider reference. - // +optional - Addresses MachineAddresses `json:"addresses,omitempty"` - - // Phase represents the current phase of machine actuation. - // E.g. Pending, Running, Terminating, Failed etc. - // +optional - Phase string `json:"phase,omitempty"` - - // BootstrapReady is the state of the bootstrap provider. - // +optional - BootstrapReady bool `json:"bootstrapReady"` - - // InfrastructureReady is the state of the infrastructure provider. - // +optional - InfrastructureReady bool `json:"infrastructureReady"` - - // ObservedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Conditions defines current service state of the Machine. - // +optional - Conditions Conditions `json:"conditions,omitempty"` -} - -// ANCHOR_END: MachineStatus - -// SetTypedPhase sets the Phase field to the string representation of MachinePhase. -func (m *MachineStatus) SetTypedPhase(p MachinePhase) { - m.Phase = string(p) -} - -// GetTypedPhase attempts to parse the Phase field and return -// the typed MachinePhase representation as described in `machine_phase_types.go`. -func (m *MachineStatus) GetTypedPhase() MachinePhase { - switch phase := MachinePhase(m.Phase); phase { - case - MachinePhasePending, - MachinePhaseProvisioning, - MachinePhaseProvisioned, - MachinePhaseRunning, - MachinePhaseDeleting, - MachinePhaseDeleted, - MachinePhaseFailed: - return phase - default: - return MachinePhaseUnknown - } -} - -// ANCHOR: Bootstrap - -// Bootstrap capsulates fields to configure the Machine’s bootstrapping mechanism. -type Bootstrap struct { - // 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.Data without - // the need of a controller. - // +optional - ConfigRef *corev1.ObjectReference `json:"configRef,omitempty"` - - // Data contains the bootstrap data, such as cloud-init details scripts. - // If nil, the Machine should remain in the Pending state. - // - // Deprecated: This field has been deprecated in v1alpha3 and - // will be removed in a future version. Switch to DataSecretName. - // - // +optional - Data *string `json:"data,omitempty"` - - // DataSecretName is the name of the secret that stores the bootstrap data script. - // If nil, the Machine should remain in the Pending state. - // +optional - DataSecretName *string `json:"dataSecretName,omitempty"` -} - -// ANCHOR_END: Bootstrap - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=machines,shortName=ma,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID" -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Machine status such as Terminating/Pending/Running/Failed etc" -// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version",description="Kubernetes version associated with this Machine" -// +kubebuilder:printcolumn:name="NodeName",type="string",JSONPath=".status.nodeRef.name",description="Node name associated with this machine",priority=1 - -// Machine is the Schema for the machines API -type Machine struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MachineSpec `json:"spec,omitempty"` - Status MachineStatus `json:"status,omitempty"` -} - -func (m *Machine) GetConditions() Conditions { - return m.Status.Conditions -} - -func (m *Machine) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// MachineList contains a list of Machine -type MachineList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Machine `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Machine{}, &MachineList{}) -} diff --git a/thirdparty/clusterapi/api/v1alpha3/machinedeployment_types.go b/thirdparty/clusterapi/api/v1alpha3/machinedeployment_types.go deleted file mode 100644 index 959c1c79432..00000000000 --- a/thirdparty/clusterapi/api/v1alpha3/machinedeployment_types.go +++ /dev/null @@ -1,272 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" -) - -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" - - // RevisionAnnotation is the revision annotation of a machine deployment's machine sets which records its rollout sequence - RevisionAnnotation = "machinedeployment.clusters.x-k8s.io/revision" - // RevisionHistoryAnnotation maintains the history of all old revisions that a machine set has served for a machine deployment. - RevisionHistoryAnnotation = "machinedeployment.clusters.x-k8s.io/revision-history" - // DesiredReplicasAnnotation is the desired replicas for a machine deployment recorded as an annotation - // in its machine sets. Helps in separating scaling events from the rollout process and for - // determining if the new machine set for a deployment is really saturated. - DesiredReplicasAnnotation = "machinedeployment.clusters.x-k8s.io/desired-replicas" - // MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which - // is machinedeployment.spec.replicas + maxSurge. Used by the underlying machine sets to estimate their - // proportions in case the deployment has surge replicas. - MaxReplicasAnnotation = "machinedeployment.clusters.x-k8s.io/max-replicas" -) - -// ANCHOR: MachineDeploymentSpec - -// MachineDeploymentSpec defines the desired state of MachineDeployment -type MachineDeploymentSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // Number of desired machines. Defaults to 1. - // This is a pointer to distinguish between explicit zero and not specified. - Replicas *int32 `json:"replicas,omitempty"` - - // Label selector for machines. Existing MachineSets whose machines are - // selected by this will be the ones affected by this deployment. - // It must match the machine template's labels. - Selector metav1.LabelSelector `json:"selector"` - - // Template describes the machines that will be created. - Template MachineTemplateSpec `json:"template"` - - // The deployment strategy to use to replace existing machines with - // new ones. - // +optional - Strategy *MachineDeploymentStrategy `json:"strategy,omitempty"` - - // 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"` - - // The number of old MachineSets to retain to allow rollback. - // This is a pointer to distinguish between explicit zero and not specified. - // Defaults to 1. - // +optional - RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` - - // Indicates that the deployment is paused. - // +optional - Paused bool `json:"paused,omitempty"` - - // The maximum time in seconds for a deployment to make progress before it - // is considered to be failed. The deployment controller will continue to - // process failed deployments and a condition with a ProgressDeadlineExceeded - // reason will be surfaced in the deployment status. Note that progress will - // not be estimated during the time a deployment is paused. Defaults to 600s. - ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` -} - -// ANCHOR_END: MachineDeploymentSpec - -// ANCHOR: MachineDeploymentStrategy - -// MachineDeploymentStrategy describes how to replace existing machines -// with new ones. -type MachineDeploymentStrategy struct { - // Type of deployment. Currently the only supported strategy is - // "RollingUpdate". - // Default is RollingUpdate. - // +optional - Type MachineDeploymentStrategyType `json:"type,omitempty"` - - // Rolling update config params. Present only if - // MachineDeploymentStrategyType = RollingUpdate. - // +optional - RollingUpdate *MachineRollingUpdateDeployment `json:"rollingUpdate,omitempty"` -} - -// ANCHOR_END: MachineDeploymentStrategy - -// ANCHOR: MachineRollingUpdateDeployment - -// MachineRollingUpdateDeployment is used to control the desired behavior of rolling update. -type MachineRollingUpdateDeployment struct { - // The maximum number of machines that can be unavailable during the update. - // Value can be an absolute number (ex: 5) or a percentage of desired - // machines (ex: 10%). - // Absolute number is calculated from percentage by rounding down. - // This can not be 0 if MaxSurge is 0. - // Defaults to 0. - // Example: when this is set to 30%, the old MachineSet can be scaled - // down to 70% of desired machines immediately when the rolling update - // starts. Once new machines are ready, old MachineSet can be scaled - // down further, followed by scaling up the new MachineSet, ensuring - // that the total number of machines available at all times - // during the update is at least 70% of desired machines. - // +optional - MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` - - // The maximum number of machines that can be scheduled above the - // desired number of machines. - // Value can be an absolute number (ex: 5) or a percentage of - // desired machines (ex: 10%). - // This can not be 0 if MaxUnavailable is 0. - // Absolute number is calculated from percentage by rounding up. - // Defaults to 1. - // Example: when this is set to 30%, the new MachineSet can be scaled - // up immediately when the rolling update starts, such that the total - // number of old and new machines do not exceed 130% of desired - // machines. Once old machines have been killed, new MachineSet can - // be scaled up further, ensuring that total number of machines running - // at any time during the update is at most 130% of desired machines. - // +optional - MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` -} - -// ANCHOR_END: MachineRollingUpdateDeployment - -// ANCHOR: MachineDeploymentStatus - -// MachineDeploymentStatus defines the observed state of MachineDeployment -type MachineDeploymentStatus struct { - // The generation observed by the deployment controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Selector is the same as the label selector but in the string format to avoid introspection - // by clients. The string will be in the same format as the query-param syntax. - // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors - // +optional - Selector string `json:"selector,omitempty"` - - // Total number of non-terminated machines targeted by this deployment - // (their labels match the selector). - // +optional - Replicas int32 `json:"replicas,omitempty"` - - // Total number of non-terminated machines targeted by this deployment - // that have the desired template spec. - // +optional - UpdatedReplicas int32 `json:"updatedReplicas,omitempty"` - - // Total number of ready machines targeted by this deployment. - // +optional - ReadyReplicas int32 `json:"readyReplicas,omitempty"` - - // Total number of available machines (ready for at least minReadySeconds) - // targeted by this deployment. - // +optional - AvailableReplicas int32 `json:"availableReplicas,omitempty"` - - // Total number of unavailable machines targeted by this deployment. - // This is the total number of machines that are still required for - // the deployment to have 100% available capacity. They may either - // be machines that are running but not yet available or machines - // that still have not been created. - // +optional - UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"` - - // Phase represents the current phase of a MachineDeployment (ScalingUp, ScalingDown, Running, Failed, or Unknown). - // +optional - Phase string `json:"phase,omitempty"` -} - -// ANCHOR_END: MachineDeploymentStatus - -// MachineDeploymentPhase indicates the progress of the machine deployment -type MachineDeploymentPhase string - -const ( - // MachineDeploymentPhaseScalingUp indicates the MachineDeployment is scaling up. - MachineDeploymentPhaseScalingUp = MachineDeploymentPhase("ScalingUp") - - // MachineDeploymentPhaseScalingDown indicates the MachineDeployment is scaling down. - MachineDeploymentPhaseScalingDown = MachineDeploymentPhase("ScalingDown") - - // MachineDeploymentPhaseRunning indicates scaling has completed and all Machines are running. - MachineDeploymentPhaseRunning = MachineDeploymentPhase("Running") - - // MachineDeploymentPhaseFailed indicates there was a problem scaling and user intervention might be required. - MachineDeploymentPhaseFailed = MachineDeploymentPhase("Failed") - - // MachineDeploymentPhaseUnknown indicates the state of the MachineDeployment cannot be determined. - MachineDeploymentPhaseUnknown = MachineDeploymentPhase("Unknown") -) - -// SetTypedPhase sets the Phase field to the string representation of MachineDeploymentPhase. -func (md *MachineDeploymentStatus) SetTypedPhase(p MachineDeploymentPhase) { - md.Phase = string(p) -} - -// GetTypedPhase attempts to parse the Phase field and return -// the typed MachineDeploymentPhase representation. -func (md *MachineDeploymentStatus) GetTypedPhase() MachineDeploymentPhase { - switch phase := MachineDeploymentPhase(md.Phase); phase { - case - MachineDeploymentPhaseScalingDown, - MachineDeploymentPhaseScalingUp, - MachineDeploymentPhaseRunning, - MachineDeploymentPhaseFailed: - return phase - default: - return MachineDeploymentPhaseUnknown - } -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=machinedeployments,shortName=md,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="MachineDeployment status such as ScalingUp/ScalingDown/Running/Failed/Unknown" -// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this MachineDeployment" -// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Total number of ready machines targeted by this MachineDeployment" -// +kubebuilder:printcolumn:name="Updated",type=integer,JSONPath=".status.updatedReplicas",description="Total number of non-terminated machines targeted by this deployment that have the desired template spec" -// +kubebuilder:printcolumn:name="Unavailable",type=integer,JSONPath=".status.unavailableReplicas",description="Total number of unavailable machines targeted by this MachineDeployment" - -// MachineDeployment is the Schema for the machinedeployments API -type MachineDeployment struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MachineDeploymentSpec `json:"spec,omitempty"` - Status MachineDeploymentStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// MachineDeploymentList contains a list of MachineDeployment -type MachineDeploymentList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MachineDeployment `json:"items"` -} - -func init() { - SchemeBuilder.Register(&MachineDeployment{}, &MachineDeploymentList{}) -} diff --git a/thirdparty/clusterapi/api/v1alpha3/machinehealthcheck_types.go b/thirdparty/clusterapi/api/v1alpha3/machinehealthcheck_types.go deleted file mode 100644 index 32850ce3801..00000000000 --- a/thirdparty/clusterapi/api/v1alpha3/machinehealthcheck_types.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" -) - -// ANCHOR: MachineHealthCheckSpec - -// MachineHealthCheckSpec defines the desired state of MachineHealthCheck -type MachineHealthCheckSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // Label selector to match machines whose health will be exercised - 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 further remediation is only allowed if at most "MaxUnhealthy" machines selected by - // "selector" are not healthy. - // +optional - MaxUnhealthy *intstr.IntOrString `json:"maxUnhealthy,omitempty"` - - // Machines older than this duration without a node will be considered to have - // failed and will be remediated. - // +optional - 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 Cluster API. - // +optional - RemediationTemplate *corev1.ObjectReference `json:"remediationTemplate,omitempty"` -} - -// ANCHOR_END: MachineHealthCHeckSpec - -// ANCHOR: UnhealthyCondition - -// 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. -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"` - - Timeout metav1.Duration `json:"timeout"` -} - -// ANCHOR_END: UnhealthyCondition - -// ANCHOR: MachineHealthCheckStatus - -// MachineHealthCheckStatus defines the observed state of MachineHealthCheck -type MachineHealthCheckStatus struct { - // total number of machines counted by this machine health check - // +kubebuilder:validation:Minimum=0 - ExpectedMachines int32 `json:"expectedMachines,omitempty"` - - // total number of healthy machines counted by this machine health check - // +kubebuilder:validation:Minimum=0 - CurrentHealthy int32 `json:"currentHealthy,omitempty"` - - // RemediationsAllowed is the number of further remediations allowed by this machine health check before - // maxUnhealthy short circuiting will be applied - // +kubebuilder:validation:Minimum=0 - RemediationsAllowed int32 `json:"remediationsAllowed,omitempty"` - - // ObservedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Targets shows the current list of machines the machine health check is watching - // +optional - Targets []string `json:"targets,omitempty"` - - // Conditions defines current service state of the MachineHealthCheck. - // +optional - Conditions Conditions `json:"conditions,omitempty"` -} - -// ANCHOR_END: MachineHealthCheckStatus - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=machinehealthchecks,shortName=mhc;mhcs,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +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" - -// MachineHealthCheck is the Schema for the machinehealthchecks API -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"` -} - -func (m *MachineHealthCheck) GetConditions() Conditions { - return m.Status.Conditions -} - -func (m *MachineHealthCheck) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// MachineHealthCheckList contains a list of MachineHealthCheck -type MachineHealthCheckList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MachineHealthCheck `json:"items"` -} - -func init() { - SchemeBuilder.Register(&MachineHealthCheck{}, &MachineHealthCheckList{}) -} diff --git a/thirdparty/clusterapi/api/v1alpha3/machineset_types.go b/thirdparty/clusterapi/api/v1alpha3/machineset_types.go deleted file mode 100644 index e7ad2b277a4..00000000000 --- a/thirdparty/clusterapi/api/v1alpha3/machineset_types.go +++ /dev/null @@ -1,215 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/util/validation/field" - - capierrors "github.com/openshift/hypershift/thirdparty/clusterapi/errors" -) - -// ANCHOR: MachineSetSpec - -// MachineSetSpec defines the desired state of MachineSet -type MachineSetSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // Replicas is the number of desired replicas. - // This is a pointer to distinguish between explicit zero and unspecified. - // Defaults to 1. - // +optional - 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. - // Object references to custom resources resources are treated as templates. - // +optional - Template MachineTemplateSpec `json:"template,omitempty"` -} - -// ANCHOR_END: MachineSetSpec - -// ANCHOR: MachineTemplateSpec - -// MachineTemplateSpec describes the data needed to create a Machine from a template -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"` -} - -// ANCHOR_END: MachineTemplateSpec - -// MachineSetDeletePolicy defines how priority is assigned to nodes to delete when -// downscaling a MachineSet. Defaults to "Random". -type MachineSetDeletePolicy string - -const ( - // RandomMachineSetDeletePolicy prioritizes both Machines that have the annotation - // "cluster.x-k8s.io/delete-machine=yes" and Machines that are unhealthy - // (Status.FailureReason or Status.FailureMessage 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.x-k8s.io/delete-machine=yes" and Machines that are unhealthy - // (Status.FailureReason or Status.FailureMessage 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.x-k8s.io/delete-machine=yes" and Machines that are unhealthy - // (Status.FailureReason or Status.FailureMessage are set to a non-empty value). - // It then prioritizes the oldest Machines for deletion based on the Machine's CreationTimestamp. - OldestMachineSetDeletePolicy MachineSetDeletePolicy = "Oldest" -) - -// ANCHOR: MachineSetStatus - -// MachineSetStatus defines the observed state of MachineSet -type MachineSetStatus struct { - // Selector is the same as the label selector but in the string format to avoid introspection - // by clients. The string will be in the same format as the query-param syntax. - // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors - // +optional - Selector string `json:"selector,omitempty"` - - // Replicas is the most recently observed number of replicas. - // +optional - Replicas int32 `json:"replicas,omitempty"` - - // 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 FailureReason and FailureMessage will be set. FailureReason - // will be populated with a succinct value suitable for machine - // interpretation, while FailureMessage 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 - FailureReason *capierrors.MachineSetStatusError `json:"failureReason,omitempty"` - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` -} - -// ANCHOR_END: MachineSetStatus - -// Validate validates the MachineSet fields. -func (m *MachineSet) Validate() field.ErrorList { - errors := field.ErrorList{} - - // validate spec.selector and spec.template.labels - fldPath := field.NewPath("spec") - errors = append(errors, metav1validation.ValidateLabelSelector(&m.Spec.Selector, fldPath.Child("selector"))...) - if len(m.Spec.Selector.MatchLabels)+len(m.Spec.Selector.MatchExpressions) == 0 { - errors = append(errors, field.Invalid(fldPath.Child("selector"), m.Spec.Selector, "empty selector is not valid for MachineSet.")) - } - selector, err := metav1.LabelSelectorAsSelector(&m.Spec.Selector) - if err != nil { - errors = append(errors, field.Invalid(fldPath.Child("selector"), m.Spec.Selector, "invalid label selector.")) - } else { - labels := labels.Set(m.Spec.Template.Labels) - if !selector.Matches(labels) { - errors = append(errors, field.Invalid(fldPath.Child("template", "metadata", "labels"), m.Spec.Template.Labels, "`selector` does not match template `labels`")) - } - } - - return errors -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=machinesets,shortName=ms,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector -// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this machineset" -// +kubebuilder:printcolumn:name="Available",type="integer",JSONPath=".status.availableReplicas",description="Total number of available machines (ready for at least minReadySeconds)" -// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Total number of ready machines targeted by this machineset." - -// MachineSet is the Schema for the machinesets API -type MachineSet struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MachineSetSpec `json:"spec,omitempty"` - Status MachineSetStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// MachineSetList contains a list of MachineSet -type MachineSetList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MachineSet `json:"items"` -} - -func init() { - SchemeBuilder.Register(&MachineSet{}, &MachineSetList{}) -} diff --git a/thirdparty/clusterapi/api/v1alpha3/zz_generated.deepcopy.go b/thirdparty/clusterapi/api/v1alpha3/zz_generated.deepcopy.go deleted file mode 100644 index e2f246c6321..00000000000 --- a/thirdparty/clusterapi/api/v1alpha3/zz_generated.deepcopy.go +++ /dev/null @@ -1,973 +0,0 @@ -// +build !ignore_autogenerated - -/* - - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/intstr" - - "github.com/openshift/hypershift/thirdparty/clusterapi/errors" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. -func (in *APIEndpoint) DeepCopy() *APIEndpoint { - if in == nil { - return nil - } - out := new(APIEndpoint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Bootstrap) DeepCopyInto(out *Bootstrap) { - *out = *in - if in.ConfigRef != nil { - in, out := &in.ConfigRef, &out.ConfigRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.Data != nil { - in, out := &in.Data, &out.Data - *out = new(string) - **out = **in - } - if in.DataSecretName != nil { - in, out := &in.DataSecretName, &out.DataSecretName - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bootstrap. -func (in *Bootstrap) DeepCopy() *Bootstrap { - if in == nil { - return nil - } - out := new(Bootstrap) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Cluster) DeepCopyInto(out *Cluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. -func (in *Cluster) DeepCopy() *Cluster { - if in == nil { - return nil - } - out := new(Cluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Cluster) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterList) DeepCopyInto(out *ClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. -func (in *ClusterList) DeepCopy() *ClusterList { - if in == nil { - return nil - } - out := new(ClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterNetwork) DeepCopyInto(out *ClusterNetwork) { - *out = *in - if in.APIServerPort != nil { - in, out := &in.APIServerPort, &out.APIServerPort - *out = new(int32) - **out = **in - } - if in.Services != nil { - in, out := &in.Services, &out.Services - *out = new(NetworkRanges) - (*in).DeepCopyInto(*out) - } - if in.Pods != nil { - in, out := &in.Pods, &out.Pods - *out = new(NetworkRanges) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterNetwork. -func (in *ClusterNetwork) DeepCopy() *ClusterNetwork { - if in == nil { - return nil - } - out := new(ClusterNetwork) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { - *out = *in - if in.ClusterNetwork != nil { - in, out := &in.ClusterNetwork, &out.ClusterNetwork - *out = new(ClusterNetwork) - (*in).DeepCopyInto(*out) - } - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.ControlPlaneRef != nil { - in, out := &in.ControlPlaneRef, &out.ControlPlaneRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.InfrastructureRef != nil { - in, out := &in.InfrastructureRef, &out.InfrastructureRef - *out = new(v1.ObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. -func (in *ClusterSpec) DeepCopy() *ClusterSpec { - if in == nil { - return nil - } - out := new(ClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { - *out = *in - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.ClusterStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. -func (in *ClusterStatus) DeepCopy() *ClusterStatus { - if in == nil { - return nil - } - out := new(ClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Condition) DeepCopyInto(out *Condition) { - *out = *in - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. -func (in *Condition) DeepCopy() *Condition { - if in == nil { - return nil - } - out := new(Condition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in Conditions) DeepCopyInto(out *Conditions) { - { - in := &in - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Conditions. -func (in Conditions) DeepCopy() Conditions { - if in == nil { - return nil - } - out := new(Conditions) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FailureDomainSpec) DeepCopyInto(out *FailureDomainSpec) { - *out = *in - if in.Attributes != nil { - in, out := &in.Attributes, &out.Attributes - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailureDomainSpec. -func (in *FailureDomainSpec) DeepCopy() *FailureDomainSpec { - if in == nil { - return nil - } - out := new(FailureDomainSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in FailureDomains) DeepCopyInto(out *FailureDomains) { - { - in := &in - *out = make(FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailureDomains. -func (in FailureDomains) DeepCopy() FailureDomains { - if in == nil { - return nil - } - out := new(FailureDomains) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Machine) DeepCopyInto(out *Machine) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine. -func (in *Machine) DeepCopy() *Machine { - if in == nil { - return nil - } - out := new(Machine) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Machine) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineAddress) DeepCopyInto(out *MachineAddress) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineAddress. -func (in *MachineAddress) DeepCopy() *MachineAddress { - if in == nil { - return nil - } - out := new(MachineAddress) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in MachineAddresses) DeepCopyInto(out *MachineAddresses) { - { - in := &in - *out = make(MachineAddresses, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineAddresses. -func (in MachineAddresses) DeepCopy() MachineAddresses { - if in == nil { - return nil - } - out := new(MachineAddresses) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeployment) DeepCopyInto(out *MachineDeployment) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeployment. -func (in *MachineDeployment) DeepCopy() *MachineDeployment { - if in == nil { - return nil - } - out := new(MachineDeployment) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineDeployment) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentList) DeepCopyInto(out *MachineDeploymentList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineDeployment, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentList. -func (in *MachineDeploymentList) DeepCopy() *MachineDeploymentList { - if in == nil { - return nil - } - out := new(MachineDeploymentList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineDeploymentList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentSpec) DeepCopyInto(out *MachineDeploymentSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - in.Selector.DeepCopyInto(&out.Selector) - in.Template.DeepCopyInto(&out.Template) - if in.Strategy != nil { - in, out := &in.Strategy, &out.Strategy - *out = new(MachineDeploymentStrategy) - (*in).DeepCopyInto(*out) - } - if in.MinReadySeconds != nil { - in, out := &in.MinReadySeconds, &out.MinReadySeconds - *out = new(int32) - **out = **in - } - if in.RevisionHistoryLimit != nil { - in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit - *out = new(int32) - **out = **in - } - if in.ProgressDeadlineSeconds != nil { - in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentSpec. -func (in *MachineDeploymentSpec) DeepCopy() *MachineDeploymentSpec { - if in == nil { - return nil - } - out := new(MachineDeploymentSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentStatus) DeepCopyInto(out *MachineDeploymentStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStatus. -func (in *MachineDeploymentStatus) DeepCopy() *MachineDeploymentStatus { - if in == nil { - return nil - } - out := new(MachineDeploymentStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentStrategy) DeepCopyInto(out *MachineDeploymentStrategy) { - *out = *in - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(MachineRollingUpdateDeployment) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStrategy. -func (in *MachineDeploymentStrategy) DeepCopy() *MachineDeploymentStrategy { - if in == nil { - return nil - } - out := new(MachineDeploymentStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineHealthCheck) DeepCopyInto(out *MachineHealthCheck) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheck. -func (in *MachineHealthCheck) DeepCopy() *MachineHealthCheck { - if in == nil { - return nil - } - out := new(MachineHealthCheck) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineHealthCheck) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineHealthCheckList) DeepCopyInto(out *MachineHealthCheckList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineHealthCheck, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckList. -func (in *MachineHealthCheckList) DeepCopy() *MachineHealthCheckList { - if in == nil { - return nil - } - out := new(MachineHealthCheckList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineHealthCheckList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineHealthCheckSpec) DeepCopyInto(out *MachineHealthCheckSpec) { - *out = *in - in.Selector.DeepCopyInto(&out.Selector) - if in.UnhealthyConditions != nil { - in, out := &in.UnhealthyConditions, &out.UnhealthyConditions - *out = make([]UnhealthyCondition, len(*in)) - copy(*out, *in) - } - if in.MaxUnhealthy != nil { - in, out := &in.MaxUnhealthy, &out.MaxUnhealthy - *out = new(intstr.IntOrString) - **out = **in - } - if in.NodeStartupTimeout != nil { - in, out := &in.NodeStartupTimeout, &out.NodeStartupTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.RemediationTemplate != nil { - in, out := &in.RemediationTemplate, &out.RemediationTemplate - *out = new(v1.ObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckSpec. -func (in *MachineHealthCheckSpec) DeepCopy() *MachineHealthCheckSpec { - if in == nil { - return nil - } - out := new(MachineHealthCheckSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineHealthCheckStatus) DeepCopyInto(out *MachineHealthCheckStatus) { - *out = *in - if in.Targets != nil { - in, out := &in.Targets, &out.Targets - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckStatus. -func (in *MachineHealthCheckStatus) DeepCopy() *MachineHealthCheckStatus { - if in == nil { - return nil - } - out := new(MachineHealthCheckStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineList) DeepCopyInto(out *MachineList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Machine, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineList. -func (in *MachineList) DeepCopy() *MachineList { - if in == nil { - return nil - } - out := new(MachineList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineRollingUpdateDeployment) DeepCopyInto(out *MachineRollingUpdateDeployment) { - *out = *in - if in.MaxUnavailable != nil { - in, out := &in.MaxUnavailable, &out.MaxUnavailable - *out = new(intstr.IntOrString) - **out = **in - } - if in.MaxSurge != nil { - in, out := &in.MaxSurge, &out.MaxSurge - *out = new(intstr.IntOrString) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineRollingUpdateDeployment. -func (in *MachineRollingUpdateDeployment) DeepCopy() *MachineRollingUpdateDeployment { - if in == nil { - return nil - } - out := new(MachineRollingUpdateDeployment) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSet) DeepCopyInto(out *MachineSet) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSet. -func (in *MachineSet) DeepCopy() *MachineSet { - if in == nil { - return nil - } - out := new(MachineSet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineSet) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSetList) DeepCopyInto(out *MachineSetList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineSet, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetList. -func (in *MachineSetList) DeepCopy() *MachineSetList { - if in == nil { - return nil - } - out := new(MachineSetList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineSetList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSetSpec) DeepCopyInto(out *MachineSetSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - in.Selector.DeepCopyInto(&out.Selector) - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetSpec. -func (in *MachineSetSpec) DeepCopy() *MachineSetSpec { - if in == nil { - return nil - } - out := new(MachineSetSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSetStatus) DeepCopyInto(out *MachineSetStatus) { - *out = *in - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.MachineSetStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetStatus. -func (in *MachineSetStatus) DeepCopy() *MachineSetStatus { - if in == nil { - return nil - } - out := new(MachineSetStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSpec) DeepCopyInto(out *MachineSpec) { - *out = *in - in.Bootstrap.DeepCopyInto(&out.Bootstrap) - out.InfrastructureRef = in.InfrastructureRef - if in.Version != nil { - in, out := &in.Version, &out.Version - *out = new(string) - **out = **in - } - if in.ProviderID != nil { - in, out := &in.ProviderID, &out.ProviderID - *out = new(string) - **out = **in - } - if in.FailureDomain != nil { - in, out := &in.FailureDomain, &out.FailureDomain - *out = new(string) - **out = **in - } - if in.NodeDrainTimeout != nil { - in, out := &in.NodeDrainTimeout, &out.NodeDrainTimeout - *out = new(metav1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpec. -func (in *MachineSpec) DeepCopy() *MachineSpec { - if in == nil { - return nil - } - out := new(MachineSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { - *out = *in - if in.NodeRef != nil { - in, out := &in.NodeRef, &out.NodeRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.LastUpdated != nil { - in, out := &in.LastUpdated, &out.LastUpdated - *out = (*in).DeepCopy() - } - if in.Version != nil { - in, out := &in.Version, &out.Version - *out = new(string) - **out = **in - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.MachineStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make(MachineAddresses, len(*in)) - copy(*out, *in) - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineStatus. -func (in *MachineStatus) DeepCopy() *MachineStatus { - if in == nil { - return nil - } - out := new(MachineStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineTemplateSpec) DeepCopyInto(out *MachineTemplateSpec) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineTemplateSpec. -func (in *MachineTemplateSpec) DeepCopy() *MachineTemplateSpec { - if in == nil { - return nil - } - out := new(MachineTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NetworkRanges) DeepCopyInto(out *NetworkRanges) { - *out = *in - if in.CIDRBlocks != nil { - in, out := &in.CIDRBlocks, &out.CIDRBlocks - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkRanges. -func (in *NetworkRanges) DeepCopy() *NetworkRanges { - if in == nil { - return nil - } - out := new(NetworkRanges) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta) { - *out = *in - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.OwnerReferences != nil { - in, out := &in.OwnerReferences, &out.OwnerReferences - *out = make([]metav1.OwnerReference, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMeta. -func (in *ObjectMeta) DeepCopy() *ObjectMeta { - if in == nil { - return nil - } - out := new(ObjectMeta) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UnhealthyCondition) DeepCopyInto(out *UnhealthyCondition) { - *out = *in - out.Timeout = in.Timeout -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnhealthyCondition. -func (in *UnhealthyCondition) DeepCopy() *UnhealthyCondition { - if in == nil { - return nil - } - out := new(UnhealthyCondition) - in.DeepCopyInto(out) - return out -} diff --git a/thirdparty/clusterapi/api/v1alpha4/cluster_types.go b/thirdparty/clusterapi/api/v1alpha4/cluster_types.go index 2ff30b379d6..afdf46f5d52 100644 --- a/thirdparty/clusterapi/api/v1alpha4/cluster_types.go +++ b/thirdparty/clusterapi/api/v1alpha4/cluster_types.go @@ -21,20 +21,22 @@ import ( "net" "strings" + capierrors "github.com/openshift/hypershift/thirdparty/clusterapi/errors" + "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - - capierrors "github.com/openshift/hypershift/thirdparty/clusterapi/errors" ) const ( + // ClusterFinalizer is the finalizer used by the cluster controller to + // cleanup the cluster resources when a Cluster is being deleted. ClusterFinalizer = "cluster.cluster.x-k8s.io" ) // ANCHOR: ClusterSpec -// ClusterSpec defines the desired state of Cluster +// ClusterSpec defines the desired state of Cluster. type ClusterSpec struct { // Paused can be used to prevent controllers from processing the Cluster and all its associated objects. // +optional @@ -87,6 +89,7 @@ type ClusterNetwork struct { // ANCHOR_END: ClusterNetwork // ANCHOR: NetworkRanges + // NetworkRanges represents ranges of network addresses. type NetworkRanges struct { CIDRBlocks []string `json:"cidrBlocks"` @@ -103,7 +106,7 @@ func (n *NetworkRanges) String() string { // ANCHOR: ClusterStatus -// ClusterStatus defines the observed state of Cluster +// ClusterStatus defines the observed state of Cluster. type ClusterStatus struct { // FailureDomains is a slice of failure domain objects synced from the infrastructure provider. FailureDomains FailureDomains `json:"failureDomains,omitempty"` @@ -128,10 +131,6 @@ type ClusterStatus struct { // +optional InfrastructureReady bool `json:"infrastructureReady"` - // ControlPlaneInitialized defines if the control plane has been initialized. - // +optional - ControlPlaneInitialized bool `json:"controlPlaneInitialized"` - // ControlPlaneReady defines if the control plane is ready. // +optional ControlPlaneReady bool `json:"controlPlaneReady,omitempty"` @@ -202,7 +201,7 @@ func (v APIEndpoint) String() string { // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Cluster status such as Pending/Provisioning/Provisioned/Deleting/Failed" -// Cluster is the Schema for the clusters API +// Cluster is the Schema for the clusters API. type Cluster struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -211,17 +210,103 @@ type Cluster struct { Status ClusterStatus `json:"status,omitempty"` } +// GetConditions returns the set of conditions for this object. func (c *Cluster) GetConditions() Conditions { return c.Status.Conditions } +// SetConditions sets the conditions on this object. func (c *Cluster) SetConditions(conditions Conditions) { c.Status.Conditions = conditions } +// GetIPFamily returns a ClusterIPFamily from the configuration provided. +func (c *Cluster) GetIPFamily() (ClusterIPFamily, error) { + var podCIDRs, serviceCIDRs []string + if c.Spec.ClusterNetwork != nil { + if c.Spec.ClusterNetwork.Pods != nil { + podCIDRs = c.Spec.ClusterNetwork.Pods.CIDRBlocks + } + if c.Spec.ClusterNetwork.Services != nil { + serviceCIDRs = c.Spec.ClusterNetwork.Services.CIDRBlocks + } + } + if len(podCIDRs) == 0 && len(serviceCIDRs) == 0 { + return IPv4IPFamily, nil + } + + podsIPFamily, err := ipFamilyForCIDRStrings(podCIDRs) + if err != nil { + return InvalidIPFamily, fmt.Errorf("pods: %s", err) + } + if len(serviceCIDRs) == 0 { + return podsIPFamily, nil + } + + servicesIPFamily, err := ipFamilyForCIDRStrings(serviceCIDRs) + if err != nil { + return InvalidIPFamily, fmt.Errorf("services: %s", err) + } + if len(podCIDRs) == 0 { + return servicesIPFamily, nil + } + + if podsIPFamily == DualStackIPFamily { + return DualStackIPFamily, nil + } else if podsIPFamily != servicesIPFamily { + return InvalidIPFamily, errors.New("pods and services IP family mismatch") + } + + return podsIPFamily, nil +} + +func ipFamilyForCIDRStrings(cidrs []string) (ClusterIPFamily, error) { + if len(cidrs) > 2 { + return InvalidIPFamily, errors.New("too many CIDRs specified") + } + var foundIPv4 bool + var foundIPv6 bool + for _, cidr := range cidrs { + ip, _, err := net.ParseCIDR(cidr) + if err != nil { + return InvalidIPFamily, fmt.Errorf("could not parse CIDR: %s", err) + } + if ip.To4() != nil { + foundIPv4 = true + } else { + foundIPv6 = true + } + } + switch { + case foundIPv4 && foundIPv6: + return DualStackIPFamily, nil + case foundIPv4: + return IPv4IPFamily, nil + case foundIPv6: + return IPv6IPFamily, nil + default: + return InvalidIPFamily, nil + } +} + +// ClusterIPFamily defines the types of supported IP families. +type ClusterIPFamily int + +// Define the ClusterIPFamily constants. +const ( + InvalidIPFamily ClusterIPFamily = iota + IPv4IPFamily + IPv6IPFamily + DualStackIPFamily +) + +func (f ClusterIPFamily) String() string { + return [...]string{"InvalidIPFamily", "IPv4IPFamily", "IPv6IPFamily", "DualStackIPFamily"}[f] +} + // +kubebuilder:object:root=true -// ClusterList contains a list of Cluster +// ClusterList contains a list of Cluster. type ClusterList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` @@ -247,7 +332,7 @@ func (in FailureDomains) FilterControlPlane() FailureDomains { return res } -// GetIDs returns a slice containing the ids for failure domains +// GetIDs returns a slice containing the ids for failure domains. func (in FailureDomains) GetIDs() []*string { ids := make([]*string, 0, len(in)) for id := range in { diff --git a/thirdparty/clusterapi/api/v1alpha4/common_types.go b/thirdparty/clusterapi/api/v1alpha4/common_types.go index 576c1d31222..324bca2e03a 100644 --- a/thirdparty/clusterapi/api/v1alpha4/common_types.go +++ b/thirdparty/clusterapi/api/v1alpha4/common_types.go @@ -23,7 +23,7 @@ import ( const ( // ClusterLabelName is the label set on machines linked to a cluster and - // external objects(bootstrap and infrastructure providers) + // external objects(bootstrap and infrastructure providers). ClusterLabelName = "cluster.x-k8s.io/cluster-name" // ProviderLabelName is the label set on components in the provider manifest. @@ -53,6 +53,11 @@ const ( // on the reconciled object. PausedAnnotation = "cluster.x-k8s.io/paused" + // DisableMachineCreate is an annotation that can be used to signal a MachineSet to stop creating new machines. + // It is utilized in the OnDelete MachineDeploymentStrategy to allow the MachineDeployment controller to scale down + // older MachineSets when Machines are deleted and add the new replicas to the latest MachineSet. + DisableMachineCreate = "cluster.x-k8s.io/disable-machine-create" + // WatchLabel is a label othat can be applied to any Cluster API object. // // Controllers which allow for selective reconciliation may check this label and proceed @@ -74,23 +79,39 @@ const ( // MachineSkipRemediationAnnotation is the annotation used to mark the machines that should not be considered for remediation by MachineHealthCheck reconciler. MachineSkipRemediationAnnotation = "cluster.x-k8s.io/skip-remediation" - // ClusterSecretType defines the type of secret created by core components + // ClusterSecretType defines the type of secret created by core components. ClusterSecretType corev1.SecretType = "cluster.x-k8s.io/secret" //nolint:gosec - // InterruptibleLabel is the label used to mark the nodes that run on interruptible instances + // InterruptibleLabel is the label used to mark the nodes that run on interruptible instances. InterruptibleLabel = "cluster.x-k8s.io/interruptible" + + // ManagedByAnnotation is an annotation that can be applied to InfraCluster resources to signify that + // some external system is managing the cluster infrastructure. + // + // Provider InfraCluster controllers will ignore resources with this annotation. + // An external controller must fulfill the contract of the InfraCluster resource. + // External infrastructure providers should ensure that the annotation, once set, cannot be removed. + ManagedByAnnotation = "cluster.x-k8s.io/managed-by" +) + +var ( + // ZeroDuration is a zero value of the metav1.Duration type. + ZeroDuration = metav1.Duration{} ) // MachineAddressType describes a valid MachineAddress type. type MachineAddressType string +// Define the MachineAddressType constants. const ( MachineHostName MachineAddressType = "Hostname" MachineExternalIP MachineAddressType = "ExternalIP" MachineInternalIP MachineAddressType = "InternalIP" MachineExternalDNS MachineAddressType = "ExternalDNS" MachineInternalDNS MachineAddressType = "InternalDNS" +) +const ( // MachineNodeNameIndex is used by the Machine Controller to index Machines by Node name, and add a watch on Nodes. MachineNodeNameIndex = "status.nodeRef.name" ) @@ -129,44 +150,6 @@ type MachineAddresses []MachineAddress // In future versions, controller-tools@v2 might allow overriding the type and validation for embedded // types. When that happens, this hack should be revisited. 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. @@ -180,13 +163,4 @@ type ObjectMeta struct { // 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"` } diff --git a/thirdparty/clusterapi/api/v1alpha4/condition_consts.go b/thirdparty/clusterapi/api/v1alpha4/condition_consts.go index 7aca8adc616..55e610cb280 100644 --- a/thirdparty/clusterapi/api/v1alpha4/condition_consts.go +++ b/thirdparty/clusterapi/api/v1alpha4/condition_consts.go @@ -35,6 +35,9 @@ const ( // DeletedReason (Severity=Info) documents an condition not in Status=True because the underlying object was deleted. DeletedReason = "Deleted" + + // IncorrectExternalRefReason (Severity=Error) documents a CAPI object with an incorrect external object reference. + IncorrectExternalRefReason = "IncorrectExternalRef" ) const ( @@ -55,7 +58,21 @@ const ( // Conditions and condition Reasons for the Cluster object const ( - // ControlPlaneReady reports the ready condition from the control plane object defined for this cluster. + // ControlPlaneInitializedCondition reports if the cluster's control plane has been initialized such that the + // cluster's apiserver is reachable and at least one control plane Machine has a node reference. Once this + // condition is marked true, its value is never changed. See the ControlPlaneReady condition for an indication of + // the current readiness of the cluster's control plane. + ControlPlaneInitializedCondition ConditionType = "ControlPlaneInitialized" + + // MissingNodeRefReason (Severity=Info) documents a cluster waiting for at least one control plane Machine to have + // its node reference populated. + MissingNodeRefReason = "MissingNodeRef" + + // WaitingForControlPlaneProviderInitializedReason (Severity=Info) documents a cluster waiting for the control plane + // provider to report successful control plane initialization. + WaitingForControlPlaneProviderInitializedReason = "WaitingForControlPlaneProviderInitialized" + + // ControlPlaneReadyCondition reports the ready condition from the control plane object defined for this cluster. // This condition is mirrored from the Ready condition in the control plane ref object, and // the absence of this condition might signal problems in the reconcile external loops or the fact that // the control plane provider does not not implements the Ready condition yet. @@ -152,7 +169,7 @@ const ( ExternalRemediationRequestCreationFailed = "ExternalRemediationRequestCreationFailed" ) -// Conditions and condition Reasons for the Machine's Node object +// Conditions and condition Reasons for the Machine's Node object. const ( // MachineNodeHealthyCondition provides info about the operational state of the Kubernetes node hosted on the machine by summarizing node conditions. // If the conditions defined in a Kubernetes node (i.e., NodeReady, NodeMemoryPressure, NodeDiskPressure, NodePIDPressure, and NodeNetworkUnavailable) are in a healthy state, it will be set to True. @@ -162,11 +179,11 @@ const ( WaitingForNodeRefReason = "WaitingForNodeRef" // NodeProvisioningReason (Severity=Info) documents machine in the process of provisioning a node. - // NB. provisioning --> NodeRef == "" + // NB. provisioning --> NodeRef == "". NodeProvisioningReason = "NodeProvisioning" // NodeNotFoundReason (Severity=Error) documents a machine's node has previously been observed but is now gone. - // NB. provisioned --> NodeRef != "" + // NB. provisioned --> NodeRef != "". NodeNotFoundReason = "NodeNotFound" // NodeConditionsFailedReason (Severity=Warning) documents a node is not in a healthy state due to the failed state of at least 1 Kubelet condition. @@ -180,7 +197,7 @@ const ( // 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 + // TooManyUnhealthyReason is the reason used when too many Machines are unhealthy and the MachineHealthCheck is blocked // from making any further remediations. TooManyUnhealthyReason = "TooManyUnhealthy" ) diff --git a/thirdparty/clusterapi/api/v1alpha4/groupversion_info.go b/thirdparty/clusterapi/api/v1alpha4/groupversion_info.go index d68b6ff4fdc..bc83bb32ee4 100644 --- a/thirdparty/clusterapi/api/v1alpha4/groupversion_info.go +++ b/thirdparty/clusterapi/api/v1alpha4/groupversion_info.go @@ -25,10 +25,10 @@ import ( ) var ( - // GroupVersion is group version used to register these objects + // GroupVersion is group version used to register these objects. GroupVersion = schema.GroupVersion{Group: "cluster.x-k8s.io", Version: "v1alpha4"} - // SchemeBuilder is used to add go types to the GroupVersionKind scheme + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. diff --git a/thirdparty/clusterapi/api/v1alpha4/machine_types.go b/thirdparty/clusterapi/api/v1alpha4/machine_types.go index 7f09d478140..fc41f058777 100644 --- a/thirdparty/clusterapi/api/v1alpha4/machine_types.go +++ b/thirdparty/clusterapi/api/v1alpha4/machine_types.go @@ -17,10 +17,9 @@ limitations under the License. package v1alpha4 import ( + capierrors "github.com/openshift/hypershift/thirdparty/clusterapi/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - capierrors "github.com/openshift/hypershift/thirdparty/clusterapi/errors" ) const ( @@ -30,13 +29,13 @@ const ( // MachineControlPlaneLabelName is the label set on machines or related objects that are part of a control plane. MachineControlPlaneLabelName = "cluster.x-k8s.io/control-plane" - // ExcludeNodeDrainingAnnotation annotation explicitly skips node draining if set + // ExcludeNodeDrainingAnnotation annotation explicitly skips node draining if set. ExcludeNodeDrainingAnnotation = "machine.cluster.x-k8s.io/exclude-node-draining" - // MachineSetLabelName is the label set on machines if they're controlled by MachineSet + // MachineSetLabelName is the label set on machines if they're controlled by MachineSet. MachineSetLabelName = "cluster.x-k8s.io/set-name" - // MachineDeploymentLabelName is the label set on machines if they're controlled by MachineDeployment + // MachineDeploymentLabelName is the label set on machines if they're controlled by MachineDeployment. MachineDeploymentLabelName = "cluster.x-k8s.io/deployment-name" // PreDrainDeleteHookAnnotationPrefix annotation specifies the prefix we @@ -54,7 +53,7 @@ const ( // ANCHOR: MachineSpec -// MachineSpec defines the desired state of Machine +// MachineSpec defines the desired state of Machine. type MachineSpec struct { // ClusterName is the name of the Cluster this object belongs to. // +kubebuilder:validation:MinLength=1 @@ -102,7 +101,7 @@ type MachineSpec struct { // ANCHOR: MachineStatus -// MachineStatus defines the observed state of Machine +// MachineStatus defines the observed state of Machine. type MachineStatus struct { // NodeRef will point to the corresponding Node if it exists. // +optional @@ -211,7 +210,7 @@ func (m *MachineStatus) GetTypedPhase() MachinePhase { // ANCHOR: Bootstrap -// Bootstrap capsulates fields to configure the Machine’s bootstrapping mechanism. +// Bootstrap encapsulates fields to configure the Machine’s bootstrapping mechanism. type Bootstrap struct { // ConfigRef is a reference to a bootstrap provider-specific resource // that holds configuration details. The reference is optional to @@ -237,7 +236,7 @@ type Bootstrap struct { // +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version",description="Kubernetes version associated with this Machine" // +kubebuilder:printcolumn:name="NodeName",type="string",JSONPath=".status.nodeRef.name",description="Node name associated with this machine",priority=1 -// Machine is the Schema for the machines API +// Machine is the Schema for the machines API. type Machine struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -246,17 +245,19 @@ type Machine struct { Status MachineStatus `json:"status,omitempty"` } +// GetConditions returns the set of conditions for this object. func (m *Machine) GetConditions() Conditions { return m.Status.Conditions } +// SetConditions sets the conditions on this object. func (m *Machine) SetConditions(conditions Conditions) { m.Status.Conditions = conditions } // +kubebuilder:object:root=true -// MachineList contains a list of Machine +// MachineList contains a list of Machine. type MachineList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/thirdparty/clusterapi/api/v1alpha4/machinedeployment_types.go b/thirdparty/clusterapi/api/v1alpha4/machinedeployment_types.go index 73eeae9aead..ada96c5397c 100644 --- a/thirdparty/clusterapi/api/v1alpha4/machinedeployment_types.go +++ b/thirdparty/clusterapi/api/v1alpha4/machinedeployment_types.go @@ -21,21 +21,28 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) +// MachineDeploymentStrategyType defines the type of MachineDeployment rollout strategies. type MachineDeploymentStrategyType string const ( - // Replace the old MachineSet by new one using rolling update + // RollingUpdateMachineDeploymentStrategyType replaces 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" - // RevisionAnnotation is the revision annotation of a machine deployment's machine sets which records its rollout sequence + // OnDeleteMachineDeploymentStrategyType replaces old MachineSets when the deletion of the associated machines are completed. + OnDeleteMachineDeploymentStrategyType MachineDeploymentStrategyType = "OnDelete" + + // RevisionAnnotation is the revision annotation of a machine deployment's machine sets which records its rollout sequence. RevisionAnnotation = "machinedeployment.clusters.x-k8s.io/revision" + // RevisionHistoryAnnotation maintains the history of all old revisions that a machine set has served for a machine deployment. RevisionHistoryAnnotation = "machinedeployment.clusters.x-k8s.io/revision-history" + // DesiredReplicasAnnotation is the desired replicas for a machine deployment recorded as an annotation // in its machine sets. Helps in separating scaling events from the rollout process and for // determining if the new machine set for a deployment is really saturated. DesiredReplicasAnnotation = "machinedeployment.clusters.x-k8s.io/desired-replicas" + // MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which // is machinedeployment.spec.replicas + maxSurge. Used by the underlying machine sets to estimate their // proportions in case the deployment has surge replicas. @@ -44,7 +51,7 @@ const ( // ANCHOR: MachineDeploymentSpec -// MachineDeploymentSpec defines the desired state of MachineDeployment +// MachineDeploymentSpec defines the desired state of MachineDeployment. type MachineDeploymentSpec struct { // ClusterName is the name of the Cluster this object belongs to. // +kubebuilder:validation:MinLength=1 @@ -101,9 +108,9 @@ type MachineDeploymentSpec struct { // MachineDeploymentStrategy describes how to replace existing machines // with new ones. type MachineDeploymentStrategy struct { - // Type of deployment. Currently the only supported strategy is - // "RollingUpdate". + // Type of deployment. // Default is RollingUpdate. + // +kubebuilder:validation:Enum=RollingUpdate;OnDelete // +optional Type MachineDeploymentStrategyType `json:"type,omitempty"` @@ -162,7 +169,7 @@ type MachineRollingUpdateDeployment struct { // ANCHOR: MachineDeploymentStatus -// MachineDeploymentStatus defines the observed state of MachineDeployment +// MachineDeploymentStatus defines the observed state of MachineDeployment. type MachineDeploymentStatus struct { // The generation observed by the deployment controller. // +optional @@ -208,7 +215,7 @@ type MachineDeploymentStatus struct { // ANCHOR_END: MachineDeploymentStatus -// MachineDeploymentPhase indicates the progress of the machine deployment +// MachineDeploymentPhase indicates the progress of the machine deployment. type MachineDeploymentPhase string const ( @@ -259,7 +266,7 @@ func (md *MachineDeploymentStatus) GetTypedPhase() MachineDeploymentPhase { // +kubebuilder:printcolumn:name="Updated",type=integer,JSONPath=".status.updatedReplicas",description="Total number of non-terminated machines targeted by this deployment that have the desired template spec" // +kubebuilder:printcolumn:name="Unavailable",type=integer,JSONPath=".status.unavailableReplicas",description="Total number of unavailable machines targeted by this MachineDeployment" -// MachineDeployment is the Schema for the machinedeployments API +// MachineDeployment is the Schema for the machinedeployments API. type MachineDeployment struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -270,7 +277,7 @@ type MachineDeployment struct { // +kubebuilder:object:root=true -// MachineDeploymentList contains a list of MachineDeployment +// MachineDeploymentList contains a list of MachineDeployment. type MachineDeploymentList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/thirdparty/clusterapi/api/v1alpha4/machinehealthcheck_types.go b/thirdparty/clusterapi/api/v1alpha4/machinehealthcheck_types.go index d34bce9c1be..887dcdb561f 100644 --- a/thirdparty/clusterapi/api/v1alpha4/machinehealthcheck_types.go +++ b/thirdparty/clusterapi/api/v1alpha4/machinehealthcheck_types.go @@ -24,7 +24,7 @@ import ( // ANCHOR: MachineHealthCheckSpec -// MachineHealthCheckSpec defines the desired state of MachineHealthCheck +// MachineHealthCheckSpec defines the desired state of MachineHealthCheck. type MachineHealthCheckSpec struct { // ClusterName is the name of the Cluster this object belongs to. // +kubebuilder:validation:MinLength=1 @@ -45,8 +45,19 @@ type MachineHealthCheckSpec struct { // +optional MaxUnhealthy *intstr.IntOrString `json:"maxUnhealthy,omitempty"` + // Any further remediation is only allowed if the number of machines selected by "selector" as not healthy + // is within the range of "UnhealthyRange". Takes precedence over MaxUnhealthy. + // Eg. "[3-5]" - This means that remediation will be allowed only when: + // (a) there are at least 3 unhealthy machines (and) + // (b) there are at most 5 unhealthy machines + // +optional + // +kubebuilder:validation:Pattern=^\[[0-9]+-[0-9]+\]$ + UnhealthyRange *string `json:"unhealthyRange,omitempty"` + // Machines older than this duration without a node will be considered to have // failed and will be remediated. + // If not set, this value is defaulted to 10 minutes. + // If you wish to disable this feature, set the value explicitly to 0. // +optional NodeStartupTimeout *metav1.Duration `json:"nodeStartupTimeout,omitempty"` @@ -83,7 +94,7 @@ type UnhealthyCondition struct { // ANCHOR: MachineHealthCheckStatus -// MachineHealthCheckStatus defines the observed state of MachineHealthCheck +// MachineHealthCheckStatus defines the observed state of MachineHealthCheck. type MachineHealthCheckStatus struct { // total number of machines counted by this machine health check // +kubebuilder:validation:Minimum=0 @@ -121,7 +132,7 @@ type MachineHealthCheckStatus struct { // +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" -// MachineHealthCheck is the Schema for the machinehealthchecks API +// MachineHealthCheck is the Schema for the machinehealthchecks API. type MachineHealthCheck struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -133,17 +144,19 @@ type MachineHealthCheck struct { Status MachineHealthCheckStatus `json:"status,omitempty"` } +// GetConditions returns the set of conditions for this object. func (m *MachineHealthCheck) GetConditions() Conditions { return m.Status.Conditions } +// SetConditions sets the conditions on this object. func (m *MachineHealthCheck) SetConditions(conditions Conditions) { m.Status.Conditions = conditions } // +kubebuilder:object:root=true -// MachineHealthCheckList contains a list of MachineHealthCheck +// MachineHealthCheckList contains a list of MachineHealthCheck. type MachineHealthCheckList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/thirdparty/clusterapi/api/v1alpha4/machineset_types.go b/thirdparty/clusterapi/api/v1alpha4/machineset_types.go index 21c1e0c4ecb..2e0217287c5 100644 --- a/thirdparty/clusterapi/api/v1alpha4/machineset_types.go +++ b/thirdparty/clusterapi/api/v1alpha4/machineset_types.go @@ -17,17 +17,16 @@ limitations under the License. package v1alpha4 import ( + capierrors "github.com/openshift/hypershift/thirdparty/clusterapi/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/validation/field" - - capierrors "github.com/openshift/hypershift/thirdparty/clusterapi/errors" ) // ANCHOR: MachineSetSpec -// MachineSetSpec defines the desired state of MachineSet +// MachineSetSpec defines the desired state of MachineSet. type MachineSetSpec struct { // ClusterName is the name of the Cluster this object belongs to. // +kubebuilder:validation:MinLength=1 @@ -67,7 +66,7 @@ type MachineSetSpec struct { // ANCHOR: MachineTemplateSpec -// MachineTemplateSpec describes the data needed to create a Machine from a template +// MachineTemplateSpec describes the data needed to create a Machine from a template. type MachineTemplateSpec struct { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -108,7 +107,7 @@ const ( // ANCHOR: MachineSetStatus -// MachineSetStatus defines the observed state of MachineSet +// MachineSetStatus defines the observed state of MachineSet. type MachineSetStatus struct { // Selector is the same as the label selector but in the string format to avoid introspection // by clients. The string will be in the same format as the query-param syntax. @@ -194,7 +193,7 @@ func (m *MachineSet) Validate() field.ErrorList { // +kubebuilder:printcolumn:name="Available",type="integer",JSONPath=".status.availableReplicas",description="Total number of available machines (ready for at least minReadySeconds)" // +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Total number of ready machines targeted by this machineset." -// MachineSet is the Schema for the machinesets API +// MachineSet is the Schema for the machinesets API. type MachineSet struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -205,7 +204,7 @@ type MachineSet struct { // +kubebuilder:object:root=true -// MachineSetList contains a list of MachineSet +// MachineSetList contains a list of MachineSet. type MachineSetList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/thirdparty/clusterapi/api/v1alpha4/zz_generated.deepcopy.go b/thirdparty/clusterapi/api/v1alpha4/zz_generated.deepcopy.go index 0b4f84bdb48..b1490ee12a1 100644 --- a/thirdparty/clusterapi/api/v1alpha4/zz_generated.deepcopy.go +++ b/thirdparty/clusterapi/api/v1alpha4/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* - +Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,12 +21,11 @@ limitations under the License. package v1alpha4 import ( - "k8s.io/api/core/v1" + "github.com/openshift/hypershift/thirdparty/clusterapi/errors" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" - - "github.com/openshift/hypershift/thirdparty/clusterapi/errors" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -578,6 +577,11 @@ func (in *MachineHealthCheckSpec) DeepCopyInto(out *MachineHealthCheckSpec) { *out = new(intstr.IntOrString) **out = **in } + if in.UnhealthyRange != nil { + in, out := &in.UnhealthyRange, &out.UnhealthyRange + *out = new(string) + **out = **in + } if in.NodeStartupTimeout != nil { in, out := &in.NodeStartupTimeout, &out.NodeStartupTimeout *out = new(metav1.Duration) @@ -937,13 +941,6 @@ func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta) { (*out)[key] = val } } - if in.OwnerReferences != nil { - in, out := &in.OwnerReferences, &out.OwnerReferences - *out = make([]metav1.OwnerReference, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMeta. diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/awscluster_conversion.go b/thirdparty/clusterapiprovideraws/v1alpha3/awscluster_conversion.go deleted file mode 100644 index 7775c5ed8f2..00000000000 --- a/thirdparty/clusterapiprovideraws/v1alpha3/awscluster_conversion.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -// Hub marks AWSCluster as a conversion hub. -func (*AWSCluster) Hub() {} - -// Hub marks AWSClusterList as a conversion hub. -func (*AWSClusterList) Hub() {} diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/awsmachine_conversion.go b/thirdparty/clusterapiprovideraws/v1alpha3/awsmachine_conversion.go deleted file mode 100644 index 02155988c09..00000000000 --- a/thirdparty/clusterapiprovideraws/v1alpha3/awsmachine_conversion.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -// Hub marks AWSMachine as a conversion hub. -func (*AWSMachine) Hub() {} - -// Hub marks AWSMachineList as a conversion hub. -func (*AWSMachineList) Hub() {} diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/defaults.go b/thirdparty/clusterapiprovideraws/v1alpha3/defaults.go deleted file mode 100644 index ec25a02404c..00000000000 --- a/thirdparty/clusterapiprovideraws/v1alpha3/defaults.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -// TODO (richardcase): get this working with defaulter-gen - -// SetDefaults_Bastion is used by defaulter-gen -func SetDefaults_Bastion(obj *Bastion) { //nolint:golint,stylecheck - // Default to allow open access to the bastion host if no CIDR Blocks have been set - if len(obj.AllowedCIDRBlocks) == 0 && !obj.DisableIngressRules { - obj.AllowedCIDRBlocks = []string{"0.0.0.0/0"} - } -} - -// SetDefaults_NetworkSpec is used by defaulter-gen -func SetDefaults_NetworkSpec(obj *NetworkSpec) { //nolint:golint,stylecheck - // Default to Calico ingress rules if no rules have been set - if obj.CNI == nil { - obj.CNI = &CNISpec{ - CNIIngressRules: CNIIngressRules{ - { - Description: "bgp (calico)", - Protocol: SecurityGroupProtocolTCP, - FromPort: 179, - ToPort: 179, - }, - { - Description: "IP-in-IP (calico)", - Protocol: SecurityGroupProtocolIPinIP, - FromPort: -1, - ToPort: 65535, - }, - }, - } - } -} diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/doc.go b/thirdparty/clusterapiprovideraws/v1alpha3/doc.go deleted file mode 100644 index 999cec2ac55..00000000000 --- a/thirdparty/clusterapiprovideraws/v1alpha3/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/validate.go b/thirdparty/clusterapiprovideraws/v1alpha3/validate.go deleted file mode 100644 index 17866ee569d..00000000000 --- a/thirdparty/clusterapiprovideraws/v1alpha3/validate.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "fmt" - "net" - - "k8s.io/apimachinery/pkg/util/validation/field" -) - -// Validate will validate the bastion fields -func (b *Bastion) Validate() []*field.Error { - var errs field.ErrorList - - if b.DisableIngressRules && len(b.AllowedCIDRBlocks) > 0 { - errs = append(errs, - field.Forbidden(field.NewPath("spec", "bastion", "allowedCIDRBlocks"), "cannot be set if spec.bastion.disableIngressRules is true"), - ) - return errs - } - - for i, cidr := range b.AllowedCIDRBlocks { - if _, _, err := net.ParseCIDR(cidr); err != nil { - errs = append(errs, - field.Invalid(field.NewPath("spec", "bastion", fmt.Sprintf("allowedCIDRBlocks[%d]", i)), cidr, "must be a valid CIDR block"), - ) - } - } - return errs -} diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/awscluster_types.go b/thirdparty/clusterapiprovideraws/v1alpha4/awscluster_types.go similarity index 86% rename from thirdparty/clusterapiprovideraws/v1alpha3/awscluster_types.go rename to thirdparty/clusterapiprovideraws/v1alpha4/awscluster_types.go index 17766c15e93..72169a10288 100644 --- a/thirdparty/clusterapiprovideraws/v1alpha3/awscluster_types.go +++ b/thirdparty/clusterapiprovideraws/v1alpha4/awscluster_types.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,18 +14,20 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha3 +package v1alpha4 import ( + clusterv1 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha4" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha3" ) const ( // ClusterFinalizer allows ReconcileAWSCluster to clean up AWS resources associated with AWSCluster before // removing it from the apiserver. ClusterFinalizer = "awscluster.infrastructure.cluster.x-k8s.io" + + // AWSClusterControllerIdentityName is the name of the AWSClusterControllerIdentity singleton + AWSClusterControllerIdentityName = "default" ) // AWSClusterSpec defines the desired state of AWSCluster @@ -83,6 +85,34 @@ type AWSClusterSpec struct { // Bastion contains options to configure the bastion host. // +optional Bastion Bastion `json:"bastion"` + + // IdentityRef is a reference to a identity to be used when reconciling this cluster + // +optional + IdentityRef *AWSIdentityReference `json:"identityRef,omitempty"` +} + +type AWSIdentityKind string + +var ( + // ControllerIdentityKind defines identity reference kind as AWSClusterControllerIdentity + ControllerIdentityKind = AWSIdentityKind("AWSClusterControllerIdentity") + + // ClusterRoleIdentityKind defines identity reference kind as AWSClusterRoleIdentity + ClusterRoleIdentityKind = AWSIdentityKind("AWSClusterRoleIdentity") + + // ClusterStaticIdentityKind defines identity reference kind as AWSClusterStaticIdentity + ClusterStaticIdentityKind = AWSIdentityKind("AWSClusterStaticIdentity") +) + +// AWSIdentityReference specifies a identity. +type AWSIdentityReference struct { + // Name of the identity. + // +kubebuilder:validation:MinLength=1 + Name string `json:"name"` + + // Kind of the identity. + // +kubebuilder:validation:Enum=AWSClusterControllerIdentity;AWSClusterRoleIdentity;AWSClusterStaticIdentity + Kind AWSIdentityKind `json:"kind"` } type Bastion struct { @@ -115,6 +145,8 @@ type Bastion struct { // AWSLoadBalancerSpec defines the desired state of an AWS load balancer type AWSLoadBalancerSpec struct { // Scheme sets the scheme of the load balancer (defaults to Internet-facing) + // +kubebuilder:default=Internet-facing + // +kubebuilder:validation:Enum=Internet-facing;internal // +optional Scheme *ClassicELBScheme `json:"scheme,omitempty"` diff --git a/thirdparty/clusterapiprovideraws/v1alpha4/awsiam_types.go b/thirdparty/clusterapiprovideraws/v1alpha4/awsiam_types.go new file mode 100644 index 00000000000..9d844698a09 --- /dev/null +++ b/thirdparty/clusterapiprovideraws/v1alpha4/awsiam_types.go @@ -0,0 +1,154 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha4 + +import ( + "encoding/json" + + "github.com/pkg/errors" +) + +type ( + Effect string + ConditionOperator string + PrincipalType string +) + +const ( + + // Any is the AWS IAM policy grammar wildcard. + Any = "*" + + // CurrentVersion is the latest version of the AWS IAM policy grammar. + CurrentVersion = "2012-10-17" + + // EffectAllow is the Allow effect in an AWS IAM policy statement entry. + EffectAllow Effect = "Allow" + + // EffectDeny is the Deny effect in an AWS IAM policy statement entry. + EffectDeny Effect = "Deny" + + // PrincipalAWS is the identity type covering AWS ARNs. + PrincipalAWS PrincipalType = "AWS" + + // PrincipalFederated is the identity type covering federated identities. + PrincipalFederated PrincipalType = "Federated" + + // PrincipalService is the identity type covering AWS services. + PrincipalService PrincipalType = "Service" + + // StringEquals is an AWS IAM policy condition operator. + StringEquals ConditionOperator = "StringEquals" + + // StringNotEquals is an AWS IAM policy condition operator. + StringNotEquals ConditionOperator = "StringNotEquals" + + // StringEqualsIgnoreCase is an AWS IAM policy condition operator. + StringEqualsIgnoreCase ConditionOperator = "StringEqualsIgnoreCase" + + // StringLike is an AWS IAM policy condition operator. + StringLike ConditionOperator = "StringLike" + + // StringNotLike is an AWS IAM policy condition operator. + StringNotLike ConditionOperator = "StringNotLike" +) + +// PolicyDocument represents an AWS IAM policy document, and can be +// converted into JSON using "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/converters" +type PolicyDocument struct { + Version string + Statement Statements + ID string `json:"Id,omitempty"` +} + +// StatementEntry represents each "statement" block in an AWS IAM policy document. +type StatementEntry struct { + Sid string `json:",omitempty"` + Principal Principals `json:",omitempty"` + NotPrincipal Principals `json:",omitempty"` + Effect Effect `json:"Effect"` + Action Actions `json:"Action"` + Resource Resources `json:",omitempty"` + Condition Conditions `json:"Condition,omitempty"` +} + +// Statements is the list of StatementEntries +type Statements []StatementEntry + +// Principals is the map of all identities a statement entry refers to +type Principals map[PrincipalType]PrincipalID + +// Actions is the list of actions +type Actions []string + +func (actions *Actions) UnmarshalJSON(data []byte) error { + var ids []string + if err := json.Unmarshal(data, &ids); err == nil { + *actions = Actions(ids) + return nil + } + var id string + if err := json.Unmarshal(data, &id); err != nil { + return errors.Wrap(err, "couldn't unmarshal as either []string or string") + } + *actions = []string{id} + return nil +} + +// Resources is the list of resources +type Resources []string + +// PrincipalID represents the list of all identities, such as ARNs +type PrincipalID []string + +func (identityID *PrincipalID) UnmarshalJSON(data []byte) error { + var ids []string + if err := json.Unmarshal(data, &ids); err == nil { + *identityID = PrincipalID(ids) + return nil + } + var id string + if err := json.Unmarshal(data, &id); err != nil { + return errors.Wrap(err, "couldn't unmarshal as either []string or string") + } + *identityID = []string{id} + return nil +} + +// Conditions is the map of all conditions in the statement entry. +type Conditions map[ConditionOperator]interface{} + +// DeepCopyInto copies the receiver, writing into out. in must be non-nil. +func (in Conditions) DeepCopyInto(out *Conditions) { + { + in := &in + *out = make(Conditions, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy copies the receiver, creating a new Conditions. +func (in Conditions) DeepCopy() Conditions { + if in == nil { + return nil + } + out := new(Conditions) + in.DeepCopyInto(out) + return *out +} diff --git a/thirdparty/clusterapiprovideraws/v1alpha4/awsidentity_types.go b/thirdparty/clusterapiprovideraws/v1alpha4/awsidentity_types.go new file mode 100644 index 00000000000..0541808289b --- /dev/null +++ b/thirdparty/clusterapiprovideraws/v1alpha4/awsidentity_types.go @@ -0,0 +1,184 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha4 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type AWSClusterIdentitySpec struct { + // AllowedNamespaces is used to identify which namespaces are allowed to use the identity from. + // Namespaces can be selected either using an array of namespaces or with label selector. + // An empty allowedNamespaces object indicates that AWSClusters can use this identity from any namespace. + // If this object is nil, no namespaces will be allowed (default behaviour, if this field is not provided) + // A namespace should be either in the NamespaceList or match with Selector to use the identity. + // + // +optional + // +nullable + AllowedNamespaces *AllowedNamespaces `json:"allowedNamespaces"` +} + +type AllowedNamespaces struct { + // An nil or empty list indicates that AWSClusters cannot use the identity from any namespace. + // + // +optional + // +nullable + NamespaceList []string `json:"list"` + + // AllowedNamespaces is a selector of namespaces that AWSClusters can + // use this ClusterPrincipal from. This is a standard Kubernetes LabelSelector, + // a label query over a set of resources. The result of matchLabels and + // matchExpressions are ANDed. + // + // An empty selector indicates that AWSClusters cannot use this + // AWSClusterIdentity from any namespace. + // +optional + Selector metav1.LabelSelector `json:"selector"` +} + +type AWSRoleSpec struct { + // The Amazon Resource Name (ARN) of the role to assume. + RoleArn string `json:"roleARN"` + // An identifier for the assumed role session + SessionName string `json:"sessionName,omitempty"` + // The duration, in seconds, of the role session before it is renewed. + // +kubebuilder:validation:Minimum:=900 + // +kubebuilder:validation:Maximum:=43200 + DurationSeconds int32 `json:"durationSeconds,omitempty"` + // An IAM policy as a JSON-encoded string that you want to use as an inline session policy. + InlinePolicy string `json:"inlinePolicy,omitempty"` + + // The Amazon Resource Names (ARNs) of the IAM managed policies that you want + // to use as managed session policies. + // The policies must exist in the same account as the role. + PolicyARNs []string `json:"policyARNs,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsclusterstaticidentities,scope=Cluster,categories=cluster-api +// +kubebuilder:storageversion + +// AWSClusterStaticIdentity is the Schema for the awsclusterstaticidentities API +// It represents a reference to an AWS access key ID and secret access key, stored in a secret. +type AWSClusterStaticIdentity struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec for this AWSClusterStaticIdentity + Spec AWSClusterStaticIdentitySpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// AWSClusterStaticIdentityList contains a list of AWSClusterStaticIdentity +type AWSClusterStaticIdentityList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSClusterStaticIdentity `json:"items"` +} + +type AWSClusterStaticIdentitySpec struct { + AWSClusterIdentitySpec `json:",inline"` + // Reference to a secret containing the credentials. The secret should + // contain the following data keys: + // AccessKeyID: AKIAIOSFODNN7EXAMPLE + // SecretAccessKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY + // SessionToken: Optional + SecretRef corev1.SecretReference `json:"secretRef"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsclusterroleidentities,scope=Cluster,categories=cluster-api +// +kubebuilder:storageversion + +// AWSClusterRoleIdentity is the Schema for the awsclusterroleidentities API +// It is used to assume a role using the provided sourceRef. +type AWSClusterRoleIdentity struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec for this AWSClusterRoleIdentity. + Spec AWSClusterRoleIdentitySpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// AWSClusterRoleIdentityList contains a list of AWSClusterRoleIdentity +type AWSClusterRoleIdentityList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSClusterRoleIdentity `json:"items"` +} + +type AWSClusterRoleIdentitySpec struct { + AWSClusterIdentitySpec `json:",inline"` + AWSRoleSpec `json:",inline"` + // A unique identifier that might be required when you assume a role in another account. + // If the administrator of the account to which the role belongs provided you with an + // external ID, then provide that value in the ExternalId parameter. This value can be + // any string, such as a passphrase or account number. A cross-account role is usually + // set up to trust everyone in an account. Therefore, the administrator of the trusting + // account might send an external ID to the administrator of the trusted account. That + // way, only someone with the ID can assume the role, rather than everyone in the + // account. For more information about the external ID, see How to Use an External ID + // When Granting Access to Your AWS Resources to a Third Party in the IAM User Guide. + // +optional + ExternalID string `json:"externalID,omitempty"` + + // SourceIdentityRef is a reference to another identity which will be chained to do + // role assumption. All identity types are accepted. + SourceIdentityRef *AWSIdentityReference `json:"sourceIdentityRef,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsclustercontrolleridentities,scope=Cluster,categories=cluster-api +// +kubebuilder:storageversion + +// AWSClusterControllerIdentity is the Schema for the awsclustercontrolleridentities API +// It is used to grant access to use Cluster API Provider AWS Controller credentials. +type AWSClusterControllerIdentity struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec for this AWSClusterControllerIdentity. + Spec AWSClusterControllerIdentitySpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// AWSClusterControllerIdentityList contains a list of AWSClusterControllerIdentity +type AWSClusterControllerIdentityList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSClusterControllerIdentity `json:"items"` +} + +type AWSClusterControllerIdentitySpec struct { + AWSClusterIdentitySpec `json:",inline"` +} + +func init() { + SchemeBuilder.Register( + &AWSClusterStaticIdentity{}, + &AWSClusterStaticIdentityList{}, + &AWSClusterRoleIdentity{}, + &AWSClusterRoleIdentityList{}, + &AWSClusterControllerIdentity{}, + &AWSClusterControllerIdentityList{}, + ) +} diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/awsmachine_types.go b/thirdparty/clusterapiprovideraws/v1alpha4/awsmachine_types.go similarity index 99% rename from thirdparty/clusterapiprovideraws/v1alpha3/awsmachine_types.go rename to thirdparty/clusterapiprovideraws/v1alpha4/awsmachine_types.go index 8ef7c5bdf26..97d08da1062 100644 --- a/thirdparty/clusterapiprovideraws/v1alpha3/awsmachine_types.go +++ b/thirdparty/clusterapiprovideraws/v1alpha4/awsmachine_types.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,13 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha3 +package v1alpha4 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha3" + clusterv1 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha4" "github.com/openshift/hypershift/thirdparty/clusterapi/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/awsmachinetemplate_conversion.go b/thirdparty/clusterapiprovideraws/v1alpha4/awsmachinelist_webhook.go similarity index 58% rename from thirdparty/clusterapiprovideraws/v1alpha3/awsmachinetemplate_conversion.go rename to thirdparty/clusterapiprovideraws/v1alpha4/awsmachinelist_webhook.go index 9c05e84dc77..91bf30c06e9 100644 --- a/thirdparty/clusterapiprovideraws/v1alpha3/awsmachinetemplate_conversion.go +++ b/thirdparty/clusterapiprovideraws/v1alpha4/awsmachinelist_webhook.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,10 +14,18 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha3 +package v1alpha4 -// Hub marks AWSMachineTemplate as a conversion hub. -func (*AWSMachineTemplate) Hub() {} +import ( + ctrl "sigs.k8s.io/controller-runtime" + logf "sigs.k8s.io/controller-runtime/pkg/log" +) -// Hub marks AWSMachineTemplateList as a conversion hub. -func (*AWSMachineTemplateList) Hub() {} +// log is for logging in this package. +var _ = logf.Log.WithName("awsmachinelist-resource") + +func (r *AWSMachineList) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/awsmachinetemplate_types.go b/thirdparty/clusterapiprovideraws/v1alpha4/awsmachinetemplate_types.go similarity index 96% rename from thirdparty/clusterapiprovideraws/v1alpha3/awsmachinetemplate_types.go rename to thirdparty/clusterapiprovideraws/v1alpha4/awsmachinetemplate_types.go index 4cce33ceda3..acede156438 100644 --- a/thirdparty/clusterapiprovideraws/v1alpha3/awsmachinetemplate_types.go +++ b/thirdparty/clusterapiprovideraws/v1alpha4/awsmachinetemplate_types.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha3 +package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/conditions_consts.go b/thirdparty/clusterapiprovideraws/v1alpha4/conditions_consts.go similarity index 82% rename from thirdparty/clusterapiprovideraws/v1alpha3/conditions_consts.go rename to thirdparty/clusterapiprovideraws/v1alpha4/conditions_consts.go index 1148d299894..00e165bbfaa 100644 --- a/thirdparty/clusterapiprovideraws/v1alpha3/conditions_consts.go +++ b/thirdparty/clusterapiprovideraws/v1alpha4/conditions_consts.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,9 +14,26 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha3 +package v1alpha4 -import clusterv1 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha3" +import clusterv1 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha4" + +const ( + // PrincipalCredentialRetrievedCondition reports on whether Principal credentials could be retrieved successfully. + // A possible scenario, where retrieval is unsuccessful, is when SourcePrincipal is not authorized for assume role. + PrincipalCredentialRetrievedCondition clusterv1.ConditionType = "PrincipalCredentialRetrieved" + // PrincipalCredentialRetrievalFailedReason used when errors occur during identity credential retrieval. + PrincipalCredentialRetrievalFailedReason = "PrincipalCredentialRetrievalFailed" + // CredentialProviderBuildFailedReason used when errors occur during building providers before trying credential retrieval. + CredentialProviderBuildFailedReason = "CredentialProviderBuildFailed" + // PrincipalUsageAllowedCondition reports on whether Principal and all the nested source identities are allowed to be used in the AWSCluster namespace. + PrincipalUsageAllowedCondition clusterv1.ConditionType = "PrincipalUsageAllowed" + // PrincipalUsageUnauthorizedReason used when AWSCluster namespace is not in the identity's allowed namespaces list. + PrincipalUsageUnauthorizedReason = "PrincipalUsageUnauthorized" + // SourcePrincipalUsageUnauthorizedReason used when AWSCluster is not in the intersection of source identity allowed namespaces + // and allowed namespaces of the identities that source identity depends to + SourcePrincipalUsageUnauthorizedReason = "SourcePrincipalUsageUnauthorized" +) const ( // VpcReady condition reports on the successful reconciliation of a VPC diff --git a/thirdparty/clusterapi/api/v1alpha3/doc.go b/thirdparty/clusterapiprovideraws/v1alpha4/doc.go similarity index 80% rename from thirdparty/clusterapi/api/v1alpha3/doc.go rename to thirdparty/clusterapiprovideraws/v1alpha4/doc.go index f0da60a3f35..2abdf955982 100644 --- a/thirdparty/clusterapi/api/v1alpha3/doc.go +++ b/thirdparty/clusterapiprovideraws/v1alpha4/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/api/v1alpha4 -package v1alpha3 +// +gencrdrefdocs:force +// +groupName=infrastructure.cluster.x-k8s.io +package v1alpha4 diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/groupversion_info.go b/thirdparty/clusterapiprovideraws/v1alpha4/groupversion_info.go similarity index 85% rename from thirdparty/clusterapiprovideraws/v1alpha3/groupversion_info.go rename to thirdparty/clusterapiprovideraws/v1alpha4/groupversion_info.go index b6614ac1639..c9ceb24ed6b 100644 --- a/thirdparty/clusterapiprovideraws/v1alpha3/groupversion_info.go +++ b/thirdparty/clusterapiprovideraws/v1alpha4/groupversion_info.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1alpha3 contains API Schema definitions for the infrastructure v1alpha3 API group +// Package v1alpha4 contains API Schema definitions for the infrastructure v1alpha4 API group // +kubebuilder:object:generate=true // +groupName=infrastructure.cluster.x-k8s.io -package v1alpha3 +package v1alpha4 import ( "k8s.io/apimachinery/pkg/runtime/schema" @@ -26,7 +26,7 @@ import ( var ( // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha3"} + GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha4"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/tags.go b/thirdparty/clusterapiprovideraws/v1alpha4/tags.go similarity index 98% rename from thirdparty/clusterapiprovideraws/v1alpha3/tags.go rename to thirdparty/clusterapiprovideraws/v1alpha4/tags.go index b062b712a96..588183e66c7 100644 --- a/thirdparty/clusterapiprovideraws/v1alpha3/tags.go +++ b/thirdparty/clusterapiprovideraws/v1alpha4/tags.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,15 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha3 +package v1alpha4 import ( "fmt" "reflect" + clusterv1 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha4" "k8s.io/apimachinery/pkg/types" - - clusterv1 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha3" ) // Tags defines a map of tags. diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/types.go b/thirdparty/clusterapiprovideraws/v1alpha4/types.go similarity index 99% rename from thirdparty/clusterapiprovideraws/v1alpha3/types.go rename to thirdparty/clusterapiprovideraws/v1alpha4/types.go index 7ecb54048a4..0359b14461a 100644 --- a/thirdparty/clusterapiprovideraws/v1alpha3/types.go +++ b/thirdparty/clusterapiprovideraws/v1alpha4/types.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,16 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha3 +package v1alpha4 import ( "fmt" "sort" "time" + clusterv1 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha4" "k8s.io/apimachinery/pkg/util/sets" - - clusterv1 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha3" ) const ( @@ -301,6 +300,15 @@ func (s Subnets) ToMap() map[string]*SubnetSpec { return res } +// IDs returns a slice of the subnet ids +func (s Subnets) IDs() []string { + res := []string{} + for _, subnet := range s { + res = append(res, subnet.ID) + } + return res +} + // FindByID returns a single subnet matching the given id or nil. func (s Subnets) FindByID(id string) *SubnetSpec { for _, x := range s { diff --git a/thirdparty/clusterapiprovideraws/v1alpha3/zz_generated.deepcopy.go b/thirdparty/clusterapiprovideraws/v1alpha4/zz_generated.deepcopy.go similarity index 67% rename from thirdparty/clusterapiprovideraws/v1alpha3/zz_generated.deepcopy.go rename to thirdparty/clusterapiprovideraws/v1alpha4/zz_generated.deepcopy.go index dbbfd58bf75..a5bb3fdcb22 100644 --- a/thirdparty/clusterapiprovideraws/v1alpha3/zz_generated.deepcopy.go +++ b/thirdparty/clusterapiprovideraws/v1alpha4/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* - +Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,13 +18,12 @@ limitations under the License. // Code generated by controller-gen. DO NOT EDIT. -package v1alpha3 +package v1alpha4 import ( - "k8s.io/apimachinery/pkg/runtime" - - apiv1alpha3 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha3" + apiv1alpha4 "github.com/openshift/hypershift/thirdparty/clusterapi/api/v1alpha4" "github.com/openshift/hypershift/thirdparty/clusterapi/errors" + "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -54,6 +53,100 @@ func (in *AWSCluster) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterControllerIdentity) DeepCopyInto(out *AWSClusterControllerIdentity) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterControllerIdentity. +func (in *AWSClusterControllerIdentity) DeepCopy() *AWSClusterControllerIdentity { + if in == nil { + return nil + } + out := new(AWSClusterControllerIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterControllerIdentity) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterControllerIdentityList) DeepCopyInto(out *AWSClusterControllerIdentityList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSClusterControllerIdentity, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterControllerIdentityList. +func (in *AWSClusterControllerIdentityList) DeepCopy() *AWSClusterControllerIdentityList { + if in == nil { + return nil + } + out := new(AWSClusterControllerIdentityList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterControllerIdentityList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterControllerIdentitySpec) DeepCopyInto(out *AWSClusterControllerIdentitySpec) { + *out = *in + in.AWSClusterIdentitySpec.DeepCopyInto(&out.AWSClusterIdentitySpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterControllerIdentitySpec. +func (in *AWSClusterControllerIdentitySpec) DeepCopy() *AWSClusterControllerIdentitySpec { + if in == nil { + return nil + } + out := new(AWSClusterControllerIdentitySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterIdentitySpec) DeepCopyInto(out *AWSClusterIdentitySpec) { + *out = *in + if in.AllowedNamespaces != nil { + in, out := &in.AllowedNamespaces, &out.AllowedNamespaces + *out = new(AllowedNamespaces) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterIdentitySpec. +func (in *AWSClusterIdentitySpec) DeepCopy() *AWSClusterIdentitySpec { + if in == nil { + return nil + } + out := new(AWSClusterIdentitySpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AWSClusterList) DeepCopyInto(out *AWSClusterList) { *out = *in @@ -86,6 +179,86 @@ func (in *AWSClusterList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterRoleIdentity) DeepCopyInto(out *AWSClusterRoleIdentity) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterRoleIdentity. +func (in *AWSClusterRoleIdentity) DeepCopy() *AWSClusterRoleIdentity { + if in == nil { + return nil + } + out := new(AWSClusterRoleIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterRoleIdentity) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterRoleIdentityList) DeepCopyInto(out *AWSClusterRoleIdentityList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSClusterRoleIdentity, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterRoleIdentityList. +func (in *AWSClusterRoleIdentityList) DeepCopy() *AWSClusterRoleIdentityList { + if in == nil { + return nil + } + out := new(AWSClusterRoleIdentityList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterRoleIdentityList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterRoleIdentitySpec) DeepCopyInto(out *AWSClusterRoleIdentitySpec) { + *out = *in + in.AWSClusterIdentitySpec.DeepCopyInto(&out.AWSClusterIdentitySpec) + in.AWSRoleSpec.DeepCopyInto(&out.AWSRoleSpec) + if in.SourceIdentityRef != nil { + in, out := &in.SourceIdentityRef, &out.SourceIdentityRef + *out = new(AWSIdentityReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterRoleIdentitySpec. +func (in *AWSClusterRoleIdentitySpec) DeepCopy() *AWSClusterRoleIdentitySpec { + if in == nil { + return nil + } + out := new(AWSClusterRoleIdentitySpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AWSClusterSpec) DeepCopyInto(out *AWSClusterSpec) { *out = *in @@ -109,6 +282,11 @@ func (in *AWSClusterSpec) DeepCopyInto(out *AWSClusterSpec) { (*in).DeepCopyInto(*out) } in.Bastion.DeepCopyInto(&out.Bastion) + if in.IdentityRef != nil { + in, out := &in.IdentityRef, &out.IdentityRef + *out = new(AWSIdentityReference) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterSpec. @@ -121,13 +299,88 @@ func (in *AWSClusterSpec) DeepCopy() *AWSClusterSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterStaticIdentity) DeepCopyInto(out *AWSClusterStaticIdentity) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterStaticIdentity. +func (in *AWSClusterStaticIdentity) DeepCopy() *AWSClusterStaticIdentity { + if in == nil { + return nil + } + out := new(AWSClusterStaticIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterStaticIdentity) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterStaticIdentityList) DeepCopyInto(out *AWSClusterStaticIdentityList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSClusterStaticIdentity, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterStaticIdentityList. +func (in *AWSClusterStaticIdentityList) DeepCopy() *AWSClusterStaticIdentityList { + if in == nil { + return nil + } + out := new(AWSClusterStaticIdentityList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterStaticIdentityList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterStaticIdentitySpec) DeepCopyInto(out *AWSClusterStaticIdentitySpec) { + *out = *in + in.AWSClusterIdentitySpec.DeepCopyInto(&out.AWSClusterIdentitySpec) + out.SecretRef = in.SecretRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterStaticIdentitySpec. +func (in *AWSClusterStaticIdentitySpec) DeepCopy() *AWSClusterStaticIdentitySpec { + if in == nil { + return nil + } + out := new(AWSClusterStaticIdentitySpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AWSClusterStatus) DeepCopyInto(out *AWSClusterStatus) { *out = *in in.Network.DeepCopyInto(&out.Network) if in.FailureDomains != nil { in, out := &in.FailureDomains, &out.FailureDomains - *out = make(apiv1alpha3.FailureDomains, len(*in)) + *out = make(apiv1alpha4.FailureDomains, len(*in)) for key, val := range *in { (*out)[key] = *val.DeepCopy() } @@ -139,7 +392,7 @@ func (in *AWSClusterStatus) DeepCopyInto(out *AWSClusterStatus) { } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha3.Conditions, len(*in)) + *out = make(apiv1alpha4.Conditions, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -156,6 +409,21 @@ func (in *AWSClusterStatus) DeepCopy() *AWSClusterStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSIdentityReference) DeepCopyInto(out *AWSIdentityReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSIdentityReference. +func (in *AWSIdentityReference) DeepCopy() *AWSIdentityReference { + if in == nil { + return nil + } + out := new(AWSIdentityReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AWSLoadBalancerSpec) DeepCopyInto(out *AWSLoadBalancerSpec) { *out = *in @@ -342,7 +610,7 @@ func (in *AWSMachineStatus) DeepCopyInto(out *AWSMachineStatus) { *out = *in if in.Addresses != nil { in, out := &in.Addresses, &out.Addresses - *out = make([]apiv1alpha3.MachineAddress, len(*in)) + *out = make([]apiv1alpha4.MachineAddress, len(*in)) copy(*out, *in) } if in.InstanceState != nil { @@ -362,7 +630,7 @@ func (in *AWSMachineStatus) DeepCopyInto(out *AWSMachineStatus) { } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha3.Conditions, len(*in)) + *out = make(apiv1alpha4.Conditions, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -501,6 +769,66 @@ func (in *AWSResourceReference) DeepCopy() *AWSResourceReference { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSRoleSpec) DeepCopyInto(out *AWSRoleSpec) { + *out = *in + if in.PolicyARNs != nil { + in, out := &in.PolicyARNs, &out.PolicyARNs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSRoleSpec. +func (in *AWSRoleSpec) DeepCopy() *AWSRoleSpec { + if in == nil { + return nil + } + out := new(AWSRoleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Actions) DeepCopyInto(out *Actions) { + { + in := &in + *out = make(Actions, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Actions. +func (in Actions) DeepCopy() Actions { + if in == nil { + return nil + } + out := new(Actions) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllowedNamespaces) DeepCopyInto(out *AllowedNamespaces) { + *out = *in + if in.NamespaceList != nil { + in, out := &in.NamespaceList, &out.NamespaceList + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.Selector.DeepCopyInto(&out.Selector) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllowedNamespaces. +func (in *AllowedNamespaces) DeepCopy() *AllowedNamespaces { + if in == nil { + return nil + } + out := new(AllowedNamespaces) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Bastion) DeepCopyInto(out *Bastion) { *out = *in @@ -823,7 +1151,7 @@ func (in *Instance) DeepCopyInto(out *Instance) { } if in.Addresses != nil { in, out := &in.Addresses, &out.Addresses - *out = make([]apiv1alpha3.MachineAddress, len(*in)) + *out = make([]apiv1alpha4.MachineAddress, len(*in)) copy(*out, *in) } if in.PrivateIP != nil { @@ -953,6 +1281,95 @@ func (in *NetworkSpec) DeepCopy() *NetworkSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyDocument) DeepCopyInto(out *PolicyDocument) { + *out = *in + if in.Statement != nil { + in, out := &in.Statement, &out.Statement + *out = make(Statements, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyDocument. +func (in *PolicyDocument) DeepCopy() *PolicyDocument { + if in == nil { + return nil + } + out := new(PolicyDocument) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in PrincipalID) DeepCopyInto(out *PrincipalID) { + { + in := &in + *out = make(PrincipalID, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrincipalID. +func (in PrincipalID) DeepCopy() PrincipalID { + if in == nil { + return nil + } + out := new(PrincipalID) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Principals) DeepCopyInto(out *Principals) { + { + in := &in + *out = make(Principals, len(*in)) + for key, val := range *in { + var outVal []string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = make(PrincipalID, len(*in)) + copy(*out, *in) + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Principals. +func (in Principals) DeepCopy() Principals { + if in == nil { + return nil + } + out := new(Principals) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Resources) DeepCopyInto(out *Resources) { + { + in := &in + *out = make(Resources, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resources. +func (in Resources) DeepCopy() Resources { + if in == nil { + return nil + } + out := new(Resources) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RouteTable) DeepCopyInto(out *RouteTable) { *out = *in @@ -1021,6 +1438,83 @@ func (in *SpotMarketOptions) DeepCopy() *SpotMarketOptions { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StatementEntry) DeepCopyInto(out *StatementEntry) { + *out = *in + if in.Principal != nil { + in, out := &in.Principal, &out.Principal + *out = make(Principals, len(*in)) + for key, val := range *in { + var outVal []string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = make(PrincipalID, len(*in)) + copy(*out, *in) + } + (*out)[key] = outVal + } + } + if in.NotPrincipal != nil { + in, out := &in.NotPrincipal, &out.NotPrincipal + *out = make(Principals, len(*in)) + for key, val := range *in { + var outVal []string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = make(PrincipalID, len(*in)) + copy(*out, *in) + } + (*out)[key] = outVal + } + } + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = make(Actions, len(*in)) + copy(*out, *in) + } + if in.Resource != nil { + in, out := &in.Resource, &out.Resource + *out = make(Resources, len(*in)) + copy(*out, *in) + } + out.Condition = in.Condition.DeepCopy() +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatementEntry. +func (in *StatementEntry) DeepCopy() *StatementEntry { + if in == nil { + return nil + } + out := new(StatementEntry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Statements) DeepCopyInto(out *Statements) { + { + in := &in + *out = make(Statements, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Statements. +func (in Statements) DeepCopy() Statements { + if in == nil { + return nil + } + out := new(Statements) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SubnetSpec) DeepCopyInto(out *SubnetSpec) { *out = *in