Skip to content

Commit

Permalink
Add resource limits to restic init container
Browse files Browse the repository at this point in the history
Fixes #1201

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
  • Loading branch information
nrb committed Jul 17, 2019
1 parent 5841f82 commit d2a496c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/1677-nrb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add low cpu/memory limits to the restic init container. This allows for restoration into namespaces with quotas defined.
7 changes: 7 additions & 0 deletions pkg/restore/restic_restore_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -107,6 +108,12 @@ func (a *ResticRestoreAction) Execute(input *velero.RestoreItemActionExecuteInpu
},
},
},
Resources: corev1.ResourceRequirements{
Limits: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("100m"),
corev1.ResourceMemory: resource.MustParse("1Mi"),
},
},
}

for volumeName := range volumeSnapshots {
Expand Down

0 comments on commit d2a496c

Please sign in to comment.