Update deployment strategy on promotion

- include spec strategy, min ready seconds and revision history limit to initialization and promotion
This commit is contained in:
Stefan Prodan
2018-11-24 20:03:02 +02:00
committed by stefanprodan
parent 423d9bbbb3
commit c5930e6f70
6 changed files with 13 additions and 6 deletions
+2
View File
@@ -6,6 +6,8 @@ metadata:
labels:
app: podinfo
spec:
minReadySeconds: 5
revisionHistoryLimit: 5
strategy:
rollingUpdate:
maxUnavailable: 0
+1 -1
View File
@@ -22,7 +22,7 @@ spec:
serviceAccountName: flagger
containers:
- name: flagger
image: stefanprodan/flagger:0.1.0-beta.7
image: stefanprodan/flagger:0.1.0-beta.9
imagePullPolicy: Always
ports:
- name: http
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: flagger
version: 0.1.0
appVersion: 0.1.0-beta.7
appVersion: 0.1.0-beta.9
description: Flagger is a Kubernetes operator that automates the promotion of canary deployments using Istio routing for traffic shifting and Prometheus metrics for canary analysis.
home: https://github.com/stefanprodan/flagger
+1 -1
View File
@@ -2,7 +2,7 @@
image:
repository: stefanprodan/flagger
tag: 0.1.0-beta.7
tag: 0.1.0-beta.9
pullPolicy: IfNotPresent
controlLoopInterval: "10s"
+7 -2
View File
@@ -48,6 +48,9 @@ func (c *CanaryDeployer) Promote(cd *flaggerv1.Canary) error {
return fmt.Errorf("deployment %s.%s query error %v", primaryName, cd.Namespace, err)
}
primary.Spec.MinReadySeconds = canary.Spec.MinReadySeconds
primary.Spec.RevisionHistoryLimit = canary.Spec.RevisionHistoryLimit
primary.Spec.Strategy = canary.Spec.Strategy
primary.Spec.Template.Spec = canary.Spec.Template.Spec
_, err = c.kubeClient.AppsV1().Deployments(primary.Namespace).Update(primary)
if err != nil {
@@ -241,8 +244,10 @@ func (c *CanaryDeployer) createPrimaryDeployment(cd *flaggerv1.Canary) error {
},
},
Spec: appsv1.DeploymentSpec{
Replicas: canaryDep.Spec.Replicas,
Strategy: canaryDep.Spec.Strategy,
MinReadySeconds: canaryDep.Spec.MinReadySeconds,
RevisionHistoryLimit: canaryDep.Spec.RevisionHistoryLimit,
Replicas: canaryDep.Spec.Replicas,
Strategy: canaryDep.Spec.Strategy,
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app": primaryName,
+1 -1
View File
@@ -1,4 +1,4 @@
package version
var VERSION = "0.1.0-beta.7"
var VERSION = "0.1.0-beta.9"
var REVISION = "unknown"