...

Text file src/k8s.io/api/policy/v1/generated.proto

Documentation: k8s.io/api/policy/v1

     1/*
     2Copyright The Kubernetes Authors.
     3
     4Licensed under the Apache License, Version 2.0 (the "License");
     5you may not use this file except in compliance with the License.
     6You may obtain a copy of the License at
     7
     8    http://www.apache.org/licenses/LICENSE-2.0
     9
    10Unless required by applicable law or agreed to in writing, software
    11distributed under the License is distributed on an "AS IS" BASIS,
    12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13See the License for the specific language governing permissions and
    14limitations under the License.
    15*/
    16
    17
    18// This file was autogenerated by go-to-protobuf. Do not edit it manually!
    19
    20syntax = "proto2";
    21
    22package k8s.io.api.policy.v1;
    23
    24import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
    25import "k8s.io/apimachinery/pkg/runtime/generated.proto";
    26import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
    27import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
    28
    29// Package-wide variables from generator "generated".
    30option go_package = "k8s.io/api/policy/v1";
    31
    32// Eviction evicts a pod from its node subject to certain policies and safety constraints.
    33// This is a subresource of Pod.  A request to cause such an eviction is
    34// created by POSTing to .../pods/<pod name>/evictions.
    35message Eviction {
    36  // ObjectMeta describes the pod that is being evicted.
    37  // +optional
    38  optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
    39
    40  // DeleteOptions may be provided
    41  // +optional
    42  optional k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2;
    43}
    44
    45// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
    46message PodDisruptionBudget {
    47  // Standard object's metadata.
    48  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    49  // +optional
    50  optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
    51
    52  // Specification of the desired behavior of the PodDisruptionBudget.
    53  // +optional
    54  optional PodDisruptionBudgetSpec spec = 2;
    55
    56  // Most recently observed status of the PodDisruptionBudget.
    57  // +optional
    58  optional PodDisruptionBudgetStatus status = 3;
    59}
    60
    61// PodDisruptionBudgetList is a collection of PodDisruptionBudgets.
    62message PodDisruptionBudgetList {
    63  // Standard object's metadata.
    64  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    65  // +optional
    66  optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
    67
    68  // Items is a list of PodDisruptionBudgets
    69  repeated PodDisruptionBudget items = 2;
    70}
    71
    72// PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.
    73message PodDisruptionBudgetSpec {
    74  // An eviction is allowed if at least "minAvailable" pods selected by
    75  // "selector" will still be available after the eviction, i.e. even in the
    76  // absence of the evicted pod.  So for example you can prevent all voluntary
    77  // evictions by specifying "100%".
    78  // +optional
    79  optional k8s.io.apimachinery.pkg.util.intstr.IntOrString minAvailable = 1;
    80
    81  // Label query over pods whose evictions are managed by the disruption
    82  // budget.
    83  // A null selector will match no pods, while an empty ({}) selector will select
    84  // all pods within the namespace.
    85  // +patchStrategy=replace
    86  // +optional
    87  optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
    88
    89  // An eviction is allowed if at most "maxUnavailable" pods selected by
    90  // "selector" are unavailable after the eviction, i.e. even in absence of
    91  // the evicted pod. For example, one can prevent all voluntary evictions
    92  // by specifying 0. This is a mutually exclusive setting with "minAvailable".
    93  // +optional
    94  optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 3;
    95
    96  // UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods
    97  // should be considered for eviction. Current implementation considers healthy pods,
    98  // as pods that have status.conditions item with type="Ready",status="True".
    99  //
   100  // Valid policies are IfHealthyBudget and AlwaysAllow.
   101  // If no policy is specified, the default behavior will be used,
   102  // which corresponds to the IfHealthyBudget policy.
   103  //
   104  // IfHealthyBudget policy means that running pods (status.phase="Running"),
   105  // but not yet healthy can be evicted only if the guarded application is not
   106  // disrupted (status.currentHealthy is at least equal to status.desiredHealthy).
   107  // Healthy pods will be subject to the PDB for eviction.
   108  //
   109  // AlwaysAllow policy means that all running pods (status.phase="Running"),
   110  // but not yet healthy are considered disrupted and can be evicted regardless
   111  // of whether the criteria in a PDB is met. This means perspective running
   112  // pods of a disrupted application might not get a chance to become healthy.
   113  // Healthy pods will be subject to the PDB for eviction.
   114  //
   115  // Additional policies may be added in the future.
   116  // Clients making eviction decisions should disallow eviction of unhealthy pods
   117  // if they encounter an unrecognized policy in this field.
   118  //
   119  // This field is beta-level. The eviction API uses this field when
   120  // the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default).
   121  // +optional
   122  optional string unhealthyPodEvictionPolicy = 4;
   123}
   124
   125// PodDisruptionBudgetStatus represents information about the status of a
   126// PodDisruptionBudget. Status may trail the actual state of a system.
   127message PodDisruptionBudgetStatus {
   128  // Most recent generation observed when updating this PDB status. DisruptionsAllowed and other
   129  // status information is valid only if observedGeneration equals to PDB's object generation.
   130  // +optional
   131  optional int64 observedGeneration = 1;
   132
   133  // DisruptedPods contains information about pods whose eviction was
   134  // processed by the API server eviction subresource handler but has not
   135  // yet been observed by the PodDisruptionBudget controller.
   136  // A pod will be in this map from the time when the API server processed the
   137  // eviction request to the time when the pod is seen by PDB controller
   138  // as having been marked for deletion (or after a timeout). The key in the map is the name of the pod
   139  // and the value is the time when the API server processed the eviction request. If
   140  // the deletion didn't occur and a pod is still there it will be removed from
   141  // the list automatically by PodDisruptionBudget controller after some time.
   142  // If everything goes smooth this map should be empty for the most of the time.
   143  // Large number of entries in the map may indicate problems with pod deletions.
   144  // +optional
   145  map<string, k8s.io.apimachinery.pkg.apis.meta.v1.Time> disruptedPods = 2;
   146
   147  // Number of pod disruptions that are currently allowed.
   148  optional int32 disruptionsAllowed = 3;
   149
   150  // current number of healthy pods
   151  optional int32 currentHealthy = 4;
   152
   153  // minimum desired number of healthy pods
   154  optional int32 desiredHealthy = 5;
   155
   156  // total number of pods counted by this disruption budget
   157  optional int32 expectedPods = 6;
   158
   159  // Conditions contain conditions for PDB. The disruption controller sets the
   160  // DisruptionAllowed condition. The following are known values for the reason field
   161  // (additional reasons could be added in the future):
   162  // - SyncFailed: The controller encountered an error and wasn't able to compute
   163  //               the number of allowed disruptions. Therefore no disruptions are
   164  //               allowed and the status of the condition will be False.
   165  // - InsufficientPods: The number of pods are either at or below the number
   166  //                     required by the PodDisruptionBudget. No disruptions are
   167  //                     allowed and the status of the condition will be False.
   168  // - SufficientPods: There are more pods than required by the PodDisruptionBudget.
   169  //                   The condition will be True, and the number of allowed
   170  //                   disruptions are provided by the disruptionsAllowed property.
   171  //
   172  // +optional
   173  // +patchMergeKey=type
   174  // +patchStrategy=merge
   175  // +listType=map
   176  // +listMapKey=type
   177  repeated k8s.io.apimachinery.pkg.apis.meta.v1.Condition conditions = 7;
   178}
   179

View as plain text