forked from kosmos-io/kosmos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make cluster and namespace level ConvertPolicy available
Signed-off-by: ONE7live <[email protected]>
- Loading branch information
Showing
21 changed files
with
3,522 additions
and
2,501 deletions.
There are no files selected for viewing
1,406 changes: 1,406 additions & 0 deletions
1,406
deploy/crds/kosmos.io_clusterpodconvertpolicies.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2,469 changes: 1,250 additions & 1,219 deletions
2,469
deploy/crds/kosmos.io_podconvertpolicies.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=cpcp | ||
// +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 ClusterPodConvertPolicy. | ||
// +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"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.