Skip to content

Commit

Permalink
fix envoy-max-heapsize not set
Browse files Browse the repository at this point in the history
Signed-off-by: yangyang <[email protected]>
  • Loading branch information
yangyy93 committed Oct 9, 2023
1 parent 03210ab commit cab835e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions internal/provisioner/controller/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ func (r *gatewayReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
contourModel.Spec.EnvoyBaseID = envoyParams.BaseID
}

if envoyParams.OverloadMaxHeapSize > 0 {
contourModel.Spec.EnvoyMaxHeapSizeBytes = envoyParams.OverloadMaxHeapSize
}

}
}

Expand Down
11 changes: 6 additions & 5 deletions internal/provisioner/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ func Default(namespace, name string) *Contour {
Name: name,
},
Spec: ContourSpec{
ContourReplicas: 2,
EnvoyWorkloadType: WorkloadTypeDaemonSet,
EnvoyReplicas: 2, // ignored if not provisioning Envoy as a deployment.
EnvoyLogLevel: contourv1alpha1.InfoLog,
EnvoyBaseID: 0,
ContourReplicas: 2,
EnvoyWorkloadType: WorkloadTypeDaemonSet,
EnvoyReplicas: 2, // ignored if not provisioning Envoy as a deployment.
EnvoyLogLevel: contourv1alpha1.InfoLog,
EnvoyBaseID: 0,
EnvoyMaxHeapSizeBytes: 0,
NetworkPublishing: NetworkPublishing{
Envoy: EnvoyNetworkPublishing{
Type: LoadBalancerServicePublishingType,
Expand Down
5 changes: 5 additions & 0 deletions internal/provisioner/objects/dataplane/dataplane_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ func TestDesiredDaemonSet(t *testing.T) {
testEnvoyImage := "docker.io/envoyproxy/envoy:test"
testLogLevelArg := "--log-level debug"
testBaseIDArg := "--base-id 1"
testEnvoyMaxHeapSize := "--overload-max-heap=8000000000"

resQutoa := corev1.ResourceRequirements{
Limits: corev1.ResourceList{
Expand All @@ -328,6 +329,8 @@ func TestDesiredDaemonSet(t *testing.T) {
// Change the Envoy base id to test --base-id 1
cntr.Spec.EnvoyBaseID = 1

cntr.Spec.EnvoyMaxHeapSizeBytes = 8000000000

ds := DesiredDaemonSet(cntr, testContourImage, testEnvoyImage)
container := checkDaemonSetHasContainer(t, ds, EnvoyContainerName, true)
checkContainerHasArg(t, container, testLogLevelArg)
Expand All @@ -343,6 +346,8 @@ func TestDesiredDaemonSet(t *testing.T) {
checkContainerHaveResourceRequirements(t, container)

checkContainerHasImage(t, container, testContourImage)
checkContainerHasArg(t, container, testEnvoyMaxHeapSize)

checkDaemonSetHasEnvVar(t, ds, EnvoyContainerName, envoyNsEnvVar)
checkDaemonSetHasEnvVar(t, ds, EnvoyContainerName, envoyPodEnvVar)
checkDaemonSetHasEnvVar(t, ds, envoyInitContainerName, envoyNsEnvVar)
Expand Down

0 comments on commit cab835e

Please sign in to comment.