From 5e84d9860886c4934783354b7b39d66fe87d4386 Mon Sep 17 00:00:00 2001 From: Wei Weng Date: Tue, 28 Oct 2025 20:43:58 +0000 Subject: [PATCH 1/4] remove v1alpha1 crds Signed-off-by: Wei Weng --- .../clusterresourceplacement_types.go | 249 -------- apis/v1alpha1/commons.go | 104 ---- apis/v1alpha1/doc.go | 22 - apis/v1alpha1/groupversion_info.go | 35 -- apis/v1alpha1/internalmembercluster_types.go | 120 ---- apis/v1alpha1/membercluster_types.go | 139 ----- apis/v1alpha1/types.go | 37 -- apis/v1alpha1/zz_generated.deepcopy.go | 542 ------------------ ...t.azure.com_clusterresourceplacements.yaml | 1 - ...leet.azure.com_internalmemberclusters.yaml | 1 - .../fleet.azure.com_memberclusters.yaml | 1 - charts/hub-agent/templates/crds/crps.yaml | 4 - .../crds/internalmemberclusters.yaml | 4 - .../templates/crds/memberclusters.yaml | 4 - ...t.azure.com_clusterresourceplacements.yaml | 437 -------------- ...leet.azure.com_internalmemberclusters.yaml | 188 ------ .../bases/fleet.azure.com_memberclusters.yaml | 281 --------- examples/fleet_v1alpha1_membercluster.yaml | 12 - .../fleetresourcehandler_webhook_test.go | 12 +- pkg/webhook/validation/uservalidation.go | 2 +- 20 files changed, 7 insertions(+), 2188 deletions(-) delete mode 100644 apis/v1alpha1/clusterresourceplacement_types.go delete mode 100644 apis/v1alpha1/commons.go delete mode 100644 apis/v1alpha1/doc.go delete mode 100644 apis/v1alpha1/groupversion_info.go delete mode 100644 apis/v1alpha1/internalmembercluster_types.go delete mode 100644 apis/v1alpha1/membercluster_types.go delete mode 100644 apis/v1alpha1/types.go delete mode 100644 apis/v1alpha1/zz_generated.deepcopy.go delete mode 120000 charts/hub-agent/crdbases/fleet.azure.com_clusterresourceplacements.yaml delete mode 120000 charts/hub-agent/crdbases/fleet.azure.com_internalmemberclusters.yaml delete mode 120000 charts/hub-agent/crdbases/fleet.azure.com_memberclusters.yaml delete mode 100644 config/crd/bases/fleet.azure.com_clusterresourceplacements.yaml delete mode 100644 config/crd/bases/fleet.azure.com_internalmemberclusters.yaml delete mode 100644 config/crd/bases/fleet.azure.com_memberclusters.yaml delete mode 100644 examples/fleet_v1alpha1_membercluster.yaml diff --git a/apis/v1alpha1/clusterresourceplacement_types.go b/apis/v1alpha1/clusterresourceplacement_types.go deleted file mode 100644 index 0c7c204c5..000000000 --- a/apis/v1alpha1/clusterresourceplacement_types.go +++ /dev/null @@ -1,249 +0,0 @@ -/* -Copyright 2025 The KubeFleet Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:nonNamespaced -// +kubebuilder:object:root=true -// +kubebuilder:resource:scope="Cluster",shortName=crp,categories={fleet-workload} -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:JSONPath=`.metadata.generation`,name="Gen",type=string -// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Scheduled")].status`,name="Scheduled",type=string -// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Scheduled")].observedGeneration`,name="ScheduledGen",type=string -// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Applied")].status`,name="Applied",type=string -// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Applied")].observedGeneration`,name="AppliedGen",type=string -// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterResourcePlacement is used to select cluster scoped resources, including built-in resources and custom resources, and placement them onto selected member clusters in a fleet. -// If a namespace is selected, ALL the resources under the namespace are placed to the target clusters. -// Note that you can't select the following resources: -// - reserved namespaces including: default, kube-* (reserved for Kubernetes system namespaces), fleet-* (reserved for fleet system namespaces). -// - reserved fleet resource types including: MemberCluster, InternalMemberCluster, ClusterResourcePlacement, MultiClusterService, ServiceImport, etc. -type ClusterResourcePlacement struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // The desired state of ClusterResourcePlacement. - // +required - Spec ClusterResourcePlacementSpec `json:"spec"` - - // The observed status of ClusterResourcePlacement. - // +optional - Status ClusterResourcePlacementStatus `json:"status,omitempty"` -} - -// ClusterResourcePlacementSpec defines the desired state of ClusterResourcePlacement. -type ClusterResourcePlacementSpec struct { - // +kubebuilder:validation:MinItems=1 - // +kubebuilder:validation:MaxItems=100 - - // ResourceSelectors is an array of selectors used to select cluster scoped resources. The selectors are `ORed`. - // You can have 1-100 selectors. - // +required - ResourceSelectors []ClusterResourceSelector `json:"resourceSelectors"` - - // Policy defines how to select member clusters to place the selected resources. - // If unspecified, all the joined member clusters are selected. - // +optional - Policy *PlacementPolicy `json:"policy,omitempty"` -} - -// ClusterResourceSelector is used to select cluster scoped resources as the target resources to be placed. -// If a namespace is selected, ALL the resources under the namespace are selected automatically. -// All the fields are `ANDed`. In other words, a resource must match all the fields to be selected. -type ClusterResourceSelector struct { - // Group name of the cluster-scoped resource. - // Use an empty string to select resources under the core API group (e.g., namespaces). - // +required - Group string `json:"group"` - - // Version of the cluster-scoped resource. - // +required - Version string `json:"version"` - - // Kind of the cluster-scoped resource. - // Note: When `Kind` is `namespace`, ALL the resources under the selected namespaces are selected. - // +required - Kind string `json:"kind"` - - // You can only specify at most one of the following two fields: Name and LabelSelector. - // If none is specified, all the cluster-scoped resources with the given group, version and kind are selected. - - // Name of the cluster-scoped resource. - // +optional - Name string `json:"name,omitempty"` - - // A label query over all the cluster-scoped resources. Resources matching the query are selected. - // Note that namespace-scoped resources can't be selected even if they match the query. - // +optional - LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"` -} - -// PlacementPolicy contains the rules to select target member clusters to place the selected resources. -// Note that only clusters that are both joined and satisfying the rules will be selected. -// -// You can only specify at most one of the two fields: ClusterNames and Affinity. -// If none is specified, all the joined clusters are selected. -type PlacementPolicy struct { - // +kubebuilder:validation:MaxItems=100 - - // ClusterNames contains a list of names of MemberCluster to place the selected resources. - // If the list is not empty, Affinity is ignored. - // +optional - ClusterNames []string `json:"clusterNames,omitempty"` - - // Affinity contains cluster affinity scheduling rules. Defines which member clusters to place the selected resources. - // +optional - Affinity *Affinity `json:"affinity,omitempty"` -} - -// Affinity is a group of cluster affinity scheduling rules. More to be added. -type Affinity struct { - // ClusterAffinity contains cluster affinity scheduling rules for the selected resources. - // +optional - ClusterAffinity *ClusterAffinity `json:"clusterAffinity,omitempty"` -} - -// ClusterAffinity contains cluster affinity scheduling rules for the selected resources. -type ClusterAffinity struct { - // +kubebuilder:validation:MaxItems=10 - - // ClusterSelectorTerms is a list of cluster selector terms. The terms are `ORed`. - // +optional - ClusterSelectorTerms []ClusterSelectorTerm `json:"clusterSelectorTerms,omitempty"` -} - -// ClusterSelectorTerm contains the requirements to select clusters. -type ClusterSelectorTerm struct { - // LabelSelector is a label query over all the joined member clusters. Clusters matching the query are selected. - // +required - LabelSelector metav1.LabelSelector `json:"labelSelector"` -} - -// ClusterResourcePlacementStatus defines the observed state of resource. -type ClusterResourcePlacementStatus struct { - // +patchMergeKey=type - // +patchStrategy=merge - // +listType=map - // +listMapKey=type - - // Conditions is an array of current observed conditions for ClusterResourcePlacement. - // +optional - Conditions []metav1.Condition `json:"conditions"` - - // SelectedResources contains a list of resources selected by ResourceSelectors. - // +optional - SelectedResources []ResourceIdentifier `json:"selectedResources,omitempty"` - - // TargetClusters contains a list of names of member clusters selected by PlacementPolicy. - // Note that the clusters must be both joined and meeting PlacementPolicy. - // +optional - TargetClusters []string `json:"targetClusters,omitempty"` - - // +kubebuilder:validation:MaxItems=1000 - - // FailedResourcePlacements is a list of all the resources failed to be placed to the given clusters. - // Note that we only include 1000 failed resource placements even if there are more than 1000. - // +optional - FailedResourcePlacements []FailedResourcePlacement `json:"failedPlacements,omitempty"` -} - -// ResourceIdentifier identifies one Kubernetes resource. -type ResourceIdentifier struct { - // Group is the group name of the selected resource. - // +optional - Group string `json:"group,omitempty"` - - // Version is the version of the selected resource. - // +required - Version string `json:"version,omitempty"` - - // Kind represents the Kind of the selected resources. - // +required - Kind string `json:"kind"` - - // Name of the target resource. - // +required - Name string `json:"name"` - - // Namespace is the namespace of the resource. Empty if the resource is cluster scoped. - // +optional - Namespace string `json:"namespace,omitempty"` -} - -// FailedResourcePlacement contains the failure details of a failed resource placement. -type FailedResourcePlacement struct { - // The resource failed to be placed. - ResourceIdentifier `json:",inline"` - - // Name of the member cluster that the resource is placed to. - // +required - ClusterName string `json:"clusterName"` - - // The failed condition status. - // +required - Condition metav1.Condition `json:"condition"` -} - -// ResourcePlacementConditionType defines a specific condition of a resource placement. -type ResourcePlacementConditionType string - -const ( - // ResourcePlacementConditionTypeScheduled indicates whether we have selected at least one resource to be placed to at least one member cluster and created work CRs under the corresponding per-cluster namespaces (i.e., fleet-member-). - // Its condition status can be one of the following: - // - "True" means we have selected at least one resource, targeted at least one member cluster and created the work CRs. - // - "False" means we have selected zero resources, zero target clusters, or failed to create the work CRs. - // - "Unknown" otherwise. - ResourcePlacementConditionTypeScheduled ResourcePlacementConditionType = "Scheduled" - - // ResourcePlacementStatusConditionTypeApplied indicates whether the selected member clusters have received the work CRs and applied the selected resources locally. - // Its condition status can be one of the following: - // - "True" means all the selected resources are successfully applied to all the target clusters. - // - "False" means some of them have failed. - // - "Unknown" otherwise. - ResourcePlacementStatusConditionTypeApplied ResourcePlacementConditionType = "Applied" -) - -// +kubebuilder:resource:scope="Cluster" -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterResourcePlacementList contains a list of ClusterResourcePlacement. -type ClusterResourcePlacementList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterResourcePlacement `json:"items"` -} - -func (m *ClusterResourcePlacement) SetConditions(conditions ...metav1.Condition) { - for _, c := range conditions { - meta.SetStatusCondition(&m.Status.Conditions, c) - } -} - -func (m *ClusterResourcePlacement) GetCondition(conditionType string) *metav1.Condition { - return meta.FindStatusCondition(m.Status.Conditions, conditionType) -} - -func init() { - SchemeBuilder.Register(&ClusterResourcePlacement{}, &ClusterResourcePlacementList{}) -} diff --git a/apis/v1alpha1/commons.go b/apis/v1alpha1/commons.go deleted file mode 100644 index 63068fee4..000000000 --- a/apis/v1alpha1/commons.go +++ /dev/null @@ -1,104 +0,0 @@ -/* -Copyright 2025 The KubeFleet Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -type ClusterState string - -const ( - ClusterStateJoin ClusterState = "Join" - ClusterStateLeave ClusterState = "Leave" - MemberClusterFinalizer = "work.fleet.azure.com/membercluster-finalizer" -) - -const ( - MemberClusterKind = "MemberCluster" - MemberClusterResource = "memberclusters" - InternalMemberClusterKind = "InternalMemberCluster" - ClusterResourcePlacementKind = "ClusterResourcePlacement" - ClusterResourcePlacementResource = "clusterresourceplacements" -) - -// ResourceUsage contains the observed resource usage of a member cluster. -type ResourceUsage struct { - // Capacity represents the total resource capacity of all the nodes on a member cluster. - // +optional - Capacity v1.ResourceList `json:"capacity,omitempty"` - - // Allocatable represents the total resources of all the nodes on a member cluster that are available for scheduling. - // +optional - Allocatable v1.ResourceList `json:"allocatable,omitempty"` - - // When the resource usage is observed. - // +optional - ObservationTime metav1.Time `json:"observationTime,omitempty"` -} - -// AgentType defines a type of agent/binary running in a member cluster. -type AgentType string - -const ( - // MemberAgent (core) handles member cluster joining/leaving as well as k8s object placement from hub to member clusters. - MemberAgent AgentType = "MemberAgent" - // MultiClusterServiceAgent (networking) is responsible for exposing multi-cluster services via L4 load - // balancer. - MultiClusterServiceAgent AgentType = "MultiClusterServiceAgent" - // ServiceExportImportAgent (networking) is responsible for export or import services across multi-clusters. - ServiceExportImportAgent AgentType = "ServiceExportImportAgent" -) - -// AgentStatus defines the observed status of the member agent of the given type. -type AgentStatus struct { - // Type of the member agent. - // +required - Type AgentType `json:"type"` - - // +patchMergeKey=type - // +patchStrategy=merge - // +listType=map - // +listMapKey=type - - // Conditions is an array of current observed conditions for the member agent. - // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` - - // Last time we received a heartbeat from the member agent. - // +optional - LastReceivedHeartbeat metav1.Time `json:"lastReceivedHeartbeat,omitempty"` -} - -// AgentConditionType identifies a specific condition on the Agent. -type AgentConditionType string - -const ( - // AgentJoined indicates the join condition of the given member agent. - // Its condition status can be one of the following: - // - "True" means the member agent has joined. - // - "False" means the member agent has left. - // - "Unknown" means the member agent is joining or leaving or in an unknown status. - AgentJoined AgentConditionType = "Joined" - // AgentHealthy indicates the health condition of the given member agent. - // Its condition status can be one of the following: - // - "True" means the member agent is healthy. - // - "False" means the member agent is unhealthy. - // - "Unknown" means the member agent has an unknown health status. - AgentHealthy AgentConditionType = "Healthy" -) diff --git a/apis/v1alpha1/doc.go b/apis/v1alpha1/doc.go deleted file mode 100644 index eed7b4593..000000000 --- a/apis/v1alpha1/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2025 The KubeFleet Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha1 contains API Schema definitions for the fleet v1alpha1 API group - -// +kubebuilder:object:generate=true -// +k8s:deepcopy-gen=package,register -// +groupName=fleet.azure.com -package v1alpha1 diff --git a/apis/v1alpha1/groupversion_info.go b/apis/v1alpha1/groupversion_info.go deleted file mode 100644 index 836fcf242..000000000 --- a/apis/v1alpha1/groupversion_info.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2025 The KubeFleet Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// +kubebuilder:object:generate=true -// +groupName=fleet.azure.com -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "fleet.azure.com", Version: "v1alpha1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/apis/v1alpha1/internalmembercluster_types.go b/apis/v1alpha1/internalmembercluster_types.go deleted file mode 100644 index ae9e8374b..000000000 --- a/apis/v1alpha1/internalmembercluster_types.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2025 The KubeFleet Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +kubebuilder:object:root=true -// +kubebuilder:resource:scope=Namespaced,categories={fleet},shortName=imc -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date - -// InternalMemberCluster is used by hub agent to notify the member agents about the member cluster state changes, and is used by the member agents to report their status. -type InternalMemberCluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // The desired state of InternalMemberCluster. - // +required - Spec InternalMemberClusterSpec `json:"spec"` - - // The observed status of InternalMemberCluster. - // +optional - Status InternalMemberClusterStatus `json:"status,omitempty"` -} - -// InternalMemberClusterSpec defines the desired state of InternalMemberCluster. Set by the hub agent. -type InternalMemberClusterSpec struct { - // +kubebuilder:validation:Required,Enum=Join;Leave - - // The desired state of the member cluster. Possible values: Join, Leave. - // +required - State ClusterState `json:"state"` - - // +kubebuilder:default=60 - // +kubebuilder:validation:Minimum=1 - // +kubebuilder:validation:Maximum=600 - - // How often (in seconds) for the member cluster to send a heartbeat to the hub cluster. Default: 60 seconds. Min: 1 second. Max: 10 minutes. - // +optional - HeartbeatPeriodSeconds int32 `json:"heartbeatPeriodSeconds,omitempty"` -} - -// InternalMemberClusterStatus defines the observed state of InternalMemberCluster. -type InternalMemberClusterStatus struct { - // The current observed resource usage of the member cluster. It is populated by the member agent. - // +optional - ResourceUsage ResourceUsage `json:"resourceUsage,omitempty"` - - // AgentStatus is an array of current observed status, each corresponding to one member agent running in the member cluster. - // +optional - AgentStatus []AgentStatus `json:"agentStatus,omitempty"` -} - -//+kubebuilder:object:root=true - -// InternalMemberClusterList contains a list of InternalMemberCluster. -type InternalMemberClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []InternalMemberCluster `json:"items"` -} - -// SetConditionsWithType is used to add condition to AgentStatus for a given agentType. -func (m *InternalMemberCluster) SetConditionsWithType(agentType AgentType, conditions ...metav1.Condition) { - desiredAgentStatus := m.GetAgentStatus(agentType) - for _, c := range conditions { - meta.SetStatusCondition(&desiredAgentStatus.Conditions, c) - } -} - -// GetConditionWithType is used to retrieve the desired condition from AgentStatus for given agentType -func (m *InternalMemberCluster) GetConditionWithType(agentType AgentType, conditionType string) *metav1.Condition { - var desiredAgentStatus AgentStatus - for _, agentStatus := range m.Status.AgentStatus { - if agentType == agentStatus.Type { - desiredAgentStatus = agentStatus - } - } - if desiredAgentStatus.Type == agentType { - return meta.FindStatusCondition(desiredAgentStatus.Conditions, conditionType) - } - return nil -} - -// GetAgentStatus is used to retrieve agent status from internal member cluster, -// if it doesn't exist it creates the expected agent status and returns it. -func (m *InternalMemberCluster) GetAgentStatus(agentType AgentType) *AgentStatus { - for i := range m.Status.AgentStatus { - if m.Status.AgentStatus[i].Type == agentType { - return &m.Status.AgentStatus[i] - } - } - agentStatus := AgentStatus{ - Type: agentType, - Conditions: []metav1.Condition{}, - } - m.Status.AgentStatus = append(m.Status.AgentStatus, agentStatus) - return &m.Status.AgentStatus[len(m.Status.AgentStatus)-1] -} - -func init() { - SchemeBuilder.Register(&InternalMemberCluster{}, &InternalMemberClusterList{}) -} diff --git a/apis/v1alpha1/membercluster_types.go b/apis/v1alpha1/membercluster_types.go deleted file mode 100644 index 7c810f500..000000000 --- a/apis/v1alpha1/membercluster_types.go +++ /dev/null @@ -1,139 +0,0 @@ -/* -Copyright 2025 The KubeFleet Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - rbacv1 "k8s.io/api/rbac/v1" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +kubebuilder:object:root=true -// +kubebuilder:resource:scope=Cluster,categories={fleet},shortName=mc -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Joined")].status`,name="Joined",type=string -// +kubebuilder:printcolumn:JSONPath=`.metadata.creationTimestamp`,name="Age",type=date - -// MemberCluster is a resource created in the hub cluster to represent a member cluster within a fleet. -type MemberCluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // The desired state of MemberCluster. - // +required - Spec MemberClusterSpec `json:"spec"` - - // The observed status of MemberCluster. - // +optional - Status MemberClusterStatus `json:"status,omitempty"` -} - -// MemberClusterSpec defines the desired state of MemberCluster. -type MemberClusterSpec struct { - // +kubebuilder:validation:Required,Enum=Join;Leave - - // The desired state of the member cluster. Possible values: Join, Leave. - // +required - State ClusterState `json:"state"` - - // The identity used by the member cluster to access the hub cluster. - // The hub agents deployed on the hub cluster will automatically grant the minimal required permissions to this identity for the member agents deployed on the member cluster to access the hub cluster. - // +required - Identity rbacv1.Subject `json:"identity"` - - // +kubebuilder:default=60 - // +kubebuilder:validation:Minimum=1 - // +kubebuilder:validation:Maximum=600 - - // How often (in seconds) for the member cluster to send a heartbeat to the hub cluster. Default: 60 seconds. Min: 1 second. Max: 10 minutes. - // +optional - HeartbeatPeriodSeconds int32 `json:"heartbeatPeriodSeconds,omitempty"` -} - -// MemberClusterStatus defines the observed status of MemberCluster. -type MemberClusterStatus struct { - // +patchMergeKey=type - // +patchStrategy=merge - // +listType=map - // +listMapKey=type - - // Conditions is an array of current observed conditions for the member cluster. - // +optional - Conditions []metav1.Condition `json:"conditions"` - - // The current observed resource usage of the member cluster. It is copied from the corresponding InternalMemberCluster object. - // +optional - ResourceUsage ResourceUsage `json:"resourceUsage,omitempty"` - - // AgentStatus is an array of current observed status, each corresponding to one member agent running in the member cluster. - // +optional - AgentStatus []AgentStatus `json:"agentStatus,omitempty"` -} - -// MemberClusterConditionType defines a specific condition of a member cluster. -type MemberClusterConditionType string - -const ( - // ConditionTypeMemberClusterReadyToJoin indicates the readiness condition of the given member cluster for joining the hub cluster. - // Its condition status can be one of the following: - // - "True" means the hub cluster is ready for the member cluster to join. - // - "False" means the hub cluster is not ready for the member cluster to join. - // - "Unknown" means it is unknown whether the hub cluster is ready for the member cluster to join. - ConditionTypeMemberClusterReadyToJoin MemberClusterConditionType = "ReadyToJoin" - - // ConditionTypeMemberClusterJoined indicates the join condition of the given member cluster. - // Its condition status can be one of the following: - // - "True" means all the agents on the member cluster have joined. - // - "False" means all the agents on the member cluster have left. - // - "Unknown" means not all the agents have joined or left. - ConditionTypeMemberClusterJoined MemberClusterConditionType = "Joined" - - // ConditionTypeMemberClusterHealthy indicates the health condition of the given member cluster. - // Its condition status can be one of the following: - // - "True" means the member cluster is healthy. - // - "False" means the member cluster is unhealthy. - // - "Unknown" means the member cluster has an unknown health status. - // NOTE: This condition type is currently unused. - ConditionTypeMemberClusterHealthy MemberClusterConditionType = "Healthy" -) - -//+kubebuilder:object:root=true - -// MemberClusterList contains a list of MemberCluster. -type MemberClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MemberCluster `json:"items"` -} - -func (m *MemberCluster) SetConditions(conditions ...metav1.Condition) { - for _, c := range conditions { - meta.SetStatusCondition(&m.Status.Conditions, c) - } -} - -func (m *MemberCluster) GetCondition(conditionType string) *metav1.Condition { - return meta.FindStatusCondition(m.Status.Conditions, conditionType) -} - -func (m *MemberCluster) RemoveCondition(conditionType string) { - meta.RemoveStatusCondition(&m.Status.Conditions, conditionType) -} - -func init() { - SchemeBuilder.Register(&MemberCluster{}, &MemberClusterList{}) -} diff --git a/apis/v1alpha1/types.go b/apis/v1alpha1/types.go deleted file mode 100644 index 94f569841..000000000 --- a/apis/v1alpha1/types.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2025 The KubeFleet Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -// A ConditionedWithType may have conditions set or retrieved based on agent type. Conditions typically -// indicate the status of both a resource and its reconciliation process. -// +kubebuilder:object:generate=false -type ConditionedWithType interface { - SetConditionsWithType(AgentType, ...metav1.Condition) - GetConditionWithType(AgentType, string) *metav1.Condition -} - -// A ConditionedAgentObj is for kubernetes resources where multiple agents can set and update conditions within AgentStatus. -// +kubebuilder:object:generate=false -type ConditionedAgentObj interface { - client.Object - ConditionedWithType -} diff --git a/apis/v1alpha1/zz_generated.deepcopy.go b/apis/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 85550ca19..000000000 --- a/apis/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,542 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright 2025 The KubeFleet Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Affinity) DeepCopyInto(out *Affinity) { - *out = *in - if in.ClusterAffinity != nil { - in, out := &in.ClusterAffinity, &out.ClusterAffinity - *out = new(ClusterAffinity) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Affinity. -func (in *Affinity) DeepCopy() *Affinity { - if in == nil { - return nil - } - out := new(Affinity) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AgentStatus) DeepCopyInto(out *AgentStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.LastReceivedHeartbeat.DeepCopyInto(&out.LastReceivedHeartbeat) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentStatus. -func (in *AgentStatus) DeepCopy() *AgentStatus { - if in == nil { - return nil - } - out := new(AgentStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterAffinity) DeepCopyInto(out *ClusterAffinity) { - *out = *in - if in.ClusterSelectorTerms != nil { - in, out := &in.ClusterSelectorTerms, &out.ClusterSelectorTerms - *out = make([]ClusterSelectorTerm, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAffinity. -func (in *ClusterAffinity) DeepCopy() *ClusterAffinity { - if in == nil { - return nil - } - out := new(ClusterAffinity) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterResourcePlacement) DeepCopyInto(out *ClusterResourcePlacement) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourcePlacement. -func (in *ClusterResourcePlacement) DeepCopy() *ClusterResourcePlacement { - if in == nil { - return nil - } - out := new(ClusterResourcePlacement) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterResourcePlacement) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterResourcePlacementList) DeepCopyInto(out *ClusterResourcePlacementList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterResourcePlacement, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourcePlacementList. -func (in *ClusterResourcePlacementList) DeepCopy() *ClusterResourcePlacementList { - if in == nil { - return nil - } - out := new(ClusterResourcePlacementList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterResourcePlacementList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterResourcePlacementSpec) DeepCopyInto(out *ClusterResourcePlacementSpec) { - *out = *in - if in.ResourceSelectors != nil { - in, out := &in.ResourceSelectors, &out.ResourceSelectors - *out = make([]ClusterResourceSelector, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Policy != nil { - in, out := &in.Policy, &out.Policy - *out = new(PlacementPolicy) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourcePlacementSpec. -func (in *ClusterResourcePlacementSpec) DeepCopy() *ClusterResourcePlacementSpec { - if in == nil { - return nil - } - out := new(ClusterResourcePlacementSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterResourcePlacementStatus) DeepCopyInto(out *ClusterResourcePlacementStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SelectedResources != nil { - in, out := &in.SelectedResources, &out.SelectedResources - *out = make([]ResourceIdentifier, len(*in)) - copy(*out, *in) - } - if in.TargetClusters != nil { - in, out := &in.TargetClusters, &out.TargetClusters - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.FailedResourcePlacements != nil { - in, out := &in.FailedResourcePlacements, &out.FailedResourcePlacements - *out = make([]FailedResourcePlacement, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourcePlacementStatus. -func (in *ClusterResourcePlacementStatus) DeepCopy() *ClusterResourcePlacementStatus { - if in == nil { - return nil - } - out := new(ClusterResourcePlacementStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterResourceSelector) DeepCopyInto(out *ClusterResourceSelector) { - *out = *in - if in.LabelSelector != nil { - in, out := &in.LabelSelector, &out.LabelSelector - *out = new(v1.LabelSelector) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSelector. -func (in *ClusterResourceSelector) DeepCopy() *ClusterResourceSelector { - if in == nil { - return nil - } - out := new(ClusterResourceSelector) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSelectorTerm) DeepCopyInto(out *ClusterSelectorTerm) { - *out = *in - in.LabelSelector.DeepCopyInto(&out.LabelSelector) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSelectorTerm. -func (in *ClusterSelectorTerm) DeepCopy() *ClusterSelectorTerm { - if in == nil { - return nil - } - out := new(ClusterSelectorTerm) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FailedResourcePlacement) DeepCopyInto(out *FailedResourcePlacement) { - *out = *in - out.ResourceIdentifier = in.ResourceIdentifier - in.Condition.DeepCopyInto(&out.Condition) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailedResourcePlacement. -func (in *FailedResourcePlacement) DeepCopy() *FailedResourcePlacement { - if in == nil { - return nil - } - out := new(FailedResourcePlacement) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InternalMemberCluster) DeepCopyInto(out *InternalMemberCluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InternalMemberCluster. -func (in *InternalMemberCluster) DeepCopy() *InternalMemberCluster { - if in == nil { - return nil - } - out := new(InternalMemberCluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *InternalMemberCluster) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InternalMemberClusterList) DeepCopyInto(out *InternalMemberClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]InternalMemberCluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InternalMemberClusterList. -func (in *InternalMemberClusterList) DeepCopy() *InternalMemberClusterList { - if in == nil { - return nil - } - out := new(InternalMemberClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *InternalMemberClusterList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InternalMemberClusterSpec) DeepCopyInto(out *InternalMemberClusterSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InternalMemberClusterSpec. -func (in *InternalMemberClusterSpec) DeepCopy() *InternalMemberClusterSpec { - if in == nil { - return nil - } - out := new(InternalMemberClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InternalMemberClusterStatus) DeepCopyInto(out *InternalMemberClusterStatus) { - *out = *in - in.ResourceUsage.DeepCopyInto(&out.ResourceUsage) - if in.AgentStatus != nil { - in, out := &in.AgentStatus, &out.AgentStatus - *out = make([]AgentStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InternalMemberClusterStatus. -func (in *InternalMemberClusterStatus) DeepCopy() *InternalMemberClusterStatus { - if in == nil { - return nil - } - out := new(InternalMemberClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MemberCluster) DeepCopyInto(out *MemberCluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberCluster. -func (in *MemberCluster) DeepCopy() *MemberCluster { - if in == nil { - return nil - } - out := new(MemberCluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MemberCluster) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MemberClusterList) DeepCopyInto(out *MemberClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MemberCluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberClusterList. -func (in *MemberClusterList) DeepCopy() *MemberClusterList { - if in == nil { - return nil - } - out := new(MemberClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MemberClusterList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MemberClusterSpec) DeepCopyInto(out *MemberClusterSpec) { - *out = *in - out.Identity = in.Identity -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberClusterSpec. -func (in *MemberClusterSpec) DeepCopy() *MemberClusterSpec { - if in == nil { - return nil - } - out := new(MemberClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MemberClusterStatus) DeepCopyInto(out *MemberClusterStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.ResourceUsage.DeepCopyInto(&out.ResourceUsage) - if in.AgentStatus != nil { - in, out := &in.AgentStatus, &out.AgentStatus - *out = make([]AgentStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberClusterStatus. -func (in *MemberClusterStatus) DeepCopy() *MemberClusterStatus { - if in == nil { - return nil - } - out := new(MemberClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PlacementPolicy) DeepCopyInto(out *PlacementPolicy) { - *out = *in - if in.ClusterNames != nil { - in, out := &in.ClusterNames, &out.ClusterNames - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Affinity != nil { - in, out := &in.Affinity, &out.Affinity - *out = new(Affinity) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementPolicy. -func (in *PlacementPolicy) DeepCopy() *PlacementPolicy { - if in == nil { - return nil - } - out := new(PlacementPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceIdentifier) DeepCopyInto(out *ResourceIdentifier) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceIdentifier. -func (in *ResourceIdentifier) DeepCopy() *ResourceIdentifier { - if in == nil { - return nil - } - out := new(ResourceIdentifier) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceUsage) DeepCopyInto(out *ResourceUsage) { - *out = *in - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(corev1.ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - if in.Allocatable != nil { - in, out := &in.Allocatable, &out.Allocatable - *out = make(corev1.ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - in.ObservationTime.DeepCopyInto(&out.ObservationTime) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceUsage. -func (in *ResourceUsage) DeepCopy() *ResourceUsage { - if in == nil { - return nil - } - out := new(ResourceUsage) - in.DeepCopyInto(out) - return out -} diff --git a/charts/hub-agent/crdbases/fleet.azure.com_clusterresourceplacements.yaml b/charts/hub-agent/crdbases/fleet.azure.com_clusterresourceplacements.yaml deleted file mode 120000 index bf1719fbe..000000000 --- a/charts/hub-agent/crdbases/fleet.azure.com_clusterresourceplacements.yaml +++ /dev/null @@ -1 +0,0 @@ -../../../config/crd/bases/fleet.azure.com_clusterresourceplacements.yaml \ No newline at end of file diff --git a/charts/hub-agent/crdbases/fleet.azure.com_internalmemberclusters.yaml b/charts/hub-agent/crdbases/fleet.azure.com_internalmemberclusters.yaml deleted file mode 120000 index 5dc940b49..000000000 --- a/charts/hub-agent/crdbases/fleet.azure.com_internalmemberclusters.yaml +++ /dev/null @@ -1 +0,0 @@ -../../../config/crd/bases/fleet.azure.com_internalmemberclusters.yaml \ No newline at end of file diff --git a/charts/hub-agent/crdbases/fleet.azure.com_memberclusters.yaml b/charts/hub-agent/crdbases/fleet.azure.com_memberclusters.yaml deleted file mode 120000 index 57ce4a01f..000000000 --- a/charts/hub-agent/crdbases/fleet.azure.com_memberclusters.yaml +++ /dev/null @@ -1 +0,0 @@ -../../../config/crd/bases/fleet.azure.com_memberclusters.yaml \ No newline at end of file diff --git a/charts/hub-agent/templates/crds/crps.yaml b/charts/hub-agent/templates/crds/crps.yaml index 6b8aa0258..f7a1be908 100644 --- a/charts/hub-agent/templates/crds/crps.yaml +++ b/charts/hub-agent/templates/crds/crps.yaml @@ -1,8 +1,4 @@ {{ $files := .Files }} -{{ if .Values.enableV1Alpha1APIs }} - {{ $files.Get "crdbases/fleet.azure.com_clusterresourceplacements.yaml" }} -{{ end }} ---- {{ if .Values.enableV1Beta1APIs }} {{ $files.Get "crdbases/placement.kubernetes-fleet.io_clusterresourceplacements.yaml" }} {{ end }} diff --git a/charts/hub-agent/templates/crds/internalmemberclusters.yaml b/charts/hub-agent/templates/crds/internalmemberclusters.yaml index 554d05d60..685e081a9 100644 --- a/charts/hub-agent/templates/crds/internalmemberclusters.yaml +++ b/charts/hub-agent/templates/crds/internalmemberclusters.yaml @@ -1,8 +1,4 @@ {{ $files := .Files }} -{{ if .Values.enableV1Alpha1APIs }} - {{ $files.Get "crdbases/fleet.azure.com_internalmemberclusters.yaml" }} -{{ end }} ---- {{ if .Values.enableV1Beta1APIs }} {{ $files.Get "crdbases/cluster.kubernetes-fleet.io_internalmemberclusters.yaml" }} {{ end }} diff --git a/charts/hub-agent/templates/crds/memberclusters.yaml b/charts/hub-agent/templates/crds/memberclusters.yaml index eb4e7417e..6d8ad48c5 100644 --- a/charts/hub-agent/templates/crds/memberclusters.yaml +++ b/charts/hub-agent/templates/crds/memberclusters.yaml @@ -1,8 +1,4 @@ {{ $files := .Files }} -{{ if .Values.enableV1Alpha1APIs }} - {{ $files.Get "crdbases/fleet.azure.com_memberclusters.yaml" }} -{{ end }} ---- {{ if .Values.enableV1Beta1APIs }} {{ $files.Get "crdbases/cluster.kubernetes-fleet.io_memberclusters.yaml" }} {{ end }} diff --git a/config/crd/bases/fleet.azure.com_clusterresourceplacements.yaml b/config/crd/bases/fleet.azure.com_clusterresourceplacements.yaml deleted file mode 100644 index 1f8a0cc44..000000000 --- a/config/crd/bases/fleet.azure.com_clusterresourceplacements.yaml +++ /dev/null @@ -1,437 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.16.0 - name: clusterresourceplacements.fleet.azure.com -spec: - group: fleet.azure.com - names: - categories: - - fleet-workload - kind: ClusterResourcePlacement - listKind: ClusterResourcePlacementList - plural: clusterresourceplacements - shortNames: - - crp - singular: clusterresourceplacement - scope: Cluster - versions: - - additionalPrinterColumns: - - jsonPath: .metadata.generation - name: Gen - type: string - - jsonPath: .status.conditions[?(@.type=="Scheduled")].status - name: Scheduled - type: string - - jsonPath: .status.conditions[?(@.type=="Scheduled")].observedGeneration - name: ScheduledGen - type: string - - jsonPath: .status.conditions[?(@.type=="Applied")].status - name: Applied - type: string - - jsonPath: .status.conditions[?(@.type=="Applied")].observedGeneration - name: AppliedGen - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: |- - ClusterResourcePlacement is used to select cluster scoped resources, including built-in resources and custom resources, and placement them onto selected member clusters in a fleet. - If a namespace is selected, ALL the resources under the namespace are placed to the target clusters. - Note that you can't select the following resources: - - reserved namespaces including: default, kube-* (reserved for Kubernetes system namespaces), fleet-* (reserved for fleet system namespaces). - - reserved fleet resource types including: MemberCluster, InternalMemberCluster, ClusterResourcePlacement, MultiClusterService, ServiceImport, etc. - 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: The desired state of ClusterResourcePlacement. - properties: - policy: - description: |- - Policy defines how to select member clusters to place the selected resources. - If unspecified, all the joined member clusters are selected. - properties: - affinity: - description: Affinity contains cluster affinity scheduling rules. - Defines which member clusters to place the selected resources. - properties: - clusterAffinity: - description: ClusterAffinity contains cluster affinity scheduling - rules for the selected resources. - properties: - clusterSelectorTerms: - description: ClusterSelectorTerms is a list of cluster - selector terms. The terms are `ORed`. - items: - description: ClusterSelectorTerm contains the requirements - to select clusters. - properties: - labelSelector: - description: LabelSelector is a label query over - all the joined member clusters. Clusters matching - the query are selected. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - required: - - labelSelector - type: object - maxItems: 10 - type: array - type: object - type: object - clusterNames: - description: |- - ClusterNames contains a list of names of MemberCluster to place the selected resources. - If the list is not empty, Affinity is ignored. - items: - type: string - maxItems: 100 - type: array - type: object - resourceSelectors: - description: |- - ResourceSelectors is an array of selectors used to select cluster scoped resources. The selectors are `ORed`. - You can have 1-100 selectors. - items: - description: |- - ClusterResourceSelector is used to select cluster scoped resources as the target resources to be placed. - If a namespace is selected, ALL the resources under the namespace are selected automatically. - All the fields are `ANDed`. In other words, a resource must match all the fields to be selected. - properties: - group: - description: |- - Group name of the cluster-scoped resource. - Use an empty string to select resources under the core API group (e.g., namespaces). - type: string - kind: - description: |- - Kind of the cluster-scoped resource. - Note: When `Kind` is `namespace`, ALL the resources under the selected namespaces are selected. - type: string - labelSelector: - description: |- - A label query over all the cluster-scoped resources. Resources matching the query are selected. - Note that namespace-scoped resources can't be selected even if they match the query. - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - name: - description: Name of the cluster-scoped resource. - type: string - version: - description: Version of the cluster-scoped resource. - type: string - required: - - group - - kind - - version - type: object - maxItems: 100 - minItems: 1 - type: array - required: - - resourceSelectors - type: object - status: - description: The observed status of ClusterResourcePlacement. - properties: - conditions: - description: Conditions is an array of current observed conditions - for ClusterResourcePlacement. - items: - description: Condition contains details for one aspect of the current - state of this API Resource. - properties: - lastTransitionTime: - description: |- - lastTransitionTime is the last time the condition transitioned from one status to another. - This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: |- - message is a human readable message indicating details about the transition. - This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: |- - observedGeneration represents the .metadata.generation that the condition was set based upon. - For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date - with respect to the current state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: |- - reason contains a programmatic identifier indicating the reason for the condition's last transition. - Producers of specific condition types may define expected values and meanings for this field, - and whether the values are considered a guaranteed API. - The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - x-kubernetes-list-map-keys: - - type - x-kubernetes-list-type: map - failedPlacements: - description: |- - FailedResourcePlacements is a list of all the resources failed to be placed to the given clusters. - Note that we only include 1000 failed resource placements even if there are more than 1000. - items: - description: FailedResourcePlacement contains the failure details - of a failed resource placement. - properties: - clusterName: - description: Name of the member cluster that the resource is - placed to. - type: string - condition: - description: The failed condition status. - properties: - lastTransitionTime: - description: |- - lastTransitionTime is the last time the condition transitioned from one status to another. - This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: |- - message is a human readable message indicating details about the transition. - This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: |- - observedGeneration represents the .metadata.generation that the condition was set based upon. - For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date - with respect to the current state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: |- - reason contains a programmatic identifier indicating the reason for the condition's last transition. - Producers of specific condition types may define expected values and meanings for this field, - and whether the values are considered a guaranteed API. - The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, - Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - group: - description: Group is the group name of the selected resource. - type: string - kind: - description: Kind represents the Kind of the selected resources. - type: string - name: - description: Name of the target resource. - type: string - namespace: - description: Namespace is the namespace of the resource. Empty - if the resource is cluster scoped. - type: string - version: - description: Version is the version of the selected resource. - type: string - required: - - clusterName - - condition - - kind - - name - - version - type: object - maxItems: 1000 - type: array - selectedResources: - description: SelectedResources contains a list of resources selected - by ResourceSelectors. - items: - description: ResourceIdentifier identifies one Kubernetes resource. - properties: - group: - description: Group is the group name of the selected resource. - type: string - kind: - description: Kind represents the Kind of the selected resources. - type: string - name: - description: Name of the target resource. - type: string - namespace: - description: Namespace is the namespace of the resource. Empty - if the resource is cluster scoped. - type: string - version: - description: Version is the version of the selected resource. - type: string - required: - - kind - - name - - version - type: object - type: array - targetClusters: - description: |- - TargetClusters contains a list of names of member clusters selected by PlacementPolicy. - Note that the clusters must be both joined and meeting PlacementPolicy. - items: - type: string - type: array - type: object - required: - - spec - type: object - served: true - storage: true - subresources: - status: {} diff --git a/config/crd/bases/fleet.azure.com_internalmemberclusters.yaml b/config/crd/bases/fleet.azure.com_internalmemberclusters.yaml deleted file mode 100644 index 18c1ddeb5..000000000 --- a/config/crd/bases/fleet.azure.com_internalmemberclusters.yaml +++ /dev/null @@ -1,188 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.16.0 - name: internalmemberclusters.fleet.azure.com -spec: - group: fleet.azure.com - names: - categories: - - fleet - kind: InternalMemberCluster - listKind: InternalMemberClusterList - plural: internalmemberclusters - shortNames: - - imc - singular: internalmembercluster - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: InternalMemberCluster is used by hub agent to notify the member - agents about the member cluster state changes, and is used by the member - agents to report their status. - 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: The desired state of InternalMemberCluster. - properties: - heartbeatPeriodSeconds: - default: 60 - description: 'How often (in seconds) for the member cluster to send - a heartbeat to the hub cluster. Default: 60 seconds. Min: 1 second. - Max: 10 minutes.' - format: int32 - maximum: 600 - minimum: 1 - type: integer - state: - description: 'The desired state of the member cluster. Possible values: - Join, Leave.' - type: string - required: - - state - type: object - status: - description: The observed status of InternalMemberCluster. - properties: - agentStatus: - description: AgentStatus is an array of current observed status, each - corresponding to one member agent running in the member cluster. - items: - description: AgentStatus defines the observed status of the member - agent of the given type. - properties: - conditions: - description: Conditions is an array of current observed conditions - for the member agent. - items: - description: Condition contains details for one aspect of - the current state of this API Resource. - properties: - lastTransitionTime: - description: |- - lastTransitionTime is the last time the condition transitioned from one status to another. - This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: |- - message is a human readable message indicating details about the transition. - This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: |- - observedGeneration represents the .metadata.generation that the condition was set based upon. - For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date - with respect to the current state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: |- - reason contains a programmatic identifier indicating the reason for the condition's last transition. - Producers of specific condition types may define expected values and meanings for this field, - and whether the values are considered a guaranteed API. - The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, - Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - x-kubernetes-list-map-keys: - - type - x-kubernetes-list-type: map - lastReceivedHeartbeat: - description: Last time we received a heartbeat from the member - agent. - format: date-time - type: string - type: - description: Type of the member agent. - type: string - required: - - type - type: object - type: array - resourceUsage: - description: The current observed resource usage of the member cluster. - It is populated by the member agent. - 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 of all - the nodes on a member cluster that are available for scheduling. - type: object - capacity: - 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: Capacity represents the total resource capacity of - all the nodes on a member cluster. - type: object - observationTime: - description: When the resource usage is observed. - format: date-time - type: string - type: object - type: object - required: - - spec - type: object - served: true - storage: true - subresources: - status: {} diff --git a/config/crd/bases/fleet.azure.com_memberclusters.yaml b/config/crd/bases/fleet.azure.com_memberclusters.yaml deleted file mode 100644 index 52710d5a5..000000000 --- a/config/crd/bases/fleet.azure.com_memberclusters.yaml +++ /dev/null @@ -1,281 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.16.0 - name: memberclusters.fleet.azure.com -spec: - group: fleet.azure.com - names: - categories: - - fleet - kind: MemberCluster - listKind: MemberClusterList - plural: memberclusters - shortNames: - - mc - singular: membercluster - scope: Cluster - versions: - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=="Joined")].status - name: Joined - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: MemberCluster is a resource created in the hub cluster to represent - a member cluster within a fleet. - 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: The desired state of MemberCluster. - properties: - heartbeatPeriodSeconds: - default: 60 - description: 'How often (in seconds) for the member cluster to send - a heartbeat to the hub cluster. Default: 60 seconds. Min: 1 second. - Max: 10 minutes.' - format: int32 - maximum: 600 - minimum: 1 - type: integer - identity: - description: |- - The identity used by the member cluster to access the hub cluster. - The hub agents deployed on the hub cluster will automatically grant the minimal required permissions to this identity for the member agents deployed on the member cluster to access the hub cluster. - properties: - apiGroup: - description: |- - APIGroup holds the API group of the referenced subject. - Defaults to "" for ServiceAccount subjects. - Defaults to "rbac.authorization.k8s.io" for User and Group subjects. - type: string - kind: - description: |- - Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". - If the Authorizer does not recognized the kind value, the Authorizer should report an error. - type: string - name: - description: Name of the object being referenced. - type: string - namespace: - description: |- - Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty - the Authorizer should report an error. - type: string - required: - - kind - - name - type: object - x-kubernetes-map-type: atomic - state: - description: 'The desired state of the member cluster. Possible values: - Join, Leave.' - type: string - required: - - identity - - state - type: object - status: - description: The observed status of MemberCluster. - properties: - agentStatus: - description: AgentStatus is an array of current observed status, each - corresponding to one member agent running in the member cluster. - items: - description: AgentStatus defines the observed status of the member - agent of the given type. - properties: - conditions: - description: Conditions is an array of current observed conditions - for the member agent. - items: - description: Condition contains details for one aspect of - the current state of this API Resource. - properties: - lastTransitionTime: - description: |- - lastTransitionTime is the last time the condition transitioned from one status to another. - This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: |- - message is a human readable message indicating details about the transition. - This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: |- - observedGeneration represents the .metadata.generation that the condition was set based upon. - For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date - with respect to the current state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: |- - reason contains a programmatic identifier indicating the reason for the condition's last transition. - Producers of specific condition types may define expected values and meanings for this field, - and whether the values are considered a guaranteed API. - The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, - Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - x-kubernetes-list-map-keys: - - type - x-kubernetes-list-type: map - lastReceivedHeartbeat: - description: Last time we received a heartbeat from the member - agent. - format: date-time - type: string - type: - description: Type of the member agent. - type: string - required: - - type - type: object - type: array - conditions: - description: Conditions is an array of current observed conditions - for the member cluster. - items: - description: Condition contains details for one aspect of the current - state of this API Resource. - properties: - lastTransitionTime: - description: |- - lastTransitionTime is the last time the condition transitioned from one status to another. - This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: |- - message is a human readable message indicating details about the transition. - This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: |- - observedGeneration represents the .metadata.generation that the condition was set based upon. - For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date - with respect to the current state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: |- - reason contains a programmatic identifier indicating the reason for the condition's last transition. - Producers of specific condition types may define expected values and meanings for this field, - and whether the values are considered a guaranteed API. - The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - x-kubernetes-list-map-keys: - - type - x-kubernetes-list-type: map - resourceUsage: - description: The current observed resource usage of the member cluster. - It is copied from the corresponding InternalMemberCluster object. - 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 of all - the nodes on a member cluster that are available for scheduling. - type: object - capacity: - 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: Capacity represents the total resource capacity of - all the nodes on a member cluster. - type: object - observationTime: - description: When the resource usage is observed. - format: date-time - type: string - type: object - type: object - required: - - spec - type: object - served: true - storage: true - subresources: - status: {} diff --git a/examples/fleet_v1alpha1_membercluster.yaml b/examples/fleet_v1alpha1_membercluster.yaml deleted file mode 100644 index fc5de54ae..000000000 --- a/examples/fleet_v1alpha1_membercluster.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: fleet.azure.com/v1alpha1 -kind: MemberCluster -metadata: - name: kind-member-testing -spec: - state: Join - identity: - name: hub-agent-sa - kind: ServiceAccount - namespace: fleet-system - apiGroup: "" - heartbeatPeriodSeconds: 30 diff --git a/pkg/webhook/fleetresourcehandler/fleetresourcehandler_webhook_test.go b/pkg/webhook/fleetresourcehandler/fleetresourcehandler_webhook_test.go index e948de5ae..a0c14b9d6 100644 --- a/pkg/webhook/fleetresourcehandler/fleetresourcehandler_webhook_test.go +++ b/pkg/webhook/fleetresourcehandler/fleetresourcehandler_webhook_test.go @@ -56,7 +56,7 @@ func TestHandleCRD(t *testing.T) { "allow user in system:masters group to modify fleet CRD": { req: admission.Request{ AdmissionRequest: admissionv1.AdmissionRequest{ - Name: "memberclusters.fleet.azure.com", + Name: "memberclusters.cluster.kubernetes-fleet.io", UserInfo: authenticationv1.UserInfo{ Username: "test-user", Groups: []string{"system:masters"}, @@ -66,12 +66,12 @@ func TestHandleCRD(t *testing.T) { }, }, resourceValidator: fleetResourceValidator{}, - wantResponse: admission.Allowed(fmt.Sprintf(validation.ResourceAllowedFormat, "test-user", utils.GenerateGroupString([]string{"system:masters"}), admissionv1.Update, &utils.CRDMetaGVK, "", types.NamespacedName{Name: "memberclusters.fleet.azure.com"})), + wantResponse: admission.Allowed(fmt.Sprintf(validation.ResourceAllowedFormat, "test-user", utils.GenerateGroupString([]string{"system:masters"}), admissionv1.Update, &utils.CRDMetaGVK, "", types.NamespacedName{Name: "memberclusters.cluster.kubernetes-fleet.io"})), }, "allow white listed user to modify fleet CRD": { req: admission.Request{ AdmissionRequest: admissionv1.AdmissionRequest{ - Name: "memberclusters.fleet.azure.com", + Name: "memberclusters.cluster.kubernetes-fleet.io", UserInfo: authenticationv1.UserInfo{ Username: "test-user", Groups: []string{"test-group"}, @@ -83,12 +83,12 @@ func TestHandleCRD(t *testing.T) { resourceValidator: fleetResourceValidator{ whiteListedUsers: []string{"test-user"}, }, - wantResponse: admission.Allowed(fmt.Sprintf(validation.ResourceAllowedFormat, "test-user", utils.GenerateGroupString([]string{"test-group"}), admissionv1.Delete, &utils.CRDMetaGVK, "", types.NamespacedName{Name: "memberclusters.fleet.azure.com"})), + wantResponse: admission.Allowed(fmt.Sprintf(validation.ResourceAllowedFormat, "test-user", utils.GenerateGroupString([]string{"test-group"}), admissionv1.Delete, &utils.CRDMetaGVK, "", types.NamespacedName{Name: "memberclusters.cluster.kubernetes-fleet.io"})), }, "deny non system user to modify fleet CRD": { req: admission.Request{ AdmissionRequest: admissionv1.AdmissionRequest{ - Name: "memberclusters.fleet.azure.com", + Name: "memberclusters.cluster.kubernetes-fleet.io", UserInfo: authenticationv1.UserInfo{ Username: "test-user", Groups: []string{"test-group"}, @@ -97,7 +97,7 @@ func TestHandleCRD(t *testing.T) { Operation: admissionv1.Create, }, }, - wantResponse: admission.Denied(fmt.Sprintf(validation.ResourceDeniedFormat, "test-user", utils.GenerateGroupString([]string{"test-group"}), admissionv1.Create, &utils.CRDMetaGVK, "", types.NamespacedName{Name: "memberclusters.fleet.azure.com"})), + wantResponse: admission.Denied(fmt.Sprintf(validation.ResourceDeniedFormat, "test-user", utils.GenerateGroupString([]string{"test-group"}), admissionv1.Create, &utils.CRDMetaGVK, "", types.NamespacedName{Name: "memberclusters.cluster.kubernetes-fleet.io"})), }, } diff --git a/pkg/webhook/validation/uservalidation.go b/pkg/webhook/validation/uservalidation.go index f2078a188..9e99d34d4 100644 --- a/pkg/webhook/validation/uservalidation.go +++ b/pkg/webhook/validation/uservalidation.go @@ -44,7 +44,7 @@ const ( ) var ( - fleetCRDGroups = []string{"networking.fleet.azure.com", "fleet.azure.com", "multicluster.x-k8s.io", "cluster.kubernetes-fleet.io", "placement.kubernetes-fleet.io"} + fleetCRDGroups = []string{"networking.fleet.azure.com", "cluster.kubernetes-fleet.io", "placement.kubernetes-fleet.io"} ) // ValidateUserForFleetCRD checks to see if user is not allowed to modify fleet CRDs. From 6c6d3461c3a7563be07ba049079a8c585eed6430 Mon Sep 17 00:00:00 2001 From: Wei Weng Date: Tue, 28 Oct 2025 20:59:47 +0000 Subject: [PATCH 2/4] remove more v1alpha1 references Signed-off-by: Wei Weng --- .github/copilot-instructions.md | 1 - CLAUDE.md | 1 - Makefile | 1 - charts/hub-agent/README.md | 1 - .../crdbases/multicluster.x-k8s.io_works.yaml | 1 - charts/hub-agent/templates/crds/works.yaml | 4 --- charts/hub-agent/templates/deployment.yaml | 1 - charts/hub-agent/values.yaml | 1 - .../multicluster.x-k8s.io_appliedworks.yaml | 1 - charts/member-agent/values.yaml | 3 +- examples/k8s-work-api_v1alpha1_work.yaml | 28 ------------------- hack/Azure/property-based-scheduling.md | 2 -- hack/Azure/setup/createHubCluster.sh | 1 - hack/Azure/setup/joinMC.sh | 1 - hack/membership/join.sh | 1 - hack/membership/joinMC.sh | 1 - test/e2e/setup.sh | 2 -- test/upgrade/setup.sh | 1 - test/upgrade/upgrade.sh | 1 - 19 files changed, 1 insertion(+), 52 deletions(-) delete mode 120000 charts/hub-agent/crdbases/multicluster.x-k8s.io_works.yaml delete mode 120000 charts/member-agent/crdbases/multicluster.x-k8s.io_appliedworks.yaml delete mode 100644 examples/k8s-work-api_v1alpha1_work.yaml diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index bf8867f7a..f6e15988a 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -49,7 +49,6 @@ The main idea is that we are creating a multi-cluster application management sol - `test/apis` - The tests for the CRDs. - `test/upgrade` - The tests for the upgrade tests to test compatibility between versions. - `test/e2e` - The end to end tests for the member and hub agent. - - `test/integration` - The integration tests for the v1alpha1 member and hub agent. - `test/scheduler` - The integration tests for the scheduler. - `test/utils` - folder contains the utils code which is used to provide common functions for tests - The `tools/` folder contains client-side tools for helping manage the fleet. diff --git a/CLAUDE.md b/CLAUDE.md index 0f60520ec..05ff228b0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -209,7 +209,6 @@ All controllers follow standard Kubernetes controller patterns: - Custom properties supported for scheduling decisions ### Multi-API Version Support -- v1alpha1 APIs maintained for backward compatibility - v1beta1 APIs are current stable version - Feature flags control API version enablement diff --git a/Makefile b/Makefile index 73409fe03..a3e4128a0 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,6 @@ MEMBER_CLUSTER_COUNT ?= 3 ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) TOOLS_DIR := hack/tools TOOLS_BIN_DIR := $(abspath $(TOOLS_DIR)/bin) -CLUSTER_CONFIG := $(abspath test/e2e/v1alpha1/kind-config.yaml) # Binaries # Note: Need to use abspath so we can invoke these from subdirectories diff --git a/charts/hub-agent/README.md b/charts/hub-agent/README.md index cd14fa7e9..b72c810e2 100644 --- a/charts/hub-agent/README.md +++ b/charts/hub-agent/README.md @@ -32,7 +32,6 @@ _See [helm install](https://helm.sh/docs/helm/helm_install/) for command documen | `affinity` | Node affinity for hub-agent pods | `{}` | | `tolerations` | Tolerations for hub-agent pods | `[]` | | `logVerbosity` | Log level (klog V logs) | `5` | -| `enableV1Alpha1APIs` | Watch for v1alpha1 APIs | `false` | | `enableV1Beta1APIs` | Watch for v1beta1 APIs | `true` | | `hubAPIQPS` | QPS for fleet-apiserver (not including events/node heartbeat) | `250` | | `hubAPIBurst` | Burst for fleet-apiserver (not including events/node heartbeat) | `1000` | diff --git a/charts/hub-agent/crdbases/multicluster.x-k8s.io_works.yaml b/charts/hub-agent/crdbases/multicluster.x-k8s.io_works.yaml deleted file mode 120000 index 1dc56dfe4..000000000 --- a/charts/hub-agent/crdbases/multicluster.x-k8s.io_works.yaml +++ /dev/null @@ -1 +0,0 @@ -../../../config/crd/bases/multicluster.x-k8s.io_works.yaml \ No newline at end of file diff --git a/charts/hub-agent/templates/crds/works.yaml b/charts/hub-agent/templates/crds/works.yaml index 9b0ac1e5c..d1b245b7c 100644 --- a/charts/hub-agent/templates/crds/works.yaml +++ b/charts/hub-agent/templates/crds/works.yaml @@ -1,8 +1,4 @@ {{ $files := .Files }} -{{ if .Values.enableV1Alpha1APIs }} - {{ $files.Get "crdbases/multicluster.x-k8s.io_works.yaml" }} -{{ end }} ---- {{ if .Values.enableV1Beta1APIs }} {{ $files.Get "crdbases/placement.kubernetes-fleet.io_works.yaml" }} {{ end }} diff --git a/charts/hub-agent/templates/deployment.yaml b/charts/hub-agent/templates/deployment.yaml index d9f1641a1..c4e24fd50 100644 --- a/charts/hub-agent/templates/deployment.yaml +++ b/charts/hub-agent/templates/deployment.yaml @@ -28,7 +28,6 @@ spec: - --webhook-client-connection-type={{.Values.webhookClientConnectionType}} - --v={{ .Values.logVerbosity }} - -add_dir_header - - --enable-v1alpha1-apis={{ .Values.enableV1Alpha1APIs }} - --enable-v1beta1-apis={{ .Values.enableV1Beta1APIs }} - --enable-cluster-inventory-apis={{ .Values.enableClusterInventoryAPI }} - --enable-staged-update-run-apis={{ .Values.enableStagedUpdateRunAPIs }} diff --git a/charts/hub-agent/values.yaml b/charts/hub-agent/values.yaml index e0e1d9265..7672e8048 100644 --- a/charts/hub-agent/values.yaml +++ b/charts/hub-agent/values.yaml @@ -36,7 +36,6 @@ tolerations: [] affinity: {} -enableV1Alpha1APIs: false enableV1Beta1APIs: true enableClusterInventoryAPI: true enableStagedUpdateRunAPIs: true diff --git a/charts/member-agent/crdbases/multicluster.x-k8s.io_appliedworks.yaml b/charts/member-agent/crdbases/multicluster.x-k8s.io_appliedworks.yaml deleted file mode 120000 index 71077cbfa..000000000 --- a/charts/member-agent/crdbases/multicluster.x-k8s.io_appliedworks.yaml +++ /dev/null @@ -1 +0,0 @@ -../../../config/crd/bases/multicluster.x-k8s.io_appliedworks.yaml \ No newline at end of file diff --git a/charts/member-agent/values.yaml b/charts/member-agent/values.yaml index 0bb28cc5d..599dcdfc0 100644 --- a/charts/member-agent/values.yaml +++ b/charts/member-agent/values.yaml @@ -59,8 +59,7 @@ azure: tlsClientInsecure: true #TODO should be false in the production useCAAuth: false -enableV1Alpha1APIs: true -enableV1Beta1APIs: false +enableV1Beta1APIs: true enablePprof: true pprofPort: 6065 diff --git a/examples/k8s-work-api_v1alpha1_work.yaml b/examples/k8s-work-api_v1alpha1_work.yaml deleted file mode 100644 index 2558f5528..000000000 --- a/examples/k8s-work-api_v1alpha1_work.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: multicluster.x-k8s.io/v1alpha1 -kind: Work -metadata: - name: test-work - namespace: fleet-member-kind-member-testing -spec: - workload: - manifests: - - apiVersion: apps/v1 - kind: Deployment - metadata: - name: test-nginx - namespace: default - spec: - selector: - matchLabels: - app: test-nginx - replicas: 2 - template: - metadata: - labels: - app: test-nginx - spec: - containers: - - name: nginx - image: nginx:1.14.2 - ports: - - containerPort: 80 diff --git a/hack/Azure/property-based-scheduling.md b/hack/Azure/property-based-scheduling.md index 877401548..c8f271362 100644 --- a/hack/Azure/property-based-scheduling.md +++ b/hack/Azure/property-based-scheduling.md @@ -123,7 +123,6 @@ helm install hub-agent charts/hub-agent/ \ --set namespace=fleet-system \ --set enableWebhook=true \ --set webhookClientConnectionType=service \ - --set enableV1Alpha1APIs=false \ --set enableV1Beta1APIs=true ``` @@ -186,7 +185,6 @@ do --set config.memberClusterName="${MEMBER_CLUSTERS[$i]}" \ --set logVerbosity=5 \ --set namespace=fleet-system \ - --set enableV1Alpha1APIs=false \ --set enableV1Beta1APIs=true \ --set propertyProvider=$PROPERTY_PROVIDER done diff --git a/hack/Azure/setup/createHubCluster.sh b/hack/Azure/setup/createHubCluster.sh index 6dd4d2092..388bd806c 100755 --- a/hack/Azure/setup/createHubCluster.sh +++ b/hack/Azure/setup/createHubCluster.sh @@ -30,7 +30,6 @@ helm install hub-agent charts/hub-agent/ \ --set namespace=fleet-system \ --set enableWebhook=false \ --set webhookClientConnectionType=service \ - --set enableV1Alpha1APIs=false \ --set enableV1Beta1APIs=true \ --set clusterUnhealthyThreshold="3m0s" \ --set forceDeleteWaitTime="1m0s" \ diff --git a/hack/Azure/setup/joinMC.sh b/hack/Azure/setup/joinMC.sh index 3a5032da1..899c54819 100755 --- a/hack/Azure/setup/joinMC.sh +++ b/hack/Azure/setup/joinMC.sh @@ -89,7 +89,6 @@ helm install member-agent charts/member-agent/ \ --set config.memberClusterName=$MEMBER_CLUSTER \ --set logVerbosity=5 \ --set namespace=fleet-system \ - --set enableV1Alpha1APIs=false \ --set enableV1Beta1APIs=true kubectl get pods -A diff --git a/hack/membership/join.sh b/hack/membership/join.sh index 072135d51..695950bb9 100755 --- a/hack/membership/join.sh +++ b/hack/membership/join.sh @@ -127,5 +127,4 @@ helm install member-agent charts/member-agent/ \ --set config.memberClusterName="$MEMBER_CLUSTER" \ --set logVerbosity=6 \ --set namespace=fleet-system \ - --set enableV1Alpha1APIs=false \ --set enableV1Beta1APIs=true diff --git a/hack/membership/joinMC.sh b/hack/membership/joinMC.sh index ebddbb423..87478824b 100755 --- a/hack/membership/joinMC.sh +++ b/hack/membership/joinMC.sh @@ -136,7 +136,6 @@ helm install member-agent charts/member-agent/ \ --set config.memberClusterName=$MEMBER_CLUSTER \ --set logVerbosity=8 \ --set namespace=fleet-system \ - --set enableV1Alpha1APIs=false \ --set enableV1Beta1APIs=true kubectl get pods -A diff --git a/test/e2e/setup.sh b/test/e2e/setup.sh index d41d66b3c..cdb47442b 100755 --- a/test/e2e/setup.sh +++ b/test/e2e/setup.sh @@ -189,7 +189,6 @@ do --set config.memberClusterName="kind-${MEMBER_CLUSTERS[$i]}" \ --set logVerbosity=5 \ --set namespace=fleet-system \ - --set enableV1Alpha1APIs=false \ --set enableV1Beta1APIs=true \ --set propertyProvider=$PROPERTY_PROVIDER \ --set region=${REGIONS[$i]} \ @@ -206,7 +205,6 @@ do --set config.memberClusterName="kind-${MEMBER_CLUSTERS[$i]}" \ --set logVerbosity=5 \ --set namespace=fleet-system \ - --set enableV1Alpha1APIs=false \ --set enableV1Beta1APIs=true \ --set propertyProvider=$PROPERTY_PROVIDER \ $( [ "$PROPERTY_PROVIDER" = "azure" ] && echo "-f azure_valid_config.yaml" ) diff --git a/test/upgrade/setup.sh b/test/upgrade/setup.sh index 482a20166..339bab0ee 100755 --- a/test/upgrade/setup.sh +++ b/test/upgrade/setup.sh @@ -124,7 +124,6 @@ do --set config.memberClusterName="kind-${MEMBER_CLUSTERS[$i]}" \ --set logVerbosity=5 \ --set namespace=fleet-system \ - --set enableV1Alpha1APIs=false \ --set enableV1Beta1APIs=true done diff --git a/test/upgrade/upgrade.sh b/test/upgrade/upgrade.sh index 46caefd9d..6f1caa366 100755 --- a/test/upgrade/upgrade.sh +++ b/test/upgrade/upgrade.sh @@ -86,7 +86,6 @@ if [ -n "$UPGRADE_MEMBER_SIDE" ]; then --set config.memberClusterName="kind-${MEMBER_CLUSTERS[$i]}" \ --set logVerbosity=5 \ --set namespace=fleet-system \ - --set enableV1Alpha1APIs=false \ --set enableV1Beta1APIs=true done fi From f95ad243b5c2b1b1003fc0a75e9cf6bf62fcd09d Mon Sep 17 00:00:00 2001 From: Wei Weng Date: Tue, 28 Oct 2025 21:44:19 +0000 Subject: [PATCH 3/4] remove v1alpha1 work CRDs Signed-off-by: Wei Weng --- .../multicluster.x-k8s.io_appliedworks.yaml | 124 -------- .../bases/multicluster.x-k8s.io_works.yaml | 264 ------------------ 2 files changed, 388 deletions(-) delete mode 100644 config/crd/bases/multicluster.x-k8s.io_appliedworks.yaml delete mode 100644 config/crd/bases/multicluster.x-k8s.io_works.yaml diff --git a/config/crd/bases/multicluster.x-k8s.io_appliedworks.yaml b/config/crd/bases/multicluster.x-k8s.io_appliedworks.yaml deleted file mode 100644 index 6b5430b29..000000000 --- a/config/crd/bases/multicluster.x-k8s.io_appliedworks.yaml +++ /dev/null @@ -1,124 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.8.0 - creationTimestamp: null - name: appliedworks.multicluster.x-k8s.io -spec: - group: multicluster.x-k8s.io - names: - categories: - - fleet - kind: AppliedWork - listKind: AppliedWorkList - plural: appliedworks - singular: appliedwork - scope: Cluster - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: AppliedWork represents an applied work on managed cluster that - is placed on a managed cluster. An appliedwork links to a work on a hub - recording resources deployed in the managed cluster. When the agent is removed - from managed cluster, cluster-admin on managed cluster can delete appliedmanifestwork - to remove resources deployed by the agent. The name of the appliedwork must - be the same as {manifestwork name} The namespace of the appliedwork should - be the same as the resource applied on the managed 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 - spec: - description: Spec represents the desired configuration of AppliedManifestWork. - properties: - workName: - description: WorkName represents the name of the related work on the - hub. - type: string - workNamespace: - description: WorkNamespace represents the namespace of the related - work on the hub. - type: string - required: - - workName - - workNamespace - type: object - status: - description: Status represents the current status of AppliedManifestWork. - properties: - appliedResources: - description: AppliedResources represents a list of resources defined - within the manifestwork that are applied. Only resources with valid - GroupVersionResource, namespace, and name are suitable. An item - in this slice is deleted when there is no mapped manifest in manifestwork.Spec - or by finalizer. The resource relating to the item will also be - removed from managed cluster. The deleted resource may still be - present until the finalizers for that resource are finished. However, - the resource will not be undeleted, so it can be removed from this - list and eventual consistency is preserved. - items: - description: AppliedResourceMeta represents the group, version, - resource, name and namespace of a resource. Since these resources - have been created, they must have valid group, version, resource, - namespace, and name. - properties: - group: - description: Group is the group of the resource. - type: string - kind: - description: Kind is the kind of the resource. - type: string - name: - description: Name is the name of the resource - type: string - namespace: - description: Namespace is the namespace of the resource, the - resource is cluster scoped if the value is empty - type: string - ordinal: - description: Ordinal represents an index in manifests list, - so the condition can still be linked to a manifest even though - manifest cannot be parsed successfully. - type: integer - resource: - description: Resource is the resource type of the resource - type: string - uid: - description: UID is set on successful deletion of the Kubernetes - resource by controller. The resource might be still visible - on the managed cluster after this field is set. It is not - directly settable by a client. - type: string - version: - description: Version is the version of the resource. - type: string - required: - - ordinal - type: object - type: array - type: object - required: - - spec - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/config/crd/bases/multicluster.x-k8s.io_works.yaml b/config/crd/bases/multicluster.x-k8s.io_works.yaml deleted file mode 100644 index a98e638bd..000000000 --- a/config/crd/bases/multicluster.x-k8s.io_works.yaml +++ /dev/null @@ -1,264 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.8.0 - creationTimestamp: null - name: works.multicluster.x-k8s.io -spec: - group: multicluster.x-k8s.io - names: - kind: Work - listKind: WorkList - plural: works - singular: work - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: Work is the Schema for the works 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: spec defines the workload of a work. - properties: - workload: - description: Workload represents the manifest workload to be deployed - on spoke cluster - properties: - manifests: - description: Manifests represents a list of kubernetes resources - to be deployed on the spoke cluster. - items: - description: Manifest represents a resource to be deployed on - spoke cluster - type: object - x-kubernetes-embedded-resource: true - x-kubernetes-preserve-unknown-fields: true - type: array - type: object - type: object - status: - description: status defines the status of each applied manifest on the - spoke cluster. - properties: - conditions: - description: 'Conditions contains the different condition statuses - for this work. Valid condition types are: 1. Applied represents - workload in Work is applied successfully on the spoke cluster. 2. - Progressing represents workload in Work in the transitioning from - one state to another the on the spoke cluster. 3. Available represents - workload in Work exists on the spoke cluster. 4. Degraded represents - the current state of workload does not match the desired state for - a certain period.' - items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - type FooStatus struct{ // Represents the observations of a foo's - current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - manifestConditions: - description: ManifestConditions represents the conditions of each - resource in work deployed on spoke cluster. - items: - description: ManifestCondition represents the conditions of the - resources deployed on spoke cluster - properties: - conditions: - description: Conditions represents the conditions of this resource - on spoke cluster - items: - description: "Condition contains details for one aspect of - the current state of this API Resource. --- This struct - is intended for direct use as an array at the field path - .status.conditions. For example, type FooStatus struct{ - // Represents the observations of a foo's current state. - // Known .status.conditions.type are: \"Available\", \"Progressing\", - and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields - }" - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should - be when the underlying condition changed. If that is - not known, then using the time when the API field changed - is acceptable. - format: date-time - type: string - message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, - if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the - current state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: reason contains a programmatic identifier - indicating the reason for the condition's last transition. - Producers of specific condition types may define expected - values and meanings for this field, and whether the - values are considered a guaranteed API. The value should - be a CamelCase string. This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, - Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across - resources like Available, but because arbitrary conditions - can be useful (see .node.status.conditions), the ability - to deconflict is important. The regex it matches is - (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - identifier: - description: resourceId represents a identity of a resource - linking to manifests in spec. - properties: - group: - description: Group is the group of the resource. - type: string - kind: - description: Kind is the kind of the resource. - type: string - name: - description: Name is the name of the resource - type: string - namespace: - description: Namespace is the namespace of the resource, - the resource is cluster scoped if the value is empty - type: string - ordinal: - description: Ordinal represents an index in manifests list, - so the condition can still be linked to a manifest even - though manifest cannot be parsed successfully. - type: integer - resource: - description: Resource is the resource type of the resource - type: string - version: - description: Version is the version of the resource. - type: string - required: - - ordinal - type: object - required: - - conditions - type: object - type: array - required: - - conditions - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] From 58e672fbfba89822f54a8d0c859a808d72544112 Mon Sep 17 00:00:00 2001 From: Wei Weng Date: Tue, 28 Oct 2025 22:10:43 +0000 Subject: [PATCH 4/4] remove one more enable v1alpha1 from chart Signed-off-by: Wei Weng --- charts/member-agent/templates/deployment.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/member-agent/templates/deployment.yaml b/charts/member-agent/templates/deployment.yaml index 6b302b801..39e0dec34 100644 --- a/charts/member-agent/templates/deployment.yaml +++ b/charts/member-agent/templates/deployment.yaml @@ -32,7 +32,6 @@ spec: {{- end }} - --v={{ .Values.logVerbosity }} - -add_dir_header - - --enable-v1alpha1-apis={{ .Values.enableV1Alpha1APIs }} - --enable-v1beta1-apis={{ .Values.enableV1Beta1APIs }} - --enable-pprof={{ .Values.enablePprof }} - --pprof-port={{ .Values.pprofPort }}