Skip to content

Commit

Permalink
Add Resource requests to pods
Browse files Browse the repository at this point in the history
Signed-off-by: Vatsal Parekh <[email protected]>
  • Loading branch information
Vatsal Parekh authored and kubevirt-bot committed May 24, 2021
1 parent c0c3b58 commit 174b78d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/manager/manager.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ spec:
port: 9440
initialDelaySeconds: 5
terminationGracePeriodSeconds: 10
resources:
requests:
memory: "150Mi"
cpu: "100m"
7 changes: 7 additions & 0 deletions internal/operands/template-validator/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package template_validator

import (
"fmt"
"k8s.io/apimachinery/pkg/api/resource"

admission "k8s.io/api/admissionregistration/v1"
apps "k8s.io/api/apps/v1"
Expand Down Expand Up @@ -137,6 +138,12 @@ func newDeployment(namespace string, replicas int32, image string) *apps.Deploym
Name: "webhook",
Image: image,
ImagePullPolicy: core.PullAlways,
Resources: core.ResourceRequirements{
Requests: core.ResourceList{
core.ResourceCPU: resource.MustParse("50m"),
core.ResourceMemory: resource.MustParse("150Mi"),
},
},
Args: []string{
"-v=2",
fmt.Sprintf("--port=%d", ContainerPort),
Expand Down

0 comments on commit 174b78d

Please sign in to comment.