Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Update broker deployments spec for better availability during upgrades #1690

Merged
merged 7 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions pkg/reconciler/brokercell/resources/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func MakeIngressDeployment(args IngressArgs) *appsv1.Deployment {
},
},
FailureThreshold: 5,
PeriodSeconds: 2,
PeriodSeconds: 15,
SuccessThreshold: 1,
TimeoutSeconds: 5,
}
Expand All @@ -57,8 +57,8 @@ func MakeIngressDeployment(args IngressArgs) *appsv1.Deployment {
},
},
FailureThreshold: 5,
InitialDelaySeconds: 5,
PeriodSeconds: 2,
InitialDelaySeconds: 15,
PeriodSeconds: 15,
SuccessThreshold: 1,
TimeoutSeconds: 5,
}
Expand Down Expand Up @@ -135,6 +135,13 @@ func deploymentTemplate(args Args, containers []corev1.Container) *appsv1.Deploy
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{MatchLabels: Labels(args.BrokerCell.Name, args.ComponentName)},
Strategy: appsv1.DeploymentStrategy{
RollingUpdate: &appsv1.RollingUpdateDeployment{
MaxSurge: &intstr.IntOrString{IntVal: 1},
MaxUnavailable: &intstr.IntOrString{IntVal: 0},
},
},
MinReadySeconds: 60,
Ectelion marked this conversation as resolved.
Show resolved Hide resolved
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: Labels(args.BrokerCell.Name, args.ComponentName),
Expand Down
5 changes: 5 additions & 0 deletions pkg/reconciler/brokercell/testingdata/fanout_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ spec:
app: cloud-run-events
brokerCell: test-brokercell
role: fanout
minReadySeconds: 60
strategy:
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
metadata:
labels: *labels
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ spec:
app: cloud-run-events
brokerCell: test-brokercell
role: fanout
minReadySeconds: 60
strategy:
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
metadata:
labels: *labels
Expand Down
11 changes: 8 additions & 3 deletions pkg/reconciler/brokercell/testingdata/ingress_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ spec:
app: cloud-run-events
brokerCell: test-brokercell
role: ingress
minReadySeconds: 60
strategy:
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
metadata:
labels: *labels
Expand All @@ -48,8 +53,8 @@ spec:
path: /healthz
port: 8080
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 2
initialDelaySeconds: 15
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 5
readinessProbe:
Expand All @@ -58,7 +63,7 @@ spec:
path: /healthz
port: 8080
scheme: HTTP
periodSeconds: 2
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 5
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ spec:
app: cloud-run-events
brokerCell: test-brokercell
role: ingress
minReadySeconds: 60
strategy:
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
metadata:
labels: *labels
Expand All @@ -49,8 +54,8 @@ spec:
path: /healthz
port: 8080
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 2
initialDelaySeconds: 15
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 5
readinessProbe:
Expand All @@ -59,7 +64,7 @@ spec:
path: /healthz
port: 8080
scheme: HTTP
periodSeconds: 2
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 5
env:
Expand Down
5 changes: 5 additions & 0 deletions pkg/reconciler/brokercell/testingdata/retry_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ spec:
app: cloud-run-events
brokerCell: test-brokercell
role: retry
minReadySeconds: 60
strategy:
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
metadata:
labels: *labels
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ spec:
app: cloud-run-events
brokerCell: test-brokercell
role: retry
minReadySeconds: 60
strategy:
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
metadata:
labels: *labels
Expand Down