diff --git a/bootstrap/api/v1beta2/kthreesconfig_webhook.go b/bootstrap/api/v1beta2/kthreesconfig_webhook.go index a618d1b5..29a40278 100644 --- a/bootstrap/api/v1beta2/kthreesconfig_webhook.go +++ b/bootstrap/api/v1beta2/kthreesconfig_webhook.go @@ -20,6 +20,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" ) // SetupWebhookWithManager will setup the webhooks for the KThreesControlPlane. @@ -36,18 +37,18 @@ var _ webhook.Defaulter = &KThreesConfig{} var _ webhook.Validator = &KThreesConfig{} // ValidateCreate will do any extra validation when creating a KThreesControlPlane. -func (c *KThreesConfig) ValidateCreate() error { - return nil +func (c *KThreesConfig) ValidateCreate() (admission.Warnings, error) { + return []string{}, nil } // ValidateUpdate will do any extra validation when updating a KThreesControlPlane. -func (c *KThreesConfig) ValidateUpdate(runtime.Object) error { - return nil +func (c *KThreesConfig) ValidateUpdate(runtime.Object) (admission.Warnings, error) { + return []string{}, nil } // ValidateDelete allows you to add any extra validation when deleting. -func (c *KThreesConfig) ValidateDelete() error { - return nil +func (c *KThreesConfig) ValidateDelete() (admission.Warnings, error) { + return []string{}, nil } // Default will set default values for the KThreesControlPlane. diff --git a/bootstrap/api/v1beta2/kthreesconfigtemplate_webhook.go b/bootstrap/api/v1beta2/kthreesconfigtemplate_webhook.go index 7f4e5815..33674cbc 100644 --- a/bootstrap/api/v1beta2/kthreesconfigtemplate_webhook.go +++ b/bootstrap/api/v1beta2/kthreesconfigtemplate_webhook.go @@ -20,6 +20,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" ) // SetupWebhookWithManager will setup the webhooks for the KThreesControlPlane. @@ -36,18 +37,18 @@ var _ webhook.Defaulter = &KThreesConfigTemplate{} var _ webhook.Validator = &KThreesConfigTemplate{} // ValidateCreate will do any extra validation when creating a KThreesControlPlane. -func (c *KThreesConfigTemplate) ValidateCreate() error { - return nil +func (c *KThreesConfigTemplate) ValidateCreate() (admission.Warnings, error) { + return []string{}, nil } // ValidateUpdate will do any extra validation when updating a KThreesControlPlane. -func (c *KThreesConfigTemplate) ValidateUpdate(runtime.Object) error { - return nil +func (c *KThreesConfigTemplate) ValidateUpdate(runtime.Object) (admission.Warnings, error) { + return []string{}, nil } // ValidateDelete allows you to add any extra validation when deleting. -func (c *KThreesConfigTemplate) ValidateDelete() error { - return nil +func (c *KThreesConfigTemplate) ValidateDelete() (admission.Warnings, error) { + return []string{}, nil } // Default will set default values for the KThreesControlPlane. diff --git a/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigs.yaml b/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigs.yaml index 4a0424e7..1a6175ff 100644 --- a/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigs.yaml +++ b/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.13.0 + controller-gen.kubebuilder.io/version: v0.14.0 name: kthreesconfigs.bootstrap.cluster.x-k8s.io spec: group: bootstrap.cluster.x-k8s.io @@ -293,14 +293,19 @@ spec: description: KThreesConfig is the Schema for the kthreesconfigs 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 @@ -335,9 +340,9 @@ spec: type: string type: array privateRegistry: - description: 'TODO: take in a object or secret and write to file. - this is not useful PrivateRegistry registry configuration file - (default: "/etc/rancher/k3s/registries.yaml")' + description: |- + TODO: take in a object or secret and write to file. this is not useful + PrivateRegistry registry configuration file (default: "/etc/rancher/k3s/registries.yaml") type: string type: object files: @@ -492,37 +497,37 @@ spec: 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: - lastTransitionTime diff --git a/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigtemplates.yaml b/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigtemplates.yaml index 547d242b..e0d5a9d5 100644 --- a/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigtemplates.yaml +++ b/bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigtemplates.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.13.0 + controller-gen.kubebuilder.io/version: v0.14.0 name: kthreesconfigtemplates.bootstrap.cluster.x-k8s.io spec: group: bootstrap.cluster.x-k8s.io @@ -241,14 +241,19 @@ spec: 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 @@ -292,9 +297,9 @@ spec: type: string type: array privateRegistry: - description: 'TODO: take in a object or secret and write - to file. this is not useful PrivateRegistry registry - configuration file (default: "/etc/rancher/k3s/registries.yaml")' + description: |- + TODO: take in a object or secret and write to file. this is not useful + PrivateRegistry registry configuration file (default: "/etc/rancher/k3s/registries.yaml") type: string type: object files: diff --git a/controlplane/api/v1beta2/kthreescontrolplane_webhook.go b/controlplane/api/v1beta2/kthreescontrolplane_webhook.go index f1928c19..c05f6aba 100644 --- a/controlplane/api/v1beta2/kthreescontrolplane_webhook.go +++ b/controlplane/api/v1beta2/kthreescontrolplane_webhook.go @@ -20,6 +20,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" ) // SetupWebhookWithManager will setup the webhooks for the KThreesControlPlane. @@ -36,18 +37,18 @@ var _ webhook.Defaulter = &KThreesControlPlane{} var _ webhook.Validator = &KThreesControlPlane{} // ValidateCreate will do any extra validation when creating a KThreesControlPlane. -func (in *KThreesControlPlane) ValidateCreate() error { - return nil +func (in *KThreesControlPlane) ValidateCreate() (admission.Warnings, error) { + return []string{}, nil } // ValidateUpdate will do any extra validation when updating a KThreesControlPlane. -func (in *KThreesControlPlane) ValidateUpdate(runtime.Object) error { - return nil +func (in *KThreesControlPlane) ValidateUpdate(runtime.Object) (admission.Warnings, error) { + return []string{}, nil } // ValidateDelete allows you to add any extra validation when deleting. -func (in *KThreesControlPlane) ValidateDelete() error { - return nil +func (in *KThreesControlPlane) ValidateDelete() (admission.Warnings, error) { + return []string{}, nil } // Default will set default values for the KThreesControlPlane. diff --git a/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanes.yaml b/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanes.yaml index 8e666b29..a72c4dda 100644 --- a/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanes.yaml +++ b/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanes.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.13.0 + controller-gen.kubebuilder.io/version: v0.14.0 name: kthreescontrolplanes.controlplane.cluster.x-k8s.io spec: group: controlplane.cluster.x-k8s.io @@ -73,48 +73,58 @@ spec: description: KThreesControlPlaneSpec defines the desired state of KThreesControlPlane. properties: infrastructureTemplate: - description: InfrastructureTemplate is a required reference to a custom - resource offered by an infrastructure provider. In the next API - version we will move this into the `KThreesControlPlaneMachineTemplate` - struct. See https://github.com/k3s-io/cluster-api-k3s/issues/62 + description: |- + InfrastructureTemplate is a required reference to a custom resource + offered by an infrastructure provider. + In the next API version we will move this into the + `KThreesControlPlaneMachineTemplate` struct. See + https://github.com/k3s-io/cluster-api-k3s/issues/62 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' + 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' + 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' + description: |- + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids type: string type: object x-kubernetes-map-type: atomic kthreesConfigSpec: - description: KThreesConfigSpec is a KThreesConfigSpec to use for initializing - and joining machines to the control plane. + description: |- + KThreesConfigSpec is a KThreesConfigSpec + to use for initializing and joining machines to the control plane. properties: agentConfig: description: AgentConfig specifies configuration for the agent @@ -146,9 +156,9 @@ spec: type: string type: array privateRegistry: - description: 'TODO: take in a object or secret and write to - file. this is not useful PrivateRegistry registry configuration - file (default: "/etc/rancher/k3s/registries.yaml")' + description: |- + TODO: take in a object or secret and write to file. this is not useful + PrivateRegistry registry configuration file (default: "/etc/rancher/k3s/registries.yaml") type: string type: object files: @@ -296,37 +306,40 @@ spec: type: string type: object machineTemplate: - description: MachineTemplate contains information about how machines - should be shaped when creating or updating a control plane. + description: |- + MachineTemplate contains information about how machines should be shaped + when creating or updating a control plane. properties: metadata: - description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#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' + 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' + 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 type: object nodeDrainTimeout: - description: 'NodeDrainTimeout is the total amount of time that the - controller will spend on draining a controlplane 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 controlplane 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 remediationStrategy: description: The RemediationStrategy that controls how control plane @@ -334,55 +347,61 @@ spec: properties: maxRetry: description: "MaxRetry is the Max number of retries while attempting - to remediate an unhealthy machine. A retry happens when a machine + to remediate an unhealthy machine.\nA retry happens when a machine that was created as a replacement for an unhealthy machine also - fails. For example, given a control plane with three machines - M1, M2, M3: \n M1 become unhealthy; remediation happens, and - M1-1 is created as a replacement. If M1-1 (replacement of M1) - has problems while bootstrapping it will become unhealthy, and - then be remediated; such operation is considered a retry, remediation-retry - #1. If M1-2 (replacement of M1-1) becomes unhealthy, remediation-retry - #2 will happen, etc. \n A retry could happen only after RetryPeriod - from the previous retry. If a machine is marked as unhealthy - after MinHealthyPeriod from the previous remediation expired, - this is not considered a retry anymore because the new issue - is assumed unrelated from the previous one. \n If not set, the - remedation will be retried infinitely." + fails.\nFor example, given a control plane with three machines + M1, M2, M3:\n\n\n\tM1 become unhealthy; remediation happens, + and M1-1 is created as a replacement.\n\tIf M1-1 (replacement + of M1) has problems while bootstrapping it will become unhealthy, + and then be\n\tremediated; such operation is considered a retry, + remediation-retry #1.\n\tIf M1-2 (replacement of M1-1) becomes + unhealthy, remediation-retry #2 will happen, etc.\n\n\nA retry + could happen only after RetryPeriod from the previous retry.\nIf + a machine is marked as unhealthy after MinHealthyPeriod from + the previous remediation expired,\nthis is not considered a + retry anymore because the new issue is assumed unrelated from + the previous one.\n\n\nIf not set, the remedation will be retried + infinitely." format: int32 type: integer minHealthyPeriod: description: "MinHealthyPeriod defines the duration after which - KCP will consider any failure to a machine unrelated from the + KCP will consider any failure to a machine unrelated\nfrom the previous one. In this case the remediation is not considered - a retry anymore, and thus the retry counter restarts from 0. - For example, assuming MinHealthyPeriod is set to 1h (default) - \n M1 become unhealthy; remediation happens, and M1-1 is created - as a replacement. If M1-1 (replacement of M1) has problems within - the 1hr after the creation, also this machine will be remediated - and this operation is considered a retry - a problem related - to the original issue happened to M1 -. \n If instead the problem + a retry anymore, and thus the retry\ncounter restarts from 0. + For example, assuming MinHealthyPeriod is set to 1h (default)\n\n\n\tM1 + become unhealthy; remediation happens, and M1-1 is created as + a replacement.\n\tIf M1-1 (replacement of M1) has problems within + the 1hr after the creation, also\n\tthis machine will be remediated + and this operation is considered a retry - a problem related\n\tto + the original issue happened to M1 -.\n\n\n\tIf instead the problem on M1-1 is happening after MinHealthyPeriod expired, e.g. four - days after m1-1 has been created as a remediation of M1, the - problem on M1-1 is considered unrelated to the original issue - happened to M1. \n If not set, this value is defaulted to 1h." + days after\n\tm1-1 has been created as a remediation of M1, + the problem on M1-1 is considered unrelated to\n\tthe original + issue happened to M1.\n\n\nIf not set, this value is defaulted + to 1h." type: string retryPeriod: - description: "RetryPeriod is the duration that KCP should wait - before remediating a machine being created as a replacement - for an unhealthy machine (a retry). \n If not set, a retry will - happen immediately." + description: |- + RetryPeriod is the duration that KCP should wait before remediating a machine being created as a replacement + for an unhealthy machine (a retry). + + + If not set, a retry will happen immediately. type: string type: object replicas: - description: Number of desired machines. Defaults to 1. When stacked - etcd is used only odd numbers are permitted, as per [etcd best practice](https://etcd.io/docs/v3.3.12/faq/#why-an-odd-number-of-cluster-members). + description: |- + Number of desired machines. Defaults to 1. When stacked etcd is used only + odd numbers are permitted, as per [etcd best practice](https://etcd.io/docs/v3.3.12/faq/#why-an-odd-number-of-cluster-members). This is a pointer to distinguish between explicit zero and not specified. format: int32 type: integer upgradeAfter: - description: UpgradeAfter is a field to indicate an upgrade should - be performed after the specified time even if no changes have been - made to the KThreesControlPlane + description: |- + UpgradeAfter is a field to indicate an upgrade should be performed + after the specified time even if no changes have been made to the + KThreesControlPlane format: date-time type: string version: @@ -402,37 +421,37 @@ spec: 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: - lastTransitionTime @@ -441,13 +460,15 @@ spec: type: object type: array failureMessage: - description: ErrorMessage indicates that there is a terminal problem - reconciling the state, and will be set to a descriptive error message. + description: |- + ErrorMessage indicates that there is a terminal problem reconciling the + state, and will be set to a descriptive error message. type: string failureReason: - description: FailureReason indicates that there is a terminal problem - reconciling the state, and will be set to a token value suitable - for programmatic interpretation. + description: |- + FailureReason indicates that there is a terminal problem reconciling the + state, and will be set to a token value suitable for + programmatic interpretation. type: string initialized: description: Initialized denotes whether or not the k3s server is @@ -461,10 +482,9 @@ spec: being remediated. type: string retryCount: - description: RetryCount used to keep track of remediation retry - for the last remediated machine. A retry happens when a machine - that was created as a replacement for an unhealthy machine also - fails. + description: |- + RetryCount used to keep track of remediation retry for the last remediated machine. + A retry happens when a machine that was created as a replacement for an unhealthy machine also fails. format: int32 type: integer timestamp: @@ -483,8 +503,9 @@ spec: format: int64 type: integer ready: - description: Ready denotes that the KThreesControlPlane API Server - is ready to receive requests. + description: |- + Ready denotes that the KThreesControlPlane API Server is ready to + receive requests. type: boolean readyReplicas: description: Total number of fully running and ready control plane @@ -492,28 +513,32 @@ spec: format: int32 type: integer replicas: - description: Total number of non-terminated machines targeted by this - control plane (their labels match the selector). + description: |- + Total number of non-terminated machines targeted by this control plane + (their labels match the selector). format: int32 type: integer selector: - description: 'Selector is the label selector in string format to avoid - introspection by clients, and is used to provide the CRD-based integration - for the scale subresource and additional integrations for things - like kubectl describe.. 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 label selector in string format to avoid introspection + by clients, and is used to provide the CRD-based integration for the + scale subresource and additional integrations for things like kubectl + describe.. 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 - control plane. 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 ready or machines + description: |- + Total number of unavailable machines targeted by this control plane. + 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 ready or machines that still have not been created. format: int32 type: integer updatedReplicas: - description: Total number of non-terminated machines targeted by this - control plane that have the desired template spec. + description: |- + Total number of non-terminated machines targeted by this control plane + that have the desired template spec. format: int32 type: integer type: object @@ -565,14 +590,19 @@ spec: 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 @@ -769,40 +799,48 @@ spec: when creating or updating a control plane. properties: 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' + 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' + 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' + description: |- + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids type: string type: object x-kubernetes-map-type: atomic @@ -831,11 +869,10 @@ spec: type: object type: object nodeDrainTimeout: - description: 'NodeDrainTimeout is the total amount of time that - the controller will spend on draining a controlplane 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 controlplane 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 required: - infrastructureRef diff --git a/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanetemplates.yaml b/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanetemplates.yaml index b1a3a122..7aa4b400 100644 --- a/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanetemplates.yaml +++ b/controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanetemplates.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.13.0 + controller-gen.kubebuilder.io/version: v0.14.0 name: kthreescontrolplanetemplates.controlplane.cluster.x-k8s.io spec: group: controlplane.cluster.x-k8s.io @@ -21,14 +21,19 @@ spec: 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 @@ -39,13 +44,16 @@ spec: template: properties: metadata: - description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' + description: |- + Standard object's metadata. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata type: object spec: properties: kthreesConfigSpec: - description: KThreesConfigSpec is a KThreesConfigSpec to use - for initializing and joining machines to the control plane. + description: |- + KThreesConfigSpec is a KThreesConfigSpec + to use for initializing and joining machines to the control plane. properties: agentConfig: description: AgentConfig specifies configuration for the @@ -79,9 +87,9 @@ spec: type: string type: array privateRegistry: - description: 'TODO: take in a object or secret and - write to file. this is not useful PrivateRegistry registry - configuration file (default: "/etc/rancher/k3s/registries.yaml")' + description: |- + TODO: take in a object or secret and write to file. this is not useful + PrivateRegistry registry configuration file (default: "/etc/rancher/k3s/registries.yaml") type: string type: object files: @@ -233,79 +241,85 @@ spec: type: string type: object machineTemplate: - description: MachineTemplate contains information about how - machines should be shaped when creating or updating a control - plane. + description: |- + MachineTemplate contains information about how machines should be shaped + when creating or updating a control plane. properties: 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' + 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' + 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' + description: |- + UID of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids type: string type: object x-kubernetes-map-type: atomic metadata: - description: 'Standard object''s metadata. More info: - https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#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' + 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' + 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 nodeDrainTimeout: - description: 'NodeDrainTimeout is the total amount of - time that the controller will spend on draining a controlplane - 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 controlplane 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 required: - infrastructureRef @@ -316,53 +330,57 @@ spec: properties: maxRetry: description: "MaxRetry is the Max number of retries while - attempting to remediate an unhealthy machine. A retry + attempting to remediate an unhealthy machine.\nA retry happens when a machine that was created as a replacement - for an unhealthy machine also fails. For example, given - a control plane with three machines M1, M2, M3: \n M1 + for an unhealthy machine also fails.\nFor example, given + a control plane with three machines M1, M2, M3:\n\n\n\tM1 become unhealthy; remediation happens, and M1-1 is created - as a replacement. If M1-1 (replacement of M1) has problems - while bootstrapping it will become unhealthy, and then - be remediated; such operation is considered a retry, - remediation-retry #1. If M1-2 (replacement of M1-1) - becomes unhealthy, remediation-retry #2 will happen, - etc. \n A retry could happen only after RetryPeriod - from the previous retry. If a machine is marked as unhealthy - after MinHealthyPeriod from the previous remediation - expired, this is not considered a retry anymore because + as a replacement.\n\tIf M1-1 (replacement of M1) has + problems while bootstrapping it will become unhealthy, + and then be\n\tremediated; such operation is considered + a retry, remediation-retry #1.\n\tIf M1-2 (replacement + of M1-1) becomes unhealthy, remediation-retry #2 will + happen, etc.\n\n\nA retry could happen only after RetryPeriod + from the previous retry.\nIf a machine is marked as + unhealthy after MinHealthyPeriod from the previous remediation + expired,\nthis is not considered a retry anymore because the new issue is assumed unrelated from the previous - one. \n If not set, the remedation will be retried infinitely." + one.\n\n\nIf not set, the remedation will be retried + infinitely." format: int32 type: integer minHealthyPeriod: description: "MinHealthyPeriod defines the duration after - which KCP will consider any failure to a machine unrelated - from the previous one. In this case the remediation - is not considered a retry anymore, and thus the retry - counter restarts from 0. For example, assuming MinHealthyPeriod - is set to 1h (default) \n M1 become unhealthy; remediation - happens, and M1-1 is created as a replacement. If M1-1 - (replacement of M1) has problems within the 1hr after - the creation, also this machine will be remediated and - this operation is considered a retry - a problem related - to the original issue happened to M1 -. \n If instead - the problem on M1-1 is happening after MinHealthyPeriod - expired, e.g. four days after m1-1 has been created + which KCP will consider any failure to a machine unrelated\nfrom + the previous one. In this case the remediation is not + considered a retry anymore, and thus the retry\ncounter + restarts from 0. For example, assuming MinHealthyPeriod + is set to 1h (default)\n\n\n\tM1 become unhealthy; remediation + happens, and M1-1 is created as a replacement.\n\tIf + M1-1 (replacement of M1) has problems within the 1hr + after the creation, also\n\tthis machine will be remediated + and this operation is considered a retry - a problem + related\n\tto the original issue happened to M1 -.\n\n\n\tIf + instead the problem on M1-1 is happening after MinHealthyPeriod + expired, e.g. four days after\n\tm1-1 has been created as a remediation of M1, the problem on M1-1 is considered - unrelated to the original issue happened to M1. \n If + unrelated to\n\tthe original issue happened to M1.\n\n\nIf not set, this value is defaulted to 1h." type: string retryPeriod: - description: "RetryPeriod is the duration that KCP should - wait before remediating a machine being created as a - replacement for an unhealthy machine (a retry). \n If - not set, a retry will happen immediately." + description: |- + RetryPeriod is the duration that KCP should wait before remediating a machine being created as a replacement + for an unhealthy machine (a retry). + + + If not set, a retry will happen immediately. type: string type: object upgradeAfter: - description: UpgradeAfter is a field to indicate an upgrade - should be performed after the specified time even if no - changes have been made to the KThreesControlPlane + description: |- + UpgradeAfter is a field to indicate an upgrade should be performed + after the specified time even if no changes have been made to the + KThreesControlPlane format: date-time type: string type: object