rollingupdatedeployment.go 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. // Code generated by applyconfiguration-gen. DO NOT EDIT.
  14. package v1beta2
  15. import (
  16. intstr "k8s.io/apimachinery/pkg/util/intstr"
  17. )
  18. // RollingUpdateDeploymentApplyConfiguration represents a declarative configuration of the RollingUpdateDeployment type for use
  19. // with apply.
  20. //
  21. // Spec to control the desired behavior of rolling update.
  22. type RollingUpdateDeploymentApplyConfiguration struct {
  23. // The maximum number of pods that can be unavailable during the update.
  24. // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
  25. // Absolute number is calculated from percentage by rounding down.
  26. // This can not be 0 if MaxSurge is 0.
  27. // Defaults to 25%.
  28. // Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods
  29. // immediately when the rolling update starts. Once new pods are ready, old ReplicaSet
  30. // can be scaled down further, followed by scaling up the new ReplicaSet, ensuring
  31. // that the total number of pods available at all times during the update is at
  32. // least 70% of desired pods.
  33. MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
  34. // The maximum number of pods that can be scheduled above the desired number of
  35. // pods.
  36. // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
  37. // This can not be 0 if MaxUnavailable is 0.
  38. // Absolute number is calculated from percentage by rounding up.
  39. // Defaults to 25%.
  40. // Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when
  41. // the rolling update starts, such that the total number of old and new pods do not exceed
  42. // 130% of desired pods. Once old pods have been killed,
  43. // new ReplicaSet can be scaled up further, ensuring that total number of pods running
  44. // at any time during the update is at most 130% of desired pods.
  45. MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"`
  46. }
  47. // RollingUpdateDeploymentApplyConfiguration constructs a declarative configuration of the RollingUpdateDeployment type for use with
  48. // apply.
  49. func RollingUpdateDeployment() *RollingUpdateDeploymentApplyConfiguration {
  50. return &RollingUpdateDeploymentApplyConfiguration{}
  51. }
  52. // WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value
  53. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  54. // If called multiple times, the MaxUnavailable field is set to the value of the last call.
  55. func (b *RollingUpdateDeploymentApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *RollingUpdateDeploymentApplyConfiguration {
  56. b.MaxUnavailable = &value
  57. return b
  58. }
  59. // WithMaxSurge sets the MaxSurge field in the declarative configuration to the given value
  60. // and returns the receiver, so that objects can be built by chaining "With" function invocations.
  61. // If called multiple times, the MaxSurge field is set to the value of the last call.
  62. func (b *RollingUpdateDeploymentApplyConfiguration) WithMaxSurge(value intstr.IntOrString) *RollingUpdateDeploymentApplyConfiguration {
  63. b.MaxSurge = &value
  64. return b
  65. }