Skip to content
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

add clusterpodconvertpolicy api #383

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,374 changes: 1,374 additions & 0 deletions deploy/crds/kosmos.io_clusterpodconvertpolicies.yaml

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions deploy/crds/kosmos.io_podconvertpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ spec:
plural: podconvertpolicies
shortNames:
- pc
- pcs
singular: podconvertpolicy
scope: Namespaced
versions:
Expand All @@ -35,7 +34,7 @@ spec:
metadata:
type: object
spec:
description: Spec is the specification for the behaviour of the podConversion.
description: Spec is the specification for the behaviour of the PodConvertPolicy.
properties:
converters:
description: Converters are some converter for convert pod when pod
Expand Down
46 changes: 46 additions & 0 deletions pkg/apis/kosmos/v1alpha1/clusterpodconvertpolicy_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +genclient
// +genclient:nonNamespaced
// +kubebuilder:resource:scope="Cluster"
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=pc
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type ClusterPodConvertPolicy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// Spec is the specification for the behaviour of the PodConvertPolicy.
// +required
Spec ClusterPodConvertPolicySpec `json:"spec"`
}

type ClusterPodConvertPolicySpec struct {
// A label query over a set of resources.
// If name is not empty, labelSelector will be ignored.
// +required
LabelSelector metav1.LabelSelector `json:"labelSelector"`

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

// Converters are some converter for convert pod when pod synced from root cluster to leaf cluster
// pod will use these converters to scheduled in leaf cluster
// +optional
Converters *Converters `json:"converters,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type ClusterPodConvertPolicyList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []ClusterPodConvertPolicy `json:"items"`
}
4 changes: 2 additions & 2 deletions pkg/apis/kosmos/v1alpha1/podconvertpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (

// +genclient
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=pc;pcs
// +kubebuilder:resource:shortName=pc
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type PodConvertPolicy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// Spec is the specification for the behaviour of the podConversion.
// Spec is the specification for the behaviour of the PodConvertPolicy.
// +required
Spec PodConvertPolicySpec `json:"spec"`
}
Expand Down
87 changes: 87 additions & 0 deletions 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.

2 changes: 2 additions & 0 deletions pkg/apis/kosmos/v1alpha1/zz_generated.register.go

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.

Loading
Loading