generated.proto 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  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 = "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. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
  105. optional k8s.io.api.core.v1.PodTemplateSpec template = 2;
  106. // An update strategy to replace existing DaemonSet pods with new pods.
  107. // +optional
  108. optional DaemonSetUpdateStrategy updateStrategy = 3;
  109. // The minimum number of seconds for which a newly created DaemonSet pod should
  110. // be ready without any of its container crashing, for it to be considered
  111. // available. Defaults to 0 (pod will be considered available as soon as it
  112. // is ready).
  113. // +optional
  114. optional int32 minReadySeconds = 4;
  115. // The number of old history to retain to allow rollback.
  116. // This is a pointer to distinguish between explicit zero and not specified.
  117. // Defaults to 10.
  118. // +optional
  119. optional int32 revisionHistoryLimit = 6;
  120. }
  121. // DaemonSetStatus represents the current status of a daemon set.
  122. message DaemonSetStatus {
  123. // The number of nodes that are running at least 1
  124. // daemon pod and are supposed to run the daemon pod.
  125. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
  126. optional int32 currentNumberScheduled = 1;
  127. // The number of nodes that are running the daemon pod, but are
  128. // not supposed to run the daemon pod.
  129. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
  130. optional int32 numberMisscheduled = 2;
  131. // The total number of nodes that should be running the daemon
  132. // pod (including nodes correctly running the daemon pod).
  133. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
  134. optional int32 desiredNumberScheduled = 3;
  135. // The number of nodes that should be running the daemon pod and have one
  136. // or more of the daemon pod running and ready.
  137. optional int32 numberReady = 4;
  138. // The most recent generation observed by the daemon set controller.
  139. // +optional
  140. optional int64 observedGeneration = 5;
  141. // The total number of nodes that are running updated daemon pod
  142. // +optional
  143. optional int32 updatedNumberScheduled = 6;
  144. // The number of nodes that should be running the
  145. // daemon pod and have one or more of the daemon pod running and
  146. // available (ready for at least spec.minReadySeconds)
  147. // +optional
  148. optional int32 numberAvailable = 7;
  149. // The number of nodes that should be running the
  150. // daemon pod and have none of the daemon pod running and available
  151. // (ready for at least spec.minReadySeconds)
  152. // +optional
  153. optional int32 numberUnavailable = 8;
  154. // Count of hash collisions for the DaemonSet. The DaemonSet controller
  155. // uses this field as a collision avoidance mechanism when it needs to
  156. // create the name for the newest ControllerRevision.
  157. // +optional
  158. optional int32 collisionCount = 9;
  159. // Represents the latest available observations of a DaemonSet's current state.
  160. // +optional
  161. // +patchMergeKey=type
  162. // +patchStrategy=merge
  163. repeated DaemonSetCondition conditions = 10;
  164. }
  165. // DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet.
  166. message DaemonSetUpdateStrategy {
  167. // Type of daemon set update. Can be "RollingUpdate" or "OnDelete". Default is RollingUpdate.
  168. // +optional
  169. optional string type = 1;
  170. // Rolling update config params. Present only if type = "RollingUpdate".
  171. // ---
  172. // TODO: Update this to follow our convention for oneOf, whatever we decide it
  173. // to be. Same as Deployment `strategy.rollingUpdate`.
  174. // See https://github.com/kubernetes/kubernetes/issues/35345
  175. // +optional
  176. optional RollingUpdateDaemonSet rollingUpdate = 2;
  177. }
  178. // Deployment enables declarative updates for Pods and ReplicaSets.
  179. message Deployment {
  180. // Standard object metadata.
  181. // +optional
  182. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  183. // Specification of the desired behavior of the Deployment.
  184. // +optional
  185. optional DeploymentSpec spec = 2;
  186. // Most recently observed status of the Deployment.
  187. // +optional
  188. optional DeploymentStatus status = 3;
  189. }
  190. // DeploymentCondition describes the state of a deployment at a certain point.
  191. message DeploymentCondition {
  192. // Type of deployment condition.
  193. optional string type = 1;
  194. // Status of the condition, one of True, False, Unknown.
  195. optional string status = 2;
  196. // The last time this condition was updated.
  197. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastUpdateTime = 6;
  198. // Last time the condition transitioned from one status to another.
  199. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 7;
  200. // The reason for the condition's last transition.
  201. optional string reason = 4;
  202. // A human readable message indicating details about the transition.
  203. optional string message = 5;
  204. }
  205. // DeploymentList is a list of Deployments.
  206. message DeploymentList {
  207. // Standard list metadata.
  208. // +optional
  209. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  210. // Items is the list of Deployments.
  211. repeated Deployment items = 2;
  212. }
  213. // DeploymentSpec is the specification of the desired behavior of the Deployment.
  214. message DeploymentSpec {
  215. // Number of desired pods. This is a pointer to distinguish between explicit
  216. // zero and not specified. Defaults to 1.
  217. // +optional
  218. optional int32 replicas = 1;
  219. // Label selector for pods. Existing ReplicaSets whose pods are
  220. // selected by this will be the ones affected by this deployment.
  221. // It must match the pod template's labels.
  222. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
  223. // Template describes the pods that will be created.
  224. optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
  225. // The deployment strategy to use to replace existing pods with new ones.
  226. // +optional
  227. // +patchStrategy=retainKeys
  228. optional DeploymentStrategy strategy = 4;
  229. // Minimum number of seconds for which a newly created pod should be ready
  230. // without any of its container crashing, for it to be considered available.
  231. // Defaults to 0 (pod will be considered available as soon as it is ready)
  232. // +optional
  233. optional int32 minReadySeconds = 5;
  234. // The number of old ReplicaSets to retain to allow rollback.
  235. // This is a pointer to distinguish between explicit zero and not specified.
  236. // Defaults to 10.
  237. // +optional
  238. optional int32 revisionHistoryLimit = 6;
  239. // Indicates that the deployment is paused.
  240. // +optional
  241. optional bool paused = 7;
  242. // The maximum time in seconds for a deployment to make progress before it
  243. // is considered to be failed. The deployment controller will continue to
  244. // process failed deployments and a condition with a ProgressDeadlineExceeded
  245. // reason will be surfaced in the deployment status. Note that progress will
  246. // not be estimated during the time a deployment is paused. Defaults to 600s.
  247. optional int32 progressDeadlineSeconds = 9;
  248. }
  249. // DeploymentStatus is the most recently observed status of the Deployment.
  250. message DeploymentStatus {
  251. // The generation observed by the deployment controller.
  252. // +optional
  253. optional int64 observedGeneration = 1;
  254. // Total number of non-terminated pods targeted by this deployment (their labels match the selector).
  255. // +optional
  256. optional int32 replicas = 2;
  257. // Total number of non-terminated pods targeted by this deployment that have the desired template spec.
  258. // +optional
  259. optional int32 updatedReplicas = 3;
  260. // Total number of ready pods targeted by this deployment.
  261. // +optional
  262. optional int32 readyReplicas = 7;
  263. // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
  264. // +optional
  265. optional int32 availableReplicas = 4;
  266. // Total number of unavailable pods targeted by this deployment. This is the total number of
  267. // pods that are still required for the deployment to have 100% available capacity. They may
  268. // either be pods that are running but not yet available or pods that still have not been created.
  269. // +optional
  270. optional int32 unavailableReplicas = 5;
  271. // Represents the latest available observations of a deployment's current state.
  272. // +patchMergeKey=type
  273. // +patchStrategy=merge
  274. repeated DeploymentCondition conditions = 6;
  275. // Count of hash collisions for the Deployment. The Deployment controller uses this
  276. // field as a collision avoidance mechanism when it needs to create the name for the
  277. // newest ReplicaSet.
  278. // +optional
  279. optional int32 collisionCount = 8;
  280. }
  281. // DeploymentStrategy describes how to replace existing pods with new ones.
  282. message DeploymentStrategy {
  283. // Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
  284. // +optional
  285. optional string type = 1;
  286. // Rolling update config params. Present only if DeploymentStrategyType =
  287. // RollingUpdate.
  288. // ---
  289. // TODO: Update this to follow our convention for oneOf, whatever we decide it
  290. // to be.
  291. // +optional
  292. optional RollingUpdateDeployment rollingUpdate = 2;
  293. }
  294. // ReplicaSet ensures that a specified number of pod replicas are running at any given time.
  295. message ReplicaSet {
  296. // If the Labels of a ReplicaSet are empty, they are defaulted to
  297. // be the same as the Pod(s) that the ReplicaSet manages.
  298. // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  299. // +optional
  300. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  301. // Spec defines the specification of the desired behavior of the ReplicaSet.
  302. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  303. // +optional
  304. optional ReplicaSetSpec spec = 2;
  305. // Status is the most recently observed status of the ReplicaSet.
  306. // This data may be out of date by some window of time.
  307. // Populated by the system.
  308. // Read-only.
  309. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
  310. // +optional
  311. optional ReplicaSetStatus status = 3;
  312. }
  313. // ReplicaSetCondition describes the state of a replica set at a certain point.
  314. message ReplicaSetCondition {
  315. // Type of replica set condition.
  316. optional string type = 1;
  317. // Status of the condition, one of True, False, Unknown.
  318. optional string status = 2;
  319. // The last time the condition transitioned from one status to another.
  320. // +optional
  321. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
  322. // The reason for the condition's last transition.
  323. // +optional
  324. optional string reason = 4;
  325. // A human readable message indicating details about the transition.
  326. // +optional
  327. optional string message = 5;
  328. }
  329. // ReplicaSetList is a collection of ReplicaSets.
  330. message ReplicaSetList {
  331. // Standard list metadata.
  332. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
  333. // +optional
  334. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  335. // List of ReplicaSets.
  336. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller
  337. repeated ReplicaSet items = 2;
  338. }
  339. // ReplicaSetSpec is the specification of a ReplicaSet.
  340. message ReplicaSetSpec {
  341. // Replicas is the number of desired replicas.
  342. // This is a pointer to distinguish between explicit zero and unspecified.
  343. // Defaults to 1.
  344. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller
  345. // +optional
  346. optional int32 replicas = 1;
  347. // Minimum number of seconds for which a newly created pod should be ready
  348. // without any of its container crashing, for it to be considered available.
  349. // Defaults to 0 (pod will be considered available as soon as it is ready)
  350. // +optional
  351. optional int32 minReadySeconds = 4;
  352. // Selector is a label query over pods that should match the replica count.
  353. // Label keys and values that must match in order to be controlled by this replica set.
  354. // It must match the pod template's labels.
  355. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
  356. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
  357. // Template is the object that describes the pod that will be created if
  358. // insufficient replicas are detected.
  359. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
  360. // +optional
  361. optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
  362. }
  363. // ReplicaSetStatus represents the current status of a ReplicaSet.
  364. message ReplicaSetStatus {
  365. // Replicas is the most recently oberved number of replicas.
  366. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller
  367. optional int32 replicas = 1;
  368. // The number of pods that have labels matching the labels of the pod template of the replicaset.
  369. // +optional
  370. optional int32 fullyLabeledReplicas = 2;
  371. // The number of ready replicas for this replica set.
  372. // +optional
  373. optional int32 readyReplicas = 4;
  374. // The number of available replicas (ready for at least minReadySeconds) for this replica set.
  375. // +optional
  376. optional int32 availableReplicas = 5;
  377. // ObservedGeneration reflects the generation of the most recently observed ReplicaSet.
  378. // +optional
  379. optional int64 observedGeneration = 3;
  380. // Represents the latest available observations of a replica set's current state.
  381. // +optional
  382. // +patchMergeKey=type
  383. // +patchStrategy=merge
  384. repeated ReplicaSetCondition conditions = 6;
  385. }
  386. // Spec to control the desired behavior of daemon set rolling update.
  387. message RollingUpdateDaemonSet {
  388. // The maximum number of DaemonSet pods that can be unavailable during the
  389. // update. Value can be an absolute number (ex: 5) or a percentage of total
  390. // number of DaemonSet pods at the start of the update (ex: 10%). Absolute
  391. // number is calculated from percentage by rounding up.
  392. // This cannot be 0.
  393. // Default value is 1.
  394. // Example: when this is set to 30%, at most 30% of the total number of nodes
  395. // that should be running the daemon pod (i.e. status.desiredNumberScheduled)
  396. // can have their pods stopped for an update at any given
  397. // time. The update starts by stopping at most 30% of those DaemonSet pods
  398. // and then brings up new DaemonSet pods in their place. Once the new pods
  399. // are available, it then proceeds onto other DaemonSet pods, thus ensuring
  400. // that at least 70% of original number of DaemonSet pods are available at
  401. // all times during the update.
  402. // +optional
  403. optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
  404. }
  405. // Spec to control the desired behavior of rolling update.
  406. message RollingUpdateDeployment {
  407. // The maximum number of pods that can be unavailable during the update.
  408. // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
  409. // Absolute number is calculated from percentage by rounding down.
  410. // This can not be 0 if MaxSurge is 0.
  411. // Defaults to 25%.
  412. // Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods
  413. // immediately when the rolling update starts. Once new pods are ready, old ReplicaSet
  414. // can be scaled down further, followed by scaling up the new ReplicaSet, ensuring
  415. // that the total number of pods available at all times during the update is at
  416. // least 70% of desired pods.
  417. // +optional
  418. optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 1;
  419. // The maximum number of pods that can be scheduled above the desired number of
  420. // pods.
  421. // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
  422. // This can not be 0 if MaxUnavailable is 0.
  423. // Absolute number is calculated from percentage by rounding up.
  424. // Defaults to 25%.
  425. // Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when
  426. // the rolling update starts, such that the total number of old and new pods do not exceed
  427. // 130% of desired pods. Once old pods have been killed,
  428. // new ReplicaSet can be scaled up further, ensuring that total number of pods running
  429. // at any time during the update is at most 130% of desired pods.
  430. // +optional
  431. optional k8s.io.apimachinery.pkg.util.intstr.IntOrString maxSurge = 2;
  432. }
  433. // RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.
  434. message RollingUpdateStatefulSetStrategy {
  435. // Partition indicates the ordinal at which the StatefulSet should be
  436. // partitioned.
  437. // Default value is 0.
  438. // +optional
  439. optional int32 partition = 1;
  440. }
  441. // StatefulSet represents a set of pods with consistent identities.
  442. // Identities are defined as:
  443. // - Network: A single stable DNS and hostname.
  444. // - Storage: As many VolumeClaims as requested.
  445. // The StatefulSet guarantees that a given network identity will always
  446. // map to the same storage identity.
  447. message StatefulSet {
  448. // +optional
  449. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  450. // Spec defines the desired identities of pods in this set.
  451. // +optional
  452. optional StatefulSetSpec spec = 2;
  453. // Status is the current status of Pods in this StatefulSet. This data
  454. // may be out of date by some window of time.
  455. // +optional
  456. optional StatefulSetStatus status = 3;
  457. }
  458. // StatefulSetCondition describes the state of a statefulset at a certain point.
  459. message StatefulSetCondition {
  460. // Type of statefulset condition.
  461. optional string type = 1;
  462. // Status of the condition, one of True, False, Unknown.
  463. optional string status = 2;
  464. // Last time the condition transitioned from one status to another.
  465. // +optional
  466. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
  467. // The reason for the condition's last transition.
  468. // +optional
  469. optional string reason = 4;
  470. // A human readable message indicating details about the transition.
  471. // +optional
  472. optional string message = 5;
  473. }
  474. // StatefulSetList is a collection of StatefulSets.
  475. message StatefulSetList {
  476. // +optional
  477. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  478. repeated StatefulSet items = 2;
  479. }
  480. // A StatefulSetSpec is the specification of a StatefulSet.
  481. message StatefulSetSpec {
  482. // replicas is the desired number of replicas of the given Template.
  483. // These are replicas in the sense that they are instantiations of the
  484. // same Template, but individual replicas also have a consistent identity.
  485. // If unspecified, defaults to 1.
  486. // TODO: Consider a rename of this field.
  487. // +optional
  488. optional int32 replicas = 1;
  489. // selector is a label query over pods that should match the replica count.
  490. // It must match the pod template's labels.
  491. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
  492. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
  493. // template is the object that describes the pod that will be created if
  494. // insufficient replicas are detected. Each pod stamped out by the StatefulSet
  495. // will fulfill this Template, but have a unique identity from the rest
  496. // of the StatefulSet.
  497. optional k8s.io.api.core.v1.PodTemplateSpec template = 3;
  498. // volumeClaimTemplates is a list of claims that pods are allowed to reference.
  499. // The StatefulSet controller is responsible for mapping network identities to
  500. // claims in a way that maintains the identity of a pod. Every claim in
  501. // this list must have at least one matching (by name) volumeMount in one
  502. // container in the template. A claim in this list takes precedence over
  503. // any volumes in the template, with the same name.
  504. // TODO: Define the behavior if a claim already exists with the same name.
  505. // +optional
  506. repeated k8s.io.api.core.v1.PersistentVolumeClaim volumeClaimTemplates = 4;
  507. // serviceName is the name of the service that governs this StatefulSet.
  508. // This service must exist before the StatefulSet, and is responsible for
  509. // the network identity of the set. Pods get DNS/hostnames that follow the
  510. // pattern: pod-specific-string.serviceName.default.svc.cluster.local
  511. // where "pod-specific-string" is managed by the StatefulSet controller.
  512. optional string serviceName = 5;
  513. // podManagementPolicy controls how pods are created during initial scale up,
  514. // when replacing pods on nodes, or when scaling down. The default policy is
  515. // `OrderedReady`, where pods are created in increasing order (pod-0, then
  516. // pod-1, etc) and the controller will wait until each pod is ready before
  517. // continuing. When scaling down, the pods are removed in the opposite order.
  518. // The alternative policy is `Parallel` which will create pods in parallel
  519. // to match the desired scale without waiting, and on scale down will delete
  520. // all pods at once.
  521. // +optional
  522. optional string podManagementPolicy = 6;
  523. // updateStrategy indicates the StatefulSetUpdateStrategy that will be
  524. // employed to update Pods in the StatefulSet when a revision is made to
  525. // Template.
  526. optional StatefulSetUpdateStrategy updateStrategy = 7;
  527. // revisionHistoryLimit is the maximum number of revisions that will
  528. // be maintained in the StatefulSet's revision history. The revision history
  529. // consists of all revisions not represented by a currently applied
  530. // StatefulSetSpec version. The default value is 10.
  531. optional int32 revisionHistoryLimit = 8;
  532. }
  533. // StatefulSetStatus represents the current state of a StatefulSet.
  534. message StatefulSetStatus {
  535. // observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the
  536. // StatefulSet's generation, which is updated on mutation by the API Server.
  537. // +optional
  538. optional int64 observedGeneration = 1;
  539. // replicas is the number of Pods created by the StatefulSet controller.
  540. optional int32 replicas = 2;
  541. // readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition.
  542. optional int32 readyReplicas = 3;
  543. // currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
  544. // indicated by currentRevision.
  545. optional int32 currentReplicas = 4;
  546. // updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
  547. // indicated by updateRevision.
  548. optional int32 updatedReplicas = 5;
  549. // currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the
  550. // sequence [0,currentReplicas).
  551. optional string currentRevision = 6;
  552. // updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence
  553. // [replicas-updatedReplicas,replicas)
  554. optional string updateRevision = 7;
  555. // collisionCount is the count of hash collisions for the StatefulSet. The StatefulSet controller
  556. // uses this field as a collision avoidance mechanism when it needs to create the name for the
  557. // newest ControllerRevision.
  558. // +optional
  559. optional int32 collisionCount = 9;
  560. // Represents the latest available observations of a statefulset's current state.
  561. // +optional
  562. // +patchMergeKey=type
  563. // +patchStrategy=merge
  564. repeated StatefulSetCondition conditions = 10;
  565. }
  566. // StatefulSetUpdateStrategy indicates the strategy that the StatefulSet
  567. // controller will use to perform updates. It includes any additional parameters
  568. // necessary to perform the update for the indicated strategy.
  569. message StatefulSetUpdateStrategy {
  570. // Type indicates the type of the StatefulSetUpdateStrategy.
  571. // Default is RollingUpdate.
  572. // +optional
  573. optional string type = 1;
  574. // RollingUpdate is used to communicate parameters when Type is RollingUpdateStatefulSetStrategyType.
  575. // +optional
  576. optional RollingUpdateStatefulSetStrategy rollingUpdate = 2;
  577. }