diff --git a/controllers/defaults.go b/controllers/defaults.go index a9613b2da..05921ba0b 100644 --- a/controllers/defaults.go +++ b/controllers/defaults.go @@ -76,6 +76,11 @@ var ( TopolvmCsiProvisionerCPURequest = "100m" TopolvmCsiProvisionerCPULimit = "100m" + TopolvmCsiResizerMemRequest = "100Mi" + TopolvmCsiResizerMemLimit = "100Mi" + TopolvmCsiResizerCPURequest = "100m" + TopolvmCsiResizerCPULimit = "100m" + // CSI Provisioner requires below environment values to make use of CSIStorageCapacity PodNameEnv = "POD_NAME" NameSpaceEnv = "NAMESPACE" diff --git a/controllers/topolvm_controller.go b/controllers/topolvm_controller.go index d187795d1..99c14656b 100644 --- a/controllers/topolvm_controller.go +++ b/controllers/topolvm_controller.go @@ -313,10 +313,22 @@ func getCsiResizerContainer() *corev1.Container { {Name: "socket-dir", MountPath: filepath.Dir(DefaultCSISocket)}, } + resourceRequirements := corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse(TopolvmCsiResizerCPULimit), + corev1.ResourceMemory: resource.MustParse(TopolvmCsiResizerMemLimit), + }, + Requests: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse(TopolvmCsiResizerCPURequest), + corev1.ResourceMemory: resource.MustParse(TopolvmCsiResizerMemRequest), + }, + } + csiResizer := &corev1.Container{ Name: CsiResizerContainerName, Image: CsiResizerImage, Args: args, + Resources: resourceRequirements, VolumeMounts: volumeMounts, } return csiResizer