generated.proto 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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 = "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. }
  77. // PodDisruptionBudgetStatus represents information about the status of a
  78. // PodDisruptionBudget. Status may trail the actual state of a system.
  79. message PodDisruptionBudgetStatus {
  80. // Most recent generation observed when updating this PDB status. DisruptionsAllowed and other
  81. // status information is valid only if observedGeneration equals to PDB's object generation.
  82. // +optional
  83. optional int64 observedGeneration = 1;
  84. // DisruptedPods contains information about pods whose eviction was
  85. // processed by the API server eviction subresource handler but has not
  86. // yet been observed by the PodDisruptionBudget controller.
  87. // A pod will be in this map from the time when the API server processed the
  88. // eviction request to the time when the pod is seen by PDB controller
  89. // as having been marked for deletion (or after a timeout). The key in the map is the name of the pod
  90. // and the value is the time when the API server processed the eviction request. If
  91. // the deletion didn't occur and a pod is still there it will be removed from
  92. // the list automatically by PodDisruptionBudget controller after some time.
  93. // If everything goes smooth this map should be empty for the most of the time.
  94. // Large number of entries in the map may indicate problems with pod deletions.
  95. // +optional
  96. map<string, k8s.io.apimachinery.pkg.apis.meta.v1.Time> disruptedPods = 2;
  97. // Number of pod disruptions that are currently allowed.
  98. optional int32 disruptionsAllowed = 3;
  99. // current number of healthy pods
  100. optional int32 currentHealthy = 4;
  101. // minimum desired number of healthy pods
  102. optional int32 desiredHealthy = 5;
  103. // total number of pods counted by this disruption budget
  104. optional int32 expectedPods = 6;
  105. // Conditions contain conditions for PDB. The disruption controller sets the
  106. // DisruptionAllowed condition. The following are known values for the reason field
  107. // (additional reasons could be added in the future):
  108. // - SyncFailed: The controller encountered an error and wasn't able to compute
  109. // the number of allowed disruptions. Therefore no disruptions are
  110. // allowed and the status of the condition will be False.
  111. // - InsufficientPods: The number of pods are either at or below the number
  112. // required by the PodDisruptionBudget. No disruptions are
  113. // allowed and the status of the condition will be False.
  114. // - SufficientPods: There are more pods than required by the PodDisruptionBudget.
  115. // The condition will be True, and the number of allowed
  116. // disruptions are provided by the disruptionsAllowed property.
  117. //
  118. // +optional
  119. // +patchMergeKey=type
  120. // +patchStrategy=merge
  121. // +listType=map
  122. // +listMapKey=type
  123. repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 7;
  124. }