1package v1beta1
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/v1beta1"
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/v1beta1"
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 // The limits on this field are the same as on Lease.name. Multiple lease
66 // candidates may reference the same Lease.name. This field is immutable.
67 "leaseName"!: string
68
69 // PingTime is the last time that the server has requested the LeaseCandidate to
70 // renew. It is only done during leader election to check if any
71 // LeaseCandidates have become ineligible. When PingTime is updated, the
72 // LeaseCandidate will respond by updating RenewTime.
73 "pingTime"?: v1.#MicroTime
74
75 // RenewTime is the time that the LeaseCandidate was last updated. Any time a
76 // Lease needs to do leader election, the PingTime field is updated to signal
77 // to the LeaseCandidate that they should update the RenewTime. Old
78 // LeaseCandidate objects are also garbage collected if it has been hours since
79 // the last renew. The PingTime field is updated regularly to prevent garbage
80 // collection for still active LeaseCandidates.
81 "renewTime"?: v1.#MicroTime
82
83 // Strategy is the strategy that coordinated leader election will use for
84 // picking the leader. If multiple candidates for the same Lease return
85 // different strategies, the strategy provided by the candidate with the latest
86 // BinaryVersion will be used. If there is still conflict, this is a user error
87 // and coordinated leader election will not operate the Lease until resolved.
88 "strategy"!: string
89}