generated.proto 38 KB

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