Skip to content

Commit

Permalink
Set container resource requests
Browse files Browse the repository at this point in the history
* Set container resource requests for operator deployment
* Set container resource requests for registry pod deployments
  • Loading branch information
kevinrizza committed Aug 26, 2019
1 parent 2786e95 commit 92d09ae
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deploy/operator.yaml
Expand Up @@ -53,6 +53,10 @@ spec:
httpGet:
path: /healthz
port: 8080
resources:
requests:
cpu: 10m
memory: 50Mi
env:
- name: WATCH_NAMESPACE
valueFrom:
Expand Down
4 changes: 4 additions & 0 deletions deploy/upstream/08_operator.yaml
Expand Up @@ -35,6 +35,10 @@ spec:
httpGet:
path: /healthz
port: 8080
resources:
requests:
cpu: 10m
memory: 50Mi
env:
- name: WATCH_NAMESPACE
valueFrom:
Expand Down
4 changes: 4 additions & 0 deletions manifests/08_operator.yaml
Expand Up @@ -53,6 +53,10 @@ spec:
httpGet:
path: /healthz
port: 8080
resources:
requests:
cpu: 10m
memory: 50Mi
env:
- name: WATCH_NAMESPACE
valueFrom:
Expand Down
7 changes: 7 additions & 0 deletions pkg/registry/registry.go
Expand Up @@ -19,6 +19,7 @@ import (
core "k8s.io/api/core/v1"
rbac "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down Expand Up @@ -366,6 +367,12 @@ func (r *registry) newPodTemplateSpec(registryCommand []string, needServiceAccou
InitialDelaySeconds: 5,
FailureThreshold: 30,
},
Resources: core.ResourceRequirements{
Requests: core.ResourceList{
core.ResourceCPU: resource.MustParse("10m"),
core.ResourceMemory: resource.MustParse("100Mi"),
},
},
},
},
},
Expand Down

0 comments on commit 92d09ae

Please sign in to comment.