generated.proto 35 KB

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