Skip to content

Commit 9ed845c

Browse files
authored
chore: graceful startup probe (cloudnative-pg#95)
Signed-off-by: Leonardo Cecchi <[email protected]>
1 parent b7daaac commit 9ed845c

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

internal/cnpgi/operator/lifecycle.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ func reconcilePodSpec(
312312
envs = append(envs, additionalEnvs...)
313313

314314
baseProbe := &corev1.Probe{
315-
FailureThreshold: 3,
315+
FailureThreshold: 10,
316+
TimeoutSeconds: 10,
316317
ProbeHandler: corev1.ProbeHandler{
317318
Exec: &corev1.ExecAction{
318319
Command: []string{"/manager", "healthcheck", "unix"},
@@ -324,7 +325,6 @@ func reconcilePodSpec(
324325
sidecarConfig.Name = "plugin-barman-cloud"
325326
sidecarConfig.Image = viper.GetString("sidecar-image")
326327
sidecarConfig.ImagePullPolicy = cluster.Spec.ImagePullPolicy
327-
sidecarConfig.LivenessProbe = baseProbe.DeepCopy()
328328
sidecarConfig.StartupProbe = baseProbe.DeepCopy()
329329

330330
// merge the main container envs if they aren't already set

manifest.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,8 @@ spec:
796796
selector:
797797
matchLabels:
798798
app: barman-cloud
799-
strategy: {}
799+
strategy:
800+
type: Recreate
800801
template:
801802
metadata:
802803
labels:

test/e2e/internal/tests/backup/backup_restore.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var _ = Describe("Backup and restore", func() {
7575
},
7676
src)).To(Succeed())
7777
g.Expect(cluster2.IsReady(*src)).To(BeTrue())
78-
}).WithTimeout(5 * time.Minute).WithPolling(5 * time.Second).Should(Succeed())
78+
}).WithTimeout(15 * time.Minute).WithPolling(5 * time.Second).Should(Succeed())
7979

8080
By("Adding data to PostgreSQL")
8181
clientSet, cfg, err := internalClient.NewClientSet()
@@ -144,7 +144,7 @@ var _ = Describe("Backup and restore", func() {
144144
types.NamespacedName{Name: dst.Name, Namespace: dst.Namespace},
145145
dst)).To(Succeed())
146146
g.Expect(cluster2.IsReady(*dst)).To(BeTrue())
147-
}).WithTimeout(5 * time.Minute).WithPolling(5 * time.Second).Should(Succeed())
147+
}).WithTimeout(15 * time.Minute).WithPolling(5 * time.Second).Should(Succeed())
148148

149149
By("Verifying the data exists in the restored instance")
150150
output, _, err := command.ExecuteInContainer(ctx,

test/e2e/internal/tests/replicacluster/replica_cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ var _ = Describe("Replica cluster", func() {
123123
},
124124
replica)).To(Succeed())
125125
g.Expect(cluster2.IsReady(*replica)).To(BeTrue())
126-
}).WithTimeout(5 * time.Minute).WithPolling(5 * time.Second).Should(Succeed())
126+
}).WithTimeout(15 * time.Minute).WithPolling(5 * time.Second).Should(Succeed())
127127

128128
By("Checking the data in the replica cluster")
129129
output, _, err := command.ExecuteInContainer(ctx,

0 commit comments

Comments
 (0)