cue.dev/x/k8s.io@v0.12.0

api/coordination/v1alpha2/schema.cue raw

 1package v1alpha2
 2
 3import "cue.dev/x/k8s.io/apimachinery/pkg/apis/meta/v1"
 4
 5// LeaseCandidate defines a candidate for a Lease object. Candidates are created
 6// such that coordinated leader election will pick the best leader from the
 7// list of candidates.
 8#LeaseCandidate: {
 9	// APIVersion defines the versioned schema of this representation of an object.
10	// Servers should convert recognized schemas to the latest internal value, and
11	// may reject unrecognized values. More info:
12	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
13	"apiVersion": "coordination.k8s.io/v1alpha2"
14
15	// Kind is a string value representing the REST resource this object represents.
16	// Servers may infer this from the endpoint the client submits requests to.
17	// Cannot be updated. In CamelCase. More info:
18	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
19	"kind": "LeaseCandidate"
20
21	// More info:
22	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
23	"metadata"?: v1.#ObjectMeta
24
25	// spec contains the specification of the Lease. More info:
26	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
27	"spec"!: #LeaseCandidateSpec
28}
29
30// LeaseCandidateList is a list of Lease objects.
31#LeaseCandidateList: {
32	// APIVersion defines the versioned schema of this representation of an object.
33	// Servers should convert recognized schemas to the latest internal value, and
34	// may reject unrecognized values. More info:
35	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
36	"apiVersion": "coordination.k8s.io/v1alpha2"
37
38	// items is a list of schema objects.
39	"items"!: [...#LeaseCandidate]
40
41	// Kind is a string value representing the REST resource this object represents.
42	// Servers may infer this from the endpoint the client submits requests to.
43	// Cannot be updated. In CamelCase. More info:
44	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
45	"kind": "LeaseCandidateList"
46
47	// Standard list metadata. More info:
48	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
49	"metadata"?: v1.#ListMeta
50}
51
52// LeaseCandidateSpec is a specification of a Lease.
53#LeaseCandidateSpec: {
54	// BinaryVersion is the binary version. It must be in a semver format without
55	// leading `v`. This field is required.
56	"binaryVersion"!: string
57
58	// EmulationVersion is the emulation version. It must be in a semver format
59	// without leading `v`. EmulationVersion must be less than or equal to
60	// BinaryVersion. This field is required when strategy is
61	// "OldestEmulationVersion"
62	"emulationVersion"?: string
63
64	// LeaseName is the name of the lease for which this candidate is contending.
65	// This field is immutable.
66	"leaseName"!: string
67
68	// PingTime is the last time that the server has requested the LeaseCandidate to
69	// renew. It is only done during leader election to check if any
70	// LeaseCandidates have become ineligible. When PingTime is updated, the
71	// LeaseCandidate will respond by updating RenewTime.
72	"pingTime"?: v1.#MicroTime
73
74	// RenewTime is the time that the LeaseCandidate was last updated. Any time a
75	// Lease needs to do leader election, the PingTime field is updated to signal
76	// to the LeaseCandidate that they should update the RenewTime. Old
77	// LeaseCandidate objects are also garbage collected if it has been hours since
78	// the last renew. The PingTime field is updated regularly to prevent garbage
79	// collection for still active LeaseCandidates.
80	"renewTime"?: v1.#MicroTime
81
82	// Strategy is the strategy that coordinated leader election will use for
83	// picking the leader. If multiple candidates for the same Lease return
84	// different strategies, the strategy provided by the candidate with the latest
85	// BinaryVersion will be used. If there is still conflict, this is a user error
86	// and coordinated leader election will not operate the Lease until resolved.
87	"strategy"!: string
88}