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

api/coordination/v1/schema.cue raw

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