k8s_pb/api/scheduling/v1alpha1/
mod.rs

1// This file is @generated by prost-build.
2/// BasicSchedulingPolicy indicates that standard Kubernetes
3/// scheduling behavior should be used.
4#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct BasicSchedulingPolicy {}
6/// GangSchedulingPolicy defines the parameters for gang scheduling.
7#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8pub struct GangSchedulingPolicy {
9    /// MinCount is the minimum number of pods that must be schedulable or scheduled
10    /// at the same time for the scheduler to admit the entire group.
11    /// It must be a positive integer.
12    ///
13    /// +required
14    #[prost(int32, optional, tag = "1")]
15    pub min_count: ::core::option::Option<i32>,
16}
17/// PodGroup represents a set of pods with a common scheduling policy.
18#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
19pub struct PodGroup {
20    /// Name is a unique identifier for the PodGroup within the Workload.
21    /// It must be a DNS label. This field is immutable.
22    ///
23    /// +required
24    #[prost(string, optional, tag = "1")]
25    pub name: ::core::option::Option<::prost::alloc::string::String>,
26    /// Policy defines the scheduling policy for this PodGroup.
27    ///
28    /// +required
29    #[prost(message, optional, tag = "3")]
30    pub policy: ::core::option::Option<PodGroupPolicy>,
31}
32/// PodGroupPolicy defines the scheduling configuration for a PodGroup.
33#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
34pub struct PodGroupPolicy {
35    /// Basic specifies that the pods in this group should be scheduled using
36    /// standard Kubernetes scheduling behavior.
37    ///
38    /// +optional
39    /// +oneOf=PolicySelection
40    #[prost(message, optional, tag = "2")]
41    pub basic: ::core::option::Option<BasicSchedulingPolicy>,
42    /// Gang specifies that the pods in this group should be scheduled using
43    /// all-or-nothing semantics.
44    ///
45    /// +optional
46    /// +oneOf=PolicySelection
47    #[prost(message, optional, tag = "3")]
48    pub gang: ::core::option::Option<GangSchedulingPolicy>,
49}
50/// DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass.
51/// PriorityClass defines mapping from a priority class name to the priority
52/// integer value. The value can be any valid integer.
53#[derive(Clone, PartialEq, ::prost::Message)]
54pub struct PriorityClass {
55    /// Standard object's metadata.
56    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
57    /// +optional
58    #[prost(message, optional, tag = "1")]
59    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
60    /// value represents the integer value of this priority class. This is the actual priority that pods
61    /// receive when they have the name of this class in their pod spec.
62    #[prost(int32, optional, tag = "2")]
63    pub value: ::core::option::Option<i32>,
64    /// globalDefault specifies whether this PriorityClass should be considered as
65    /// the default priority for pods that do not have any priority class.
66    /// Only one PriorityClass can be marked as `globalDefault`. However, if more than
67    /// one PriorityClasses exists with their `globalDefault` field set to true,
68    /// the smallest value of such global default PriorityClasses will be used as the default priority.
69    /// +optional
70    #[prost(bool, optional, tag = "3")]
71    pub global_default: ::core::option::Option<bool>,
72    /// description is an arbitrary string that usually provides guidelines on
73    /// when this priority class should be used.
74    /// +optional
75    #[prost(string, optional, tag = "4")]
76    pub description: ::core::option::Option<::prost::alloc::string::String>,
77    /// preemptionPolicy is the Policy for preempting pods with lower priority.
78    /// One of Never, PreemptLowerPriority.
79    /// Defaults to PreemptLowerPriority if unset.
80    /// +optional
81    #[prost(string, optional, tag = "5")]
82    pub preemption_policy: ::core::option::Option<::prost::alloc::string::String>,
83}
84/// PriorityClassList is a collection of priority classes.
85#[derive(Clone, PartialEq, ::prost::Message)]
86pub struct PriorityClassList {
87    /// Standard list metadata
88    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
89    /// +optional
90    #[prost(message, optional, tag = "1")]
91    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
92    /// items is the list of PriorityClasses
93    #[prost(message, repeated, tag = "2")]
94    pub items: ::prost::alloc::vec::Vec<PriorityClass>,
95}
96/// TypedLocalObjectReference allows to reference typed object inside the same namespace.
97#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
98pub struct TypedLocalObjectReference {
99    /// APIGroup is the group for the resource being referenced.
100    /// If APIGroup is empty, the specified Kind must be in the core API group.
101    /// For any other third-party types, setting APIGroup is required.
102    /// It must be a DNS subdomain.
103    ///
104    /// +optional
105    #[prost(string, optional, tag = "1")]
106    pub api_group: ::core::option::Option<::prost::alloc::string::String>,
107    /// Kind is the type of resource being referenced.
108    /// It must be a path segment name.
109    ///
110    /// +required
111    #[prost(string, optional, tag = "2")]
112    pub kind: ::core::option::Option<::prost::alloc::string::String>,
113    /// Name is the name of resource being referenced.
114    /// It must be a path segment name.
115    ///
116    /// +required
117    #[prost(string, optional, tag = "3")]
118    pub name: ::core::option::Option<::prost::alloc::string::String>,
119}
120/// Workload allows for expressing scheduling constraints that should be used
121/// when managing lifecycle of workloads from scheduling perspective,
122/// including scheduling, preemption, eviction and other phases.
123#[derive(Clone, PartialEq, ::prost::Message)]
124pub struct Workload {
125    /// Standard object's metadata.
126    /// Name must be a DNS subdomain.
127    ///
128    /// +optional
129    #[prost(message, optional, tag = "1")]
130    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
131    /// Spec defines the desired behavior of a Workload.
132    ///
133    /// +required
134    #[prost(message, optional, tag = "2")]
135    pub spec: ::core::option::Option<WorkloadSpec>,
136}
137/// WorkloadList contains a list of Workload resources.
138#[derive(Clone, PartialEq, ::prost::Message)]
139pub struct WorkloadList {
140    /// Standard list metadata.
141    ///
142    /// +optional
143    #[prost(message, optional, tag = "1")]
144    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
145    /// Items is the list of Workloads.
146    #[prost(message, repeated, tag = "2")]
147    pub items: ::prost::alloc::vec::Vec<Workload>,
148}
149/// WorkloadSpec defines the desired state of a Workload.
150#[derive(Clone, PartialEq, ::prost::Message)]
151pub struct WorkloadSpec {
152    /// ControllerRef is an optional reference to the controlling object, such as a
153    /// Deployment or Job. This field is intended for use by tools like CLIs
154    /// to provide a link back to the original workload definition.
155    /// When set, it cannot be changed.
156    ///
157    /// +optional
158    #[prost(message, optional, tag = "1")]
159    pub controller_ref: ::core::option::Option<TypedLocalObjectReference>,
160    /// PodGroups is the list of pod groups that make up the Workload.
161    /// The maximum number of pod groups is 8. This field is immutable.
162    ///
163    /// +required
164    /// +listType=map
165    /// +listMapKey=name
166    #[prost(message, repeated, tag = "2")]
167    pub pod_groups: ::prost::alloc::vec::Vec<PodGroup>,
168}
169
170impl crate::Resource for Workload {
171    const API_VERSION: &'static str = "scheduling.k8s.io/v1alpha1";
172    const GROUP: &'static str = "scheduling.k8s.io";
173    const VERSION: &'static str = "v1alpha1";
174    const KIND: &'static str = "Workload";
175    const URL_PATH_SEGMENT: &'static str = "workloads";
176    type Scope = crate::NamespaceResourceScope;
177}
178impl crate::Metadata for Workload {
179    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
180    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
181        self.metadata.as_ref()
182    }
183    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
184        self.metadata.as_mut()
185    }
186}
187impl crate::HasSpec for Workload {
188    type Spec = crate::api::scheduling::v1alpha1::WorkloadSpec;
189    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
190        self.spec.as_ref()
191    }
192    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
193        self.spec.as_mut()
194    }
195}