Skip to content

Commit

Permalink
Add resource request for created pod when viewing pvcs
Browse files Browse the repository at this point in the history
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 puppetlabs-toy-chest#568.

Signed-off-by: Michael Smith <[email protected]>
  • Loading branch information
MikaelSmith committed Mar 30, 2020
1 parent d88bf42 commit ae10e23
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugin/kubernetes/pvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit ae10e23

Please sign in to comment.