...

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

Documentation: k8s.io/api/apps/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.apps.v1;
    23
    24import "k8s.io/api/core/v1/generated.proto";
    25import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
    26import "k8s.io/apimachinery/pkg/runtime/generated.proto";
    27import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
    28import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
    29
    30// Package-wide variables from generator "generated".
    31option go_package = "k8s.io/api/apps/v1";
    32
    33// ControllerRevision implements an immutable snapshot of state data. Clients
    34// are responsible for serializing and deserializing the objects that contain
    35// their internal state.
    36// Once a ControllerRevision has been successfully created, it can not be updated.
    37// The API Server will fail validation of all requests that attempt to mutate
    38// the Data field. ControllerRevisions may, however, be deleted. Note that, due to its use by both
    39// the DaemonSet and StatefulSet controllers for update and rollback, this object is beta. However,
    40// it may be subject to name and representation changes in future releases, and clients should not
    41// depend on its stability. It is primarily for internal use by controllers.
    42message ControllerRevision {
    43  // Standard object's metadata.
    44  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    45  // +optional
    46  optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
    47
    48  // Data is the serialized representation of the state.
    49  optional k8s.io.apimachinery.pkg.runtime.RawExtension data = 2;
    50
    51  // Revision indicates the revision of the state represented by Data.
    52  optional int64 revision = 3;
    53}
    54
    55// ControllerRevisionList is a resource containing a list of ControllerRevision objects.
    56message ControllerRevisionList {
    57  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    58  // +optional
    59  optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
    60
    61  // Items is the list of ControllerRevisions
    62  repeated ControllerRevision items = 2;
    63}
    64
    65// DaemonSet represents the configuration of a daemon set.
    66message DaemonSet {
    67  // Standard object's metadata.
    68  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    69  // +optional
    70  optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
    71
    72  // The desired behavior of this daemon set.
    73  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    74  // +optional
    75  optional DaemonSetSpec spec = 2;
    76
    77  // The current status of this daemon set. This data may be
    78  // out of date by some window of time.
    79  // Populated by the system.
    80  // Read-only.
    81  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    82  // +optional
    83  optional DaemonSetStatus status = 3;
    84}
    85
    86// DaemonSetCondition describes the state of a DaemonSet at a certain point.
    87message DaemonSetCondition {
    88  // Type of DaemonSet condition.
    89  optional string type = 1;
    90
    91  // Status of the condition, one of True, False, Unknown.
    92  optional string status = 2;
    93
    94  // Last time the condition transitioned from one status to another.
    95  // +optional
    96  optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
    97
    98  // The reason for the condition's last transition.
    99  // +optional
   100  optional string reason = 4;
   101
   102  // A human readable message indicating details about the transition.
   103  // +optional
   104  optional string message = 5;
   105}
   106
   107// DaemonSetList is a collection of daemon sets.
   108message DaemonSetList {
   109  // Standard list metadata.
   110  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   111  // +optional
   112  optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
   113
   114  // A list of daemon sets.
   115  repeated DaemonSet items = 2;
   116}
   117
   118// DaemonSetSpec is the specification of a daemon set.
   119message DaemonSetSpec {
   120  // A label query over pods that are managed by the daemon set.
   121  // Must match in order to be controlled.
   122  // It must match the pod template's labels.
   123  // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
   124  optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 1;
   125
   126  // An object that describes the pod that will be created.
   127  // The DaemonSet will create exactly one copy of this pod on every node
   128  // that matches the template's node selector (or on every node if no node
   129  // selector is specified).
   130  // The only allowed template.spec.restartPolicy value is "Always".
   131  // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
   132  optional k8s.io.api.core.v1.PodTemplateSpec template = 2;
   133
   134  // An update strategy to replace existing DaemonSet pods with new pods.
   135  // +optional
   136  optional DaemonSetUpdateStrategy updateStrategy = 3;
   137
   138  // The minimum number of seconds for which a newly created DaemonSet pod should
   139  // be ready without any of its container crashing, for it to be considered
   140  // available. Defaults to 0 (pod will be considered available as soon as it
   141  // is ready).
   142  // +optional
   143  optional int32 minReadySeconds = 4;
   144
   145  // The number of old history to retain to allow rollback.
   146  // This is a pointer to distinguish between explicit zero and not specified.
   147  // Defaults to 10.
   148  // +optional
   149  optional int32 revisionHistoryLimit = 6;
   150}
   151
   152// DaemonSetStatus represents the current status of a daemon set.
   153message DaemonSetStatus {
   154  // The number of nodes that are running at least 1
   155  // daemon pod and are supposed to run the daemon pod.
   156  // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
   157  optional int32 currentNumberScheduled = 1;
   158
   159  // The number of nodes that are running the daemon pod, but are
   160  // not supposed to run the daemon pod.
   161  // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
   162  optional int32 numberMisscheduled = 2;
   163
   164  // The total number of nodes that should be running the daemon
   165  // pod (including nodes correctly running the daemon pod).
   166  // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
   167  optional int32 desiredNumberScheduled = 3;
   168
   169  // numberReady is the number of nodes that should be running the daemon pod and have one
   170  // or more of the daemon pod running with a Ready Condition.
   171  optional int32 numberReady = 4;
   172
   173  // The most recent generation observed by the daemon set controller.
   174  // +optional
   175  optional int64 observedGeneration = 5;
   176
   177  // The total number of nodes that are running updated daemon pod
   178  // +optional
   179  optional int32 updatedNumberScheduled = 6;
   180
   181  // The number of nodes that should be running the
   182  // daemon pod and have one or more of the daemon pod running and
   183  // available (ready for at least spec.minReadySeconds)
   184  // +optional
   185  optional int32 numberAvailable = 7;
   186
   187  // The number of nodes that should be running the
   188  // daemon pod and have none of the daemon pod running and available
   189  // (ready for at least spec.minReadySeconds)
   190  // +optional
   191  optional int32 numberUnavailable = 8;
   192
   193  // Count of hash collisions for the DaemonSet. The DaemonSet controller
   194  // uses this field as a collision avoidance mechanism when it needs to
   195  // create the name for the newest ControllerRevision.
   196  // +optional
   197  optional int32 collisionCount = 9;
   198
   199  // Represents the latest available observations of a DaemonSet's current state.
   200  // +optional
   201  // +patchMergeKey=type
   202  // +patchStrategy=merge
   203  // +listType=map
   204  // +listMapKey=type
   205  repeated DaemonSetCondition conditions = 10;
   206}
   207
   208// DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet.
   209message DaemonSetUpdateStrategy {
   210  // Type of daemon set update. Can be "RollingUpdate" or "OnDelete". Default is RollingUpdate.
   211  // +optional
   212  optional string type = 1;
   213
   214  // Rolling update config params. Present only if type = "RollingUpdate".
   215  // ---
   216  // TODO: Update this to follow our convention for oneOf, whatever we decide it
   217  // to be. Same as Deployment `strategy.rollingUpdate`.
   218  // See https://github.com/kubernetes/kubernetes/issues/35345
   219  // +optional
   220  optional RollingUpdateDaemonSet rollingUpdate = 2;
   221}
   222
   223// Deployment enables declarative updates for Pods and ReplicaSets.
   224message Deployment {
   225  // Standard object's metadata.
   226  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   227  // +optional
   228  optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
   229
   230  // Specification of the desired behavior of the Deployment.
   231  // +optional
   232  optional DeploymentSpec spec = 2;
   233
   234  // Most recently observed status of the Deployment.
   235  // +optional
   236  optional DeploymentStatus status = 3;
   237}
   238
   239// DeploymentCondition describes the state of a deployment at a certain point.
   240message DeploymentCondition {
   241  // Type of deployment condition.
   242  optional string type = 1;
   243
   244  // Status of the condition, one of True, False, Unknown.
   245  optional string status = 2;
   246
   247  // The last time this condition was updated.
   248  optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6;
   249
   250  // Last time the condition transitioned from one status to another.
   251  optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7;
   252
   253  // The reason for the condition's last transition.
   254  optional string reason = 4;
   255
   256  // A human readable message indicating details about the transition.
   257  optional string message = 5;
   258}
   259
   260// DeploymentList is a list of Deployments.
   261message DeploymentList {
   262  // Standard list metadata.
   263  // +optional
   264  optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
   265
   266  // Items is the list of Deployments.
   267  repeated Deployment items = 2;
   268}
   269
   270// DeploymentSpec is the specification of the desired behavior of the Deployment.
   271message DeploymentSpec {
   272  // Number of desired pods. This is a pointer to distinguish between explicit
   273  // zero and not specified. Defaults to 1.
   274  // +optional
   275  optional int32 replicas = 1;
   276
   277  // Label selector for pods. Existing ReplicaSets whose pods are
   278  // selected by this will be the ones affected by this deployment.
   279  // It must match the pod template's labels.
   280  optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
   281
   282  // Template describes the pods that will be created.
   283  // The only allowed template.spec.restartPolicy value is "Always".
   284  optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
   285
   286  // The deployment strategy to use to replace existing pods with new ones.
   287  // +optional
   288  // +patchStrategy=retainKeys
   289  optional DeploymentStrategy strategy = 4;
   290
   291  // Minimum number of seconds for which a newly created pod should be ready
   292  // without any of its container crashing, for it to be considered available.
   293  // Defaults to 0 (pod will be considered available as soon as it is ready)
   294  // +optional
   295  optional int32 minReadySeconds = 5;
   296
   297  // The number of old ReplicaSets to retain to allow rollback.
   298  // This is a pointer to distinguish between explicit zero and not specified.
   299  // Defaults to 10.
   300  // +optional
   301  optional int32 revisionHistoryLimit = 6;
   302
   303  // Indicates that the deployment is paused.
   304  // +optional
   305  optional bool paused = 7;
   306
   307  // The maximum time in seconds for a deployment to make progress before it
   308  // is considered to be failed. The deployment controller will continue to
   309  // process failed deployments and a condition with a ProgressDeadlineExceeded
   310  // reason will be surfaced in the deployment status. Note that progress will
   311  // not be estimated during the time a deployment is paused. Defaults to 600s.
   312  optional int32 progressDeadlineSeconds = 9;
   313}
   314
   315// DeploymentStatus is the most recently observed status of the Deployment.
   316message DeploymentStatus {
   317  // The generation observed by the deployment controller.
   318  // +optional
   319  optional int64 observedGeneration = 1;
   320
   321  // Total number of non-terminated pods targeted by this deployment (their labels match the selector).
   322  // +optional
   323  optional int32 replicas = 2;
   324
   325  // Total number of non-terminated pods targeted by this deployment that have the desired template spec.
   326  // +optional
   327  optional int32 updatedReplicas = 3;
   328
   329  // readyReplicas is the number of pods targeted by this Deployment with a Ready Condition.
   330  // +optional
   331  optional int32 readyReplicas = 7;
   332
   333  // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
   334  // +optional
   335  optional int32 availableReplicas = 4;
   336
   337  // Total number of unavailable pods targeted by this deployment. This is the total number of
   338  // pods that are still required for the deployment to have 100% available capacity. They may
   339  // either be pods that are running but not yet available or pods that still have not been created.
   340  // +optional
   341  optional int32 unavailableReplicas = 5;
   342
   343  // Represents the latest available observations of a deployment's current state.
   344  // +patchMergeKey=type
   345  // +patchStrategy=merge
   346  // +listType=map
   347  // +listMapKey=type
   348  repeated DeploymentCondition conditions = 6;
   349
   350  // Count of hash collisions for the Deployment. The Deployment controller uses this
   351  // field as a collision avoidance mechanism when it needs to create the name for the
   352  // newest ReplicaSet.
   353  // +optional
   354  optional int32 collisionCount = 8;
   355}
   356
   357// DeploymentStrategy describes how to replace existing pods with new ones.
   358message DeploymentStrategy {
   359  // Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
   360  // +optional
   361  optional string type = 1;
   362
   363  // Rolling update config params. Present only if DeploymentStrategyType =
   364  // RollingUpdate.
   365  // ---
   366  // TODO: Update this to follow our convention for oneOf, whatever we decide it
   367  // to be.
   368  // +optional
   369  optional RollingUpdateDeployment rollingUpdate = 2;
   370}
   371
   372// ReplicaSet ensures that a specified number of pod replicas are running at any given time.
   373message ReplicaSet {
   374  // If the Labels of a ReplicaSet are empty, they are defaulted to
   375  // be the same as the Pod(s) that the ReplicaSet manages.
   376  // Standard object's metadata.
   377  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   378  // +optional
   379  optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
   380
   381  // Spec defines the specification of the desired behavior of the ReplicaSet.
   382  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   383  // +optional
   384  optional ReplicaSetSpec spec = 2;
   385
   386  // Status is the most recently observed status of the ReplicaSet.
   387  // This data may be out of date by some window of time.
   388  // Populated by the system.
   389  // Read-only.
   390  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   391  // +optional
   392  optional ReplicaSetStatus status = 3;
   393}
   394
   395// ReplicaSetCondition describes the state of a replica set at a certain point.
   396message ReplicaSetCondition {
   397  // Type of replica set condition.
   398  optional string type = 1;
   399
   400  // Status of the condition, one of True, False, Unknown.
   401  optional string status = 2;
   402
   403  // The last time the condition transitioned from one status to another.
   404  // +optional
   405  optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
   406
   407  // The reason for the condition's last transition.
   408  // +optional
   409  optional string reason = 4;
   410
   411  // A human readable message indicating details about the transition.
   412  // +optional
   413  optional string message = 5;
   414}
   415
   416// ReplicaSetList is a collection of ReplicaSets.
   417message ReplicaSetList {
   418  // Standard list metadata.
   419  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
   420  // +optional
   421  optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
   422
   423  // List of ReplicaSets.
   424  // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller
   425  repeated ReplicaSet items = 2;
   426}
   427
   428// ReplicaSetSpec is the specification of a ReplicaSet.
   429message ReplicaSetSpec {
   430  // Replicas is the number of desired replicas.
   431  // This is a pointer to distinguish between explicit zero and unspecified.
   432  // Defaults to 1.
   433  // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller
   434  // +optional
   435  optional int32 replicas = 1;
   436
   437  // Minimum number of seconds for which a newly created pod should be ready
   438  // without any of its container crashing, for it to be considered available.
   439  // Defaults to 0 (pod will be considered available as soon as it is ready)
   440  // +optional
   441  optional int32 minReadySeconds = 4;
   442
   443  // Selector is a label query over pods that should match the replica count.
   444  // Label keys and values that must match in order to be controlled by this replica set.
   445  // It must match the pod template's labels.
   446  // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
   447  optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
   448
   449  // Template is the object that describes the pod that will be created if
   450  // insufficient replicas are detected.
   451  // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
   452  // +optional
   453  optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
   454}
   455
   456// ReplicaSetStatus represents the current status of a ReplicaSet.
   457message ReplicaSetStatus {
   458  // Replicas is the most recently observed number of replicas.
   459  // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller
   460  optional int32 replicas = 1;
   461
   462  // The number of pods that have labels matching the labels of the pod template of the replicaset.
   463  // +optional
   464  optional int32 fullyLabeledReplicas = 2;
   465
   466  // readyReplicas is the number of pods targeted by this ReplicaSet with a Ready Condition.
   467  // +optional
   468  optional int32 readyReplicas = 4;
   469
   470  // The number of available replicas (ready for at least minReadySeconds) for this replica set.
   471  // +optional
   472  optional int32 availableReplicas = 5;
   473
   474  // ObservedGeneration reflects the generation of the most recently observed ReplicaSet.
   475  // +optional
   476  optional int64 observedGeneration = 3;
   477
   478  // Represents the latest available observations of a replica set's current state.
   479  // +optional
   480  // +patchMergeKey=type
   481  // +patchStrategy=merge
   482  // +listType=map
   483  // +listMapKey=type
   484  repeated ReplicaSetCondition conditions = 6;
   485}
   486
   487// Spec to control the desired behavior of daemon set rolling update.
   488message RollingUpdateDaemonSet {
   489  // The maximum number of DaemonSet pods that can be unavailable during the
   490  // update. Value can be an absolute number (ex: 5) or a percentage of total
   491  // number of DaemonSet pods at the start of the update (ex: 10%). Absolute
   492  // number is calculated from percentage by rounding up.
   493  // This cannot be 0 if MaxSurge is 0
   494  // Default value is 1.
   495  // Example: when this is set to 30%, at most 30% of the total number of nodes
   496  // that should be running the daemon pod (i.e. status.desiredNumberScheduled)
   497  // can have their pods stopped for an update at any given time. The update
   498  // starts by stopping at most 30% of those DaemonSet pods and then brings
   499  // up new DaemonSet pods in their place. Once the new pods are available,
   500  // it then proceeds onto other DaemonSet pods, thus ensuring that at least
   501  // 70% of original number of DaemonSet pods are available at all times during
   502  // the update.
   503  // +optional
   504  optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
   505
   506  // The maximum number of nodes with an existing available DaemonSet pod that
   507  // can have an updated DaemonSet pod during during an update.
   508  // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
   509  // This can not be 0 if MaxUnavailable is 0.
   510  // Absolute number is calculated from percentage by rounding up to a minimum of 1.
   511  // Default value is 0.
   512  // Example: when this is set to 30%, at most 30% of the total number of nodes
   513  // that should be running the daemon pod (i.e. status.desiredNumberScheduled)
   514  // can have their a new pod created before the old pod is marked as deleted.
   515  // The update starts by launching new pods on 30% of nodes. Once an updated
   516  // pod is available (Ready for at least minReadySeconds) the old DaemonSet pod
   517  // on that node is marked deleted. If the old pod becomes unavailable for any
   518  // reason (Ready transitions to false, is evicted, or is drained) an updated
   519  // pod is immediatedly created on that node without considering surge limits.
   520  // Allowing surge implies the possibility that the resources consumed by the
   521  // daemonset on any given node can double if the readiness check fails, and
   522  // so resource intensive daemonsets should take into account that they may
   523  // cause evictions during disruption.
   524  // +optional
   525  optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
   526}
   527
   528// Spec to control the desired behavior of rolling update.
   529message RollingUpdateDeployment {
   530  // The maximum number of pods that can be unavailable during the update.
   531  // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
   532  // Absolute number is calculated from percentage by rounding down.
   533  // This can not be 0 if MaxSurge is 0.
   534  // Defaults to 25%.
   535  // Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods
   536  // immediately when the rolling update starts. Once new pods are ready, old ReplicaSet
   537  // can be scaled down further, followed by scaling up the new ReplicaSet, ensuring
   538  // that the total number of pods available at all times during the update is at
   539  // least 70% of desired pods.
   540  // +optional
   541  optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
   542
   543  // The maximum number of pods that can be scheduled above the desired number of
   544  // pods.
   545  // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
   546  // This can not be 0 if MaxUnavailable is 0.
   547  // Absolute number is calculated from percentage by rounding up.
   548  // Defaults to 25%.
   549  // Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when
   550  // the rolling update starts, such that the total number of old and new pods do not exceed
   551  // 130% of desired pods. Once old pods have been killed,
   552  // new ReplicaSet can be scaled up further, ensuring that total number of pods running
   553  // at any time during the update is at most 130% of desired pods.
   554  // +optional
   555  optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
   556}
   557
   558// RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.
   559message RollingUpdateStatefulSetStrategy {
   560  // Partition indicates the ordinal at which the StatefulSet should be partitioned
   561  // for updates. During a rolling update, all pods from ordinal Replicas-1 to
   562  // Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched.
   563  // This is helpful in being able to do a canary based deployment. The default value is 0.
   564  // +optional
   565  optional int32 partition = 1;
   566
   567  // The maximum number of pods that can be unavailable during the update.
   568  // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
   569  // Absolute number is calculated from percentage by rounding up. This can not be 0.
   570  // Defaults to 1. This field is alpha-level and is only honored by servers that enable the
   571  // MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to
   572  // Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it
   573  // will be counted towards MaxUnavailable.
   574  // +optional
   575  optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 2;
   576}
   577
   578// StatefulSet represents a set of pods with consistent identities.
   579// Identities are defined as:
   580//   - Network: A single stable DNS and hostname.
   581//   - Storage: As many VolumeClaims as requested.
   582//
   583// The StatefulSet guarantees that a given network identity will always
   584// map to the same storage identity.
   585message StatefulSet {
   586  // Standard object's metadata.
   587  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   588  // +optional
   589  optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
   590
   591  // Spec defines the desired identities of pods in this set.
   592  // +optional
   593  optional StatefulSetSpec spec = 2;
   594
   595  // Status is the current status of Pods in this StatefulSet. This data
   596  // may be out of date by some window of time.
   597  // +optional
   598  optional StatefulSetStatus status = 3;
   599}
   600
   601// StatefulSetCondition describes the state of a statefulset at a certain point.
   602message StatefulSetCondition {
   603  // Type of statefulset condition.
   604  optional string type = 1;
   605
   606  // Status of the condition, one of True, False, Unknown.
   607  optional string status = 2;
   608
   609  // Last time the condition transitioned from one status to another.
   610  // +optional
   611  optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
   612
   613  // The reason for the condition's last transition.
   614  // +optional
   615  optional string reason = 4;
   616
   617  // A human readable message indicating details about the transition.
   618  // +optional
   619  optional string message = 5;
   620}
   621
   622// StatefulSetList is a collection of StatefulSets.
   623message StatefulSetList {
   624  // Standard list's metadata.
   625  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   626  // +optional
   627  optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
   628
   629  // Items is the list of stateful sets.
   630  repeated StatefulSet items = 2;
   631}
   632
   633// StatefulSetOrdinals describes the policy used for replica ordinal assignment
   634// in this StatefulSet.
   635message StatefulSetOrdinals {
   636  // start is the number representing the first replica's index. It may be used
   637  // to number replicas from an alternate index (eg: 1-indexed) over the default
   638  // 0-indexed names, or to orchestrate progressive movement of replicas from
   639  // one StatefulSet to another.
   640  // If set, replica indices will be in the range:
   641  //   [.spec.ordinals.start, .spec.ordinals.start + .spec.replicas).
   642  // If unset, defaults to 0. Replica indices will be in the range:
   643  //   [0, .spec.replicas).
   644  // +optional
   645  optional int32 start = 1;
   646}
   647
   648// StatefulSetPersistentVolumeClaimRetentionPolicy describes the policy used for PVCs
   649// created from the StatefulSet VolumeClaimTemplates.
   650message StatefulSetPersistentVolumeClaimRetentionPolicy {
   651  // WhenDeleted specifies what happens to PVCs created from StatefulSet
   652  // VolumeClaimTemplates when the StatefulSet is deleted. The default policy
   653  // of `Retain` causes PVCs to not be affected by StatefulSet deletion. The
   654  // `Delete` policy causes those PVCs to be deleted.
   655  optional string whenDeleted = 1;
   656
   657  // WhenScaled specifies what happens to PVCs created from StatefulSet
   658  // VolumeClaimTemplates when the StatefulSet is scaled down. The default
   659  // policy of `Retain` causes PVCs to not be affected by a scaledown. The
   660  // `Delete` policy causes the associated PVCs for any excess pods above
   661  // the replica count to be deleted.
   662  optional string whenScaled = 2;
   663}
   664
   665// A StatefulSetSpec is the specification of a StatefulSet.
   666message StatefulSetSpec {
   667  // replicas is the desired number of replicas of the given Template.
   668  // These are replicas in the sense that they are instantiations of the
   669  // same Template, but individual replicas also have a consistent identity.
   670  // If unspecified, defaults to 1.
   671  // TODO: Consider a rename of this field.
   672  // +optional
   673  optional int32 replicas = 1;
   674
   675  // selector is a label query over pods that should match the replica count.
   676  // It must match the pod template's labels.
   677  // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
   678  optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
   679
   680  // template is the object that describes the pod that will be created if
   681  // insufficient replicas are detected. Each pod stamped out by the StatefulSet
   682  // will fulfill this Template, but have a unique identity from the rest
   683  // of the StatefulSet. Each pod will be named with the format
   684  // <statefulsetname>-<podindex>. For example, a pod in a StatefulSet named
   685  // "web" with index number "3" would be named "web-3".
   686  // The only allowed template.spec.restartPolicy value is "Always".
   687  optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
   688
   689  // volumeClaimTemplates is a list of claims that pods are allowed to reference.
   690  // The StatefulSet controller is responsible for mapping network identities to
   691  // claims in a way that maintains the identity of a pod. Every claim in
   692  // this list must have at least one matching (by name) volumeMount in one
   693  // container in the template. A claim in this list takes precedence over
   694  // any volumes in the template, with the same name.
   695  // TODO: Define the behavior if a claim already exists with the same name.
   696  // +optional
   697  // +listType=atomic
   698  repeated k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4;
   699
   700  // serviceName is the name of the service that governs this StatefulSet.
   701  // This service must exist before the StatefulSet, and is responsible for
   702  // the network identity of the set. Pods get DNS/hostnames that follow the
   703  // pattern: pod-specific-string.serviceName.default.svc.cluster.local
   704  // where "pod-specific-string" is managed by the StatefulSet controller.
   705  optional string serviceName = 5;
   706
   707  // podManagementPolicy controls how pods are created during initial scale up,
   708  // when replacing pods on nodes, or when scaling down. The default policy is
   709  // `OrderedReady`, where pods are created in increasing order (pod-0, then
   710  // pod-1, etc) and the controller will wait until each pod is ready before
   711  // continuing. When scaling down, the pods are removed in the opposite order.
   712  // The alternative policy is `Parallel` which will create pods in parallel
   713  // to match the desired scale without waiting, and on scale down will delete
   714  // all pods at once.
   715  // +optional
   716  optional string podManagementPolicy = 6;
   717
   718  // updateStrategy indicates the StatefulSetUpdateStrategy that will be
   719  // employed to update Pods in the StatefulSet when a revision is made to
   720  // Template.
   721  optional StatefulSetUpdateStrategy updateStrategy = 7;
   722
   723  // revisionHistoryLimit is the maximum number of revisions that will
   724  // be maintained in the StatefulSet's revision history. The revision history
   725  // consists of all revisions not represented by a currently applied
   726  // StatefulSetSpec version. The default value is 10.
   727  optional int32 revisionHistoryLimit = 8;
   728
   729  // Minimum number of seconds for which a newly created pod should be ready
   730  // without any of its container crashing for it to be considered available.
   731  // Defaults to 0 (pod will be considered available as soon as it is ready)
   732  // +optional
   733  optional int32 minReadySeconds = 9;
   734
   735  // persistentVolumeClaimRetentionPolicy describes the lifecycle of persistent
   736  // volume claims created from volumeClaimTemplates. By default, all persistent
   737  // volume claims are created as needed and retained until manually deleted. This
   738  // policy allows the lifecycle to be altered, for example by deleting persistent
   739  // volume claims when their stateful set is deleted, or when their pod is scaled
   740  // down. This requires the StatefulSetAutoDeletePVC feature gate to be enabled,
   741  // which is alpha.  +optional
   742  optional StatefulSetPersistentVolumeClaimRetentionPolicy persistentVolumeClaimRetentionPolicy = 10;
   743
   744  // ordinals controls the numbering of replica indices in a StatefulSet. The
   745  // default ordinals behavior assigns a "0" index to the first replica and
   746  // increments the index by one for each additional replica requested. Using
   747  // the ordinals field requires the StatefulSetStartOrdinal feature gate to be
   748  // enabled, which is beta.
   749  // +optional
   750  optional StatefulSetOrdinals ordinals = 11;
   751}
   752
   753// StatefulSetStatus represents the current state of a StatefulSet.
   754message StatefulSetStatus {
   755  // observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the
   756  // StatefulSet's generation, which is updated on mutation by the API Server.
   757  // +optional
   758  optional int64 observedGeneration = 1;
   759
   760  // replicas is the number of Pods created by the StatefulSet controller.
   761  optional int32 replicas = 2;
   762
   763  // readyReplicas is the number of pods created for this StatefulSet with a Ready Condition.
   764  optional int32 readyReplicas = 3;
   765
   766  // currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
   767  // indicated by currentRevision.
   768  optional int32 currentReplicas = 4;
   769
   770  // updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
   771  // indicated by updateRevision.
   772  optional int32 updatedReplicas = 5;
   773
   774  // currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the
   775  // sequence [0,currentReplicas).
   776  optional string currentRevision = 6;
   777
   778  // updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence
   779  // [replicas-updatedReplicas,replicas)
   780  optional string updateRevision = 7;
   781
   782  // collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller
   783  // uses this field as a collision avoidance mechanism when it needs to create the name for the
   784  // newest ControllerRevision.
   785  // +optional
   786  optional int32 collisionCount = 9;
   787
   788  // Represents the latest available observations of a statefulset's current state.
   789  // +optional
   790  // +patchMergeKey=type
   791  // +patchStrategy=merge
   792  // +listType=map
   793  // +listMapKey=type
   794  repeated StatefulSetCondition conditions = 10;
   795
   796  // Total number of available pods (ready for at least minReadySeconds) targeted by this statefulset.
   797  // +optional
   798  optional int32 availableReplicas = 11;
   799}
   800
   801// StatefulSetUpdateStrategy indicates the strategy that the StatefulSet
   802// controller will use to perform updates. It includes any additional parameters
   803// necessary to perform the update for the indicated strategy.
   804message StatefulSetUpdateStrategy {
   805  // Type indicates the type of the StatefulSetUpdateStrategy.
   806  // Default is RollingUpdate.
   807  // +optional
   808  optional string type = 1;
   809
   810  // RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType.
   811  // +optional
   812  optional RollingUpdateStatefulSetStrategy rollingUpdate = 2;
   813}
   814

View as plain text