diff --git a/.reuse/dep5 b/.reuse/dep5 index d93d2c1ed..8386966b7 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -567,6 +567,10 @@ Files: crd-catalog/kubevious/workload-operator/* Copyright: The kubevious/workload-operator Authors License: Apache-2.0 +Files: crd-catalog/kubewharf/kubeadmiral/* +Copyright: The kubewharf/kubeadmiral Authors +License: Apache-2.0 + Files: crd-catalog/kumahq/kuma/* Copyright: The kumahq/kuma Authors License: Apache-2.0 diff --git a/code-generator/src/catalog.rs b/code-generator/src/catalog.rs index 36e6f7670..e8f1c817e 100644 --- a/code-generator/src/catalog.rs +++ b/code-generator/src/catalog.rs @@ -1466,6 +1466,26 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[ "https://github.com/kubevious/workload-operator/blob/main/crds/workload.yaml", ], }, + UpstreamSource { + project_name: "kubewharf/kubeadmiral", + license: APACHE_V2, + urls: &[ + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_clustercollectedstatuses.yaml", + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_clusterfederatedobjects.yaml", + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_clusteroverridepolicies.yaml", + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_clusterpropagatedversions.yaml", + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_clusterpropagationpolicies.yaml", + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_collectedstatuses.yaml", + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_federatedclusters.yaml", + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_federatedobjects.yaml", + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_federatedtypeconfigs.yaml", + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_overridepolicies.yaml", + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_propagatedversions.yaml", + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_propagationpolicies.yaml", + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_schedulerpluginwebhookconfigurations.yaml", + "https://github.com/kubewharf/kubeadmiral/blob/main/config/crds/core.kubeadmiral.io_schedulingprofiles.yaml", + ], + }, UpstreamSource { project_name: "kumahq/kuma", license: APACHE_V2, diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clustercollectedstatuses.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clustercollectedstatuses.yaml new file mode 100644 index 000000000..ef1e092db --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clustercollectedstatuses.yaml @@ -0,0 +1,60 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: clustercollectedstatuses.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: ClusterCollectedStatus + listKind: ClusterCollectedStatusList + plural: clustercollectedstatuses + shortNames: + - ccs + singular: clustercollectedstatus + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: ClusterCollectedStatus stores the collected fields of Kubernetes objects from member clusters, that are propagated by a ClusterFederatedObject. + 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 + clusters: + description: Clusters is the list of member clusters and collected fields for its propagated Kubernetes object. + items: + description: CollectedFieldsWithCluster stores the collected fields of a Kubernetes object in a member cluster. + properties: + cluster: + description: Cluster is the name of the member cluster. + type: string + collectedFields: + description: CollectedFields is the the set of fields collected for the Kubernetes object. + x-kubernetes-preserve-unknown-fields: true + error: + description: Error records any errors encountered while collecting fields from the cluster. + type: string + required: + - cluster + - collectedFields + type: object + type: array + 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 + lastUpdateTime: + description: LastUpdateTime is the last time that a collection was performed. + format: date-time + type: string + metadata: + type: object + required: + - clusters + - lastUpdateTime + type: object + served: true + storage: true diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterfederatedobjects.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterfederatedobjects.yaml new file mode 100644 index 000000000..8d7237123 --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterfederatedobjects.yaml @@ -0,0 +1,185 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: clusterfederatedobjects.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: ClusterFederatedObject + listKind: ClusterFederatedObjectList + plural: clusterfederatedobjects + shortNames: + - cfo + singular: clusterfederatedobject + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: ClusterFederatedObject describes a cluster-scoped Kubernetes object and how it should be propagated to different member clusters. + 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 defines the desired behavior of the FederatedObject. + properties: + follows: + description: Follows defines other objects, or "leaders", that the Kubernetes object should follow during propagation, i.e. the Kubernetes object should be propagated to all member clusters that its "leaders" are placed in. + items: + description: LeaderReference contains the identifying metadata of a "leader" Kubernetes object. + properties: + group: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - kind + - name + type: object + type: array + overrides: + description: Overrides describe the overrides that should be applied to the base template of the Kubernetes object before it is propagated to individual member clusters. + items: + description: OverrideWithController describes the overrides that will be applied to a Kubernetes object before it is propagated to individual member clusters. + properties: + clusters: + description: Override is the list of member clusters and their respective override patches. + items: + description: ClusterReferenceWithPatches represents a single member cluster and a list of override patches for the cluster. + properties: + cluster: + description: Cluster is the name of the member cluster. + type: string + patches: + description: Patches is the list of override patches for the member cluster. + items: + description: OverridePatch defines a JSON patch. + properties: + op: + type: string + path: + type: string + value: + x-kubernetes-preserve-unknown-fields: true + required: + - path + type: object + type: array + required: + - cluster + type: object + type: array + controller: + description: Controller identifies the controller responsible for this override. + type: string + required: + - clusters + - controller + type: object + type: array + placements: + description: Placements describe the member clusters that the Kubernetes object will be propagated to, which is a union of all the listed clusters. + items: + description: PlacementWithController describes the member clusters that a Kubernetes object should be propagated to. + properties: + controller: + description: Controller identifies the controller responsible for this placement. + type: string + placement: + description: Placement is the list of member clusters that the Kubernetes object should be propagated to. + items: + description: ClusterReference represents a single member cluster. + properties: + cluster: + description: Cluster is the name of the member cluster. + type: string + required: + - cluster + type: object + type: array + required: + - controller + - placement + type: object + type: array + template: + description: Template is the base template of the Kubernetes object to be propagated. + x-kubernetes-preserve-unknown-fields: true + required: + - template + type: object + status: + description: Status describes the most recently observed status of the FederatedObject. + properties: + clusters: + description: Clusters contains the propagation status of the Kubernetes object for individual member clusters. + items: + description: PropagationStatus describes the propagation of a Kubernetes object to a given member cluster. + properties: + cluster: + description: Cluster is the name of the member cluster. + type: string + lastObservedGeneration: + description: LastObservedGeneration is the last observed generation of the Kubernetes object in the member cluster. + format: int64 + type: integer + status: + description: Status describes the current status of propagating the Kubernetes object to the member cluster. + type: string + required: + - cluster + - status + type: object + type: array + conditions: + description: Conditions describe the current state of this FederatedObject. + items: + description: GenericFederatedObjectCondition contains the current details about a particular condition of a FederatedObject. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time the status of this condition changed. + format: date-time + type: string + lastUpdateTime: + description: LastUpdateTime is the last time a reconciliation for this condition occurred. + format: date-time + type: string + reason: + description: Reason is the reason for the last status change of this condition. + type: string + status: + description: Status is the status of the condition, one of True, False or Unknown. + type: string + type: + description: Type is the type of the condition. + type: string + required: + - status + - type + type: object + type: array + syncedGeneration: + description: SyncedGeneration is the generation of this FederatedObject when it was last synced to selected member clusters. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusteroverridepolicies.args b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusteroverridepolicies.args new file mode 100644 index 000000000..7ab47510b --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusteroverridepolicies.args @@ -0,0 +1 @@ +--derive=PartialEq diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusteroverridepolicies.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusteroverridepolicies.yaml new file mode 100644 index 000000000..e0fd30703 --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusteroverridepolicies.yaml @@ -0,0 +1,207 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: clusteroverridepolicies.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: ClusterOverridePolicy + listKind: ClusterOverridePolicyList + plural: clusteroverridepolicies + shortNames: + - cop + singular: clusteroverridepolicy + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: ClusterOverridePolicy describes the override rules for a resource. + 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: + properties: + overrideRules: + description: OverrideRules specify the override rules. Each rule specifies the overriders and the clusters these overriders should be applied to. + items: + properties: + overriders: + description: Overriders specify the overriders to be applied in the target clusters. + properties: + image: + description: Image specifies the overriders that applies to the image. + items: + properties: + containerNames: + description: ContainerNames are ignored when ImagePath is set. If empty, the image override rule applies to all containers. Otherwise, this override targets the specified container(s) or init container(s) in the pod template. + items: + type: string + type: array + imagePath: + description: "ImagePath indicates the image path to target. For Example: /spec/template/spec/containers/0/image \n If empty, the system will automatically resolve the image path if the resource type is Pod, CronJob, Deployment, StatefulSet, DaemonSet or Job." + type: string + operations: + description: Operations are the specific operations to be performed on ContainerNames or ImagePath. + items: + properties: + imageComponent: + description: ImageComponent is the part of the image to override. + enum: + - Registry + - Repository + - Tag + - Digest + type: string + operator: + description: Operator specifies the operation. If omitted, defaults to "overwrite". + enum: + - addIfAbsent + - overwrite + - delete + type: string + value: + description: Value is the value required by the operation. For 'addIfAbsent' Operator, the old value of ImageComponent should be empty, and the Value shouldn't be empty. + type: string + required: + - imageComponent + type: object + type: array + required: + - operations + type: object + type: array + jsonpatch: + description: JsonPatch specifies overriders in a syntax similar to RFC6902 JSON Patch. + items: + properties: + operator: + description: Operator specifies the operation. If omitted, defaults to "replace". + type: string + path: + description: Path is a JSON pointer (RFC 6901) specifying the location within the resource document where the operation is performed. Each key in the path should be prefixed with "/", while "~" and "/" should be escaped as "~0" and "~1" respectively. For example, to add a label "kubeadmiral.io/label", the path should be "/metadata/labels/kubeadmiral.io~1label". + type: string + value: + description: Value is the value(s) required by the operation. + x-kubernetes-preserve-unknown-fields: true + required: + - path + type: object + type: array + type: object + targetClusters: + description: TargetClusters selects the clusters in which the overriders in this rule should be applied. If multiple types of selectors are specified, the overall result is the intersection of all of them. + properties: + clusterAffinity: + description: ClusterAffinity selects FederatedClusters by matching their labels and fields against expressions. If multiple terms are specified, their results are ORed. + items: + properties: + matchExpressions: + description: A list of cluster selector requirements by cluster labels. + items: + description: ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys + properties: + key: + type: string + operator: + description: ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt + type: string + values: + items: + type: string + type: array + required: + - key + - operator + - values + type: object + type: array + matchFields: + description: A list of cluster selector requirements by cluster fields. + items: + description: ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys + properties: + key: + type: string + operator: + description: ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt + type: string + values: + items: + type: string + type: array + required: + - key + - operator + - values + type: object + type: array + type: object + type: array + clusterSelector: + additionalProperties: + type: string + description: ClusterSelector selects FederatedClusters by their labels. Empty labels selects all FederatedClusters. + type: object + clusters: + description: Clusters selects FederatedClusters by their names. Empty Clusters selects all FederatedClusters. + items: + type: string + type: array + type: object + type: object + type: array + type: object + status: + properties: + refCount: + format: int64 + minimum: 0.0 + type: integer + typedRefCount: + items: + properties: + count: + format: int64 + minimum: 0.0 + type: integer + group: + type: string + resource: + type: string + required: + - count + - resource + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterpropagatedversions.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterpropagatedversions.yaml new file mode 100644 index 000000000..64b895d8e --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterpropagatedversions.yaml @@ -0,0 +1,62 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: clusterpropagatedversions.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: ClusterPropagatedVersion + listKind: ClusterPropagatedVersionList + plural: clusterpropagatedversions + singular: clusterpropagatedversion + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: ClusterPropagatedVersion holds version information about the state propagated from ClusterFederatedObject to member clusters. The name of a ClusterPropagatedVersion is the same as its ClusterFederatedObject. If a target resource has a populated metadata.Generation field, the generation will be stored with a prefix of `gen:` as the version for the cluster. If metadata.Generation is not available, metadata.ResourceVersion will be stored with a prefix of `rv:` as the version for the cluster. + 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 + status: + description: PropagatedVersionStatus defines the observed state of PropagatedVersion + properties: + clusterVersions: + description: The last versions produced in each cluster for this resource. + items: + properties: + clusterName: + description: The name of the cluster the version is for. + type: string + version: + description: The last version produced for the resource by a KubeAdmiral operation. + type: string + required: + - clusterName + - version + type: object + type: array + overridesVersion: + description: The observed version of the overrides for this resource. + type: string + templateVersion: + description: The observed version of the template for this resource. + type: string + required: + - overridesVersion + - templateVersion + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterpropagationpolicies.args b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterpropagationpolicies.args new file mode 100644 index 000000000..7ab47510b --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterpropagationpolicies.args @@ -0,0 +1 @@ +--derive=PartialEq diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterpropagationpolicies.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterpropagationpolicies.yaml new file mode 100644 index 000000000..602e6557b --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterpropagationpolicies.yaml @@ -0,0 +1,263 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: clusterpropagationpolicies.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: ClusterPropagationPolicy + listKind: ClusterPropagationPolicyList + plural: clusterpropagationpolicies + shortNames: + - cpp + singular: clusterpropagationpolicy + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: ClusterPropagationPolicy describes the scheduling rules for a resource. + 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: + properties: + name: + maxLength: 63 + type: string + type: object + spec: + properties: + autoMigration: + description: Configures behaviors related to auto migration. If absent, auto migration will be disabled. + properties: + keepUnschedulableReplicas: + default: false + description: Besides starting new replicas in other cluster(s), whether to keep the unschedulable replicas in the original cluster so we can go back to the desired state when the cluster recovers. + type: boolean + when: + default: + podUnschedulableFor: 1m + description: When a replica should be subject to auto migration. + minProperties: 1 + properties: + podUnschedulableFor: + description: A pod will be subject to auto migration if it remains unschedulable beyond this duration. Duration should be specified in a format that can be parsed by Go's time.ParseDuration. + format: duration + type: string + type: object + type: object + clusterAffinity: + description: ClusterAffinity is a list of cluster selector terms, the terms are ORed. A empty or nil ClusterAffinity selects everything. + items: + properties: + matchExpressions: + description: A list of cluster selector requirements by cluster labels. + items: + description: ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys + properties: + key: + type: string + operator: + description: ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt + type: string + values: + items: + type: string + type: array + required: + - key + - operator + - values + type: object + type: array + matchFields: + description: A list of cluster selector requirements by cluster fields. + items: + description: ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys + properties: + key: + type: string + operator: + description: ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt + type: string + values: + items: + type: string + type: array + required: + - key + - operator + - values + type: object + type: array + type: object + type: array + clusterSelector: + additionalProperties: + type: string + description: ClusterSelector is a label query over clusters to consider for scheduling. An empty or nil ClusterSelector selects everything. + type: object + disableFollowerScheduling: + description: DisableFollowerScheduling is a boolean that determines if follower scheduling is disabled. Resources that depend on other resources (e.g. deployments) are called leaders, and resources that are depended on (e.g. configmaps and secrets) are called followers. If a leader enables follower scheduling, its followers will additionally be scheduled to clusters where the leader is scheduled. + type: boolean + maxClusters: + description: MaxClusters is the maximum number of replicas that the federated object can be propagated to. The maximum number of clusters is unbounded if no value is provided. + format: int64 + type: integer + placement: + description: Placement is an explicit list of clusters used to select member clusters to propagate resources to. + items: + description: DesiredPlacement describes a cluster that a federated object can be propagated to and its propagation preferences. + properties: + cluster: + description: Cluster is the name of the FederatedCluster to propagate to. + type: string + preferences: + description: Preferences contains the cluster's propagation preferences. + properties: + maxReplicas: + description: Maximum number of replicas that should be assigned to this cluster workload object. Unbounded if no value provided (default). + format: int64 + minimum: 0.0 + type: integer + minReplicas: + description: Minimum number of replicas that should be assigned to this cluster workload object. 0 by default. + format: int64 + minimum: 0.0 + type: integer + weight: + description: A number expressing the preference to put an additional replica to this cluster workload object. + format: int64 + minimum: 0.0 + type: integer + type: object + required: + - cluster + type: object + type: array + reschedulePolicy: + default: + rescheduleWhen: + policyContentChanged: true + description: Configures behaviors related to rescheduling. + properties: + disableRescheduling: + description: DisableRescheduling determines if a federated object can be rescheduled. + type: boolean + replicaRescheduling: + default: {} + description: Configures behaviors related to replica rescheduling. Default set via a post-generation patch. See patch file for details. + properties: + avoidDisruption: + default: true + description: If set to true, the scheduler will attempt to prevent migrating existing replicas during rescheduling. In order to do so, replica scheduling preferences might not be fully respected. If set to false, the scheduler will always rebalance the replicas based on the specified preferences, which might cause temporary service disruption. + type: boolean + type: object + rescheduleWhen: + description: When the related objects should be subject to reschedule. + properties: + clusterAPIResourcesChanged: + default: false + description: If set to true, changes to clusters' enabled list of api resources will trigger rescheduling. It set to false, the scheduler will reschedule only when other options are triggered or the replicas or the requested resources of the template changed. + type: boolean + clusterJoined: + default: false + description: If set to true, clusters joining the federation will trigger rescheduling. It set to false, the scheduler will reschedule only when other options are triggered or the replicas or the requested resources of the template changed. + type: boolean + clusterLabelsChanged: + default: false + description: If set to true, changes to cluster labels will trigger rescheduling. It set to false, the scheduler will reschedule only when other options are triggered or the replicas or the requested resources of the template changed. + type: boolean + policyContentChanged: + default: true + description: If set to true, the scheduler will trigger rescheduling when the semantics of the policy changes. For example, modifying placement, schedulingMode, maxClusters, clusterSelector, and other configurations related to scheduling (includes reschedulePolicy itself) will immediately trigger rescheduling. Modifying the labels, annotations, autoMigration configuration will not trigger rescheduling. It set to false, the scheduler will not reschedule when the policy content changes. + type: boolean + type: object + type: object + schedulingMode: + description: SchedulingMode determines the mode used for scheduling. + enum: + - Duplicate + - Divide + type: string + schedulingProfile: + description: Profile determines the scheduling profile to be used for scheduling + type: string + tolerations: + description: Tolerations describe a set of cluster taints that the policy tolerates. + items: + description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + type: string + type: object + type: array + required: + - schedulingMode + type: object + status: + properties: + refCount: + format: int64 + minimum: 0.0 + type: integer + typedRefCount: + items: + properties: + count: + format: int64 + minimum: 0.0 + type: integer + group: + type: string + resource: + type: string + required: + - count + - resource + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/collectedstatuses.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/collectedstatuses.yaml new file mode 100644 index 000000000..0fac774f9 --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/collectedstatuses.yaml @@ -0,0 +1,60 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: collectedstatuses.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: CollectedStatus + listKind: CollectedStatusList + plural: collectedstatuses + shortNames: + - cs + singular: collectedstatus + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: CollectedStatus stores the collected fields of Kubernetes objects from member clusters, that are propagated by a FederatedObject. + 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 + clusters: + description: Clusters is the list of member clusters and collected fields for its propagated Kubernetes object. + items: + description: CollectedFieldsWithCluster stores the collected fields of a Kubernetes object in a member cluster. + properties: + cluster: + description: Cluster is the name of the member cluster. + type: string + collectedFields: + description: CollectedFields is the the set of fields collected for the Kubernetes object. + x-kubernetes-preserve-unknown-fields: true + error: + description: Error records any errors encountered while collecting fields from the cluster. + type: string + required: + - cluster + - collectedFields + type: object + type: array + 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 + lastUpdateTime: + description: LastUpdateTime is the last time that a collection was performed. + format: date-time + type: string + metadata: + type: object + required: + - clusters + - lastUpdateTime + type: object + served: true + storage: true diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedclusters.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedclusters.yaml new file mode 100644 index 000000000..69c61eb3e --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedclusters.yaml @@ -0,0 +1,191 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: federatedclusters.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: FederatedCluster + listKind: FederatedClusterList + plural: federatedclusters + shortNames: + - fcluster + singular: federatedcluster + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: ready + type: string + - jsonPath: .status.conditions[?(@.type=='Joined')].status + name: joined + type: string + - jsonPath: .metadata.creationTimestamp + name: age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: FederatedCluster is the Schema for the federatedclusters 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: FederatedClusterSpec defines the desired state of FederatedCluster + properties: + apiEndpoint: + description: The API endpoint of the member cluster. This can be a hostname, hostname:port, IP or IP:port. + type: string + insecure: + description: Access API endpoint with security. + type: boolean + secretRef: + description: Name of the secret containing the token required to access the member cluster. The secret needs to exist in the fed system namespace. + properties: + name: + description: Name of a secret within the enclosing namespace + type: string + required: + - name + type: object + taints: + description: If specified, the cluster's taints. + items: + description: The node this Taint is attached to has the "effect" on any pod that does not tolerate the Taint. + properties: + effect: + description: Required. The effect of the taint on pods that do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Required. The taint key to be applied to a node. + type: string + timeAdded: + description: TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints. + format: date-time + type: string + value: + description: The taint value corresponding to the taint key. + type: string + required: + - effect + - key + type: object + type: array + useServiceAccount: + description: Whether to use service account token to authenticate to the member cluster. + type: boolean + required: + - apiEndpoint + - secretRef + type: object + status: + description: FederatedClusterStatus defines the observed state of FederatedCluster + properties: + apiResourceTypes: + description: The list of api resource types defined in the federated cluster + items: + description: APIResource represents a Kubernetes API resource. + properties: + group: + description: Group of the resource. + type: string + kind: + description: Kind of the resource. + type: string + pluralName: + description: Lower-cased plural name of the resource (e.g. configmaps). If not provided, it will be computed by lower-casing the kind and suffixing an 's'. + type: string + scope: + description: Scope of the resource. + type: string + version: + description: Version of the resource. + type: string + required: + - kind + - pluralName + - scope + - version + type: object + type: array + conditions: + description: Conditions is an array of current cluster conditions. + items: + description: ClusterCondition describes current state of a cluster. + properties: + lastProbeTime: + description: Last time the condition was checked. + format: date-time + type: string + lastTransitionTime: + description: Last time the condition transit from one status to another. + format: date-time + type: string + message: + description: Human readable message indicating details about the current status. + type: string + reason: + description: Programmatic identifier indicating the reason for the current status. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of cluster condition, Ready or Offline. + type: string + required: + - lastProbeTime + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + joinPerformed: + description: Whether any effectual action was performed in the cluster while joining. If true, clean-up is required on cluster removal to undo the side-effects. + type: boolean + resources: + description: Resources describes the cluster's resources. + properties: + allocatable: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Allocatable represents the total resources that are allocatable for scheduling. + type: object + available: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Available represents the resources currently available for scheduling. + type: object + schedulableNodes: + description: SchedulableNodes represents number of nodes which is ready and schedulable. + format: int64 + type: integer + type: object + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedobjects.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedobjects.yaml new file mode 100644 index 000000000..da93f7a85 --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedobjects.yaml @@ -0,0 +1,185 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: federatedobjects.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: FederatedObject + listKind: FederatedObjectList + plural: federatedobjects + shortNames: + - fo + singular: federatedobject + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: FederatedObject describes a namespace-scoped Kubernetes object and how it should be propagated to different member clusters. + 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 defines the desired behavior of the FederatedObject. + properties: + follows: + description: Follows defines other objects, or "leaders", that the Kubernetes object should follow during propagation, i.e. the Kubernetes object should be propagated to all member clusters that its "leaders" are placed in. + items: + description: LeaderReference contains the identifying metadata of a "leader" Kubernetes object. + properties: + group: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - kind + - name + type: object + type: array + overrides: + description: Overrides describe the overrides that should be applied to the base template of the Kubernetes object before it is propagated to individual member clusters. + items: + description: OverrideWithController describes the overrides that will be applied to a Kubernetes object before it is propagated to individual member clusters. + properties: + clusters: + description: Override is the list of member clusters and their respective override patches. + items: + description: ClusterReferenceWithPatches represents a single member cluster and a list of override patches for the cluster. + properties: + cluster: + description: Cluster is the name of the member cluster. + type: string + patches: + description: Patches is the list of override patches for the member cluster. + items: + description: OverridePatch defines a JSON patch. + properties: + op: + type: string + path: + type: string + value: + x-kubernetes-preserve-unknown-fields: true + required: + - path + type: object + type: array + required: + - cluster + type: object + type: array + controller: + description: Controller identifies the controller responsible for this override. + type: string + required: + - clusters + - controller + type: object + type: array + placements: + description: Placements describe the member clusters that the Kubernetes object will be propagated to, which is a union of all the listed clusters. + items: + description: PlacementWithController describes the member clusters that a Kubernetes object should be propagated to. + properties: + controller: + description: Controller identifies the controller responsible for this placement. + type: string + placement: + description: Placement is the list of member clusters that the Kubernetes object should be propagated to. + items: + description: ClusterReference represents a single member cluster. + properties: + cluster: + description: Cluster is the name of the member cluster. + type: string + required: + - cluster + type: object + type: array + required: + - controller + - placement + type: object + type: array + template: + description: Template is the base template of the Kubernetes object to be propagated. + x-kubernetes-preserve-unknown-fields: true + required: + - template + type: object + status: + description: Status describes the most recently observed status of the FederatedObject. + properties: + clusters: + description: Clusters contains the propagation status of the Kubernetes object for individual member clusters. + items: + description: PropagationStatus describes the propagation of a Kubernetes object to a given member cluster. + properties: + cluster: + description: Cluster is the name of the member cluster. + type: string + lastObservedGeneration: + description: LastObservedGeneration is the last observed generation of the Kubernetes object in the member cluster. + format: int64 + type: integer + status: + description: Status describes the current status of propagating the Kubernetes object to the member cluster. + type: string + required: + - cluster + - status + type: object + type: array + conditions: + description: Conditions describe the current state of this FederatedObject. + items: + description: GenericFederatedObjectCondition contains the current details about a particular condition of a FederatedObject. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time the status of this condition changed. + format: date-time + type: string + lastUpdateTime: + description: LastUpdateTime is the last time a reconciliation for this condition occurred. + format: date-time + type: string + reason: + description: Reason is the reason for the last status change of this condition. + type: string + status: + description: Status is the status of the condition, one of True, False or Unknown. + type: string + type: + description: Type is the type of the condition. + type: string + required: + - status + - type + type: object + type: array + syncedGeneration: + description: SyncedGeneration is the generation of this FederatedObject when it was last synced to selected member clusters. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedtypeconfigs.ignore b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedtypeconfigs.ignore new file mode 100644 index 000000000..27a36b059 --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedtypeconfigs.ignore @@ -0,0 +1 @@ +cannot find type `FederatedTypeConfigStatus` in this scope diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedtypeconfigs.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedtypeconfigs.yaml new file mode 100644 index 000000000..2c1fbb00c --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedtypeconfigs.yaml @@ -0,0 +1,125 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: federatedtypeconfigs.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: FederatedTypeConfig + listKind: FederatedTypeConfigList + plural: federatedtypeconfigs + shortNames: + - ftc + singular: federatedtypeconfig + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: FederatedTypeConfig specifies an API resource type to federate and various type-specific options. + 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: + properties: + autoMigration: + description: Configuration for AutoMigration. If left empty, the AutoMigration feature will be disabled. + properties: + enabled: + description: Whether or not to automatically migrate unschedulable pods to a different cluster. + type: boolean + required: + - enabled + type: object + controllers: + description: The controllers that must run before the source object can be propagated to member clusters. Each inner slice specifies a step. Step T must complete before step T+1 can commence. Controllers within each step can execute in parallel. + items: + items: + type: string + type: array + type: array + pathDefinition: + description: Defines the paths to various fields in the target object's schema. + properties: + availableReplicasStatus: + description: Path to a numeric field that reflects the number of available replicas that the object currently has. E.g. `status.availableReplicas` for Deployment and ReplicaSet. + type: string + labelSelector: + description: Path to a metav1.LabelSelector field that selects the replicas for this object. E.g. `spec.selector` for Deployment and ReplicaSet. + type: string + readyReplicasStatus: + description: Path to a numeric field that reflects the number of ready replicas that the object currently has. E.g. `status.readyReplicas` for Deployment and ReplicaSet. + type: string + replicasSpec: + description: Path to a numeric field that indicates the number of replicas that an object can be divided into. E.g. `spec.replicas` for Deployment and ReplicaSet. + type: string + replicasStatus: + description: Path to a numeric field that reflects the number of replicas that the object currently has. E.g. `status.replicas` for Deployment and ReplicaSet. + type: string + type: object + sourceType: + description: The API resource type to be federated. + properties: + group: + description: Group of the resource. + type: string + kind: + description: Kind of the resource. + type: string + pluralName: + description: Lower-cased plural name of the resource (e.g. configmaps). If not provided, it will be computed by lower-casing the kind and suffixing an 's'. + type: string + scope: + description: Scope of the resource. + type: string + version: + description: Version of the resource. + type: string + required: + - kind + - pluralName + - scope + - version + type: object + statusAggregation: + description: Configuration for StatusAggregation. If left empty, the StatusAggregation feature will be disabled. + properties: + enabled: + description: Whether or not to enable status aggregation. + type: boolean + required: + - enabled + type: object + statusCollection: + description: Configuration for StatusCollection. If left empty, the StatusCollection feature will be disabled. + properties: + enabled: + description: Whether or not to enable status collection. + type: boolean + fields: + description: Contains the fields to be collected during status collection. Each field is a dot separated string that corresponds to its path in the source object's schema. E.g. `metadata.creationTimestamp`. + items: + type: string + type: array + required: + - enabled + type: object + required: + - sourceType + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/overridepolicies.args b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/overridepolicies.args new file mode 100644 index 000000000..7ab47510b --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/overridepolicies.args @@ -0,0 +1 @@ +--derive=PartialEq diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/overridepolicies.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/overridepolicies.yaml new file mode 100644 index 000000000..e67c730e9 --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/overridepolicies.yaml @@ -0,0 +1,207 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: overridepolicies.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: OverridePolicy + listKind: OverridePolicyList + plural: overridepolicies + shortNames: + - op + singular: overridepolicy + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: OverridePolicy describes the override rules for a resource. + 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: + properties: + overrideRules: + description: OverrideRules specify the override rules. Each rule specifies the overriders and the clusters these overriders should be applied to. + items: + properties: + overriders: + description: Overriders specify the overriders to be applied in the target clusters. + properties: + image: + description: Image specifies the overriders that applies to the image. + items: + properties: + containerNames: + description: ContainerNames are ignored when ImagePath is set. If empty, the image override rule applies to all containers. Otherwise, this override targets the specified container(s) or init container(s) in the pod template. + items: + type: string + type: array + imagePath: + description: "ImagePath indicates the image path to target. For Example: /spec/template/spec/containers/0/image \n If empty, the system will automatically resolve the image path if the resource type is Pod, CronJob, Deployment, StatefulSet, DaemonSet or Job." + type: string + operations: + description: Operations are the specific operations to be performed on ContainerNames or ImagePath. + items: + properties: + imageComponent: + description: ImageComponent is the part of the image to override. + enum: + - Registry + - Repository + - Tag + - Digest + type: string + operator: + description: Operator specifies the operation. If omitted, defaults to "overwrite". + enum: + - addIfAbsent + - overwrite + - delete + type: string + value: + description: Value is the value required by the operation. For 'addIfAbsent' Operator, the old value of ImageComponent should be empty, and the Value shouldn't be empty. + type: string + required: + - imageComponent + type: object + type: array + required: + - operations + type: object + type: array + jsonpatch: + description: JsonPatch specifies overriders in a syntax similar to RFC6902 JSON Patch. + items: + properties: + operator: + description: Operator specifies the operation. If omitted, defaults to "replace". + type: string + path: + description: Path is a JSON pointer (RFC 6901) specifying the location within the resource document where the operation is performed. Each key in the path should be prefixed with "/", while "~" and "/" should be escaped as "~0" and "~1" respectively. For example, to add a label "kubeadmiral.io/label", the path should be "/metadata/labels/kubeadmiral.io~1label". + type: string + value: + description: Value is the value(s) required by the operation. + x-kubernetes-preserve-unknown-fields: true + required: + - path + type: object + type: array + type: object + targetClusters: + description: TargetClusters selects the clusters in which the overriders in this rule should be applied. If multiple types of selectors are specified, the overall result is the intersection of all of them. + properties: + clusterAffinity: + description: ClusterAffinity selects FederatedClusters by matching their labels and fields against expressions. If multiple terms are specified, their results are ORed. + items: + properties: + matchExpressions: + description: A list of cluster selector requirements by cluster labels. + items: + description: ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys + properties: + key: + type: string + operator: + description: ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt + type: string + values: + items: + type: string + type: array + required: + - key + - operator + - values + type: object + type: array + matchFields: + description: A list of cluster selector requirements by cluster fields. + items: + description: ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys + properties: + key: + type: string + operator: + description: ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt + type: string + values: + items: + type: string + type: array + required: + - key + - operator + - values + type: object + type: array + type: object + type: array + clusterSelector: + additionalProperties: + type: string + description: ClusterSelector selects FederatedClusters by their labels. Empty labels selects all FederatedClusters. + type: object + clusters: + description: Clusters selects FederatedClusters by their names. Empty Clusters selects all FederatedClusters. + items: + type: string + type: array + type: object + type: object + type: array + type: object + status: + properties: + refCount: + format: int64 + minimum: 0.0 + type: integer + typedRefCount: + items: + properties: + count: + format: int64 + minimum: 0.0 + type: integer + group: + type: string + resource: + type: string + required: + - count + - resource + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/propagatedversions.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/propagatedversions.yaml new file mode 100644 index 000000000..520cf869e --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/propagatedversions.yaml @@ -0,0 +1,62 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: propagatedversions.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: PropagatedVersion + listKind: PropagatedVersionList + plural: propagatedversions + singular: propagatedversion + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: PropagatedVersion holds version information about the state propagated from FederatedObject to member clusters. The name of a PropagatedVersion is the same as its FederatedObject. If a target resource has a populated metadata.Generation field, the generation will be stored with a prefix of `gen:` as the version for the cluster. If metadata.Generation is not available, metadata.ResourceVersion will be stored with a prefix of `rv:` as the version for the cluster. + 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 + status: + description: PropagatedVersionStatus defines the observed state of PropagatedVersion + properties: + clusterVersions: + description: The last versions produced in each cluster for this resource. + items: + properties: + clusterName: + description: The name of the cluster the version is for. + type: string + version: + description: The last version produced for the resource by a KubeAdmiral operation. + type: string + required: + - clusterName + - version + type: object + type: array + overridesVersion: + description: The observed version of the overrides for this resource. + type: string + templateVersion: + description: The observed version of the template for this resource. + type: string + required: + - overridesVersion + - templateVersion + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/propagationpolicies.args b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/propagationpolicies.args new file mode 100644 index 000000000..7ab47510b --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/propagationpolicies.args @@ -0,0 +1 @@ +--derive=PartialEq diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/propagationpolicies.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/propagationpolicies.yaml new file mode 100644 index 000000000..90832dbba --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/propagationpolicies.yaml @@ -0,0 +1,263 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: propagationpolicies.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: PropagationPolicy + listKind: PropagationPolicyList + plural: propagationpolicies + shortNames: + - pp + singular: propagationpolicy + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: PropagationPolicy describes the scheduling rules for a resource. + 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: + properties: + name: + maxLength: 63 + type: string + type: object + spec: + properties: + autoMigration: + description: Configures behaviors related to auto migration. If absent, auto migration will be disabled. + properties: + keepUnschedulableReplicas: + default: false + description: Besides starting new replicas in other cluster(s), whether to keep the unschedulable replicas in the original cluster so we can go back to the desired state when the cluster recovers. + type: boolean + when: + default: + podUnschedulableFor: 1m + description: When a replica should be subject to auto migration. + minProperties: 1 + properties: + podUnschedulableFor: + description: A pod will be subject to auto migration if it remains unschedulable beyond this duration. Duration should be specified in a format that can be parsed by Go's time.ParseDuration. + format: duration + type: string + type: object + type: object + clusterAffinity: + description: ClusterAffinity is a list of cluster selector terms, the terms are ORed. A empty or nil ClusterAffinity selects everything. + items: + properties: + matchExpressions: + description: A list of cluster selector requirements by cluster labels. + items: + description: ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys + properties: + key: + type: string + operator: + description: ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt + type: string + values: + items: + type: string + type: array + required: + - key + - operator + - values + type: object + type: array + matchFields: + description: A list of cluster selector requirements by cluster fields. + items: + description: ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys + properties: + key: + type: string + operator: + description: ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + enum: + - In + - NotIn + - Exists + - DoesNotExist + - Gt + - Lt + type: string + values: + items: + type: string + type: array + required: + - key + - operator + - values + type: object + type: array + type: object + type: array + clusterSelector: + additionalProperties: + type: string + description: ClusterSelector is a label query over clusters to consider for scheduling. An empty or nil ClusterSelector selects everything. + type: object + disableFollowerScheduling: + description: DisableFollowerScheduling is a boolean that determines if follower scheduling is disabled. Resources that depend on other resources (e.g. deployments) are called leaders, and resources that are depended on (e.g. configmaps and secrets) are called followers. If a leader enables follower scheduling, its followers will additionally be scheduled to clusters where the leader is scheduled. + type: boolean + maxClusters: + description: MaxClusters is the maximum number of replicas that the federated object can be propagated to. The maximum number of clusters is unbounded if no value is provided. + format: int64 + type: integer + placement: + description: Placement is an explicit list of clusters used to select member clusters to propagate resources to. + items: + description: DesiredPlacement describes a cluster that a federated object can be propagated to and its propagation preferences. + properties: + cluster: + description: Cluster is the name of the FederatedCluster to propagate to. + type: string + preferences: + description: Preferences contains the cluster's propagation preferences. + properties: + maxReplicas: + description: Maximum number of replicas that should be assigned to this cluster workload object. Unbounded if no value provided (default). + format: int64 + minimum: 0.0 + type: integer + minReplicas: + description: Minimum number of replicas that should be assigned to this cluster workload object. 0 by default. + format: int64 + minimum: 0.0 + type: integer + weight: + description: A number expressing the preference to put an additional replica to this cluster workload object. + format: int64 + minimum: 0.0 + type: integer + type: object + required: + - cluster + type: object + type: array + reschedulePolicy: + default: + rescheduleWhen: + policyContentChanged: true + description: Configures behaviors related to rescheduling. + properties: + disableRescheduling: + description: DisableRescheduling determines if a federated object can be rescheduled. + type: boolean + replicaRescheduling: + default: {} + description: Configures behaviors related to replica rescheduling. Default set via a post-generation patch. See patch file for details. + properties: + avoidDisruption: + default: true + description: If set to true, the scheduler will attempt to prevent migrating existing replicas during rescheduling. In order to do so, replica scheduling preferences might not be fully respected. If set to false, the scheduler will always rebalance the replicas based on the specified preferences, which might cause temporary service disruption. + type: boolean + type: object + rescheduleWhen: + description: When the related objects should be subject to reschedule. + properties: + clusterAPIResourcesChanged: + default: false + description: If set to true, changes to clusters' enabled list of api resources will trigger rescheduling. It set to false, the scheduler will reschedule only when other options are triggered or the replicas or the requested resources of the template changed. + type: boolean + clusterJoined: + default: false + description: If set to true, clusters joining the federation will trigger rescheduling. It set to false, the scheduler will reschedule only when other options are triggered or the replicas or the requested resources of the template changed. + type: boolean + clusterLabelsChanged: + default: false + description: If set to true, changes to cluster labels will trigger rescheduling. It set to false, the scheduler will reschedule only when other options are triggered or the replicas or the requested resources of the template changed. + type: boolean + policyContentChanged: + default: true + description: If set to true, the scheduler will trigger rescheduling when the semantics of the policy changes. For example, modifying placement, schedulingMode, maxClusters, clusterSelector, and other configurations related to scheduling (includes reschedulePolicy itself) will immediately trigger rescheduling. Modifying the labels, annotations, autoMigration configuration will not trigger rescheduling. It set to false, the scheduler will not reschedule when the policy content changes. + type: boolean + type: object + type: object + schedulingMode: + description: SchedulingMode determines the mode used for scheduling. + enum: + - Duplicate + - Divide + type: string + schedulingProfile: + description: Profile determines the scheduling profile to be used for scheduling + type: string + tolerations: + description: Tolerations describe a set of cluster taints that the policy tolerates. + items: + description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + type: string + type: object + type: array + required: + - schedulingMode + type: object + status: + properties: + refCount: + format: int64 + minimum: 0.0 + type: integer + typedRefCount: + items: + properties: + count: + format: int64 + minimum: 0.0 + type: integer + group: + type: string + resource: + type: string + required: + - count + - resource + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/schedulerpluginwebhookconfigurations.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/schedulerpluginwebhookconfigurations.yaml new file mode 100644 index 000000000..12a0ac6cf --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/schedulerpluginwebhookconfigurations.yaml @@ -0,0 +1,85 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: schedulerpluginwebhookconfigurations.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: SchedulerPluginWebhookConfiguration + listKind: SchedulerPluginWebhookConfigurationList + plural: schedulerpluginwebhookconfigurations + singular: schedulerpluginwebhookconfiguration + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: SchedulerPluginWebhookConfiguration is a webhook that can be used as a scheduler plugin. + 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: + properties: + filterPath: + description: Path for the filter call, empty if not supported. This path is appended to the URLPrefix when issuing the filter call to webhook. + type: string + httpTimeout: + default: 5s + description: HTTPTimeout specifies the timeout duration for a call to the webhook. Timeout fails the scheduling of the workload. Defaults to 5 seconds. + format: duration + type: string + payloadVersions: + description: PayloadVersions is an ordered list of preferred request and response versions the webhook expects. The scheduler will try to use the first version in the list which it supports. If none of the versions specified in this list supported by the scheduler, scheduling will fail for this object. + items: + type: string + minItems: 1 + type: array + scorePath: + description: Path for the score call, empty if not supported. This verb is appended to the URLPrefix when issuing the score call to webhook. + type: string + selectPath: + description: Path for the select call, empty if not supported. This verb is appended to the URLPrefix when issuing the select call to webhook. + type: string + tlsConfig: + description: TLSConfig specifies the transport layer security config. + properties: + caData: + description: CAData holds PEM-encoded bytes (typically read from a root certificates bundle). + format: byte + type: string + certData: + description: CertData holds PEM-encoded bytes (typically read from a client certificate file). + format: byte + type: string + insecure: + description: Server should be accessed without verifying the TLS certificate. For testing only. + type: boolean + keyData: + description: KeyData holds PEM-encoded bytes (typically read from a client certificate key file). + format: byte + type: string + serverName: + description: ServerName is passed to the server for SNI and is used in the client to check server certificates against. If ServerName is empty, the hostname used to contact the server is used. + type: string + type: object + urlPrefix: + description: URLPrefix at which the webhook is available + type: string + required: + - payloadVersions + - urlPrefix + type: object + required: + - spec + type: object + served: true + storage: true diff --git a/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/schedulingprofiles.yaml b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/schedulingprofiles.yaml new file mode 100644 index 000000000..8377602a6 --- /dev/null +++ b/crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/schedulingprofiles.yaml @@ -0,0 +1,190 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + kubeadmiral.io/no-federated-resource: 'true' + name: schedulingprofiles.core.kubeadmiral.io +spec: + group: core.kubeadmiral.io + names: + kind: SchedulingProfile + listKind: SchedulingProfileList + plural: schedulingprofiles + shortNames: + - sp + singular: schedulingprofile + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: SchedulingProfile configures the plugins to use when scheduling a resource + 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: + properties: + pluginConfig: + description: PluginConfig is an optional set of custom plugin arguments for each plugin. Omitting config args for a plugin is equivalent to using the default config for that plugin. + items: + description: PluginConfig specifies arguments that should be passed to a plugin at the time of initialization. A plugin that is invoked at multiple extension points is initialized once. Args can have arbitrary structure. It is up to the plugin to process these Args. + properties: + args: + description: Args defines the arguments passed to the plugins at the time of initialization. Args can have arbitrary structure. + x-kubernetes-preserve-unknown-fields: true + name: + description: Name defines the name of plugin being configured. + type: string + required: + - name + type: object + type: array + plugins: + description: Plugins specify the set of plugins that should be enabled or disabled. Enabled plugins are the ones that should be enabled in addition to the default plugins. Disabled plugins are any of the default plugins that should be disabled. When no enabled or disabled plugin is specified for an extension point, default plugins for that extension point will be used if there is any. + properties: + filter: + description: Filter is the list of plugins that should be invoked during the filter phase. + properties: + disabled: + description: Disabled specifies default plugins that should be disabled. + items: + description: Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. + properties: + name: + description: Name defines the name of the plugin. + type: string + type: + description: Type defines the type of the plugin. Type should be omitted when referencing in-tree plugins. + enum: + - Webhook + type: string + wait: + description: Weight defines the weight of the plugin. + format: int64 + minimum: 0.0 + type: integer + type: object + type: array + enabled: + description: Enabled specifies plugins that should be enabled in addition to the default plugins. Enabled plugins are called in the order specified here, after default plugins. If they need to be invoked before default plugins, default plugins must be disabled and re-enabled here in desired order. + items: + description: Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. + properties: + name: + description: Name defines the name of the plugin. + type: string + type: + description: Type defines the type of the plugin. Type should be omitted when referencing in-tree plugins. + enum: + - Webhook + type: string + wait: + description: Weight defines the weight of the plugin. + format: int64 + minimum: 0.0 + type: integer + type: object + type: array + type: object + score: + description: Score is the list of plugins that should be invoked during the score phase. + properties: + disabled: + description: Disabled specifies default plugins that should be disabled. + items: + description: Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. + properties: + name: + description: Name defines the name of the plugin. + type: string + type: + description: Type defines the type of the plugin. Type should be omitted when referencing in-tree plugins. + enum: + - Webhook + type: string + wait: + description: Weight defines the weight of the plugin. + format: int64 + minimum: 0.0 + type: integer + type: object + type: array + enabled: + description: Enabled specifies plugins that should be enabled in addition to the default plugins. Enabled plugins are called in the order specified here, after default plugins. If they need to be invoked before default plugins, default plugins must be disabled and re-enabled here in desired order. + items: + description: Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. + properties: + name: + description: Name defines the name of the plugin. + type: string + type: + description: Type defines the type of the plugin. Type should be omitted when referencing in-tree plugins. + enum: + - Webhook + type: string + wait: + description: Weight defines the weight of the plugin. + format: int64 + minimum: 0.0 + type: integer + type: object + type: array + type: object + select: + description: Select is the list of plugins that should be invoked during the select phase. + properties: + disabled: + description: Disabled specifies default plugins that should be disabled. + items: + description: Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. + properties: + name: + description: Name defines the name of the plugin. + type: string + type: + description: Type defines the type of the plugin. Type should be omitted when referencing in-tree plugins. + enum: + - Webhook + type: string + wait: + description: Weight defines the weight of the plugin. + format: int64 + minimum: 0.0 + type: integer + type: object + type: array + enabled: + description: Enabled specifies plugins that should be enabled in addition to the default plugins. Enabled plugins are called in the order specified here, after default plugins. If they need to be invoked before default plugins, default plugins must be disabled and re-enabled here in desired order. + items: + description: Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. + properties: + name: + description: Name defines the name of the plugin. + type: string + type: + description: Type defines the type of the plugin. Type should be omitted when referencing in-tree plugins. + enum: + - Webhook + type: string + wait: + description: Weight defines the weight of the plugin. + format: int64 + minimum: 0.0 + type: integer + type: object + type: array + type: object + type: object + type: object + required: + - spec + type: object + served: true + storage: true diff --git a/kube-custom-resources-rs/Cargo.toml b/kube-custom-resources-rs/Cargo.toml index e3b3f26fb..7f496ad22 100644 --- a/kube-custom-resources-rs/Cargo.toml +++ b/kube-custom-resources-rs/Cargo.toml @@ -91,6 +91,7 @@ config_koordinator_sh = [] config_openshift_io = [] console_openshift_io = [] controlplane_operator_openshift_io = [] +core_kubeadmiral_io = [] core_linuxsuren_github_com = [] core_openfeature_dev = [] couchbase_com = [] diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/mod.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/mod.rs new file mode 100644 index 000000000..32a5a9d4f --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/mod.rs @@ -0,0 +1 @@ +pub mod v1alpha1; diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clustercollectedstatuses.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clustercollectedstatuses.rs new file mode 100644 index 000000000..0e75e1110 --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clustercollectedstatuses.rs @@ -0,0 +1,21 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clustercollectedstatuses.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.2 + + +use serde::{Serialize, Deserialize}; +use std::collections::HashMap; + +/// CollectedFieldsWithCluster stores the collected fields of a Kubernetes object in a member cluster. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct ClusterCollectedStatusClusters { + /// Cluster is the name of the member cluster. + pub cluster: String, + /// CollectedFields is the the set of fields collected for the Kubernetes object. + #[serde(rename = "collectedFields")] + pub collected_fields: HashMap, + /// Error records any errors encountered while collecting fields from the cluster. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} + diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clusterfederatedobjects.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clusterfederatedobjects.rs new file mode 100644 index 000000000..5110cae4b --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clusterfederatedobjects.rs @@ -0,0 +1,128 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterfederatedobjects.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.2 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::HashMap; + +/// Spec defines the desired behavior of the FederatedObject. +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "core.kubeadmiral.io", version = "v1alpha1", kind = "ClusterFederatedObject", plural = "clusterfederatedobjects")] +#[kube(status = "ClusterFederatedObjectStatus")] +#[kube(schema = "disabled")] +pub struct ClusterFederatedObjectSpec { + /// Follows defines other objects, or "leaders", that the Kubernetes object should follow during propagation, i.e. the Kubernetes object should be propagated to all member clusters that its "leaders" are placed in. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub follows: Option>, + /// Overrides describe the overrides that should be applied to the base template of the Kubernetes object before it is propagated to individual member clusters. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overrides: Option>, + /// Placements describe the member clusters that the Kubernetes object will be propagated to, which is a union of all the listed clusters. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub placements: Option>, + /// Template is the base template of the Kubernetes object to be propagated. + pub template: HashMap, +} + +/// LeaderReference contains the identifying metadata of a "leader" Kubernetes object. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct ClusterFederatedObjectFollows { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option, + pub kind: String, + pub name: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub namespace: Option, +} + +/// OverrideWithController describes the overrides that will be applied to a Kubernetes object before it is propagated to individual member clusters. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct ClusterFederatedObjectOverrides { + /// Override is the list of member clusters and their respective override patches. + pub clusters: Vec, + /// Controller identifies the controller responsible for this override. + pub controller: String, +} + +/// ClusterReferenceWithPatches represents a single member cluster and a list of override patches for the cluster. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct ClusterFederatedObjectOverridesClusters { + /// Cluster is the name of the member cluster. + pub cluster: String, + /// Patches is the list of override patches for the member cluster. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub patches: Option>, +} + +/// OverridePatch defines a JSON patch. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct ClusterFederatedObjectOverridesClustersPatches { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub op: Option, + pub path: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option>, +} + +/// PlacementWithController describes the member clusters that a Kubernetes object should be propagated to. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct ClusterFederatedObjectPlacements { + /// Controller identifies the controller responsible for this placement. + pub controller: String, + /// Placement is the list of member clusters that the Kubernetes object should be propagated to. + pub placement: Vec, +} + +/// ClusterReference represents a single member cluster. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct ClusterFederatedObjectPlacementsPlacement { + /// Cluster is the name of the member cluster. + pub cluster: String, +} + +/// Status describes the most recently observed status of the FederatedObject. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct ClusterFederatedObjectStatus { + /// Clusters contains the propagation status of the Kubernetes object for individual member clusters. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub clusters: Option>, + /// Conditions describe the current state of this FederatedObject. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conditions: Option>, + /// SyncedGeneration is the generation of this FederatedObject when it was last synced to selected member clusters. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "syncedGeneration")] + pub synced_generation: Option, +} + +/// PropagationStatus describes the propagation of a Kubernetes object to a given member cluster. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct ClusterFederatedObjectStatusClusters { + /// Cluster is the name of the member cluster. + pub cluster: String, + /// LastObservedGeneration is the last observed generation of the Kubernetes object in the member cluster. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastObservedGeneration")] + pub last_observed_generation: Option, + /// Status describes the current status of propagating the Kubernetes object to the member cluster. + pub status: String, +} + +/// GenericFederatedObjectCondition contains the current details about a particular condition of a FederatedObject. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct ClusterFederatedObjectStatusConditions { + /// LastTransitionTime is the last time the status of this condition changed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastTransitionTime")] + pub last_transition_time: Option, + /// LastUpdateTime is the last time a reconciliation for this condition occurred. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastUpdateTime")] + pub last_update_time: Option, + /// Reason is the reason for the last status change of this condition. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Status is the status of the condition, one of True, False or Unknown. + pub status: String, + /// Type is the type of the condition. + #[serde(rename = "type")] + pub r#type: String, +} + diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clusteroverridepolicies.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clusteroverridepolicies.rs new file mode 100644 index 000000000..eaf5d42eb --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clusteroverridepolicies.rs @@ -0,0 +1,176 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusteroverridepolicies.yaml --derive=PartialEq +// kopium version: 0.16.2 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; +use std::collections::HashMap; + +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, PartialEq)] +#[kube(group = "core.kubeadmiral.io", version = "v1alpha1", kind = "ClusterOverridePolicy", plural = "clusteroverridepolicies")] +#[kube(status = "ClusterOverridePolicyStatus")] +#[kube(schema = "disabled")] +pub struct ClusterOverridePolicySpec { + /// OverrideRules specify the override rules. Each rule specifies the overriders and the clusters these overriders should be applied to. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "overrideRules")] + pub override_rules: Option>, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterOverridePolicyOverrideRules { + /// Overriders specify the overriders to be applied in the target clusters. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overriders: Option, + /// TargetClusters selects the clusters in which the overriders in this rule should be applied. If multiple types of selectors are specified, the overall result is the intersection of all of them. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetClusters")] + pub target_clusters: Option, +} + +/// Overriders specify the overriders to be applied in the target clusters. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterOverridePolicyOverrideRulesOverriders { + /// Image specifies the overriders that applies to the image. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// JsonPatch specifies overriders in a syntax similar to RFC6902 JSON Patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub jsonpatch: Option>, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterOverridePolicyOverrideRulesOverridersImage { + /// ContainerNames are ignored when ImagePath is set. If empty, the image override rule applies to all containers. Otherwise, this override targets the specified container(s) or init container(s) in the pod template. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerNames")] + pub container_names: Option>, + /// ImagePath indicates the image path to target. For Example: /spec/template/spec/containers/0/image + /// If empty, the system will automatically resolve the image path if the resource type is Pod, CronJob, Deployment, StatefulSet, DaemonSet or Job. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imagePath")] + pub image_path: Option, + /// Operations are the specific operations to be performed on ContainerNames or ImagePath. + pub operations: Vec, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterOverridePolicyOverrideRulesOverridersImageOperations { + /// ImageComponent is the part of the image to override. + #[serde(rename = "imageComponent")] + pub image_component: ClusterOverridePolicyOverrideRulesOverridersImageOperationsImageComponent, + /// Operator specifies the operation. If omitted, defaults to "overwrite". + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option, + /// Value is the value required by the operation. For 'addIfAbsent' Operator, the old value of ImageComponent should be empty, and the Value shouldn't be empty. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum ClusterOverridePolicyOverrideRulesOverridersImageOperationsImageComponent { + Registry, + Repository, + Tag, + Digest, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum ClusterOverridePolicyOverrideRulesOverridersImageOperationsOperator { + #[serde(rename = "addIfAbsent")] + AddIfAbsent, + #[serde(rename = "overwrite")] + Overwrite, + #[serde(rename = "delete")] + Delete, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterOverridePolicyOverrideRulesOverridersJsonpatch { + /// Operator specifies the operation. If omitted, defaults to "replace". + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option, + /// Path is a JSON pointer (RFC 6901) specifying the location within the resource document where the operation is performed. Each key in the path should be prefixed with "/", while "~" and "/" should be escaped as "~0" and "~1" respectively. For example, to add a label "kubeadmiral.io/label", the path should be "/metadata/labels/kubeadmiral.io~1label". + pub path: String, + /// Value is the value(s) required by the operation. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option>, +} + +/// TargetClusters selects the clusters in which the overriders in this rule should be applied. If multiple types of selectors are specified, the overall result is the intersection of all of them. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterOverridePolicyOverrideRulesTargetClusters { + /// ClusterAffinity selects FederatedClusters by matching their labels and fields against expressions. If multiple terms are specified, their results are ORed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterAffinity")] + pub cluster_affinity: Option>, + /// ClusterSelector selects FederatedClusters by their labels. Empty labels selects all FederatedClusters. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterSelector")] + pub cluster_selector: Option>, + /// Clusters selects FederatedClusters by their names. Empty Clusters selects all FederatedClusters. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub clusters: Option>, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterOverridePolicyOverrideRulesTargetClustersClusterAffinity { + /// A list of cluster selector requirements by cluster labels. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// A list of cluster selector requirements by cluster fields. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchFields")] + pub match_fields: Option>, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterOverridePolicyOverrideRulesTargetClustersClusterAffinityMatchExpressions { + pub key: String, + /// ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + pub operator: ClusterOverridePolicyOverrideRulesTargetClustersClusterAffinityMatchExpressionsOperator, + pub values: Vec, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum ClusterOverridePolicyOverrideRulesTargetClustersClusterAffinityMatchExpressionsOperator { + In, + NotIn, + Exists, + DoesNotExist, + Gt, + Lt, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterOverridePolicyOverrideRulesTargetClustersClusterAffinityMatchFields { + pub key: String, + /// ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + pub operator: ClusterOverridePolicyOverrideRulesTargetClustersClusterAffinityMatchFieldsOperator, + pub values: Vec, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum ClusterOverridePolicyOverrideRulesTargetClustersClusterAffinityMatchFieldsOperator { + In, + NotIn, + Exists, + DoesNotExist, + Gt, + Lt, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterOverridePolicyStatus { + #[serde(default, skip_serializing_if = "Option::is_none", rename = "refCount")] + pub ref_count: Option, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "typedRefCount")] + pub typed_ref_count: Option>, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterOverridePolicyStatusTypedRefCount { + pub count: i64, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option, + pub resource: String, +} + diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clusterpropagatedversions.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clusterpropagatedversions.rs new file mode 100644 index 000000000..8bd228be4 --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clusterpropagatedversions.rs @@ -0,0 +1,30 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterpropagatedversions.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.2 + + +use serde::{Serialize, Deserialize}; + +/// PropagatedVersionStatus defines the observed state of PropagatedVersion +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct ClusterPropagatedVersionStatus { + /// The last versions produced in each cluster for this resource. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterVersions")] + pub cluster_versions: Option>, + /// The observed version of the overrides for this resource. + #[serde(rename = "overridesVersion")] + pub overrides_version: String, + /// The observed version of the template for this resource. + #[serde(rename = "templateVersion")] + pub template_version: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct ClusterPropagatedVersionStatusClusterVersions { + /// The name of the cluster the version is for. + #[serde(rename = "clusterName")] + pub cluster_name: String, + /// The last version produced for the resource by a KubeAdmiral operation. + pub version: String, +} + diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clusterpropagationpolicies.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clusterpropagationpolicies.rs new file mode 100644 index 000000000..78e902f16 --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/clusterpropagationpolicies.rs @@ -0,0 +1,219 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/clusterpropagationpolicies.yaml --derive=PartialEq +// kopium version: 0.16.2 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, PartialEq)] +#[kube(group = "core.kubeadmiral.io", version = "v1alpha1", kind = "ClusterPropagationPolicy", plural = "clusterpropagationpolicies")] +#[kube(status = "ClusterPropagationPolicyStatus")] +#[kube(schema = "disabled")] +pub struct ClusterPropagationPolicySpec { + /// Configures behaviors related to auto migration. If absent, auto migration will be disabled. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "autoMigration")] + pub auto_migration: Option, + /// ClusterAffinity is a list of cluster selector terms, the terms are ORed. A empty or nil ClusterAffinity selects everything. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterAffinity")] + pub cluster_affinity: Option>, + /// ClusterSelector is a label query over clusters to consider for scheduling. An empty or nil ClusterSelector selects everything. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterSelector")] + pub cluster_selector: Option>, + /// DisableFollowerScheduling is a boolean that determines if follower scheduling is disabled. Resources that depend on other resources (e.g. deployments) are called leaders, and resources that are depended on (e.g. configmaps and secrets) are called followers. If a leader enables follower scheduling, its followers will additionally be scheduled to clusters where the leader is scheduled. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableFollowerScheduling")] + pub disable_follower_scheduling: Option, + /// MaxClusters is the maximum number of replicas that the federated object can be propagated to. The maximum number of clusters is unbounded if no value is provided. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxClusters")] + pub max_clusters: Option, + /// Placement is an explicit list of clusters used to select member clusters to propagate resources to. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub placement: Option>, + /// Configures behaviors related to rescheduling. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "reschedulePolicy")] + pub reschedule_policy: Option, + /// SchedulingMode determines the mode used for scheduling. + #[serde(rename = "schedulingMode")] + pub scheduling_mode: ClusterPropagationPolicySchedulingMode, + /// Profile determines the scheduling profile to be used for scheduling + #[serde(default, skip_serializing_if = "Option::is_none", rename = "schedulingProfile")] + pub scheduling_profile: Option, + /// Tolerations describe a set of cluster taints that the policy tolerates. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tolerations: Option>, +} + +/// Configures behaviors related to auto migration. If absent, auto migration will be disabled. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterPropagationPolicyAutoMigration { + /// Besides starting new replicas in other cluster(s), whether to keep the unschedulable replicas in the original cluster so we can go back to the desired state when the cluster recovers. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "keepUnschedulableReplicas")] + pub keep_unschedulable_replicas: Option, + /// When a replica should be subject to auto migration. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub when: Option, +} + +/// When a replica should be subject to auto migration. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterPropagationPolicyAutoMigrationWhen { + /// A pod will be subject to auto migration if it remains unschedulable beyond this duration. Duration should be specified in a format that can be parsed by Go's time.ParseDuration. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "podUnschedulableFor")] + pub pod_unschedulable_for: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterPropagationPolicyClusterAffinity { + /// A list of cluster selector requirements by cluster labels. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// A list of cluster selector requirements by cluster fields. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchFields")] + pub match_fields: Option>, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterPropagationPolicyClusterAffinityMatchExpressions { + pub key: String, + /// ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + pub operator: ClusterPropagationPolicyClusterAffinityMatchExpressionsOperator, + pub values: Vec, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum ClusterPropagationPolicyClusterAffinityMatchExpressionsOperator { + In, + NotIn, + Exists, + DoesNotExist, + Gt, + Lt, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterPropagationPolicyClusterAffinityMatchFields { + pub key: String, + /// ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + pub operator: ClusterPropagationPolicyClusterAffinityMatchFieldsOperator, + pub values: Vec, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum ClusterPropagationPolicyClusterAffinityMatchFieldsOperator { + In, + NotIn, + Exists, + DoesNotExist, + Gt, + Lt, +} + +/// DesiredPlacement describes a cluster that a federated object can be propagated to and its propagation preferences. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterPropagationPolicyPlacement { + /// Cluster is the name of the FederatedCluster to propagate to. + pub cluster: String, + /// Preferences contains the cluster's propagation preferences. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preferences: Option, +} + +/// Preferences contains the cluster's propagation preferences. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterPropagationPolicyPlacementPreferences { + /// Maximum number of replicas that should be assigned to this cluster workload object. Unbounded if no value provided (default). + #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxReplicas")] + pub max_replicas: Option, + /// Minimum number of replicas that should be assigned to this cluster workload object. 0 by default. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "minReplicas")] + pub min_replicas: Option, + /// A number expressing the preference to put an additional replica to this cluster workload object. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub weight: Option, +} + +/// Configures behaviors related to rescheduling. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterPropagationPolicyReschedulePolicy { + /// DisableRescheduling determines if a federated object can be rescheduled. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableRescheduling")] + pub disable_rescheduling: Option, + /// Configures behaviors related to replica rescheduling. Default set via a post-generation patch. See patch file for details. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "replicaRescheduling")] + pub replica_rescheduling: Option, + /// When the related objects should be subject to reschedule. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "rescheduleWhen")] + pub reschedule_when: Option, +} + +/// Configures behaviors related to replica rescheduling. Default set via a post-generation patch. See patch file for details. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterPropagationPolicyReschedulePolicyReplicaRescheduling { + /// If set to true, the scheduler will attempt to prevent migrating existing replicas during rescheduling. In order to do so, replica scheduling preferences might not be fully respected. If set to false, the scheduler will always rebalance the replicas based on the specified preferences, which might cause temporary service disruption. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "avoidDisruption")] + pub avoid_disruption: Option, +} + +/// When the related objects should be subject to reschedule. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterPropagationPolicyReschedulePolicyRescheduleWhen { + /// If set to true, changes to clusters' enabled list of api resources will trigger rescheduling. It set to false, the scheduler will reschedule only when other options are triggered or the replicas or the requested resources of the template changed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterAPIResourcesChanged")] + pub cluster_api_resources_changed: Option, + /// If set to true, clusters joining the federation will trigger rescheduling. It set to false, the scheduler will reschedule only when other options are triggered or the replicas or the requested resources of the template changed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterJoined")] + pub cluster_joined: Option, + /// If set to true, changes to cluster labels will trigger rescheduling. It set to false, the scheduler will reschedule only when other options are triggered or the replicas or the requested resources of the template changed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterLabelsChanged")] + pub cluster_labels_changed: Option, + /// If set to true, the scheduler will trigger rescheduling when the semantics of the policy changes. For example, modifying placement, schedulingMode, maxClusters, clusterSelector, and other configurations related to scheduling (includes reschedulePolicy itself) will immediately trigger rescheduling. Modifying the labels, annotations, autoMigration configuration will not trigger rescheduling. It set to false, the scheduler will not reschedule when the policy content changes. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "policyContentChanged")] + pub policy_content_changed: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum ClusterPropagationPolicySchedulingMode { + Duplicate, + Divide, +} + +/// The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterPropagationPolicyTolerations { + /// Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub effect: Option, + /// Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key: Option, + /// Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option, + /// TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "tolerationSeconds")] + pub toleration_seconds: Option, + /// Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterPropagationPolicyStatus { + #[serde(default, skip_serializing_if = "Option::is_none", rename = "refCount")] + pub ref_count: Option, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "typedRefCount")] + pub typed_ref_count: Option>, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ClusterPropagationPolicyStatusTypedRefCount { + pub count: i64, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option, + pub resource: String, +} + diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/collectedstatuses.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/collectedstatuses.rs new file mode 100644 index 000000000..589d9be7f --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/collectedstatuses.rs @@ -0,0 +1,21 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/collectedstatuses.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.2 + + +use serde::{Serialize, Deserialize}; +use std::collections::HashMap; + +/// CollectedFieldsWithCluster stores the collected fields of a Kubernetes object in a member cluster. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct CollectedStatusClusters { + /// Cluster is the name of the member cluster. + pub cluster: String, + /// CollectedFields is the the set of fields collected for the Kubernetes object. + #[serde(rename = "collectedFields")] + pub collected_fields: HashMap, + /// Error records any errors encountered while collecting fields from the cluster. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} + diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/federatedclusters.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/federatedclusters.rs new file mode 100644 index 000000000..332a20727 --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/federatedclusters.rs @@ -0,0 +1,122 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedclusters.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.2 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; +use k8s_openapi::apimachinery::pkg::util::intstr::IntOrString; + +/// FederatedClusterSpec defines the desired state of FederatedCluster +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "core.kubeadmiral.io", version = "v1alpha1", kind = "FederatedCluster", plural = "federatedclusters")] +#[kube(status = "FederatedClusterStatus")] +#[kube(schema = "disabled")] +pub struct FederatedClusterSpec { + /// The API endpoint of the member cluster. This can be a hostname, hostname:port, IP or IP:port. + #[serde(rename = "apiEndpoint")] + pub api_endpoint: String, + /// Access API endpoint with security. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub insecure: Option, + /// Name of the secret containing the token required to access the member cluster. The secret needs to exist in the fed system namespace. + #[serde(rename = "secretRef")] + pub secret_ref: FederatedClusterSecretRef, + /// If specified, the cluster's taints. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub taints: Option>, + /// Whether to use service account token to authenticate to the member cluster. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "useServiceAccount")] + pub use_service_account: Option, +} + +/// Name of the secret containing the token required to access the member cluster. The secret needs to exist in the fed system namespace. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedClusterSecretRef { + /// Name of a secret within the enclosing namespace + pub name: String, +} + +/// The node this Taint is attached to has the "effect" on any pod that does not tolerate the Taint. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedClusterTaints { + /// Required. The effect of the taint on pods that do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule and NoExecute. + pub effect: String, + /// Required. The taint key to be applied to a node. + pub key: String, + /// TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeAdded")] + pub time_added: Option, + /// The taint value corresponding to the taint key. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} + +/// FederatedClusterStatus defines the observed state of FederatedCluster +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedClusterStatus { + /// The list of api resource types defined in the federated cluster + #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiResourceTypes")] + pub api_resource_types: Option>, + /// Conditions is an array of current cluster conditions. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conditions: Option>, + /// Whether any effectual action was performed in the cluster while joining. If true, clean-up is required on cluster removal to undo the side-effects. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "joinPerformed")] + pub join_performed: Option, + /// Resources describes the cluster's resources. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub resources: Option, +} + +/// APIResource represents a Kubernetes API resource. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedClusterStatusApiResourceTypes { + /// Group of the resource. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option, + /// Kind of the resource. + pub kind: String, + /// Lower-cased plural name of the resource (e.g. configmaps). If not provided, it will be computed by lower-casing the kind and suffixing an 's'. + #[serde(rename = "pluralName")] + pub plural_name: String, + /// Scope of the resource. + pub scope: String, + /// Version of the resource. + pub version: String, +} + +/// ClusterCondition describes current state of a cluster. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedClusterStatusConditions { + /// Last time the condition was checked. + #[serde(rename = "lastProbeTime")] + pub last_probe_time: String, + /// Last time the condition transit from one status to another. + #[serde(rename = "lastTransitionTime")] + pub last_transition_time: String, + /// Human readable message indicating details about the current status. + pub message: String, + /// Programmatic identifier indicating the reason for the current status. + pub reason: String, + /// Status of the condition, one of True, False, Unknown. + pub status: String, + /// Type of cluster condition, Ready or Offline. + #[serde(rename = "type")] + pub r#type: String, +} + +/// Resources describes the cluster's resources. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedClusterStatusResources { + /// Allocatable represents the total resources that are allocatable for scheduling. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub allocatable: Option>, + /// Available represents the resources currently available for scheduling. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub available: Option>, + /// SchedulableNodes represents number of nodes which is ready and schedulable. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "schedulableNodes")] + pub schedulable_nodes: Option, +} + diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/federatedobjects.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/federatedobjects.rs new file mode 100644 index 000000000..07022900b --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/federatedobjects.rs @@ -0,0 +1,129 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/federatedobjects.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.2 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::HashMap; + +/// Spec defines the desired behavior of the FederatedObject. +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "core.kubeadmiral.io", version = "v1alpha1", kind = "FederatedObject", plural = "federatedobjects")] +#[kube(namespaced)] +#[kube(status = "FederatedObjectStatus")] +#[kube(schema = "disabled")] +pub struct FederatedObjectSpec { + /// Follows defines other objects, or "leaders", that the Kubernetes object should follow during propagation, i.e. the Kubernetes object should be propagated to all member clusters that its "leaders" are placed in. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub follows: Option>, + /// Overrides describe the overrides that should be applied to the base template of the Kubernetes object before it is propagated to individual member clusters. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overrides: Option>, + /// Placements describe the member clusters that the Kubernetes object will be propagated to, which is a union of all the listed clusters. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub placements: Option>, + /// Template is the base template of the Kubernetes object to be propagated. + pub template: HashMap, +} + +/// LeaderReference contains the identifying metadata of a "leader" Kubernetes object. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedObjectFollows { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option, + pub kind: String, + pub name: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub namespace: Option, +} + +/// OverrideWithController describes the overrides that will be applied to a Kubernetes object before it is propagated to individual member clusters. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedObjectOverrides { + /// Override is the list of member clusters and their respective override patches. + pub clusters: Vec, + /// Controller identifies the controller responsible for this override. + pub controller: String, +} + +/// ClusterReferenceWithPatches represents a single member cluster and a list of override patches for the cluster. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedObjectOverridesClusters { + /// Cluster is the name of the member cluster. + pub cluster: String, + /// Patches is the list of override patches for the member cluster. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub patches: Option>, +} + +/// OverridePatch defines a JSON patch. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedObjectOverridesClustersPatches { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub op: Option, + pub path: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option>, +} + +/// PlacementWithController describes the member clusters that a Kubernetes object should be propagated to. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedObjectPlacements { + /// Controller identifies the controller responsible for this placement. + pub controller: String, + /// Placement is the list of member clusters that the Kubernetes object should be propagated to. + pub placement: Vec, +} + +/// ClusterReference represents a single member cluster. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedObjectPlacementsPlacement { + /// Cluster is the name of the member cluster. + pub cluster: String, +} + +/// Status describes the most recently observed status of the FederatedObject. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedObjectStatus { + /// Clusters contains the propagation status of the Kubernetes object for individual member clusters. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub clusters: Option>, + /// Conditions describe the current state of this FederatedObject. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conditions: Option>, + /// SyncedGeneration is the generation of this FederatedObject when it was last synced to selected member clusters. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "syncedGeneration")] + pub synced_generation: Option, +} + +/// PropagationStatus describes the propagation of a Kubernetes object to a given member cluster. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedObjectStatusClusters { + /// Cluster is the name of the member cluster. + pub cluster: String, + /// LastObservedGeneration is the last observed generation of the Kubernetes object in the member cluster. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastObservedGeneration")] + pub last_observed_generation: Option, + /// Status describes the current status of propagating the Kubernetes object to the member cluster. + pub status: String, +} + +/// GenericFederatedObjectCondition contains the current details about a particular condition of a FederatedObject. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct FederatedObjectStatusConditions { + /// LastTransitionTime is the last time the status of this condition changed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastTransitionTime")] + pub last_transition_time: Option, + /// LastUpdateTime is the last time a reconciliation for this condition occurred. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastUpdateTime")] + pub last_update_time: Option, + /// Reason is the reason for the last status change of this condition. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Status is the status of the condition, one of True, False or Unknown. + pub status: String, + /// Type is the type of the condition. + #[serde(rename = "type")] + pub r#type: String, +} + diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/mod.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/mod.rs new file mode 100644 index 000000000..18a9bd411 --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/mod.rs @@ -0,0 +1,13 @@ +pub mod clustercollectedstatuses; +pub mod clusterfederatedobjects; +pub mod clusteroverridepolicies; +pub mod clusterpropagatedversions; +pub mod clusterpropagationpolicies; +pub mod collectedstatuses; +pub mod federatedclusters; +pub mod federatedobjects; +pub mod overridepolicies; +pub mod propagatedversions; +pub mod propagationpolicies; +pub mod schedulerpluginwebhookconfigurations; +pub mod schedulingprofiles; diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/overridepolicies.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/overridepolicies.rs new file mode 100644 index 000000000..78a15cd0f --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/overridepolicies.rs @@ -0,0 +1,177 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/overridepolicies.yaml --derive=PartialEq +// kopium version: 0.16.2 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; +use std::collections::HashMap; + +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, PartialEq)] +#[kube(group = "core.kubeadmiral.io", version = "v1alpha1", kind = "OverridePolicy", plural = "overridepolicies")] +#[kube(namespaced)] +#[kube(status = "OverridePolicyStatus")] +#[kube(schema = "disabled")] +pub struct OverridePolicySpec { + /// OverrideRules specify the override rules. Each rule specifies the overriders and the clusters these overriders should be applied to. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "overrideRules")] + pub override_rules: Option>, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct OverridePolicyOverrideRules { + /// Overriders specify the overriders to be applied in the target clusters. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overriders: Option, + /// TargetClusters selects the clusters in which the overriders in this rule should be applied. If multiple types of selectors are specified, the overall result is the intersection of all of them. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetClusters")] + pub target_clusters: Option, +} + +/// Overriders specify the overriders to be applied in the target clusters. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct OverridePolicyOverrideRulesOverriders { + /// Image specifies the overriders that applies to the image. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub image: Option>, + /// JsonPatch specifies overriders in a syntax similar to RFC6902 JSON Patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub jsonpatch: Option>, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct OverridePolicyOverrideRulesOverridersImage { + /// ContainerNames are ignored when ImagePath is set. If empty, the image override rule applies to all containers. Otherwise, this override targets the specified container(s) or init container(s) in the pod template. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerNames")] + pub container_names: Option>, + /// ImagePath indicates the image path to target. For Example: /spec/template/spec/containers/0/image + /// If empty, the system will automatically resolve the image path if the resource type is Pod, CronJob, Deployment, StatefulSet, DaemonSet or Job. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "imagePath")] + pub image_path: Option, + /// Operations are the specific operations to be performed on ContainerNames or ImagePath. + pub operations: Vec, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct OverridePolicyOverrideRulesOverridersImageOperations { + /// ImageComponent is the part of the image to override. + #[serde(rename = "imageComponent")] + pub image_component: OverridePolicyOverrideRulesOverridersImageOperationsImageComponent, + /// Operator specifies the operation. If omitted, defaults to "overwrite". + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option, + /// Value is the value required by the operation. For 'addIfAbsent' Operator, the old value of ImageComponent should be empty, and the Value shouldn't be empty. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum OverridePolicyOverrideRulesOverridersImageOperationsImageComponent { + Registry, + Repository, + Tag, + Digest, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum OverridePolicyOverrideRulesOverridersImageOperationsOperator { + #[serde(rename = "addIfAbsent")] + AddIfAbsent, + #[serde(rename = "overwrite")] + Overwrite, + #[serde(rename = "delete")] + Delete, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct OverridePolicyOverrideRulesOverridersJsonpatch { + /// Operator specifies the operation. If omitted, defaults to "replace". + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option, + /// Path is a JSON pointer (RFC 6901) specifying the location within the resource document where the operation is performed. Each key in the path should be prefixed with "/", while "~" and "/" should be escaped as "~0" and "~1" respectively. For example, to add a label "kubeadmiral.io/label", the path should be "/metadata/labels/kubeadmiral.io~1label". + pub path: String, + /// Value is the value(s) required by the operation. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option>, +} + +/// TargetClusters selects the clusters in which the overriders in this rule should be applied. If multiple types of selectors are specified, the overall result is the intersection of all of them. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct OverridePolicyOverrideRulesTargetClusters { + /// ClusterAffinity selects FederatedClusters by matching their labels and fields against expressions. If multiple terms are specified, their results are ORed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterAffinity")] + pub cluster_affinity: Option>, + /// ClusterSelector selects FederatedClusters by their labels. Empty labels selects all FederatedClusters. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterSelector")] + pub cluster_selector: Option>, + /// Clusters selects FederatedClusters by their names. Empty Clusters selects all FederatedClusters. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub clusters: Option>, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct OverridePolicyOverrideRulesTargetClustersClusterAffinity { + /// A list of cluster selector requirements by cluster labels. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// A list of cluster selector requirements by cluster fields. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchFields")] + pub match_fields: Option>, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct OverridePolicyOverrideRulesTargetClustersClusterAffinityMatchExpressions { + pub key: String, + /// ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + pub operator: OverridePolicyOverrideRulesTargetClustersClusterAffinityMatchExpressionsOperator, + pub values: Vec, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum OverridePolicyOverrideRulesTargetClustersClusterAffinityMatchExpressionsOperator { + In, + NotIn, + Exists, + DoesNotExist, + Gt, + Lt, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct OverridePolicyOverrideRulesTargetClustersClusterAffinityMatchFields { + pub key: String, + /// ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + pub operator: OverridePolicyOverrideRulesTargetClustersClusterAffinityMatchFieldsOperator, + pub values: Vec, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum OverridePolicyOverrideRulesTargetClustersClusterAffinityMatchFieldsOperator { + In, + NotIn, + Exists, + DoesNotExist, + Gt, + Lt, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct OverridePolicyStatus { + #[serde(default, skip_serializing_if = "Option::is_none", rename = "refCount")] + pub ref_count: Option, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "typedRefCount")] + pub typed_ref_count: Option>, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct OverridePolicyStatusTypedRefCount { + pub count: i64, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option, + pub resource: String, +} + diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/propagatedversions.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/propagatedversions.rs new file mode 100644 index 000000000..e76b889bd --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/propagatedversions.rs @@ -0,0 +1,30 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/propagatedversions.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.2 + + +use serde::{Serialize, Deserialize}; + +/// PropagatedVersionStatus defines the observed state of PropagatedVersion +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct PropagatedVersionStatus { + /// The last versions produced in each cluster for this resource. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterVersions")] + pub cluster_versions: Option>, + /// The observed version of the overrides for this resource. + #[serde(rename = "overridesVersion")] + pub overrides_version: String, + /// The observed version of the template for this resource. + #[serde(rename = "templateVersion")] + pub template_version: String, +} + +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct PropagatedVersionStatusClusterVersions { + /// The name of the cluster the version is for. + #[serde(rename = "clusterName")] + pub cluster_name: String, + /// The last version produced for the resource by a KubeAdmiral operation. + pub version: String, +} + diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/propagationpolicies.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/propagationpolicies.rs new file mode 100644 index 000000000..0d703725d --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/propagationpolicies.rs @@ -0,0 +1,220 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/propagationpolicies.yaml --derive=PartialEq +// kopium version: 0.16.2 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, PartialEq)] +#[kube(group = "core.kubeadmiral.io", version = "v1alpha1", kind = "PropagationPolicy", plural = "propagationpolicies")] +#[kube(namespaced)] +#[kube(status = "PropagationPolicyStatus")] +#[kube(schema = "disabled")] +pub struct PropagationPolicySpec { + /// Configures behaviors related to auto migration. If absent, auto migration will be disabled. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "autoMigration")] + pub auto_migration: Option, + /// ClusterAffinity is a list of cluster selector terms, the terms are ORed. A empty or nil ClusterAffinity selects everything. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterAffinity")] + pub cluster_affinity: Option>, + /// ClusterSelector is a label query over clusters to consider for scheduling. An empty or nil ClusterSelector selects everything. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterSelector")] + pub cluster_selector: Option>, + /// DisableFollowerScheduling is a boolean that determines if follower scheduling is disabled. Resources that depend on other resources (e.g. deployments) are called leaders, and resources that are depended on (e.g. configmaps and secrets) are called followers. If a leader enables follower scheduling, its followers will additionally be scheduled to clusters where the leader is scheduled. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableFollowerScheduling")] + pub disable_follower_scheduling: Option, + /// MaxClusters is the maximum number of replicas that the federated object can be propagated to. The maximum number of clusters is unbounded if no value is provided. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxClusters")] + pub max_clusters: Option, + /// Placement is an explicit list of clusters used to select member clusters to propagate resources to. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub placement: Option>, + /// Configures behaviors related to rescheduling. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "reschedulePolicy")] + pub reschedule_policy: Option, + /// SchedulingMode determines the mode used for scheduling. + #[serde(rename = "schedulingMode")] + pub scheduling_mode: PropagationPolicySchedulingMode, + /// Profile determines the scheduling profile to be used for scheduling + #[serde(default, skip_serializing_if = "Option::is_none", rename = "schedulingProfile")] + pub scheduling_profile: Option, + /// Tolerations describe a set of cluster taints that the policy tolerates. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tolerations: Option>, +} + +/// Configures behaviors related to auto migration. If absent, auto migration will be disabled. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct PropagationPolicyAutoMigration { + /// Besides starting new replicas in other cluster(s), whether to keep the unschedulable replicas in the original cluster so we can go back to the desired state when the cluster recovers. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "keepUnschedulableReplicas")] + pub keep_unschedulable_replicas: Option, + /// When a replica should be subject to auto migration. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub when: Option, +} + +/// When a replica should be subject to auto migration. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct PropagationPolicyAutoMigrationWhen { + /// A pod will be subject to auto migration if it remains unschedulable beyond this duration. Duration should be specified in a format that can be parsed by Go's time.ParseDuration. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "podUnschedulableFor")] + pub pod_unschedulable_for: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct PropagationPolicyClusterAffinity { + /// A list of cluster selector requirements by cluster labels. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// A list of cluster selector requirements by cluster fields. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchFields")] + pub match_fields: Option>, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct PropagationPolicyClusterAffinityMatchExpressions { + pub key: String, + /// ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + pub operator: PropagationPolicyClusterAffinityMatchExpressionsOperator, + pub values: Vec, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum PropagationPolicyClusterAffinityMatchExpressionsOperator { + In, + NotIn, + Exists, + DoesNotExist, + Gt, + Lt, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct PropagationPolicyClusterAffinityMatchFields { + pub key: String, + /// ClusterSelectorOperator is the set of operators that can be used in a cluster selector requirement. + pub operator: PropagationPolicyClusterAffinityMatchFieldsOperator, + pub values: Vec, +} + +/// ClusterSelectorRequirement is a selector that contains values, a key, and an operator that relates the values and keys +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum PropagationPolicyClusterAffinityMatchFieldsOperator { + In, + NotIn, + Exists, + DoesNotExist, + Gt, + Lt, +} + +/// DesiredPlacement describes a cluster that a federated object can be propagated to and its propagation preferences. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct PropagationPolicyPlacement { + /// Cluster is the name of the FederatedCluster to propagate to. + pub cluster: String, + /// Preferences contains the cluster's propagation preferences. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preferences: Option, +} + +/// Preferences contains the cluster's propagation preferences. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct PropagationPolicyPlacementPreferences { + /// Maximum number of replicas that should be assigned to this cluster workload object. Unbounded if no value provided (default). + #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxReplicas")] + pub max_replicas: Option, + /// Minimum number of replicas that should be assigned to this cluster workload object. 0 by default. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "minReplicas")] + pub min_replicas: Option, + /// A number expressing the preference to put an additional replica to this cluster workload object. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub weight: Option, +} + +/// Configures behaviors related to rescheduling. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct PropagationPolicyReschedulePolicy { + /// DisableRescheduling determines if a federated object can be rescheduled. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableRescheduling")] + pub disable_rescheduling: Option, + /// Configures behaviors related to replica rescheduling. Default set via a post-generation patch. See patch file for details. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "replicaRescheduling")] + pub replica_rescheduling: Option, + /// When the related objects should be subject to reschedule. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "rescheduleWhen")] + pub reschedule_when: Option, +} + +/// Configures behaviors related to replica rescheduling. Default set via a post-generation patch. See patch file for details. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct PropagationPolicyReschedulePolicyReplicaRescheduling { + /// If set to true, the scheduler will attempt to prevent migrating existing replicas during rescheduling. In order to do so, replica scheduling preferences might not be fully respected. If set to false, the scheduler will always rebalance the replicas based on the specified preferences, which might cause temporary service disruption. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "avoidDisruption")] + pub avoid_disruption: Option, +} + +/// When the related objects should be subject to reschedule. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct PropagationPolicyReschedulePolicyRescheduleWhen { + /// If set to true, changes to clusters' enabled list of api resources will trigger rescheduling. It set to false, the scheduler will reschedule only when other options are triggered or the replicas or the requested resources of the template changed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterAPIResourcesChanged")] + pub cluster_api_resources_changed: Option, + /// If set to true, clusters joining the federation will trigger rescheduling. It set to false, the scheduler will reschedule only when other options are triggered or the replicas or the requested resources of the template changed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterJoined")] + pub cluster_joined: Option, + /// If set to true, changes to cluster labels will trigger rescheduling. It set to false, the scheduler will reschedule only when other options are triggered or the replicas or the requested resources of the template changed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterLabelsChanged")] + pub cluster_labels_changed: Option, + /// If set to true, the scheduler will trigger rescheduling when the semantics of the policy changes. For example, modifying placement, schedulingMode, maxClusters, clusterSelector, and other configurations related to scheduling (includes reschedulePolicy itself) will immediately trigger rescheduling. Modifying the labels, annotations, autoMigration configuration will not trigger rescheduling. It set to false, the scheduler will not reschedule when the policy content changes. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "policyContentChanged")] + pub policy_content_changed: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum PropagationPolicySchedulingMode { + Duplicate, + Divide, +} + +/// The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct PropagationPolicyTolerations { + /// Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub effect: Option, + /// Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key: Option, + /// Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub operator: Option, + /// TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "tolerationSeconds")] + pub toleration_seconds: Option, + /// Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct PropagationPolicyStatus { + #[serde(default, skip_serializing_if = "Option::is_none", rename = "refCount")] + pub ref_count: Option, + #[serde(default, skip_serializing_if = "Option::is_none", rename = "typedRefCount")] + pub typed_ref_count: Option>, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct PropagationPolicyStatusTypedRefCount { + pub count: i64, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group: Option, + pub resource: String, +} + diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/schedulerpluginwebhookconfigurations.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/schedulerpluginwebhookconfigurations.rs new file mode 100644 index 000000000..a37340c52 --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/schedulerpluginwebhookconfigurations.rs @@ -0,0 +1,54 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/schedulerpluginwebhookconfigurations.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.2 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; + +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "core.kubeadmiral.io", version = "v1alpha1", kind = "SchedulerPluginWebhookConfiguration", plural = "schedulerpluginwebhookconfigurations")] +#[kube(schema = "disabled")] +pub struct SchedulerPluginWebhookConfigurationSpec { + /// Path for the filter call, empty if not supported. This path is appended to the URLPrefix when issuing the filter call to webhook. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "filterPath")] + pub filter_path: Option, + /// HTTPTimeout specifies the timeout duration for a call to the webhook. Timeout fails the scheduling of the workload. Defaults to 5 seconds. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpTimeout")] + pub http_timeout: Option, + /// PayloadVersions is an ordered list of preferred request and response versions the webhook expects. The scheduler will try to use the first version in the list which it supports. If none of the versions specified in this list supported by the scheduler, scheduling will fail for this object. + #[serde(rename = "payloadVersions")] + pub payload_versions: Vec, + /// Path for the score call, empty if not supported. This verb is appended to the URLPrefix when issuing the score call to webhook. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "scorePath")] + pub score_path: Option, + /// Path for the select call, empty if not supported. This verb is appended to the URLPrefix when issuing the select call to webhook. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "selectPath")] + pub select_path: Option, + /// TLSConfig specifies the transport layer security config. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "tlsConfig")] + pub tls_config: Option, + /// URLPrefix at which the webhook is available + #[serde(rename = "urlPrefix")] + pub url_prefix: String, +} + +/// TLSConfig specifies the transport layer security config. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SchedulerPluginWebhookConfigurationTlsConfig { + /// CAData holds PEM-encoded bytes (typically read from a root certificates bundle). + #[serde(default, skip_serializing_if = "Option::is_none", rename = "caData")] + pub ca_data: Option, + /// CertData holds PEM-encoded bytes (typically read from a client certificate file). + #[serde(default, skip_serializing_if = "Option::is_none", rename = "certData")] + pub cert_data: Option, + /// Server should be accessed without verifying the TLS certificate. For testing only. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub insecure: Option, + /// KeyData holds PEM-encoded bytes (typically read from a client certificate key file). + #[serde(default, skip_serializing_if = "Option::is_none", rename = "keyData")] + pub key_data: Option, + /// ServerName is passed to the server for SNI and is used in the client to check server certificates against. If ServerName is empty, the hostname used to contact the server is used. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "serverName")] + pub server_name: Option, +} + diff --git a/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/schedulingprofiles.rs b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/schedulingprofiles.rs new file mode 100644 index 000000000..52a22a6f1 --- /dev/null +++ b/kube-custom-resources-rs/src/core_kubeadmiral_io/v1alpha1/schedulingprofiles.rs @@ -0,0 +1,197 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename=./crd-catalog/kubewharf/kubeadmiral/core.kubeadmiral.io/v1alpha1/schedulingprofiles.yaml --derive=Default --derive=PartialEq +// kopium version: 0.16.2 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::HashMap; + +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +#[kube(group = "core.kubeadmiral.io", version = "v1alpha1", kind = "SchedulingProfile", plural = "schedulingprofiles")] +#[kube(schema = "disabled")] +pub struct SchedulingProfileSpec { + /// PluginConfig is an optional set of custom plugin arguments for each plugin. Omitting config args for a plugin is equivalent to using the default config for that plugin. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "pluginConfig")] + pub plugin_config: Option>, + /// Plugins specify the set of plugins that should be enabled or disabled. Enabled plugins are the ones that should be enabled in addition to the default plugins. Disabled plugins are any of the default plugins that should be disabled. When no enabled or disabled plugin is specified for an extension point, default plugins for that extension point will be used if there is any. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub plugins: Option, +} + +/// PluginConfig specifies arguments that should be passed to a plugin at the time of initialization. A plugin that is invoked at multiple extension points is initialized once. Args can have arbitrary structure. It is up to the plugin to process these Args. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SchedulingProfilePluginConfig { + /// Args defines the arguments passed to the plugins at the time of initialization. Args can have arbitrary structure. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub args: Option>, + /// Name defines the name of plugin being configured. + pub name: String, +} + +/// Plugins specify the set of plugins that should be enabled or disabled. Enabled plugins are the ones that should be enabled in addition to the default plugins. Disabled plugins are any of the default plugins that should be disabled. When no enabled or disabled plugin is specified for an extension point, default plugins for that extension point will be used if there is any. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SchedulingProfilePlugins { + /// Filter is the list of plugins that should be invoked during the filter phase. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub filter: Option, + /// Score is the list of plugins that should be invoked during the score phase. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub score: Option, + /// Select is the list of plugins that should be invoked during the select phase. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub select: Option, +} + +/// Filter is the list of plugins that should be invoked during the filter phase. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SchedulingProfilePluginsFilter { + /// Disabled specifies default plugins that should be disabled. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub disabled: Option>, + /// Enabled specifies plugins that should be enabled in addition to the default plugins. Enabled plugins are called in the order specified here, after default plugins. If they need to be invoked before default plugins, default plugins must be disabled and re-enabled here in desired order. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option>, +} + +/// Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SchedulingProfilePluginsFilterDisabled { + /// Name defines the name of the plugin. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Type defines the type of the plugin. Type should be omitted when referencing in-tree plugins. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")] + pub r#type: Option, + /// Weight defines the weight of the plugin. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wait: Option, +} + +/// Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum SchedulingProfilePluginsFilterDisabledType { + Webhook, +} + +/// Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SchedulingProfilePluginsFilterEnabled { + /// Name defines the name of the plugin. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Type defines the type of the plugin. Type should be omitted when referencing in-tree plugins. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")] + pub r#type: Option, + /// Weight defines the weight of the plugin. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wait: Option, +} + +/// Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum SchedulingProfilePluginsFilterEnabledType { + Webhook, +} + +/// Score is the list of plugins that should be invoked during the score phase. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SchedulingProfilePluginsScore { + /// Disabled specifies default plugins that should be disabled. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub disabled: Option>, + /// Enabled specifies plugins that should be enabled in addition to the default plugins. Enabled plugins are called in the order specified here, after default plugins. If they need to be invoked before default plugins, default plugins must be disabled and re-enabled here in desired order. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option>, +} + +/// Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SchedulingProfilePluginsScoreDisabled { + /// Name defines the name of the plugin. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Type defines the type of the plugin. Type should be omitted when referencing in-tree plugins. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")] + pub r#type: Option, + /// Weight defines the weight of the plugin. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wait: Option, +} + +/// Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum SchedulingProfilePluginsScoreDisabledType { + Webhook, +} + +/// Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SchedulingProfilePluginsScoreEnabled { + /// Name defines the name of the plugin. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Type defines the type of the plugin. Type should be omitted when referencing in-tree plugins. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")] + pub r#type: Option, + /// Weight defines the weight of the plugin. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wait: Option, +} + +/// Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum SchedulingProfilePluginsScoreEnabledType { + Webhook, +} + +/// Select is the list of plugins that should be invoked during the select phase. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SchedulingProfilePluginsSelect { + /// Disabled specifies default plugins that should be disabled. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub disabled: Option>, + /// Enabled specifies plugins that should be enabled in addition to the default plugins. Enabled plugins are called in the order specified here, after default plugins. If they need to be invoked before default plugins, default plugins must be disabled and re-enabled here in desired order. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub enabled: Option>, +} + +/// Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SchedulingProfilePluginsSelectDisabled { + /// Name defines the name of the plugin. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Type defines the type of the plugin. Type should be omitted when referencing in-tree plugins. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")] + pub r#type: Option, + /// Weight defines the weight of the plugin. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wait: Option, +} + +/// Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum SchedulingProfilePluginsSelectDisabledType { + Webhook, +} + +/// Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] +pub struct SchedulingProfilePluginsSelectEnabled { + /// Name defines the name of the plugin. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Type defines the type of the plugin. Type should be omitted when referencing in-tree plugins. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")] + pub r#type: Option, + /// Weight defines the weight of the plugin. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub wait: Option, +} + +/// Plugin specifies a plugin type, name and its weight when applicable. Weight is used only for Score plugins. +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +pub enum SchedulingProfilePluginsSelectEnabledType { + Webhook, +} + diff --git a/kube-custom-resources-rs/src/lib.rs b/kube-custom-resources-rs/src/lib.rs index ed19f5acd..97f5f8701 100644 --- a/kube-custom-resources-rs/src/lib.rs +++ b/kube-custom-resources-rs/src/lib.rs @@ -697,6 +697,25 @@ Every group has its own feature in this crate. The available features are as fol - kinds: - `PodNetworkConnectivityCheck` +## core_kubeadmiral_io + +- apiVersion: `core.kubeadmiral.io/v1alpha1` +- kinds: + - `ClusterCollectedStatus` + - `ClusterFederatedObject` + - `ClusterOverridePolicy` + - `ClusterPropagatedVersion` + - `ClusterPropagationPolicy` + - `CollectedStatus` + - `FederatedCluster` + - `FederatedObject` + - `FederatedTypeConfig` + - `OverridePolicy` + - `PropagatedVersion` + - `PropagationPolicy` + - `SchedulerPluginWebhookConfiguration` + - `SchedulingProfile` + ## core_linuxsuren_github_com - apiVersion: `core.linuxsuren.github.com/v1alpha1` @@ -2695,6 +2714,8 @@ pub mod config_openshift_io; pub mod console_openshift_io; #[cfg(feature = "controlplane_operator_openshift_io")] pub mod controlplane_operator_openshift_io; +#[cfg(feature = "core_kubeadmiral_io")] +pub mod core_kubeadmiral_io; #[cfg(feature = "core_linuxsuren_github_com")] pub mod core_linuxsuren_github_com; #[cfg(feature = "core_openfeature_dev")]