1 package v1 2 3 import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 4 5 // +genclient 6 // +genclient:nonNamespaced 7 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 8 9 // Scheduler holds cluster-wide config information to run the Kubernetes Scheduler 10 // and influence its placement decisions. The canonical name for this config is `cluster`. 11 // 12 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 13 // +openshift:compatibility-gen:level=1 14 type Scheduler struct { 15 metav1.TypeMeta `json:",inline"` 16 17 // metadata is the standard object's metadata. 18 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 19 metav1.ObjectMeta `json:"metadata,omitempty"` 20 21 // spec holds user settable values for configuration 22 // +kubebuilder:validation:Required 23 // +required 24 Spec SchedulerSpec `json:"spec"` 25 // status holds observed values from the cluster. They may not be overridden. 26 // +optional 27 Status SchedulerStatus `json:"status"` 28 } 29 30 type SchedulerSpec struct { 31 // DEPRECATED: the scheduler Policy API has been deprecated and will be removed in a future release. 32 // policy is a reference to a ConfigMap containing scheduler policy which has 33 // user specified predicates and priorities. If this ConfigMap is not available 34 // scheduler will default to use DefaultAlgorithmProvider. 35 // The namespace for this configmap is openshift-config. 36 // +optional 37 Policy ConfigMapNameReference `json:"policy,omitempty"` 38 // profile sets which scheduling profile should be set in order to configure scheduling 39 // decisions for new pods. 40 // 41 // Valid values are "LowNodeUtilization", "HighNodeUtilization", "NoScoring" 42 // Defaults to "LowNodeUtilization" 43 // +optional 44 Profile SchedulerProfile `json:"profile,omitempty"` 45 // defaultNodeSelector helps set the cluster-wide default node selector to 46 // restrict pod placement to specific nodes. This is applied to the pods 47 // created in all namespaces and creates an intersection with any existing 48 // nodeSelectors already set on a pod, additionally constraining that pod's selector. 49 // For example, 50 // defaultNodeSelector: "type=user-node,region=east" would set nodeSelector 51 // field in pod spec to "type=user-node,region=east" to all pods created 52 // in all namespaces. Namespaces having project-wide node selectors won't be 53 // impacted even if this field is set. This adds an annotation section to 54 // the namespace. 55 // For example, if a new namespace is created with 56 // node-selector='type=user-node,region=east', 57 // the annotation openshift.io/node-selector: type=user-node,region=east 58 // gets added to the project. When the openshift.io/node-selector annotation 59 // is set on the project the value is used in preference to the value we are setting 60 // for defaultNodeSelector field. 61 // For instance, 62 // openshift.io/node-selector: "type=user-node,region=west" means 63 // that the default of "type=user-node,region=east" set in defaultNodeSelector 64 // would not be applied. 65 // +optional 66 DefaultNodeSelector string `json:"defaultNodeSelector,omitempty"` 67 // MastersSchedulable allows masters nodes to be schedulable. When this flag is 68 // turned on, all the master nodes in the cluster will be made schedulable, 69 // so that workload pods can run on them. The default value for this field is false, 70 // meaning none of the master nodes are schedulable. 71 // Important Note: Once the workload pods start running on the master nodes, 72 // extreme care must be taken to ensure that cluster-critical control plane components 73 // are not impacted. 74 // Please turn on this field after doing due diligence. 75 // +optional 76 MastersSchedulable bool `json:"mastersSchedulable"` 77 } 78 79 // +kubebuilder:validation:Enum="";LowNodeUtilization;HighNodeUtilization;NoScoring 80 type SchedulerProfile string 81 82 var ( 83 // LowNodeUtililization is the default, and defines a scheduling profile which prefers to 84 // spread pods evenly among nodes targeting low resource consumption on each node. 85 LowNodeUtilization SchedulerProfile = "LowNodeUtilization" 86 87 // HighNodeUtilization defines a scheduling profile which packs as many pods as possible onto 88 // as few nodes as possible targeting a small node count but high resource usage on each node. 89 HighNodeUtilization SchedulerProfile = "HighNodeUtilization" 90 91 // NoScoring defines a scheduling profile which tries to provide lower-latency scheduling 92 // at the expense of potentially less optimal pod placement decisions. 93 NoScoring SchedulerProfile = "NoScoring" 94 ) 95 96 type SchedulerStatus struct { 97 } 98 99 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 100 101 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 102 // +openshift:compatibility-gen:level=1 103 type SchedulerList struct { 104 metav1.TypeMeta `json:",inline"` 105 106 // metadata is the standard list's metadata. 107 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 108 metav1.ListMeta `json:"metadata"` 109 110 Items []Scheduler `json:"items"` 111 } 112