mirror of
https://forge.liiib.re/indiehost/libre.sh/libre.sh.git
synced 2024-12-28 06:36:42 +00:00
fix(synapse): define deployment strategy
All checks were successful
/ publish (push) Successful in 13s
All checks were successful
/ publish (push) Successful in 13s
Avoid surges with more than 1 container and conflict running upgrade.
This commit is contained in:
parent
f0dbc1e45b
commit
1475c5ed19
1 changed files with 9 additions and 0 deletions
|
@ -23,6 +23,7 @@ import (
|
|||
appsv1 "k8s.io/api/apps/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/util/intstr"
|
||||
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
|
||||
|
||||
matrixv1alpha1 "libre.sh/api/matrix/v1alpha1"
|
||||
|
@ -56,6 +57,14 @@ func (r *SynapseReconciler) reconcileDeployment(ctx context.Context, synapse *ma
|
|||
}
|
||||
deployment.Spec.Replicas = &replicas
|
||||
|
||||
deployment.Spec.Strategy.Type = appsv1.RollingUpdateDeploymentStrategyType
|
||||
maxSurge := intstr.FromInt(1)
|
||||
maxUnavailable := intstr.FromInt(0)
|
||||
deployment.Spec.Strategy.RollingUpdate = &appsv1.RollingUpdateDeployment{
|
||||
MaxSurge: &maxSurge,
|
||||
MaxUnavailable: &maxUnavailable,
|
||||
}
|
||||
|
||||
r.mutatePodTemplateSpec(ctx, synapse, resources, &deployment.Spec.Template)
|
||||
|
||||
deployment.Spec.Template.Spec.Containers[0].Ports = []corev1.ContainerPort{
|
||||
|
|
Loading…
Reference in a new issue