-
Notifications
You must be signed in to change notification settings - Fork 81
✨ [WIP] Adding managed namespace field in the managedclusterset #390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,26 +144,34 @@ const ( | |
|
||
// ManagedClusterStatus represents the current status of joined managed cluster. | ||
type ManagedClusterStatus struct { | ||
// Conditions contains the different condition statuses for this managed cluster. | ||
// conditions contains the different condition statuses for this managed cluster. | ||
Conditions []metav1.Condition `json:"conditions"` | ||
|
||
// Capacity represents the total resource capacity from all nodeStatuses | ||
// capacity represents the total resource capacity from all nodeStatuses | ||
// on the managed cluster. | ||
Capacity ResourceList `json:"capacity,omitempty"` | ||
|
||
// Allocatable represents the total allocatable resources on the managed cluster. | ||
// allocatable represents the total allocatable resources on the managed cluster. | ||
Allocatable ResourceList `json:"allocatable,omitempty"` | ||
|
||
// Version represents the kubernetes version of the managed cluster. | ||
// version represents the kubernetes version of the managed cluster. | ||
Version ManagedClusterVersion `json:"version,omitempty"` | ||
|
||
// ClusterClaims represents cluster information that a managed cluster claims, | ||
// clusterClaims represents cluster information that a managed cluster claims, | ||
// for example a unique cluster identifier (id.k8s.io) and kubernetes version | ||
// (kubeversion.open-cluster-management.io). They are written from the managed | ||
// cluster. The set of claims is not uniform across a fleet, some claims can be | ||
// vendor or version specific and may not be included from all managed clusters. | ||
// +optional | ||
ClusterClaims []ManagedClusterClaim `json:"clusterClaims,omitempty"` | ||
|
||
// managedNamespaces are a list of namespaces managed by the clustersets the | ||
// cluster belongs to. | ||
// +optional | ||
// +listType=map | ||
// +listMapKey=clusterSet | ||
// +listMapKey=name | ||
ManagedNamespaces []ClusterSetManagedNamespaceConfig `json:"managedNamespaces,omitempty"` | ||
} | ||
|
||
// ManagedClusterVersion represents version information about the managed cluster. | ||
|
@@ -188,6 +196,27 @@ type ManagedClusterClaim struct { | |
Value string `json:"value,omitempty"` | ||
} | ||
|
||
// managedNamespaces defines a namespace on the managedclusters across the | ||
// clusterset to be managed by this clusterset. | ||
type ManagedNamespaceConfig struct { | ||
// name is the name of the namespace. | ||
// +required | ||
// +kubebuilder:validation:MaxLength=63 | ||
// +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ | ||
Name string `json:"name"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any restriction on the name? for example, it cannot be one of 'kube-system', 'kube-public' and 'default' |
||
} | ||
|
||
type ClusterSetManagedNamespaceConfig struct { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Has this struct been used anywhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated, should be in the cluster status |
||
ManagedNamespaceConfig `json:",inline"` | ||
|
||
// clusterSet represents the name of the cluster set. | ||
// +required | ||
ClusterSet string `json:"clusterSet"` | ||
|
||
// conditions are the status conditions of the managed namespace | ||
Conditions []metav1.Condition `json:"conditions,omitempty"` | ||
} | ||
|
||
const ( | ||
// ManagedClusterConditionJoined means the managed cluster has successfully joined the hub. | ||
ManagedClusterConditionJoined string = "ManagedClusterJoined" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the 'clusterSet' is the key of the map, does that mean for each clusterset only one item is allowed in the list? in another world, only one managed namespace is allowed for a clusterset in the 'managedNamespaces' list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct, add name is another key