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
+16
View File
@@ -185,6 +185,9 @@ func (deploy *NewDeploy) getDeploymentSpec(fn *fv1.Function, env *fv1.Environmen
}
resources := deploy.getResources(env, fn)
maxUnavailable := intstr.FromString("20%")
maxSurge := intstr.FromString("100%")
deployment := &v1beta1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: deployName,
@@ -217,6 +220,12 @@ func (deploy *NewDeploy) getDeploymentSpec(fn *fv1.Function, env *fv1.Environmen
},
},
},
Env: []apiv1.EnvVar{
{
Name: fv1.LastUpdateTimestamp,
Value: time.Now().String(),
},
},
// https://istio.io/docs/setup/kubernetes/additional-setup/requirements/
Ports: []apiv1.ContainerPort{
{
@@ -231,6 +240,13 @@ func (deploy *NewDeploy) getDeploymentSpec(fn *fv1.Function, env *fv1.Environmen
TerminationGracePeriodSeconds: &gracePeriodSeconds,
},
},
Strategy: v1beta1.DeploymentStrategy{
Type: v1beta1.RollingUpdateDeploymentStrategyType,
RollingUpdate: &v1beta1.RollingUpdateDeployment{
MaxUnavailable: &maxUnavailable,
MaxSurge: &maxSurge,
},
},
},
}