From 4d31eb24f0e85479c62225c0c8299b8bcdf75742 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 26 Mar 2020 17:42:59 -0700 Subject: [PATCH] Add resource request for created pod when viewing pvcs Add low resource requests - reflecting these won't use a lot of resources - to make it more likely the pod will be successfully scheduled. Resolves #568. Signed-off-by: Michael Smith --- plugin/kubernetes/pvc.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugin/kubernetes/pvc.go b/plugin/kubernetes/pvc.go index 269b8a376..64a65d455 100644 --- a/plugin/kubernetes/pvc.go +++ b/plugin/kubernetes/pvc.go @@ -14,6 +14,7 @@ import ( "github.com/puppetlabs/wash/plugin" "github.com/puppetlabs/wash/volume" corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/watch" typedv1 "k8s.io/client-go/kubernetes/typed/core/v1" @@ -80,6 +81,12 @@ func (v *pvc) createPod(cmd []string) (string, error) { Name: "busybox", Image: "busybox", Args: cmd, + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse("1m"), + corev1.ResourceMemory: resource.MustParse("10Mi"), + }, + }, VolumeMounts: []corev1.VolumeMount{ { Name: v.Name(),