generated.proto 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // This file was autogenerated by go-to-protobuf. Do not edit it manually!
  14. syntax = "proto2";
  15. package k8s.io.api.coordination.v1beta1;
  16. import "k8s.io/api/coordination/v1/generated.proto";
  17. import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
  18. import "k8s.io/apimachinery/pkg/runtime/generated.proto";
  19. import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
  20. // Package-wide variables from generator "generated".
  21. option go_package = "k8s.io/api/coordination/v1beta1";
  22. // Lease defines a lease concept.
  23. message Lease {
  24. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  25. // +optional
  26. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  27. // spec contains the specification of the Lease.
  28. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  29. // +optional
  30. optional LeaseSpec spec = 2;
  31. }
  32. // LeaseCandidate defines a candidate for a Lease object.
  33. // Candidates are created such that coordinated leader election will pick the best leader from the list of candidates.
  34. message LeaseCandidate {
  35. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  36. // +optional
  37. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  38. // spec contains the specification of the Lease.
  39. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  40. // +optional
  41. optional LeaseCandidateSpec spec = 2;
  42. }
  43. // LeaseCandidateList is a list of Lease objects.
  44. message LeaseCandidateList {
  45. // Standard list metadata.
  46. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  47. // +optional
  48. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  49. // items is a list of schema objects.
  50. repeated LeaseCandidate items = 2;
  51. }
  52. // LeaseCandidateSpec is a specification of a Lease.
  53. message LeaseCandidateSpec {
  54. // LeaseName is the name of the lease for which this candidate is contending.
  55. // The limits on this field are the same as on Lease.name. Multiple lease candidates
  56. // may reference the same Lease.name.
  57. // This field is immutable.
  58. // +required
  59. optional string leaseName = 1;
  60. // PingTime is the last time that the server has requested the LeaseCandidate
  61. // to renew. It is only done during leader election to check if any
  62. // LeaseCandidates have become ineligible. When PingTime is updated, the
  63. // LeaseCandidate will respond by updating RenewTime.
  64. // +optional
  65. optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime pingTime = 2;
  66. // RenewTime is the time that the LeaseCandidate was last updated.
  67. // Any time a Lease needs to do leader election, the PingTime field
  68. // is updated to signal to the LeaseCandidate that they should update
  69. // the RenewTime.
  70. // Old LeaseCandidate objects are also garbage collected if it has been hours
  71. // since the last renew. The PingTime field is updated regularly to prevent
  72. // garbage collection for still active LeaseCandidates.
  73. // +optional
  74. optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 3;
  75. // BinaryVersion is the binary version. It must be in a semver format without leading `v`.
  76. // This field is required.
  77. // +required
  78. optional string binaryVersion = 4;
  79. // EmulationVersion is the emulation version. It must be in a semver format without leading `v`.
  80. // EmulationVersion must be less than or equal to BinaryVersion.
  81. // This field is required when strategy is "OldestEmulationVersion"
  82. // +optional
  83. optional string emulationVersion = 5;
  84. // Strategy is the strategy that coordinated leader election will use for picking the leader.
  85. // If multiple candidates for the same Lease return different strategies, the strategy provided
  86. // by the candidate with the latest BinaryVersion will be used. If there is still conflict,
  87. // this is a user error and coordinated leader election will not operate the Lease until resolved.
  88. // +required
  89. optional string strategy = 6;
  90. }
  91. // LeaseList is a list of Lease objects.
  92. message LeaseList {
  93. // Standard list metadata.
  94. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  95. // +optional
  96. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  97. // items is a list of schema objects.
  98. repeated Lease items = 2;
  99. }
  100. // LeaseSpec is a specification of a Lease.
  101. message LeaseSpec {
  102. // holderIdentity contains the identity of the holder of a current lease.
  103. // If Coordinated Leader Election is used, the holder identity must be
  104. // equal to the elected LeaseCandidate.metadata.name field.
  105. // +optional
  106. optional string holderIdentity = 1;
  107. // leaseDurationSeconds is a duration that candidates for a lease need
  108. // to wait to force acquire it. This is measure against time of last
  109. // observed renewTime.
  110. // +optional
  111. optional int32 leaseDurationSeconds = 2;
  112. // acquireTime is a time when the current lease was acquired.
  113. // +optional
  114. optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime acquireTime = 3;
  115. // renewTime is a time when the current holder of a lease has last
  116. // updated the lease.
  117. // +optional
  118. optional .k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 4;
  119. // leaseTransitions is the number of transitions of a lease between
  120. // holders.
  121. // +optional
  122. optional int32 leaseTransitions = 5;
  123. // Strategy indicates the strategy for picking the leader for coordinated leader election
  124. // (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
  125. // +featureGate=CoordinatedLeaderElection
  126. // +optional
  127. optional string strategy = 6;
  128. // PreferredHolder signals to a lease holder that the lease has a
  129. // more optimal holder and should be given up.
  130. // +featureGate=CoordinatedLeaderElection
  131. // +optional
  132. optional string preferredHolder = 7;
  133. }