Adds default resources for fetcher pod (#500)

The fetcher needs a relatively smaller set of resources and does not have to be same as the function container/defaults. This change adds defaults for fetcher containers in function pods.
This commit is contained in:
Vishal
2018-02-24 01:07:02 +05:30
committed by GitHub
parent 245506efe3
commit e5b137fe24
3 changed files with 70 additions and 2 deletions
+7
View File
@@ -45,6 +45,7 @@ import (
"github.com/fission/fission/environments/fetcher"
fetcherClient "github.com/fission/fission/environments/fetcher/client"
"github.com/fission/fission/executor/fscache"
"github.com/fission/fission/executor/util"
)
const POD_PHASE_RUNNING string = "Running"
@@ -433,6 +434,11 @@ func (gp *GenericPool) createPool() error {
poolDeploymentName := fmt.Sprintf("%v-%v-%v",
gp.env.Metadata.Name, gp.env.Metadata.UID, strings.ToLower(gp.poolInstanceId))
fetcherResources, err := util.GetFetcherResources()
if err != nil {
return err
}
deployment := &v1beta1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: poolDeploymentName,
@@ -515,6 +521,7 @@ func (gp *GenericPool) createPool() error {
MountPath: gp.sharedCfgMapPath,
},
},
Resources: fetcherResources,
Command: []string{"/fetcher",
"-secret-dir", gp.sharedSecretPath,
"-cfgmap-dir", gp.sharedCfgMapPath,