generated.proto 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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.policy.v1beta1;
  16. import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
  17. import "k8s.io/apimachinery/pkg/runtime/generated.proto";
  18. import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
  19. import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
  20. // Package-wide variables from generator "generated".
  21. option go_package = "k8s.io/api/policy/v1beta1";
  22. // Eviction evicts a pod from its node subject to certain policies and safety constraints.
  23. // This is a subresource of Pod. A request to cause such an eviction is
  24. // created by POSTing to .../pods/<pod name>/evictions.
  25. message Eviction {
  26. // ObjectMeta describes the pod that is being evicted.
  27. // +optional
  28. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  29. // DeleteOptions may be provided
  30. // +optional
  31. optional .k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2;
  32. }
  33. // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
  34. message PodDisruptionBudget {
  35. // Standard object's metadata.
  36. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  37. // +optional
  38. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  39. // Specification of the desired behavior of the PodDisruptionBudget.
  40. // +optional
  41. optional PodDisruptionBudgetSpec spec = 2;
  42. // Most recently observed status of the PodDisruptionBudget.
  43. // +optional
  44. optional PodDisruptionBudgetStatus status = 3;
  45. }
  46. // PodDisruptionBudgetList is a collection of PodDisruptionBudgets.
  47. message PodDisruptionBudgetList {
  48. // Standard object's metadata.
  49. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  50. // +optional
  51. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  52. // items list individual PodDisruptionBudget objects
  53. repeated PodDisruptionBudget items = 2;
  54. }
  55. // PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.
  56. message PodDisruptionBudgetSpec {
  57. // An eviction is allowed if at least "minAvailable" pods selected by
  58. // "selector" will still be available after the eviction, i.e. even in the
  59. // absence of the evicted pod. So for example you can prevent all voluntary
  60. // evictions by specifying "100%".
  61. // +optional
  62. optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString minAvailable = 1;
  63. // Label query over pods whose evictions are managed by the disruption
  64. // budget.
  65. // A null selector selects no pods.
  66. // An empty selector ({}) also selects no pods, which differs from standard behavior of selecting all pods.
  67. // In policy/v1, an empty selector will select all pods in the namespace.
  68. // +optional
  69. optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
  70. // An eviction is allowed if at most "maxUnavailable" pods selected by
  71. // "selector" are unavailable after the eviction, i.e. even in absence of
  72. // the evicted pod. For example, one can prevent all voluntary evictions
  73. // by specifying 0. This is a mutually exclusive setting with "minAvailable".
  74. // +optional
  75. optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 3;
  76. // UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods
  77. // should be considered for eviction. Current implementation considers healthy pods,
  78. // as pods that have status.conditions item with type="Ready",status="True".
  79. //
  80. // Valid policies are IfHealthyBudget and AlwaysAllow.
  81. // If no policy is specified, the default behavior will be used,
  82. // which corresponds to the IfHealthyBudget policy.
  83. //
  84. // IfHealthyBudget policy means that running pods (status.phase="Running"),
  85. // but not yet healthy can be evicted only if the guarded application is not
  86. // disrupted (status.currentHealthy is at least equal to status.desiredHealthy).
  87. // Healthy pods will be subject to the PDB for eviction.
  88. //
  89. // AlwaysAllow policy means that all running pods (status.phase="Running"),
  90. // but not yet healthy are considered disrupted and can be evicted regardless
  91. // of whether the criteria in a PDB is met. This means perspective running
  92. // pods of a disrupted application might not get a chance to become healthy.
  93. // Healthy pods will be subject to the PDB for eviction.
  94. //
  95. // Additional policies may be added in the future.
  96. // Clients making eviction decisions should disallow eviction of unhealthy pods
  97. // if they encounter an unrecognized policy in this field.
  98. // +optional
  99. optional string unhealthyPodEvictionPolicy = 4;
  100. }
  101. // PodDisruptionBudgetStatus represents information about the status of a
  102. // PodDisruptionBudget. Status may trail the actual state of a system.
  103. message PodDisruptionBudgetStatus {
  104. // Most recent generation observed when updating this PDB status. DisruptionsAllowed and other
  105. // status information is valid only if observedGeneration equals to PDB's object generation.
  106. // +optional
  107. optional int64 observedGeneration = 1;
  108. // DisruptedPods contains information about pods whose eviction was
  109. // processed by the API server eviction subresource handler but has not
  110. // yet been observed by the PodDisruptionBudget controller.
  111. // A pod will be in this map from the time when the API server processed the
  112. // eviction request to the time when the pod is seen by PDB controller
  113. // as having been marked for deletion (or after a timeout). The key in the map is the name of the pod
  114. // and the value is the time when the API server processed the eviction request. If
  115. // the deletion didn't occur and a pod is still there it will be removed from
  116. // the list automatically by PodDisruptionBudget controller after some time.
  117. // If everything goes smooth this map should be empty for the most of the time.
  118. // Large number of entries in the map may indicate problems with pod deletions.
  119. // +optional
  120. map<string, .k8s.io.apimachinery.pkg.apis.meta.v1.Time> disruptedPods = 2;
  121. // Number of pod disruptions that are currently allowed.
  122. optional int32 disruptionsAllowed = 3;
  123. // current number of healthy pods
  124. optional int32 currentHealthy = 4;
  125. // minimum desired number of healthy pods
  126. optional int32 desiredHealthy = 5;
  127. // total number of pods counted by this disruption budget
  128. optional int32 expectedPods = 6;
  129. // Conditions contain conditions for PDB. The disruption controller sets the
  130. // DisruptionAllowed condition. The following are known values for the reason field
  131. // (additional reasons could be added in the future):
  132. // - SyncFailed: The controller encountered an error and wasn't able to compute
  133. // the number of allowed disruptions. Therefore no disruptions are
  134. // allowed and the status of the condition will be False.
  135. // - InsufficientPods: The number of pods are either at or below the number
  136. // required by the PodDisruptionBudget. No disruptions are
  137. // allowed and the status of the condition will be False.
  138. // - SufficientPods: There are more pods than required by the PodDisruptionBudget.
  139. // The condition will be True, and the number of allowed
  140. // disruptions are provided by the disruptionsAllowed property.
  141. //
  142. // +optional
  143. // +patchMergeKey=type
  144. // +patchStrategy=merge
  145. // +listType=map
  146. // +listMapKey=type
  147. repeated .k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 7;
  148. }