Function Update if config/secret changes (#1224)

* Config and secret change to invoke function update
* Added recycle function for pool manager as well - where it recycles the specialized pods
* Switched to rolling update of pods and env variable based change instead of deleting pods in new deploy executor
This commit is contained in:
Vishal
2019-07-23 09:27:43 +08:00
committed by Ta-Ching Chen
parent 1beaa9ec13
commit 93c5b53b77
7 changed files with 305 additions and 11 deletions
+7 -2
View File
@@ -32,6 +32,7 @@ import (
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
"github.com/fission/fission/pkg/crd"
"github.com/fission/fission/pkg/executor/cms"
"github.com/fission/fission/pkg/executor/fscache"
"github.com/fission/fission/pkg/executor/newdeploy"
"github.com/fission/fission/pkg/executor/poolmgr"
@@ -45,6 +46,7 @@ type (
gpm *poolmgr.GenericPoolManager
ndm *newdeploy.NewDeploy
cms *cms.ConfigSecretController
fissionClient *crd.FissionClient
fsCache *fscache.FunctionServiceCache
@@ -64,11 +66,12 @@ type (
}
)
func MakeExecutor(logger *zap.Logger, gpm *poolmgr.GenericPoolManager, ndm *newdeploy.NewDeploy, fissionClient *crd.FissionClient, fsCache *fscache.FunctionServiceCache) *Executor {
func MakeExecutor(logger *zap.Logger, gpm *poolmgr.GenericPoolManager, ndm *newdeploy.NewDeploy, cms *cms.ConfigSecretController, fissionClient *crd.FissionClient, fsCache *fscache.FunctionServiceCache) *Executor {
executor := &Executor{
logger: logger.Named("executor"),
gpm: gpm,
ndm: ndm,
cms: cms,
fissionClient: fissionClient,
fsCache: fsCache,
@@ -238,7 +241,9 @@ func StartExecutor(logger *zap.Logger, fissionNamespace string, functionNamespac
fissionClient, kubernetesClient, restClient,
functionNamespace, fetcherConfig, poolID)
api := MakeExecutor(logger, gpm, ndm, fissionClient, fsCache)
cms := cms.MakeConfigSecretController(logger, fissionClient, kubernetesClient, ndm, gpm)
api := MakeExecutor(logger, gpm, ndm, cms, fissionClient, fsCache)
go api.Serve(port)
go serveMetric(logger)