blob: d68b4b318791673e28103c05980210d18c4790e3 [file] [log] [blame]
Matteo Scandoloa4285862020-12-01 18:10:10 -08001/*
2Copyright 2018 The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17package v1beta1
18
19import (
20 apiv1 "k8s.io/api/core/v1"
21 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22)
23
24// +genclient
25// +genclient:nonNamespaced
26// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
27// +k8s:prerelease-lifecycle-gen:introduced=1.11
28// +k8s:prerelease-lifecycle-gen:deprecated=1.14
29// +k8s:prerelease-lifecycle-gen:removed=1.22
30// +k8s:prerelease-lifecycle-gen:replacement=scheduling.k8s.io,v1,PriorityClass
31
32// DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass.
33// PriorityClass defines mapping from a priority class name to the priority
34// integer value. The value can be any valid integer.
35type PriorityClass struct {
36 metav1.TypeMeta `json:",inline"`
37 // Standard object's metadata.
38 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
39 // +optional
40 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
41
42 // The value of this priority class. This is the actual priority that pods
43 // receive when they have the name of this class in their pod spec.
44 Value int32 `json:"value" protobuf:"bytes,2,opt,name=value"`
45
46 // globalDefault specifies whether this PriorityClass should be considered as
47 // the default priority for pods that do not have any priority class.
48 // Only one PriorityClass can be marked as `globalDefault`. However, if more than
49 // one PriorityClasses exists with their `globalDefault` field set to true,
50 // the smallest value of such global default PriorityClasses will be used as the default priority.
51 // +optional
52 GlobalDefault bool `json:"globalDefault,omitempty" protobuf:"bytes,3,opt,name=globalDefault"`
53
54 // description is an arbitrary string that usually provides guidelines on
55 // when this priority class should be used.
56 // +optional
57 Description string `json:"description,omitempty" protobuf:"bytes,4,opt,name=description"`
58
59 // PreemptionPolicy is the Policy for preempting pods with lower priority.
60 // One of Never, PreemptLowerPriority.
61 // Defaults to PreemptLowerPriority if unset.
62 // This field is beta-level, gated by the NonPreemptingPriority feature-gate.
63 // +optional
64 PreemptionPolicy *apiv1.PreemptionPolicy `json:"preemptionPolicy,omitempty" protobuf:"bytes,5,opt,name=preemptionPolicy"`
65}
66
67// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
68// +k8s:prerelease-lifecycle-gen:introduced=1.11
69// +k8s:prerelease-lifecycle-gen:deprecated=1.14
70// +k8s:prerelease-lifecycle-gen:removed=1.22
71// +k8s:prerelease-lifecycle-gen:replacement=scheduling.k8s.io,v1,PriorityClassList
72
73// PriorityClassList is a collection of priority classes.
74type PriorityClassList struct {
75 metav1.TypeMeta `json:",inline"`
76 // Standard list metadata
77 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
78 // +optional
79 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
80
81 // items is the list of PriorityClasses
82 Items []PriorityClass `json:"items" protobuf:"bytes,2,rep,name=items"`
83}