generated.proto 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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.v1;
  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/v1";
  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 is a list of PodDisruptionBudgets
  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 will match no pods, while an empty ({}) selector will select
  66. // all pods within the namespace.
  67. // +patchStrategy=replace
  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. //
  99. // This field is beta-level. The eviction API uses this field when
  100. // the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default).
  101. // +optional
  102. optional string unhealthyPodEvictionPolicy = 4;
  103. }
  104. // PodDisruptionBudgetStatus represents information about the status of a
  105. // PodDisruptionBudget. Status may trail the actual state of a system.
  106. message PodDisruptionBudgetStatus {
  107. // Most recent generation observed when updating this PDB status. DisruptionsAllowed and other
  108. // status information is valid only if observedGeneration equals to PDB's object generation.
  109. // +optional
  110. optional int64 observedGeneration = 1;
  111. // DisruptedPods contains information about pods whose eviction was
  112. // processed by the API server eviction subresource handler but has not
  113. // yet been observed by the PodDisruptionBudget controller.
  114. // A pod will be in this map from the time when the API server processed the
  115. // eviction request to the time when the pod is seen by PDB controller
  116. // as having been marked for deletion (or after a timeout). The key in the map is the name of the pod
  117. // and the value is the time when the API server processed the eviction request. If
  118. // the deletion didn't occur and a pod is still there it will be removed from
  119. // the list automatically by PodDisruptionBudget controller after some time.
  120. // If everything goes smooth this map should be empty for the most of the time.
  121. // Large number of entries in the map may indicate problems with pod deletions.
  122. // +optional
  123. map<string, k8s.io.apimachinery.pkg.apis.meta.v1.Time> disruptedPods = 2;
  124. // Number of pod disruptions that are currently allowed.
  125. optional int32 disruptionsAllowed = 3;
  126. // current number of healthy pods
  127. optional int32 currentHealthy = 4;
  128. // minimum desired number of healthy pods
  129. optional int32 desiredHealthy = 5;
  130. // total number of pods counted by this disruption budget
  131. optional int32 expectedPods = 6;
  132. // Conditions contain conditions for PDB. The disruption controller sets the
  133. // DisruptionAllowed condition. The following are known values for the reason field
  134. // (additional reasons could be added in the future):
  135. // - SyncFailed: The controller encountered an error and wasn't able to compute
  136. // the number of allowed disruptions. Therefore no disruptions are
  137. // allowed and the status of the condition will be False.
  138. // - InsufficientPods: The number of pods are either at or below the number
  139. // required by the PodDisruptionBudget. No disruptions are
  140. // allowed and the status of the condition will be False.
  141. // - SufficientPods: There are more pods than required by the PodDisruptionBudget.
  142. // The condition will be True, and the number of allowed
  143. // disruptions are provided by the disruptionsAllowed property.
  144. //
  145. // +optional
  146. // +patchMergeKey=type
  147. // +patchStrategy=merge
  148. // +listType=map
  149. // +listMapKey=type
  150. repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 7;
  151. }