# Lease

LeaseLease defines a lease concept.apiVersion: coordination.k8s.io/v1import "k8s.io/api/coordination/v1"LeaseLease defines a lease concept.apiVersion: coordination.k8s.io/v1kind: Leasemetadata (ObjectMeta)More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (LeaseSpec)spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-statusLeaseSpecLeaseSpec is a specification of a Lease.acquireTime (MicroTime)acquireTime is a time when the current lease was acquired.MicroTime is version of Time with microsecond level precision.holderIdentity (string)holderIdentity contains the identity of the holder of a current lease. If Coordinated Leader Election is used, the holder identity must be equal to the elected LeaseCandidate.metadata.name field.leaseDurationSeconds (int32)leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measured against the time of last observed renewTime.leaseTransitions (int32)leaseTransitions is the number of transitions of a lease between holders.preferredHolder (string)PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up. This field can only be set if Strategy is also set.renewTime (MicroTime)renewTime is a time when the current holder of a lease has last updated the lease.MicroTime is version of Time with microsecond level precision.strategy (string)Strategy indicates the strategy for picking the leader for coordinated leader election. If the field is not specified, there is no active coordination for this lease. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.LeaseListLeaseList is a list of Lease objects.apiVersion: coordination.k8s.io/v1kind: LeaseListmetadata (ListMeta)Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataitems ([]Lease), requireditems is a list of schema objects.Operationsget read the specified LeaseHTTP RequestGET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}Parametersname (in path): string, requiredname of the Leasenamespace (in path): string, requirednamespacepretty (in query): stringprettyResponse200 (Lease): OK401: Unauthorizedlist list or watch objects of kind LeaseHTTP RequestGET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leasesParametersnamespace (in path): string, requirednamespaceallowWatchBookmarks (in query): booleanallowWatchBookmarkscontinue (in query): stringcontinuefieldSelector (in query): stringfieldSelectorlabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondswatch (in query): booleanwatchResponse200 (LeaseList): OK401: Unauthorizedlist list or watch objects of kind LeaseHTTP RequestGET /apis/coordination.k8s.io/v1/leasesParametersallowWatchBookmarks (in query): booleanallowWatchBookmarkscontinue (in query): stringcontinuefieldSelector (in query): stringfieldSelectorlabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondswatch (in query): booleanwatchResponse200 (LeaseList): OK401: Unauthorizedcreate create a LeaseHTTP RequestPOST /apis/coordination.k8s.io/v1/namespaces/{namespace}/leasesParametersnamespace (in path): string, requirednamespacebody: Lease, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (Lease): OK201 (Lease): Created202 (Lease): Accepted401: Unauthorizedupdate replace the specified LeaseHTTP RequestPUT /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}Parametersname (in path): string, requiredname of the Leasenamespace (in path): string, requirednamespacebody: Lease, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (Lease): OK201 (Lease): Created401: Unauthorizedpatch partially update the specified LeaseHTTP RequestPATCH /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}Parametersname (in path): string, requiredname of the Leasenamespace (in path): string, requirednamespacebody: Patch, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationforce (in query): booleanforcepretty (in query): stringprettyResponse200 (Lease): OK201 (Lease): Created401: Unauthorizeddelete delete a LeaseHTTP RequestDELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}Parametersname (in path): string, requiredname of the Leasenamespace (in path): string, requirednamespacebody: DeleteOptionsdryRun (in query): stringdryRungracePeriodSeconds (in query): integergracePeriodSecondsignoreStoreReadErrorWithClusterBreakingPotential (in query): booleanignoreStoreReadErrorWithClusterBreakingPotentialpretty (in query): stringprettypropagationPolicy (in query): stringpropagationPolicyResponse200 (Status): OK202 (Status): Accepted401: Unauthorizeddeletecollection delete collection of LeaseHTTP RequestDELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leasesParametersnamespace (in path): string, requirednamespacebody: DeleteOptionscontinue (in query): stringcontinuedryRun (in query): stringdryRunfieldSelector (in query): stringfieldSelectorgracePeriodSeconds (in query): integergracePeriodSecondsignoreStoreReadErrorWithClusterBreakingPotential (in query): booleanignoreStoreReadErrorWithClusterBreakingPotentiallabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettypropagationPolicy (in query): stringpropagationPolicyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondsResponse200 (Status): OK401: UnauthorizedThis page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.