diff --git a/apis/projectcontour/v1alpha1/contourdeployment.go b/apis/projectcontour/v1alpha1/contourdeployment.go index de561d1c264..cf1f5bea6d5 100644 --- a/apis/projectcontour/v1alpha1/contourdeployment.go +++ b/apis/projectcontour/v1alpha1/contourdeployment.go @@ -14,6 +14,7 @@ package v1alpha1 import ( + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -74,10 +75,15 @@ type ContourDeploymentSpec struct { // ContourSettings contains settings for the Contour part of the installation, // i.e. the xDS server/control plane and associated resources. type ContourSettings struct { - // Replicas is the desired number of Contour replicas. If unset, + // Deprecated: Use `DeploymentSettings.Replicas` instead. + // + // Replicas is the desired number of Contour replicas. If if unset, // defaults to 2. // + // if both `DeploymentSettings.Replicas` and this one is set, use `DeploymentSettings.Replicas`. + // // +kubebuilder:validation:Minimum=0 + // +optional Replicas int32 `json:"replicas,omitempty"` // NodePlacement describes node scheduling configuration of Contour pods. @@ -104,6 +110,29 @@ type ContourSettings struct { // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ // +optional Resources corev1.ResourceRequirements `json:"resources,omitempty"` + + // Deployment describes the settings for running contour as a `Deployment`. + // +optional + Deployment *DeploymentSettings `json:"deployment,omitempty"` +} + +// DeploymentSettings contains settings for Deployment resources. +type DeploymentSettings struct { + // Replicas is the desired number of replicas. + // + // +kubebuilder:validation:Minimum=0 + Replicas int32 `json:"replicas,omitempty"` + + // Strategy describes the deployment strategy to use to replace existing pods with new pods. + // +optional + Strategy *appsv1.DeploymentStrategy `json:"strategy,omitempty"` +} + +// DaemonSetSettings contains settings for DaemonSet resources. +type DaemonSetSettings struct { + // Strategy describes the deployment strategy to use to replace existing DaemonSet pods with new pods. + // +optional + UpdateStrategy *appsv1.DaemonSetUpdateStrategy `json:"updateStrategy,omitempty"` } // EnvoySettings contains settings for the Envoy part of the installation, @@ -116,11 +145,16 @@ type EnvoySettings struct { // +optional WorkloadType WorkloadType `json:"workloadType,omitempty"` + // Deprecated: Use `DeploymentSettings.Replicas` instead. + // // Replicas is the desired number of Envoy replicas. If WorkloadType // is not "Deployment", this field is ignored. Otherwise, if unset, // defaults to 2. // + // if both `DeploymentSettings.Replicas` and this one is set, use `DeploymentSettings.Replicas`. + // // +kubebuilder:validation:Minimum=0 + // +optional Replicas int32 `json:"replicas,omitempty"` // NetworkPublishing defines how to expose Envoy to a network. @@ -156,6 +190,16 @@ type EnvoySettings struct { // // +optional LogLevel LogLevel `json:"logLevel,omitempty"` + + // DaemonSet describes the settings for running envoy as a `DaemonSet`. + // if `WorkloadType` is `Deployment`,it's must be nil + // +optional + DaemonSet *DaemonSetSettings `json:"daemonSet,omitempty"` + + // Deployment describes the settings for running envoy as a `Deployment`. + // if `WorkloadType` is `DaemonSet`,it's must be nil + // +optional + Deployment *DeploymentSettings `json:"deployment,omitempty"` } // WorkloadType is the type of Kubernetes workload to use for a component. diff --git a/apis/projectcontour/v1alpha1/zz_generated.deepcopy.go b/apis/projectcontour/v1alpha1/zz_generated.deepcopy.go index 46518727be8..493fc6b6f28 100644 --- a/apis/projectcontour/v1alpha1/zz_generated.deepcopy.go +++ b/apis/projectcontour/v1alpha1/zz_generated.deepcopy.go @@ -23,6 +23,7 @@ package v1alpha1 import ( "github.com/projectcontour/contour/apis/projectcontour/v1" + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -340,6 +341,11 @@ func (in *ContourSettings) DeepCopyInto(out *ContourSettings) { (*in).DeepCopyInto(*out) } in.Resources.DeepCopyInto(&out.Resources) + if in.Deployment != nil { + in, out := &in.Deployment, &out.Deployment + *out = new(DeploymentSettings) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContourSettings. @@ -352,6 +358,26 @@ func (in *ContourSettings) DeepCopy() *ContourSettings { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DaemonSetSettings) DeepCopyInto(out *DaemonSetSettings) { + *out = *in + if in.UpdateStrategy != nil { + in, out := &in.UpdateStrategy, &out.UpdateStrategy + *out = new(appsv1.DaemonSetUpdateStrategy) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DaemonSetSettings. +func (in *DaemonSetSettings) DeepCopy() *DaemonSetSettings { + if in == nil { + return nil + } + out := new(DaemonSetSettings) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DebugConfig) DeepCopyInto(out *DebugConfig) { *out = *in @@ -367,6 +393,26 @@ func (in *DebugConfig) DeepCopy() *DebugConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeploymentSettings) DeepCopyInto(out *DeploymentSettings) { + *out = *in + if in.Strategy != nil { + in, out := &in.Strategy, &out.Strategy + *out = new(appsv1.DeploymentStrategy) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSettings. +func (in *DeploymentSettings) DeepCopy() *DeploymentSettings { + if in == nil { + return nil + } + out := new(DeploymentSettings) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EnvoyConfig) DeepCopyInto(out *EnvoyConfig) { *out = *in @@ -547,6 +593,16 @@ func (in *EnvoySettings) DeepCopyInto(out *EnvoySettings) { } } in.Resources.DeepCopyInto(&out.Resources) + if in.DaemonSet != nil { + in, out := &in.DaemonSet, &out.DaemonSet + *out = new(DaemonSetSettings) + (*in).DeepCopyInto(*out) + } + if in.Deployment != nil { + in, out := &in.Deployment, &out.Deployment + *out = new(DeploymentSettings) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoySettings. diff --git a/changelogs/unreleased/4713-izturn-deprecation.md b/changelogs/unreleased/4713-izturn-deprecation.md new file mode 100644 index 00000000000..e2c96b861f3 --- /dev/null +++ b/changelogs/unreleased/4713-izturn-deprecation.md @@ -0,0 +1,5 @@ +# ContourDeployment.Spec.Contour.Replicas and ContourDeployment.Spec.Envoy.Replicas are deprecated + +- `ContourDeployment.Spec.Contour.Replicas` is deprecated and has been replaced by `ContourDeployment.Spec.Contour.Deployment.Replicas`. Users should switch to using the new field. The deprecated field will be removed in a future release. See #4713 for additional details. + +- `ContourDeployment.Spec.Envoy.Replicas` is deprecated and has been replaced by `ContourDeployment.Spec.Envoy.Deployment.Replicas`. Users should switch to using the new field. The deprecated field will be removed in a future release. See #4713 for additional details. diff --git a/changelogs/unreleased/4713-izturn-small.md b/changelogs/unreleased/4713-izturn-small.md new file mode 100644 index 00000000000..b0266a8f969 --- /dev/null +++ b/changelogs/unreleased/4713-izturn-small.md @@ -0,0 +1 @@ +Add (update)Strategy configurability to ContourDeployment resource for components. \ No newline at end of file diff --git a/examples/contour/01-crds.yaml b/examples/contour/01-crds.yaml index b9d698f558c..5c067d5589d 100644 --- a/examples/contour/01-crds.yaml +++ b/examples/contour/01-crds.yaml @@ -854,6 +854,69 @@ spec: associated resources, including things like replica count for the Deployment, and node placement constraints for the pods. properties: + deployment: + description: Deployment describes the settings for running contour + as a `Deployment`. + properties: + replicas: + description: Replicas is the desired number of replicas. + format: int32 + minimum: 0 + type: integer + strategy: + description: Strategy describes the deployment strategy to + use to replace existing pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if DeploymentStrategyType = RollingUpdate. --- TODO: + Update this to follow our convention for oneOf, whatever + we decide it to be.' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be scheduled above the desired number of pods. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up. Defaults to 25%. + Example: when this is set to 30%, the new ReplicaSet + can be scaled up immediately when the rolling update + starts, such that the total number of old and new + pods do not exceed 130% of desired pods. Once old + pods have been killed, new ReplicaSet can be scaled + up further, ensuring that total number of pods running + at any time during the update is at most 130% of + desired pods.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be unavailable during the update. Value can be an + absolute number (ex: 5) or a percentage of desired + pods (ex: 10%). Absolute number is calculated from + percentage by rounding down. This can not be 0 if + MaxSurge is 0. Defaults to 25%. Example: when this + is set to 30%, the old ReplicaSet can be scaled + down to 70% of desired pods immediately when the + rolling update starts. Once new pods are ready, + old ReplicaSet can be scaled down further, followed + by scaling up the new ReplicaSet, ensuring that + the total number of pods available at all times + during the update is at least 70% of desired pods.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of deployment. Can be "Recreate" or + "RollingUpdate". Default is RollingUpdate. + type: string + type: object + type: object kubernetesLogLevel: description: KubernetesLogLevel Enable Kubernetes client debug logging with log level. If unset, defaults to 0. @@ -927,8 +990,10 @@ spec: type: array type: object replicas: - description: Replicas is the desired number of Contour replicas. - If unset, defaults to 2. + description: "Deprecated: Use `DeploymentSettings.Replicas` instead. + \n Replicas is the desired number of Contour replicas. If if + unset, defaults to 2. \n if both `DeploymentSettings.Replicas` + and this one is set, use `DeploymentSettings.Replicas`." format: int32 minimum: 0 type: integer @@ -967,6 +1032,144 @@ spec: or Deployment), node placement constraints for the pods, and various options for the Envoy service. properties: + daemonSet: + description: DaemonSet describes the settings for running envoy + as a `DaemonSet`. if `WorkloadType` is `Deployment`,it's must + be nil + properties: + updateStrategy: + description: Strategy describes the deployment strategy to + use to replace existing DaemonSet pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if type = "RollingUpdate". --- TODO: Update this to + follow our convention for oneOf, whatever we decide + it to be. Same as Deployment `strategy.rollingUpdate`. + See https://github.com/kubernetes/kubernetes/issues/35345' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of nodes with an + existing available DaemonSet pod that can have an + updated DaemonSet pod during during an update. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up to a minimum of 1. + Default value is 0. Example: when this is set to + 30%, at most 30% of the total number of nodes that + should be running the daemon pod (i.e. status.desiredNumberScheduled) + can have their a new pod created before the old + pod is marked as deleted. The update starts by launching + new pods on 30% of nodes. Once an updated pod is + available (Ready for at least minReadySeconds) the + old DaemonSet pod on that node is marked deleted. + If the old pod becomes unavailable for any reason + (Ready transitions to false, is evicted, or is drained) + an updated pod is immediatedly created on that node + without considering surge limits. Allowing surge + implies the possibility that the resources consumed + by the daemonset on any given node can double if + the readiness check fails, and so resource intensive + daemonsets should take into account that they may + cause evictions during disruption.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of DaemonSet pods + that can be unavailable during the update. Value + can be an absolute number (ex: 5) or a percentage + of total number of DaemonSet pods at the start of + the update (ex: 10%). Absolute number is calculated + from percentage by rounding up. This cannot be 0 + if MaxSurge is 0 Default value is 1. Example: when + this is set to 30%, at most 30% of the total number + of nodes that should be running the daemon pod (i.e. + status.desiredNumberScheduled) can have their pods + stopped for an update at any given time. The update + starts by stopping at most 30% of those DaemonSet + pods and then brings up new DaemonSet pods in their + place. Once the new pods are available, it then + proceeds onto other DaemonSet pods, thus ensuring + that at least 70% of original number of DaemonSet + pods are available at all times during the update.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of daemon set update. Can be "RollingUpdate" + or "OnDelete". Default is RollingUpdate. + type: string + type: object + type: object + deployment: + description: Deployment describes the settings for running envoy + as a `Deployment`. if `WorkloadType` is `DaemonSet`,it's must + be nil + properties: + replicas: + description: Replicas is the desired number of replicas. + format: int32 + minimum: 0 + type: integer + strategy: + description: Strategy describes the deployment strategy to + use to replace existing pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if DeploymentStrategyType = RollingUpdate. --- TODO: + Update this to follow our convention for oneOf, whatever + we decide it to be.' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be scheduled above the desired number of pods. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up. Defaults to 25%. + Example: when this is set to 30%, the new ReplicaSet + can be scaled up immediately when the rolling update + starts, such that the total number of old and new + pods do not exceed 130% of desired pods. Once old + pods have been killed, new ReplicaSet can be scaled + up further, ensuring that total number of pods running + at any time during the update is at most 130% of + desired pods.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be unavailable during the update. Value can be an + absolute number (ex: 5) or a percentage of desired + pods (ex: 10%). Absolute number is calculated from + percentage by rounding down. This can not be 0 if + MaxSurge is 0. Defaults to 25%. Example: when this + is set to 30%, the old ReplicaSet can be scaled + down to 70% of desired pods immediately when the + rolling update starts. Once new pods are ready, + old ReplicaSet can be scaled down further, followed + by scaling up the new ReplicaSet, ensuring that + the total number of pods available at all times + during the update is at least 70% of desired pods.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of deployment. Can be "Recreate" or + "RollingUpdate". Default is RollingUpdate. + type: string + type: object + type: object extraVolumeMounts: description: ExtraVolumeMounts holds the extra volume mounts to add (normally used with extraVolumes). @@ -2671,9 +2874,11 @@ spec: Envoy pods. type: object replicas: - description: Replicas is the desired number of Envoy replicas. - If WorkloadType is not "Deployment", this field is ignored. - Otherwise, if unset, defaults to 2. + description: "Deprecated: Use `DeploymentSettings.Replicas` instead. + \n Replicas is the desired number of Envoy replicas. If WorkloadType + is not \"Deployment\", this field is ignored. Otherwise, if + unset, defaults to 2. \n if both `DeploymentSettings.Replicas` + and this one is set, use `DeploymentSettings.Replicas`." format: int32 minimum: 0 type: integer diff --git a/examples/render/contour-deployment.yaml b/examples/render/contour-deployment.yaml index 63aed8aa676..eaa960c9585 100644 --- a/examples/render/contour-deployment.yaml +++ b/examples/render/contour-deployment.yaml @@ -1063,6 +1063,69 @@ spec: associated resources, including things like replica count for the Deployment, and node placement constraints for the pods. properties: + deployment: + description: Deployment describes the settings for running contour + as a `Deployment`. + properties: + replicas: + description: Replicas is the desired number of replicas. + format: int32 + minimum: 0 + type: integer + strategy: + description: Strategy describes the deployment strategy to + use to replace existing pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if DeploymentStrategyType = RollingUpdate. --- TODO: + Update this to follow our convention for oneOf, whatever + we decide it to be.' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be scheduled above the desired number of pods. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up. Defaults to 25%. + Example: when this is set to 30%, the new ReplicaSet + can be scaled up immediately when the rolling update + starts, such that the total number of old and new + pods do not exceed 130% of desired pods. Once old + pods have been killed, new ReplicaSet can be scaled + up further, ensuring that total number of pods running + at any time during the update is at most 130% of + desired pods.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be unavailable during the update. Value can be an + absolute number (ex: 5) or a percentage of desired + pods (ex: 10%). Absolute number is calculated from + percentage by rounding down. This can not be 0 if + MaxSurge is 0. Defaults to 25%. Example: when this + is set to 30%, the old ReplicaSet can be scaled + down to 70% of desired pods immediately when the + rolling update starts. Once new pods are ready, + old ReplicaSet can be scaled down further, followed + by scaling up the new ReplicaSet, ensuring that + the total number of pods available at all times + during the update is at least 70% of desired pods.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of deployment. Can be "Recreate" or + "RollingUpdate". Default is RollingUpdate. + type: string + type: object + type: object kubernetesLogLevel: description: KubernetesLogLevel Enable Kubernetes client debug logging with log level. If unset, defaults to 0. @@ -1136,8 +1199,10 @@ spec: type: array type: object replicas: - description: Replicas is the desired number of Contour replicas. - If unset, defaults to 2. + description: "Deprecated: Use `DeploymentSettings.Replicas` instead. + \n Replicas is the desired number of Contour replicas. If if + unset, defaults to 2. \n if both `DeploymentSettings.Replicas` + and this one is set, use `DeploymentSettings.Replicas`." format: int32 minimum: 0 type: integer @@ -1176,6 +1241,144 @@ spec: or Deployment), node placement constraints for the pods, and various options for the Envoy service. properties: + daemonSet: + description: DaemonSet describes the settings for running envoy + as a `DaemonSet`. if `WorkloadType` is `Deployment`,it's must + be nil + properties: + updateStrategy: + description: Strategy describes the deployment strategy to + use to replace existing DaemonSet pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if type = "RollingUpdate". --- TODO: Update this to + follow our convention for oneOf, whatever we decide + it to be. Same as Deployment `strategy.rollingUpdate`. + See https://github.com/kubernetes/kubernetes/issues/35345' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of nodes with an + existing available DaemonSet pod that can have an + updated DaemonSet pod during during an update. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up to a minimum of 1. + Default value is 0. Example: when this is set to + 30%, at most 30% of the total number of nodes that + should be running the daemon pod (i.e. status.desiredNumberScheduled) + can have their a new pod created before the old + pod is marked as deleted. The update starts by launching + new pods on 30% of nodes. Once an updated pod is + available (Ready for at least minReadySeconds) the + old DaemonSet pod on that node is marked deleted. + If the old pod becomes unavailable for any reason + (Ready transitions to false, is evicted, or is drained) + an updated pod is immediatedly created on that node + without considering surge limits. Allowing surge + implies the possibility that the resources consumed + by the daemonset on any given node can double if + the readiness check fails, and so resource intensive + daemonsets should take into account that they may + cause evictions during disruption.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of DaemonSet pods + that can be unavailable during the update. Value + can be an absolute number (ex: 5) or a percentage + of total number of DaemonSet pods at the start of + the update (ex: 10%). Absolute number is calculated + from percentage by rounding up. This cannot be 0 + if MaxSurge is 0 Default value is 1. Example: when + this is set to 30%, at most 30% of the total number + of nodes that should be running the daemon pod (i.e. + status.desiredNumberScheduled) can have their pods + stopped for an update at any given time. The update + starts by stopping at most 30% of those DaemonSet + pods and then brings up new DaemonSet pods in their + place. Once the new pods are available, it then + proceeds onto other DaemonSet pods, thus ensuring + that at least 70% of original number of DaemonSet + pods are available at all times during the update.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of daemon set update. Can be "RollingUpdate" + or "OnDelete". Default is RollingUpdate. + type: string + type: object + type: object + deployment: + description: Deployment describes the settings for running envoy + as a `Deployment`. if `WorkloadType` is `DaemonSet`,it's must + be nil + properties: + replicas: + description: Replicas is the desired number of replicas. + format: int32 + minimum: 0 + type: integer + strategy: + description: Strategy describes the deployment strategy to + use to replace existing pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if DeploymentStrategyType = RollingUpdate. --- TODO: + Update this to follow our convention for oneOf, whatever + we decide it to be.' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be scheduled above the desired number of pods. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up. Defaults to 25%. + Example: when this is set to 30%, the new ReplicaSet + can be scaled up immediately when the rolling update + starts, such that the total number of old and new + pods do not exceed 130% of desired pods. Once old + pods have been killed, new ReplicaSet can be scaled + up further, ensuring that total number of pods running + at any time during the update is at most 130% of + desired pods.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be unavailable during the update. Value can be an + absolute number (ex: 5) or a percentage of desired + pods (ex: 10%). Absolute number is calculated from + percentage by rounding down. This can not be 0 if + MaxSurge is 0. Defaults to 25%. Example: when this + is set to 30%, the old ReplicaSet can be scaled + down to 70% of desired pods immediately when the + rolling update starts. Once new pods are ready, + old ReplicaSet can be scaled down further, followed + by scaling up the new ReplicaSet, ensuring that + the total number of pods available at all times + during the update is at least 70% of desired pods.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of deployment. Can be "Recreate" or + "RollingUpdate". Default is RollingUpdate. + type: string + type: object + type: object extraVolumeMounts: description: ExtraVolumeMounts holds the extra volume mounts to add (normally used with extraVolumes). @@ -2880,9 +3083,11 @@ spec: Envoy pods. type: object replicas: - description: Replicas is the desired number of Envoy replicas. - If WorkloadType is not "Deployment", this field is ignored. - Otherwise, if unset, defaults to 2. + description: "Deprecated: Use `DeploymentSettings.Replicas` instead. + \n Replicas is the desired number of Envoy replicas. If WorkloadType + is not \"Deployment\", this field is ignored. Otherwise, if + unset, defaults to 2. \n if both `DeploymentSettings.Replicas` + and this one is set, use `DeploymentSettings.Replicas`." format: int32 minimum: 0 type: integer diff --git a/examples/render/contour-gateway-provisioner.yaml b/examples/render/contour-gateway-provisioner.yaml index df429515158..58603832e31 100644 --- a/examples/render/contour-gateway-provisioner.yaml +++ b/examples/render/contour-gateway-provisioner.yaml @@ -868,6 +868,69 @@ spec: associated resources, including things like replica count for the Deployment, and node placement constraints for the pods. properties: + deployment: + description: Deployment describes the settings for running contour + as a `Deployment`. + properties: + replicas: + description: Replicas is the desired number of replicas. + format: int32 + minimum: 0 + type: integer + strategy: + description: Strategy describes the deployment strategy to + use to replace existing pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if DeploymentStrategyType = RollingUpdate. --- TODO: + Update this to follow our convention for oneOf, whatever + we decide it to be.' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be scheduled above the desired number of pods. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up. Defaults to 25%. + Example: when this is set to 30%, the new ReplicaSet + can be scaled up immediately when the rolling update + starts, such that the total number of old and new + pods do not exceed 130% of desired pods. Once old + pods have been killed, new ReplicaSet can be scaled + up further, ensuring that total number of pods running + at any time during the update is at most 130% of + desired pods.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be unavailable during the update. Value can be an + absolute number (ex: 5) or a percentage of desired + pods (ex: 10%). Absolute number is calculated from + percentage by rounding down. This can not be 0 if + MaxSurge is 0. Defaults to 25%. Example: when this + is set to 30%, the old ReplicaSet can be scaled + down to 70% of desired pods immediately when the + rolling update starts. Once new pods are ready, + old ReplicaSet can be scaled down further, followed + by scaling up the new ReplicaSet, ensuring that + the total number of pods available at all times + during the update is at least 70% of desired pods.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of deployment. Can be "Recreate" or + "RollingUpdate". Default is RollingUpdate. + type: string + type: object + type: object kubernetesLogLevel: description: KubernetesLogLevel Enable Kubernetes client debug logging with log level. If unset, defaults to 0. @@ -941,8 +1004,10 @@ spec: type: array type: object replicas: - description: Replicas is the desired number of Contour replicas. - If unset, defaults to 2. + description: "Deprecated: Use `DeploymentSettings.Replicas` instead. + \n Replicas is the desired number of Contour replicas. If if + unset, defaults to 2. \n if both `DeploymentSettings.Replicas` + and this one is set, use `DeploymentSettings.Replicas`." format: int32 minimum: 0 type: integer @@ -981,6 +1046,144 @@ spec: or Deployment), node placement constraints for the pods, and various options for the Envoy service. properties: + daemonSet: + description: DaemonSet describes the settings for running envoy + as a `DaemonSet`. if `WorkloadType` is `Deployment`,it's must + be nil + properties: + updateStrategy: + description: Strategy describes the deployment strategy to + use to replace existing DaemonSet pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if type = "RollingUpdate". --- TODO: Update this to + follow our convention for oneOf, whatever we decide + it to be. Same as Deployment `strategy.rollingUpdate`. + See https://github.com/kubernetes/kubernetes/issues/35345' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of nodes with an + existing available DaemonSet pod that can have an + updated DaemonSet pod during during an update. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up to a minimum of 1. + Default value is 0. Example: when this is set to + 30%, at most 30% of the total number of nodes that + should be running the daemon pod (i.e. status.desiredNumberScheduled) + can have their a new pod created before the old + pod is marked as deleted. The update starts by launching + new pods on 30% of nodes. Once an updated pod is + available (Ready for at least minReadySeconds) the + old DaemonSet pod on that node is marked deleted. + If the old pod becomes unavailable for any reason + (Ready transitions to false, is evicted, or is drained) + an updated pod is immediatedly created on that node + without considering surge limits. Allowing surge + implies the possibility that the resources consumed + by the daemonset on any given node can double if + the readiness check fails, and so resource intensive + daemonsets should take into account that they may + cause evictions during disruption.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of DaemonSet pods + that can be unavailable during the update. Value + can be an absolute number (ex: 5) or a percentage + of total number of DaemonSet pods at the start of + the update (ex: 10%). Absolute number is calculated + from percentage by rounding up. This cannot be 0 + if MaxSurge is 0 Default value is 1. Example: when + this is set to 30%, at most 30% of the total number + of nodes that should be running the daemon pod (i.e. + status.desiredNumberScheduled) can have their pods + stopped for an update at any given time. The update + starts by stopping at most 30% of those DaemonSet + pods and then brings up new DaemonSet pods in their + place. Once the new pods are available, it then + proceeds onto other DaemonSet pods, thus ensuring + that at least 70% of original number of DaemonSet + pods are available at all times during the update.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of daemon set update. Can be "RollingUpdate" + or "OnDelete". Default is RollingUpdate. + type: string + type: object + type: object + deployment: + description: Deployment describes the settings for running envoy + as a `Deployment`. if `WorkloadType` is `DaemonSet`,it's must + be nil + properties: + replicas: + description: Replicas is the desired number of replicas. + format: int32 + minimum: 0 + type: integer + strategy: + description: Strategy describes the deployment strategy to + use to replace existing pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if DeploymentStrategyType = RollingUpdate. --- TODO: + Update this to follow our convention for oneOf, whatever + we decide it to be.' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be scheduled above the desired number of pods. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up. Defaults to 25%. + Example: when this is set to 30%, the new ReplicaSet + can be scaled up immediately when the rolling update + starts, such that the total number of old and new + pods do not exceed 130% of desired pods. Once old + pods have been killed, new ReplicaSet can be scaled + up further, ensuring that total number of pods running + at any time during the update is at most 130% of + desired pods.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be unavailable during the update. Value can be an + absolute number (ex: 5) or a percentage of desired + pods (ex: 10%). Absolute number is calculated from + percentage by rounding down. This can not be 0 if + MaxSurge is 0. Defaults to 25%. Example: when this + is set to 30%, the old ReplicaSet can be scaled + down to 70% of desired pods immediately when the + rolling update starts. Once new pods are ready, + old ReplicaSet can be scaled down further, followed + by scaling up the new ReplicaSet, ensuring that + the total number of pods available at all times + during the update is at least 70% of desired pods.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of deployment. Can be "Recreate" or + "RollingUpdate". Default is RollingUpdate. + type: string + type: object + type: object extraVolumeMounts: description: ExtraVolumeMounts holds the extra volume mounts to add (normally used with extraVolumes). @@ -2685,9 +2888,11 @@ spec: Envoy pods. type: object replicas: - description: Replicas is the desired number of Envoy replicas. - If WorkloadType is not "Deployment", this field is ignored. - Otherwise, if unset, defaults to 2. + description: "Deprecated: Use `DeploymentSettings.Replicas` instead. + \n Replicas is the desired number of Envoy replicas. If WorkloadType + is not \"Deployment\", this field is ignored. Otherwise, if + unset, defaults to 2. \n if both `DeploymentSettings.Replicas` + and this one is set, use `DeploymentSettings.Replicas`." format: int32 minimum: 0 type: integer diff --git a/examples/render/contour-gateway.yaml b/examples/render/contour-gateway.yaml index ba02b629010..1367e12c529 100644 --- a/examples/render/contour-gateway.yaml +++ b/examples/render/contour-gateway.yaml @@ -1069,6 +1069,69 @@ spec: associated resources, including things like replica count for the Deployment, and node placement constraints for the pods. properties: + deployment: + description: Deployment describes the settings for running contour + as a `Deployment`. + properties: + replicas: + description: Replicas is the desired number of replicas. + format: int32 + minimum: 0 + type: integer + strategy: + description: Strategy describes the deployment strategy to + use to replace existing pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if DeploymentStrategyType = RollingUpdate. --- TODO: + Update this to follow our convention for oneOf, whatever + we decide it to be.' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be scheduled above the desired number of pods. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up. Defaults to 25%. + Example: when this is set to 30%, the new ReplicaSet + can be scaled up immediately when the rolling update + starts, such that the total number of old and new + pods do not exceed 130% of desired pods. Once old + pods have been killed, new ReplicaSet can be scaled + up further, ensuring that total number of pods running + at any time during the update is at most 130% of + desired pods.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be unavailable during the update. Value can be an + absolute number (ex: 5) or a percentage of desired + pods (ex: 10%). Absolute number is calculated from + percentage by rounding down. This can not be 0 if + MaxSurge is 0. Defaults to 25%. Example: when this + is set to 30%, the old ReplicaSet can be scaled + down to 70% of desired pods immediately when the + rolling update starts. Once new pods are ready, + old ReplicaSet can be scaled down further, followed + by scaling up the new ReplicaSet, ensuring that + the total number of pods available at all times + during the update is at least 70% of desired pods.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of deployment. Can be "Recreate" or + "RollingUpdate". Default is RollingUpdate. + type: string + type: object + type: object kubernetesLogLevel: description: KubernetesLogLevel Enable Kubernetes client debug logging with log level. If unset, defaults to 0. @@ -1142,8 +1205,10 @@ spec: type: array type: object replicas: - description: Replicas is the desired number of Contour replicas. - If unset, defaults to 2. + description: "Deprecated: Use `DeploymentSettings.Replicas` instead. + \n Replicas is the desired number of Contour replicas. If if + unset, defaults to 2. \n if both `DeploymentSettings.Replicas` + and this one is set, use `DeploymentSettings.Replicas`." format: int32 minimum: 0 type: integer @@ -1182,6 +1247,144 @@ spec: or Deployment), node placement constraints for the pods, and various options for the Envoy service. properties: + daemonSet: + description: DaemonSet describes the settings for running envoy + as a `DaemonSet`. if `WorkloadType` is `Deployment`,it's must + be nil + properties: + updateStrategy: + description: Strategy describes the deployment strategy to + use to replace existing DaemonSet pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if type = "RollingUpdate". --- TODO: Update this to + follow our convention for oneOf, whatever we decide + it to be. Same as Deployment `strategy.rollingUpdate`. + See https://github.com/kubernetes/kubernetes/issues/35345' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of nodes with an + existing available DaemonSet pod that can have an + updated DaemonSet pod during during an update. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up to a minimum of 1. + Default value is 0. Example: when this is set to + 30%, at most 30% of the total number of nodes that + should be running the daemon pod (i.e. status.desiredNumberScheduled) + can have their a new pod created before the old + pod is marked as deleted. The update starts by launching + new pods on 30% of nodes. Once an updated pod is + available (Ready for at least minReadySeconds) the + old DaemonSet pod on that node is marked deleted. + If the old pod becomes unavailable for any reason + (Ready transitions to false, is evicted, or is drained) + an updated pod is immediatedly created on that node + without considering surge limits. Allowing surge + implies the possibility that the resources consumed + by the daemonset on any given node can double if + the readiness check fails, and so resource intensive + daemonsets should take into account that they may + cause evictions during disruption.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of DaemonSet pods + that can be unavailable during the update. Value + can be an absolute number (ex: 5) or a percentage + of total number of DaemonSet pods at the start of + the update (ex: 10%). Absolute number is calculated + from percentage by rounding up. This cannot be 0 + if MaxSurge is 0 Default value is 1. Example: when + this is set to 30%, at most 30% of the total number + of nodes that should be running the daemon pod (i.e. + status.desiredNumberScheduled) can have their pods + stopped for an update at any given time. The update + starts by stopping at most 30% of those DaemonSet + pods and then brings up new DaemonSet pods in their + place. Once the new pods are available, it then + proceeds onto other DaemonSet pods, thus ensuring + that at least 70% of original number of DaemonSet + pods are available at all times during the update.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of daemon set update. Can be "RollingUpdate" + or "OnDelete". Default is RollingUpdate. + type: string + type: object + type: object + deployment: + description: Deployment describes the settings for running envoy + as a `Deployment`. if `WorkloadType` is `DaemonSet`,it's must + be nil + properties: + replicas: + description: Replicas is the desired number of replicas. + format: int32 + minimum: 0 + type: integer + strategy: + description: Strategy describes the deployment strategy to + use to replace existing pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if DeploymentStrategyType = RollingUpdate. --- TODO: + Update this to follow our convention for oneOf, whatever + we decide it to be.' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be scheduled above the desired number of pods. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up. Defaults to 25%. + Example: when this is set to 30%, the new ReplicaSet + can be scaled up immediately when the rolling update + starts, such that the total number of old and new + pods do not exceed 130% of desired pods. Once old + pods have been killed, new ReplicaSet can be scaled + up further, ensuring that total number of pods running + at any time during the update is at most 130% of + desired pods.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be unavailable during the update. Value can be an + absolute number (ex: 5) or a percentage of desired + pods (ex: 10%). Absolute number is calculated from + percentage by rounding down. This can not be 0 if + MaxSurge is 0. Defaults to 25%. Example: when this + is set to 30%, the old ReplicaSet can be scaled + down to 70% of desired pods immediately when the + rolling update starts. Once new pods are ready, + old ReplicaSet can be scaled down further, followed + by scaling up the new ReplicaSet, ensuring that + the total number of pods available at all times + during the update is at least 70% of desired pods.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of deployment. Can be "Recreate" or + "RollingUpdate". Default is RollingUpdate. + type: string + type: object + type: object extraVolumeMounts: description: ExtraVolumeMounts holds the extra volume mounts to add (normally used with extraVolumes). @@ -2886,9 +3089,11 @@ spec: Envoy pods. type: object replicas: - description: Replicas is the desired number of Envoy replicas. - If WorkloadType is not "Deployment", this field is ignored. - Otherwise, if unset, defaults to 2. + description: "Deprecated: Use `DeploymentSettings.Replicas` instead. + \n Replicas is the desired number of Envoy replicas. If WorkloadType + is not \"Deployment\", this field is ignored. Otherwise, if + unset, defaults to 2. \n if both `DeploymentSettings.Replicas` + and this one is set, use `DeploymentSettings.Replicas`." format: int32 minimum: 0 type: integer diff --git a/examples/render/contour.yaml b/examples/render/contour.yaml index df8267eab82..f8629b1a798 100644 --- a/examples/render/contour.yaml +++ b/examples/render/contour.yaml @@ -1063,6 +1063,69 @@ spec: associated resources, including things like replica count for the Deployment, and node placement constraints for the pods. properties: + deployment: + description: Deployment describes the settings for running contour + as a `Deployment`. + properties: + replicas: + description: Replicas is the desired number of replicas. + format: int32 + minimum: 0 + type: integer + strategy: + description: Strategy describes the deployment strategy to + use to replace existing pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if DeploymentStrategyType = RollingUpdate. --- TODO: + Update this to follow our convention for oneOf, whatever + we decide it to be.' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be scheduled above the desired number of pods. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up. Defaults to 25%. + Example: when this is set to 30%, the new ReplicaSet + can be scaled up immediately when the rolling update + starts, such that the total number of old and new + pods do not exceed 130% of desired pods. Once old + pods have been killed, new ReplicaSet can be scaled + up further, ensuring that total number of pods running + at any time during the update is at most 130% of + desired pods.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be unavailable during the update. Value can be an + absolute number (ex: 5) or a percentage of desired + pods (ex: 10%). Absolute number is calculated from + percentage by rounding down. This can not be 0 if + MaxSurge is 0. Defaults to 25%. Example: when this + is set to 30%, the old ReplicaSet can be scaled + down to 70% of desired pods immediately when the + rolling update starts. Once new pods are ready, + old ReplicaSet can be scaled down further, followed + by scaling up the new ReplicaSet, ensuring that + the total number of pods available at all times + during the update is at least 70% of desired pods.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of deployment. Can be "Recreate" or + "RollingUpdate". Default is RollingUpdate. + type: string + type: object + type: object kubernetesLogLevel: description: KubernetesLogLevel Enable Kubernetes client debug logging with log level. If unset, defaults to 0. @@ -1136,8 +1199,10 @@ spec: type: array type: object replicas: - description: Replicas is the desired number of Contour replicas. - If unset, defaults to 2. + description: "Deprecated: Use `DeploymentSettings.Replicas` instead. + \n Replicas is the desired number of Contour replicas. If if + unset, defaults to 2. \n if both `DeploymentSettings.Replicas` + and this one is set, use `DeploymentSettings.Replicas`." format: int32 minimum: 0 type: integer @@ -1176,6 +1241,144 @@ spec: or Deployment), node placement constraints for the pods, and various options for the Envoy service. properties: + daemonSet: + description: DaemonSet describes the settings for running envoy + as a `DaemonSet`. if `WorkloadType` is `Deployment`,it's must + be nil + properties: + updateStrategy: + description: Strategy describes the deployment strategy to + use to replace existing DaemonSet pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if type = "RollingUpdate". --- TODO: Update this to + follow our convention for oneOf, whatever we decide + it to be. Same as Deployment `strategy.rollingUpdate`. + See https://github.com/kubernetes/kubernetes/issues/35345' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of nodes with an + existing available DaemonSet pod that can have an + updated DaemonSet pod during during an update. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up to a minimum of 1. + Default value is 0. Example: when this is set to + 30%, at most 30% of the total number of nodes that + should be running the daemon pod (i.e. status.desiredNumberScheduled) + can have their a new pod created before the old + pod is marked as deleted. The update starts by launching + new pods on 30% of nodes. Once an updated pod is + available (Ready for at least minReadySeconds) the + old DaemonSet pod on that node is marked deleted. + If the old pod becomes unavailable for any reason + (Ready transitions to false, is evicted, or is drained) + an updated pod is immediatedly created on that node + without considering surge limits. Allowing surge + implies the possibility that the resources consumed + by the daemonset on any given node can double if + the readiness check fails, and so resource intensive + daemonsets should take into account that they may + cause evictions during disruption.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of DaemonSet pods + that can be unavailable during the update. Value + can be an absolute number (ex: 5) or a percentage + of total number of DaemonSet pods at the start of + the update (ex: 10%). Absolute number is calculated + from percentage by rounding up. This cannot be 0 + if MaxSurge is 0 Default value is 1. Example: when + this is set to 30%, at most 30% of the total number + of nodes that should be running the daemon pod (i.e. + status.desiredNumberScheduled) can have their pods + stopped for an update at any given time. The update + starts by stopping at most 30% of those DaemonSet + pods and then brings up new DaemonSet pods in their + place. Once the new pods are available, it then + proceeds onto other DaemonSet pods, thus ensuring + that at least 70% of original number of DaemonSet + pods are available at all times during the update.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of daemon set update. Can be "RollingUpdate" + or "OnDelete". Default is RollingUpdate. + type: string + type: object + type: object + deployment: + description: Deployment describes the settings for running envoy + as a `Deployment`. if `WorkloadType` is `DaemonSet`,it's must + be nil + properties: + replicas: + description: Replicas is the desired number of replicas. + format: int32 + minimum: 0 + type: integer + strategy: + description: Strategy describes the deployment strategy to + use to replace existing pods with new pods. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only + if DeploymentStrategyType = RollingUpdate. --- TODO: + Update this to follow our convention for oneOf, whatever + we decide it to be.' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be scheduled above the desired number of pods. Value + can be an absolute number (ex: 5) or a percentage + of desired pods (ex: 10%). This can not be 0 if + MaxUnavailable is 0. Absolute number is calculated + from percentage by rounding up. Defaults to 25%. + Example: when this is set to 30%, the new ReplicaSet + can be scaled up immediately when the rolling update + starts, such that the total number of old and new + pods do not exceed 130% of desired pods. Once old + pods have been killed, new ReplicaSet can be scaled + up further, ensuring that total number of pods running + at any time during the update is at most 130% of + desired pods.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of pods that can + be unavailable during the update. Value can be an + absolute number (ex: 5) or a percentage of desired + pods (ex: 10%). Absolute number is calculated from + percentage by rounding down. This can not be 0 if + MaxSurge is 0. Defaults to 25%. Example: when this + is set to 30%, the old ReplicaSet can be scaled + down to 70% of desired pods immediately when the + rolling update starts. Once new pods are ready, + old ReplicaSet can be scaled down further, followed + by scaling up the new ReplicaSet, ensuring that + the total number of pods available at all times + during the update is at least 70% of desired pods.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of deployment. Can be "Recreate" or + "RollingUpdate". Default is RollingUpdate. + type: string + type: object + type: object extraVolumeMounts: description: ExtraVolumeMounts holds the extra volume mounts to add (normally used with extraVolumes). @@ -2880,9 +3083,11 @@ spec: Envoy pods. type: object replicas: - description: Replicas is the desired number of Envoy replicas. - If WorkloadType is not "Deployment", this field is ignored. - Otherwise, if unset, defaults to 2. + description: "Deprecated: Use `DeploymentSettings.Replicas` instead. + \n Replicas is the desired number of Envoy replicas. If WorkloadType + is not \"Deployment\", this field is ignored. Otherwise, if + unset, defaults to 2. \n if both `DeploymentSettings.Replicas` + and this one is set, use `DeploymentSettings.Replicas`." format: int32 minimum: 0 type: integer diff --git a/internal/provisioner/controller/gateway.go b/internal/provisioner/controller/gateway.go index 08425bdbd2f..7c99e6716bf 100644 --- a/internal/provisioner/controller/gateway.go +++ b/internal/provisioner/controller/gateway.go @@ -239,9 +239,13 @@ func (r *gatewayReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct } if gatewayClassParams.Spec.Contour != nil { + if gatewayClassParams.Spec.Contour.Replicas > 0 { // nolint:staticcheck + contourModel.Spec.ContourReplicas = gatewayClassParams.Spec.Contour.Replicas // nolint:staticcheck + } + // Deployment replicas - if gatewayClassParams.Spec.Contour.Replicas > 0 { - contourModel.Spec.ContourReplicas = gatewayClassParams.Spec.Contour.Replicas + if gatewayClassParams.Spec.Contour.Deployment != nil && gatewayClassParams.Spec.Contour.Deployment.Replicas > 0 { + contourModel.Spec.ContourReplicas = gatewayClassParams.Spec.Contour.Deployment.Replicas } // Node placement @@ -261,6 +265,11 @@ func (r *gatewayReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct contourModel.Spec.ContourLogLevel = gatewayClassParams.Spec.Contour.LogLevel contourModel.Spec.KubernetesLogLevel = gatewayClassParams.Spec.Contour.KubernetesLogLevel + + if gatewayClassParams.Spec.Contour.Deployment != nil && + gatewayClassParams.Spec.Contour.Deployment.Strategy != nil { + contourModel.Spec.ContourDeploymentStrategy = *gatewayClassParams.Spec.Contour.Deployment.Strategy + } } if gatewayClassParams.Spec.Envoy != nil { @@ -272,9 +281,14 @@ func (r *gatewayReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct } // Deployment replicas - if gatewayClassParams.Spec.Envoy.WorkloadType == contour_api_v1alpha1.WorkloadTypeDeployment && - gatewayClassParams.Spec.Envoy.Replicas > 0 { - contourModel.Spec.EnvoyReplicas = gatewayClassParams.Spec.Envoy.Replicas + if gatewayClassParams.Spec.Envoy.WorkloadType == contour_api_v1alpha1.WorkloadTypeDeployment { + if gatewayClassParams.Spec.Envoy.Replicas > 0 { // nolint:staticcheck + contourModel.Spec.EnvoyReplicas = gatewayClassParams.Spec.Envoy.Replicas // nolint:staticcheck + } + + if gatewayClassParams.Spec.Envoy.Deployment != nil && gatewayClassParams.Spec.Envoy.Deployment.Replicas > 0 { + contourModel.Spec.EnvoyReplicas = gatewayClassParams.Spec.Envoy.Deployment.Replicas + } } // Network publishing @@ -319,6 +333,18 @@ func (r *gatewayReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct contourModel.Spec.EnvoyLogLevel = gatewayClassParams.Spec.Envoy.LogLevel } + if gatewayClassParams.Spec.Envoy.WorkloadType == contour_api_v1alpha1.WorkloadTypeDeployment && + gatewayClassParams.Spec.Envoy.Deployment != nil && + gatewayClassParams.Spec.Envoy.Deployment.Strategy != nil { + contourModel.Spec.EnvoyDeploymentStrategy = *gatewayClassParams.Spec.Envoy.Deployment.Strategy + } + + if gatewayClassParams.Spec.Envoy.WorkloadType == contour_api_v1alpha1.WorkloadTypeDaemonSet && + gatewayClassParams.Spec.Envoy.DaemonSet != nil && + gatewayClassParams.Spec.Envoy.DaemonSet.UpdateStrategy != nil { + contourModel.Spec.EnvoyDaemonSetUpdateStrategy = *gatewayClassParams.Spec.Envoy.DaemonSet.UpdateStrategy + } + } } diff --git a/internal/provisioner/controller/gateway_test.go b/internal/provisioner/controller/gateway_test.go index 8610b9d38c6..2d771428cfd 100644 --- a/internal/provisioner/controller/gateway_test.go +++ b/internal/provisioner/controller/gateway_test.go @@ -719,7 +719,7 @@ func TestGatewayReconcile(t *testing.T) { assert.EqualValues(t, 2, *deploy.Spec.Replicas) }, }, - "If ContourDeployment.Spec.Contour.Replicas is specified, the Contour deployment gets that number of replicas": { + "If ContourDeployment.Spec.Contour.Deployment is specified, the Contour deployment gets that settings": { gatewayClass: reconcilableGatewayClassWithParams("gatewayclass-1", controller), gatewayClassParams: &contourv1alpha1.ContourDeployment{ ObjectMeta: metav1.ObjectMeta{ @@ -729,6 +729,12 @@ func TestGatewayReconcile(t *testing.T) { Spec: contourv1alpha1.ContourDeploymentSpec{ Contour: &contourv1alpha1.ContourSettings{ Replicas: 3, + Deployment: &contourv1alpha1.DeploymentSettings{ + Replicas: 4, + Strategy: &appsv1.DeploymentStrategy{ + Type: appsv1.RecreateDeploymentStrategyType, + }, + }, }, }, }, @@ -760,7 +766,9 @@ func TestGatewayReconcile(t *testing.T) { require.NoError(t, r.client.Get(context.Background(), keyFor(deploy), deploy)) require.NotNil(t, deploy.Spec.Replicas) - assert.EqualValues(t, 3, *deploy.Spec.Replicas) + assert.EqualValues(t, 4, *deploy.Spec.Replicas) + require.NotNil(t, deploy.Spec.Strategy) + assert.EqualValues(t, appsv1.RecreateDeploymentStrategyType, deploy.Spec.Strategy.Type) }, }, "If ContourDeployment.Spec.Contour.NodePlacement is not specified, the Contour deployment has no node selector or tolerations set": { @@ -1111,6 +1119,72 @@ func TestGatewayReconcile(t *testing.T) { assert.True(t, errors.IsNotFound(err)) }, }, + "If ContourDeployment.Spec.Envoy.WorkloadType is set to Deployment," + + "an Envoy deployment is provisioned with the settings come from DeployemntSettings": { + gatewayClass: reconcilableGatewayClassWithParams("gatewayclass-1", controller), + gatewayClassParams: &contourv1alpha1.ContourDeployment{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "projectcontour", + Name: "gatewayclass-1-params", + }, + Spec: contourv1alpha1.ContourDeploymentSpec{ + Envoy: &contourv1alpha1.EnvoySettings{ + WorkloadType: contourv1alpha1.WorkloadTypeDeployment, + Replicas: 7, + Deployment: &contourv1alpha1.DeploymentSettings{ + Replicas: 6, + Strategy: &appsv1.DeploymentStrategy{ + Type: appsv1.RecreateDeploymentStrategyType, + }, + }, + }, + }, + }, + gateway: &gatewayv1beta1.Gateway{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "gateway-1", + Name: "gateway-1", + }, + Spec: gatewayv1beta1.GatewaySpec{ + GatewayClassName: gatewayv1beta1.ObjectName("gatewayclass-1"), + }, + }, + assertions: func(t *testing.T, r *gatewayReconciler, gw *gatewayv1beta1.Gateway, reconcileErr error) { + require.NoError(t, reconcileErr) + + // Verify the Gateway has a "Scheduled: true" condition + require.NoError(t, r.client.Get(context.Background(), keyFor(gw), gw)) + require.Len(t, gw.Status.Conditions, 1) + assert.Equal(t, string(gatewayv1beta1.GatewayConditionScheduled), gw.Status.Conditions[0].Type) + assert.Equal(t, metav1.ConditionTrue, gw.Status.Conditions[0].Status) + + // Verify the deployment has been created + deploy := &appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "gateway-1", + Name: "envoy-gateway-1", + }, + } + require.NoError(t, r.client.Get(context.Background(), keyFor(deploy), deploy)) + + assert.NotNil(t, deploy.Spec.Replicas) + assert.EqualValues(t, 6, *deploy.Spec.Replicas) + + assert.NotNil(t, deploy.Spec.Strategy) + assert.EqualValues(t, appsv1.RecreateDeploymentStrategyType, deploy.Spec.Strategy.Type) + + // Verify that a daemonset has *not* been created + ds := &appsv1.DaemonSet{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "gateway-1", + Name: "envoy-gateway-1", + }, + } + err := r.client.Get(context.Background(), keyFor(ds), ds) + assert.True(t, errors.IsNotFound(err)) + }, + }, + "If ContourDeployment.Spec.Envoy.PodAnnotations is specified, the Envoy pods' have annotations for prometheus & user-defined": { gatewayClass: reconcilableGatewayClassWithParams("gatewayclass-1", controller), gatewayClassParams: &contourv1alpha1.ContourDeployment{ @@ -1155,6 +1229,65 @@ func TestGatewayReconcile(t *testing.T) { assert.Contains(t, ds.Spec.Template.ObjectMeta.Annotations, "key") }, }, + + "If ContourDeployment.Spec.Envoy.WorkloadType is set to DaemonSet," + + "an Envoy daemonset is provisioned with the strategy that come from DaemonsetSettings": { + gatewayClass: reconcilableGatewayClassWithParams("gatewayclass-1", controller), + gatewayClassParams: &contourv1alpha1.ContourDeployment{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "projectcontour", + Name: "gatewayclass-1-params", + }, + Spec: contourv1alpha1.ContourDeploymentSpec{ + Envoy: &contourv1alpha1.EnvoySettings{ + WorkloadType: contourv1alpha1.WorkloadTypeDaemonSet, + DaemonSet: &contourv1alpha1.DaemonSetSettings{ + UpdateStrategy: &appsv1.DaemonSetUpdateStrategy{ + Type: appsv1.OnDeleteDaemonSetStrategyType, + }, + }, + }, + }, + }, + gateway: &gatewayv1beta1.Gateway{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "gateway-1", + Name: "gateway-1", + }, + Spec: gatewayv1beta1.GatewaySpec{ + GatewayClassName: gatewayv1beta1.ObjectName("gatewayclass-1"), + }, + }, + assertions: func(t *testing.T, r *gatewayReconciler, gw *gatewayv1beta1.Gateway, reconcileErr error) { + require.NoError(t, reconcileErr) + + // Verify the Gateway has a "Scheduled: true" condition + require.NoError(t, r.client.Get(context.Background(), keyFor(gw), gw)) + require.Len(t, gw.Status.Conditions, 1) + assert.Equal(t, string(gatewayv1beta1.GatewayConditionScheduled), gw.Status.Conditions[0].Type) + assert.Equal(t, metav1.ConditionTrue, gw.Status.Conditions[0].Status) + + // Verify the daemonset has been created + ds := &appsv1.DaemonSet{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "gateway-1", + Name: "envoy-gateway-1", + }, + } + require.NoError(t, r.client.Get(context.Background(), keyFor(ds), ds)) + assert.EqualValues(t, appsv1.OnDeleteDaemonSetStrategyType, ds.Spec.UpdateStrategy.Type) + + // Verify that a deployment has *not* been created + deployment := &appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "gateway-1", + Name: "envoy-gateway-1", + }, + } + err := r.client.Get(context.Background(), keyFor(deployment), deployment) + assert.True(t, errors.IsNotFound(err)) + }, + }, } for name, tc := range tests { diff --git a/internal/provisioner/model/model.go b/internal/provisioner/model/model.go index 55bad861a99..729a03f2317 100644 --- a/internal/provisioner/model/model.go +++ b/internal/provisioner/model/model.go @@ -15,8 +15,12 @@ package model import ( contourv1alpha1 "github.com/projectcontour/contour/apis/projectcontour/v1alpha1" + opintstr "github.com/projectcontour/contour/internal/provisioner/intstr" + + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/utils/pointer" ) @@ -55,6 +59,25 @@ func Default(namespace, name string) *Contour { }, }, }, + EnvoyDaemonSetUpdateStrategy: appsv1.DaemonSetUpdateStrategy{ + Type: appsv1.RollingUpdateDaemonSetStrategyType, + RollingUpdate: &appsv1.RollingUpdateDaemonSet{ + MaxUnavailable: opintstr.PointerTo(intstr.FromString("10%")), + }, + }, + EnvoyDeploymentStrategy: appsv1.DeploymentStrategy{ + Type: appsv1.RollingUpdateDeploymentStrategyType, + RollingUpdate: &appsv1.RollingUpdateDeployment{ + MaxSurge: opintstr.PointerTo(intstr.FromString("10%")), + }, + }, + ContourDeploymentStrategy: appsv1.DeploymentStrategy{ + Type: appsv1.RollingUpdateDeploymentStrategyType, + RollingUpdate: &appsv1.RollingUpdateDeployment{ + MaxSurge: opintstr.PointerTo(intstr.FromString("50%")), + MaxUnavailable: opintstr.PointerTo(intstr.FromString("25%")), + }, + }, ResourceLabels: map[string]string{}, EnvoyPodAnnotations: map[string]string{}, }, @@ -171,6 +194,19 @@ type ContourSpec struct { // defaults to 0. KubernetesLogLevel uint8 + // An update strategy to replace existing Envoy DaemonSet pods with new pods. + // when envoy be running as a `Deployment`,it's must be nil + // +optional + EnvoyDaemonSetUpdateStrategy appsv1.DaemonSetUpdateStrategy + + // The deployment strategy to use to replace existing Envoy pods with new ones. + // when envoy be running as a `DaemonSet`,it's must be nil + EnvoyDeploymentStrategy appsv1.DeploymentStrategy + + // The deployment strategy to use to replace existing Contour pods with new ones. + // when envoy be running as a `DaemonSet`,it's must be nil + ContourDeploymentStrategy appsv1.DeploymentStrategy + // ResourceLabels is a set of labels to add to the provisioned Contour resource(s). ResourceLabels map[string]string diff --git a/internal/provisioner/objects/dataplane/dataplane.go b/internal/provisioner/objects/dataplane/dataplane.go index 26ed3b411f4..0e2b8faa0ab 100644 --- a/internal/provisioner/objects/dataplane/dataplane.go +++ b/internal/provisioner/objects/dataplane/dataplane.go @@ -19,7 +19,6 @@ import ( "path/filepath" "github.com/projectcontour/contour/internal/provisioner/equality" - opintstr "github.com/projectcontour/contour/internal/provisioner/intstr" "github.com/projectcontour/contour/internal/provisioner/labels" "github.com/projectcontour/contour/internal/provisioner/model" "github.com/projectcontour/contour/internal/provisioner/objects" @@ -327,13 +326,8 @@ func DesiredDaemonSet(contour *model.Contour, contourImage, envoyImage string) * Spec: appsv1.DaemonSetSpec{ RevisionHistoryLimit: pointer.Int32Ptr(int32(10)), // Ensure the deamonset adopts only its own pods. - Selector: EnvoyPodSelector(contour), - UpdateStrategy: appsv1.DaemonSetUpdateStrategy{ - Type: appsv1.RollingUpdateDaemonSetStrategyType, - RollingUpdate: &appsv1.RollingUpdateDaemonSet{ - MaxUnavailable: opintstr.PointerTo(intstr.FromString("10%")), - }, - }, + Selector: EnvoyPodSelector(contour), + UpdateStrategy: contour.Spec.EnvoyDaemonSetUpdateStrategy, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ // TODO [danehans]: Remove the prometheus annotations when Contour is updated to @@ -406,12 +400,7 @@ func desiredDeployment(contour *model.Contour, contourImage, envoyImage string) RevisionHistoryLimit: pointer.Int32Ptr(int32(10)), // Ensure the deamonset adopts only its own pods. Selector: EnvoyPodSelector(contour), - Strategy: appsv1.DeploymentStrategy{ - Type: appsv1.RollingUpdateDeploymentStrategyType, - RollingUpdate: &appsv1.RollingUpdateDeployment{ - MaxSurge: opintstr.PointerTo(intstr.FromString("10%")), - }, - }, + Strategy: contour.Spec.EnvoyDeploymentStrategy, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ // TODO [danehans]: Remove the prometheus annotations when Contour is updated to diff --git a/internal/provisioner/objects/dataplane/dataplane_test.go b/internal/provisioner/objects/dataplane/dataplane_test.go index 76829118cd0..bc839b924dc 100644 --- a/internal/provisioner/objects/dataplane/dataplane_test.go +++ b/internal/provisioner/objects/dataplane/dataplane_test.go @@ -175,6 +175,24 @@ func checkDaemonSetHasResourceRequirements(t *testing.T, ds *appsv1.DaemonSet, e } t.Errorf("daemonset has unexpected resource requirements %v", expected) } +func checkDaemonSetHasUpdateStrategy(t *testing.T, ds *appsv1.DaemonSet, expected appsv1.DaemonSetUpdateStrategy) { + t.Helper() + + if apiequality.Semantic.DeepEqual(ds.Spec.UpdateStrategy, expected) { + return + } + t.Errorf("daemonset has unexpected update strategy %q", expected) +} + +func checkDeploymentHasStrategy(t *testing.T, ds *appsv1.Deployment, expected appsv1.DeploymentStrategy) { + t.Helper() + + if apiequality.Semantic.DeepEqual(ds.Spec.Strategy, expected) { + return + } + t.Errorf("deployment has unexpected strategy %q", expected) +} + func checkDaemonSetHasTolerations(t *testing.T, ds *appsv1.DaemonSet, expected []corev1.Toleration) { t.Helper() @@ -274,6 +292,17 @@ func TestDesiredDaemonSet(t *testing.T) { checkDaemonSetHasPodAnnotations(t, ds, envoyPodAnnotations(cntr)) checkDaemonSetHasResourceRequirements(t, ds, resQutoa) + checkDaemonSetHasUpdateStrategy(t, ds, cntr.Spec.EnvoyDaemonSetUpdateStrategy) +} + +func TestDesiredDeployment(t *testing.T) { + name := "deploy-test" + cntr := model.Default(fmt.Sprintf("%s-ns", name), name) + + testContourImage := "ghcr.io/projectcontour/contour:test" + testEnvoyImage := "docker.io/envoyproxy/envoy:test" + deploy := desiredDeployment(cntr, testContourImage, testEnvoyImage) + checkDeploymentHasStrategy(t, deploy, cntr.Spec.EnvoyDeploymentStrategy) } diff --git a/internal/provisioner/objects/deployment/deployment.go b/internal/provisioner/objects/deployment/deployment.go index 5247e63d036..9eddd293c36 100644 --- a/internal/provisioner/objects/deployment/deployment.go +++ b/internal/provisioner/objects/deployment/deployment.go @@ -20,7 +20,6 @@ import ( "github.com/projectcontour/contour/apis/projectcontour/v1alpha1" "github.com/projectcontour/contour/internal/provisioner/equality" - opintstr "github.com/projectcontour/contour/internal/provisioner/intstr" "github.com/projectcontour/contour/internal/provisioner/labels" "github.com/projectcontour/contour/internal/provisioner/model" "github.com/projectcontour/contour/internal/provisioner/objects" @@ -206,13 +205,7 @@ func DesiredDeployment(contour *model.Contour, image string) *appsv1.Deployment RevisionHistoryLimit: pointer.Int32(10), // Ensure the deployment adopts only its own pods. Selector: ContourDeploymentPodSelector(contour), - Strategy: appsv1.DeploymentStrategy{ - Type: appsv1.RollingUpdateDeploymentStrategyType, - RollingUpdate: &appsv1.RollingUpdateDeployment{ - MaxSurge: opintstr.PointerTo(intstr.FromString("50%")), - MaxUnavailable: opintstr.PointerTo(intstr.FromString("25%")), - }, - }, + Strategy: contour.Spec.ContourDeploymentStrategy, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ // TODO [danehans]: Remove the prometheus annotations when Contour is updated to diff --git a/internal/provisioner/objects/deployment/deployment_test.go b/internal/provisioner/objects/deployment/deployment_test.go index dfb542013fe..6c76d7cba04 100644 --- a/internal/provisioner/objects/deployment/deployment_test.go +++ b/internal/provisioner/objects/deployment/deployment_test.go @@ -116,6 +116,15 @@ func checkDeploymentHasResourceRequirements(t *testing.T, deploy *appsv1.Deploym t.Errorf("daemonset has unexpected resource requirements %v", expected) } +func checkDeploymentHasStrategy(t *testing.T, ds *appsv1.Deployment, expected appsv1.DeploymentStrategy) { + t.Helper() + + if apiequality.Semantic.DeepEqual(ds.Spec.Strategy, expected) { + return + } + t.Errorf("deployment has unexpected strategy %q", expected) +} + func TestDesiredDeployment(t *testing.T) { name := "deploy-test" cntr := model.Default(fmt.Sprintf("%s-ns", name), name) @@ -186,6 +195,7 @@ func TestDesiredDeployment(t *testing.T) { checkDeploymentHasNodeSelector(t, deploy, nil) checkDeploymentHasTolerations(t, deploy, nil) checkDeploymentHasResourceRequirements(t, deploy, resQutoa) + checkDeploymentHasStrategy(t, deploy, cntr.Spec.ContourDeploymentStrategy) } func TestNodePlacementDeployment(t *testing.T) { diff --git a/site/content/docs/main/config/api-reference.html b/site/content/docs/main/config/api-reference.html index da9ed5bc32f..1b385361ec9 100644 --- a/site/content/docs/main/config/api-reference.html +++ b/site/content/docs/main/config/api-reference.html @@ -5367,8 +5367,11 @@

ContourSettings -

Replicas is the desired number of Contour replicas. If unset, +(Optional) +

Deprecated: Use DeploymentSettings.Replicas instead.

+

Replicas is the desired number of Contour replicas. If if unset, defaults to 2.

+

if both DeploymentSettings.Replicas and this one is set, use DeploymentSettings.Replicas.

@@ -5433,6 +5436,55 @@

ContourSettings More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

+ + +deployment +
+ + +DeploymentSettings + + + + +(Optional) +

Deployment describes the settings for running contour as a Deployment.

+ + + + +

DaemonSetSettings +

+

+(Appears on: +EnvoySettings) +

+

+

DaemonSetSettings contains settings for DaemonSet resources.

+

+ + + + + + + + + + + +
FieldDescription
+updateStrategy +
+ + +Kubernetes apps/v1.DaemonSetUpdateStrategy + + +
+(Optional) +

Strategy describes the deployment strategy to use to replace existing DaemonSet pods with new pods.

+

DebugConfig @@ -5482,6 +5534,53 @@

DebugConfig +

DeploymentSettings +

+

+(Appears on: +ContourSettings, +EnvoySettings) +

+

+

DeploymentSettings contains settings for Deployment resources.

+

+ + + + + + + + + + + + + + + + + +
FieldDescription
+replicas +
+ +int32 + +
+

Replicas is the desired number of replicas.

+
+strategy +
+ + +Kubernetes apps/v1.DeploymentStrategy + + +
+(Optional) +

Strategy describes the deployment strategy to use to replace existing pods with new pods.

+

EnvoyConfig

@@ -5980,9 +6079,12 @@

EnvoySettings +(Optional) +

Deprecated: Use DeploymentSettings.Replicas instead.

Replicas is the desired number of Envoy replicas. If WorkloadType is not “Deployment”, this field is ignored. Otherwise, if unset, defaults to 2.

+

if both DeploymentSettings.Replicas and this one is set, use DeploymentSettings.Replicas.

@@ -6090,6 +6192,38 @@

EnvoySettings Allowed values are “trace”, “debug”, “info”, “warn”, “error”, “critical”, “off”.

+ + +daemonSet +
+ + +DaemonSetSettings + + + + +(Optional) +

DaemonSet describes the settings for running envoy as a DaemonSet. +if WorkloadType is Deployment,it’s must be nil

+ + + + +deployment +
+ + +DeploymentSettings + + + + +(Optional) +

Deployment describes the settings for running envoy as a Deployment. +if WorkloadType is DaemonSet,it’s must be nil

+ +

EnvoyTLS