Skip to content

Commit

Permalink
Merge pull request #470 from duanmengkk/main
Browse files Browse the repository at this point in the history
modify virtualcluster's definition
  • Loading branch information
duanmengkk authored Apr 21, 2024
2 parents 17d228c + 7f95d01 commit 6559079
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 29 deletions.
22 changes: 10 additions & 12 deletions deploy/crds/kosmos.io_virtualclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ spec:
spec:
description: Spec is the specification for the behaviour of the VirtualCluster.
properties:
PromotePolicies:
externalIP:
description: ExternalIP is the external ip of the virtual kubernetes's
control plane
type: string
kubeconfig:
description: Kubeconfig is the kubeconfig of the virtual kubernetes's
control plane
type: string
promotePolicies:
description: PromotePolicies definites the policies for promote to
the kubernetes's control plane
items:
Expand Down Expand Up @@ -88,17 +96,10 @@ spec:
nodeCount:
description: NodeCount is the number of nodes to promote to
the kubernetes's control plane
format: int32
type: integer
type: object
type: array
externalIP:
description: ExternalIP is the external ip of the virtual kubernetes's
control plane
type: string
kubeconfig:
description: Kubeconfig is the kubeconfig of the virtual kubernetes's
control plane
type: string
promoteResources:
description: PromoteResources definites the resources for promote
to the kubernetes's control plane, the resources can be nodes or
Expand All @@ -109,9 +110,6 @@ spec:
kubernetes's control plane
items:
properties:
address:
description: Address defines node ip
type: string
nodeName:
description: NodeName defines node name
type: string
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/kosmos/v1alpha1/podconvertpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type PodConvertPolicySpec struct {

// A label query over a set of resources.
// If name is not empty, LeafNodeSelector will be ignored.
// +option
// +optional
LeafNodeSelector *metav1.LabelSelector `json:"leafNodeSelector,omitempty"`

// Converters are some converter for convert pod when pod synced from root cluster to leaf cluster
Expand Down
9 changes: 3 additions & 6 deletions pkg/apis/kosmos/v1alpha1/virtualcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type VirtualClusterSpec struct {

// PromotePolicies definites the policies for promote to the kubernetes's control plane
// +optional
PromotePolicies []PromotePolicy `json:"PromotePolicies,omitempty"`
PromotePolicies []PromotePolicy `json:"promotePolicies,omitempty"`

// PromoteResources definites the resources for promote to the kubernetes's control plane,
// the resources can be nodes or just cpu,memory or gpu resources
Expand All @@ -55,11 +55,11 @@ type VirtualClusterSpec struct {
type PromotePolicy struct {
// LabelSelector is used to select nodes that are eligible for promotion to the kubernetes's control plane.
// +optional
LabelSelector metav1.LabelSelector `json:"labelSelector,omitempty"`
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`

// NodeCount is the number of nodes to promote to the kubernetes's control plane
// +optional
NodeCount int16 `json:"nodeCount,omitempty"`
NodeCount *int32 `json:"nodeCount,omitempty"`
}

type PromoteResources struct {
Expand All @@ -76,9 +76,6 @@ type NodeInfo struct {
//NodeName defines node name
//+optional
NodeName string `json:"nodeName,omitempty"`
//Address defines node ip
//+optional
Address string `json:"address,omitempty"`
}

type VirtualClusterStatus struct {
Expand Down
11 changes: 10 additions & 1 deletion pkg/apis/kosmos/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions pkg/generated/openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6559079

Please sign in to comment.