1package v1
2
3import "cue.dev/x/k8s.io/apimachinery/pkg/apis/meta/v1"
4
5// Lease defines a lease concept.
6#Lease: {
7 // APIVersion defines the versioned schema of this representation of an object.
8 // Servers should convert recognized schemas to the latest internal value, and
9 // may reject unrecognized values. More info:
10 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
11 "apiVersion": "coordination.k8s.io/v1"
12
13 // Kind is a string value representing the REST resource this object represents.
14 // Servers may infer this from the endpoint the client submits requests to.
15 // Cannot be updated. In CamelCase. More info:
16 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
17 "kind": "Lease"
18
19 // More info:
20 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
21 "metadata"?: v1.#ObjectMeta
22
23 // spec contains the specification of the Lease. More info:
24 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
25 "spec"?: #LeaseSpec
26}
27
28// LeaseList is a list of Lease objects.
29#LeaseList: {
30 // APIVersion defines the versioned schema of this representation of an object.
31 // Servers should convert recognized schemas to the latest internal value, and
32 // may reject unrecognized values. More info:
33 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
34 "apiVersion": "coordination.k8s.io/v1"
35
36 // items is a list of schema objects.
37 "items"!: [...#Lease]
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": "LeaseList"
44
45 // Standard list metadata. More info:
46 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
47 "metadata"?: v1.#ListMeta
48}
49
50// LeaseSpec is a specification of a Lease.
51#LeaseSpec: {
52 // acquireTime is a time when the current lease was acquired.
53 "acquireTime"?: v1.#MicroTime
54
55 // holderIdentity contains the identity of the holder of a current lease. If
56 // Coordinated Leader Election is used, the holder identity must be equal to
57 // the elected LeaseCandidate.metadata.name field.
58 "holderIdentity"?: string
59
60 // leaseDurationSeconds is a duration that candidates for a lease need to wait
61 // to force acquire it. This is measured against the time of last observed
62 // renewTime.
63 "leaseDurationSeconds"?: int32 & int
64
65 // leaseTransitions is the number of transitions of a lease between holders.
66 "leaseTransitions"?: int32 & int
67
68 // PreferredHolder signals to a lease holder that the lease has a more optimal
69 // holder and should be given up. This field can only be set if Strategy is
70 // also set.
71 "preferredHolder"?: string
72
73 // renewTime is a time when the current holder of a lease has last updated the lease.
74 "renewTime"?: v1.#MicroTime
75
76 // Strategy indicates the strategy for picking the leader for coordinated leader
77 // election. If the field is not specified, there is no active coordination for
78 // this lease. (Alpha) Using this field requires the CoordinatedLeaderElection
79 // feature gate to be enabled.
80 "strategy"?: string
81}