chore: graceful startup probe (#95)

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
This commit is contained in:
Leonardo Cecchi 2024-12-11 15:57:42 +01:00 committed by GitHub
parent b7daaac075
commit 9ed845c10f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 6 deletions

View File

@ -312,7 +312,8 @@ func reconcilePodSpec(
envs = append(envs, additionalEnvs...) envs = append(envs, additionalEnvs...)
baseProbe := &corev1.Probe{ baseProbe := &corev1.Probe{
FailureThreshold: 3, FailureThreshold: 10,
TimeoutSeconds: 10,
ProbeHandler: corev1.ProbeHandler{ ProbeHandler: corev1.ProbeHandler{
Exec: &corev1.ExecAction{ Exec: &corev1.ExecAction{
Command: []string{"/manager", "healthcheck", "unix"}, Command: []string{"/manager", "healthcheck", "unix"},
@ -324,7 +325,6 @@ func reconcilePodSpec(
sidecarConfig.Name = "plugin-barman-cloud" sidecarConfig.Name = "plugin-barman-cloud"
sidecarConfig.Image = viper.GetString("sidecar-image") sidecarConfig.Image = viper.GetString("sidecar-image")
sidecarConfig.ImagePullPolicy = cluster.Spec.ImagePullPolicy sidecarConfig.ImagePullPolicy = cluster.Spec.ImagePullPolicy
sidecarConfig.LivenessProbe = baseProbe.DeepCopy()
sidecarConfig.StartupProbe = baseProbe.DeepCopy() sidecarConfig.StartupProbe = baseProbe.DeepCopy()
// merge the main container envs if they aren't already set // merge the main container envs if they aren't already set

View File

@ -796,7 +796,8 @@ spec:
selector: selector:
matchLabels: matchLabels:
app: barman-cloud app: barman-cloud
strategy: {} strategy:
type: Recreate
template: template:
metadata: metadata:
labels: labels:

View File

@ -75,7 +75,7 @@ var _ = Describe("Backup and restore", func() {
}, },
src)).To(Succeed()) src)).To(Succeed())
g.Expect(cluster2.IsReady(*src)).To(BeTrue()) g.Expect(cluster2.IsReady(*src)).To(BeTrue())
}).WithTimeout(5 * time.Minute).WithPolling(5 * time.Second).Should(Succeed()) }).WithTimeout(15 * time.Minute).WithPolling(5 * time.Second).Should(Succeed())
By("Adding data to PostgreSQL") By("Adding data to PostgreSQL")
clientSet, cfg, err := internalClient.NewClientSet() clientSet, cfg, err := internalClient.NewClientSet()
@ -144,7 +144,7 @@ var _ = Describe("Backup and restore", func() {
types.NamespacedName{Name: dst.Name, Namespace: dst.Namespace}, types.NamespacedName{Name: dst.Name, Namespace: dst.Namespace},
dst)).To(Succeed()) dst)).To(Succeed())
g.Expect(cluster2.IsReady(*dst)).To(BeTrue()) g.Expect(cluster2.IsReady(*dst)).To(BeTrue())
}).WithTimeout(5 * time.Minute).WithPolling(5 * time.Second).Should(Succeed()) }).WithTimeout(15 * time.Minute).WithPolling(5 * time.Second).Should(Succeed())
By("Verifying the data exists in the restored instance") By("Verifying the data exists in the restored instance")
output, _, err := command.ExecuteInContainer(ctx, output, _, err := command.ExecuteInContainer(ctx,

View File

@ -123,7 +123,7 @@ var _ = Describe("Replica cluster", func() {
}, },
replica)).To(Succeed()) replica)).To(Succeed())
g.Expect(cluster2.IsReady(*replica)).To(BeTrue()) g.Expect(cluster2.IsReady(*replica)).To(BeTrue())
}).WithTimeout(5 * time.Minute).WithPolling(5 * time.Second).Should(Succeed()) }).WithTimeout(15 * time.Minute).WithPolling(5 * time.Second).Should(Succeed())
By("Checking the data in the replica cluster") By("Checking the data in the replica cluster")
output, _, err := command.ExecuteInContainer(ctx, output, _, err := command.ExecuteInContainer(ctx,