Skip to content

Commit

Permalink
Merge pull request #161 from Madhu-1/add-resize-res
Browse files Browse the repository at this point in the history
feat: add resource limit and request for csiResizer
  • Loading branch information
openshift-merge-robot authored Apr 20, 2022
2 parents 4bb8d1d + 56a3568 commit b346b4f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions controllers/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 12 additions & 0 deletions controllers/topolvm_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b346b4f

Please sign in to comment.