1package v1
2
3import (
4 "cue.dev/x/k8s.io/apimachinery/pkg/api/resource"
5 "cue.dev/x/k8s.io/apimachinery/pkg/apis/meta/v1"
6 v1_9 "cue.dev/x/k8s.io/api/core/v1"
7)
8
9// Overhead structure represents the resource overhead associated with running a pod.
10#Overhead: {
11 // podFixed represents the fixed resource overhead associated with running a pod.
12 "podFixed"?: [string]: resource.#Quantity
13}
14
15// RuntimeClass defines a class of container runtime supported in the cluster.
16// The RuntimeClass is used to determine which container runtime is used to run
17// all containers in a pod. RuntimeClasses are manually defined by a user or
18// cluster provisioner, and referenced in the PodSpec. The Kubelet is
19// responsible for resolving the RuntimeClassName reference before running the
20// pod. For more details, see
21// https://kubernetes.io/docs/concepts/containers/runtime-class/
22#RuntimeClass: {
23 // APIVersion defines the versioned schema of this representation of an object.
24 // Servers should convert recognized schemas to the latest internal value, and
25 // may reject unrecognized values. More info:
26 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
27 "apiVersion": "node.k8s.io/v1"
28
29 // handler specifies the underlying runtime and configuration that the CRI
30 // implementation will use to handle pods of this class. The possible values
31 // are specific to the node & CRI configuration. It is assumed that all
32 // handlers are available on every node, and handlers of the same name are
33 // equivalent on every node. For example, a handler called "runc" might specify
34 // that the runc OCI runtime (using native Linux containers) will be used to
35 // run the containers in a pod. The Handler must be lowercase, conform to the
36 // DNS Label (RFC 1123) requirements, and is immutable.
37 "handler"!: string
38
39 // Kind is a string value representing the REST resource this object represents.
40 // Servers may infer this from the endpoint the client submits requests to.
41 // Cannot be updated. In CamelCase. More info:
42 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
43 "kind": "RuntimeClass"
44
45 // More info:
46 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
47 "metadata"?: v1.#ObjectMeta
48
49 // overhead represents the resource overhead associated with running a pod for a
50 // given RuntimeClass. For more details, see
51 // https://kubernetes.io/docs/concepts/scheduling-eviction/pod-overhead/
52 "overhead"?: #Overhead
53
54 // scheduling holds the scheduling constraints to ensure that pods running with
55 // this RuntimeClass are scheduled to nodes that support it. If scheduling is
56 // nil, this RuntimeClass is assumed to be supported by all nodes.
57 "scheduling"?: #Scheduling
58}
59
60// RuntimeClassList is a list of RuntimeClass objects.
61#RuntimeClassList: {
62 // APIVersion defines the versioned schema of this representation of an object.
63 // Servers should convert recognized schemas to the latest internal value, and
64 // may reject unrecognized values. More info:
65 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
66 "apiVersion": "node.k8s.io/v1"
67
68 // items is a list of schema objects.
69 "items"!: [...#RuntimeClass]
70
71 // Kind is a string value representing the REST resource this object represents.
72 // Servers may infer this from the endpoint the client submits requests to.
73 // Cannot be updated. In CamelCase. More info:
74 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
75 "kind": "RuntimeClassList"
76
77 // Standard list metadata. More info:
78 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
79 "metadata"?: v1.#ListMeta
80}
81
82// Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass.
83#Scheduling: {
84 // nodeSelector lists labels that must be present on nodes that support this
85 // RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node
86 // matched by this selector. The RuntimeClass nodeSelector is merged with a
87 // pod's existing nodeSelector. Any conflicts will cause the pod to be rejected
88 // in admission.
89 "nodeSelector"?: [string]: string
90
91 // tolerations are appended (excluding duplicates) to pods running with this
92 // RuntimeClass during admission, effectively unioning the set of nodes
93 // tolerated by the pod and the RuntimeClass.
94 "tolerations"?: [...v1_9.#Toleration]
95}