Skip to content

Commit

Permalink
Remove initial delay seconds for probes
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-hontarau committed Apr 2, 2024
1 parent acd264a commit f5b2f67
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 43 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/etcdcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ type PodSpec struct {

// LivenessProbe defines liveness probe check for the pod.
// If not specified, default probe will be used with HTTP probe handler and path /livez on the port 2379,
// with initialDelaySeconds 5 and periodSeconds 5.
// with periodSeconds 5.
// +optional
LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"`

// ReadinessProbe defines readiness probe check for the pod.
// If not specified, default probe will be used with HTTP probe handler and path /readyz on the port 2379,
// with initialDelaySeconds 5 and periodSeconds 5.
// with periodSeconds 5.
// +optional
ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"`

Expand Down
10 changes: 6 additions & 4 deletions config/crd/bases/etcd.aenix.io_etcdclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1278,8 +1278,9 @@ spec:
for this pod.
type: string
readinessProbe:
description: ReadinessProbe defines readiness probe check for
the pod.
description: |-
ReadinessProbe defines readiness probe check for the pod.
If not specified, default probe will be used.
properties:
exec:
description: Exec specifies the action to take.
Expand Down Expand Up @@ -1667,8 +1668,9 @@ spec:
type: object
type: object
startupProbe:
description: StartupProbe defines startup probe check for the
pod.
description: |-
StartupProbe defines startup probe check for the pod.
If not specified, default probe will be used.
properties:
exec:
description: Exec specifies the action to take.
Expand Down
6 changes: 2 additions & 4 deletions internal/controller/factory/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ func getReadinessProbe(probe *corev1.Probe) *corev1.Probe {
Port: intstr.FromInt32(2379),
},
},
InitialDelaySeconds: 5,
PeriodSeconds: 5,
PeriodSeconds: 5,
}
return mergeWithDefaultProbe(probe, defaultProbe)
}
Expand All @@ -230,8 +229,7 @@ func getLivenessProbe(probe *corev1.Probe) *corev1.Probe {
Port: intstr.FromInt32(2379),
},
},
InitialDelaySeconds: 5,
PeriodSeconds: 5,
PeriodSeconds: 5,
}
return mergeWithDefaultProbe(probe, defaultProbe)
}
Expand Down
57 changes: 24 additions & 33 deletions internal/controller/factory/statefulset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,10 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() {
Scheme: v1.URISchemeHTTP,
},
},
InitialDelaySeconds: 0,
TimeoutSeconds: 1,
PeriodSeconds: 5,
SuccessThreshold: 1,
FailureThreshold: 3,
TimeoutSeconds: 1,
PeriodSeconds: 5,
SuccessThreshold: 1,
FailureThreshold: 3,
}))
})

Expand All @@ -156,11 +155,10 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() {
Scheme: v1.URISchemeHTTP,
},
},
InitialDelaySeconds: 5,
TimeoutSeconds: 1,
PeriodSeconds: 5,
SuccessThreshold: 1,
FailureThreshold: 3,
TimeoutSeconds: 1,
PeriodSeconds: 5,
SuccessThreshold: 1,
FailureThreshold: 3,
}))
})

Expand All @@ -173,11 +171,10 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() {
Scheme: v1.URISchemeHTTP,
},
},
InitialDelaySeconds: 5,
TimeoutSeconds: 1,
PeriodSeconds: 5,
SuccessThreshold: 1,
FailureThreshold: 3,
TimeoutSeconds: 1,
PeriodSeconds: 5,
SuccessThreshold: 1,
FailureThreshold: 3,
}))
})

Expand Down Expand Up @@ -223,11 +220,10 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() {
Scheme: v1.URISchemeHTTP,
},
},
InitialDelaySeconds: 0,
TimeoutSeconds: 1,
PeriodSeconds: 7,
SuccessThreshold: 1,
FailureThreshold: 3,
TimeoutSeconds: 1,
PeriodSeconds: 7,
SuccessThreshold: 1,
FailureThreshold: 3,
}))
})

Expand All @@ -240,11 +236,10 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() {
Scheme: v1.URISchemeHTTP,
},
},
InitialDelaySeconds: 5,
TimeoutSeconds: 1,
PeriodSeconds: 3,
SuccessThreshold: 1,
FailureThreshold: 3,
TimeoutSeconds: 1,
PeriodSeconds: 3,
SuccessThreshold: 1,
FailureThreshold: 3,
}))
})

Expand Down Expand Up @@ -336,8 +331,7 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() {
Port: intstr.FromInt32(2379),
},
},
InitialDelaySeconds: 5,
PeriodSeconds: 5,
PeriodSeconds: 5,
}))
})
It("should correctly override all values", func() {
Expand Down Expand Up @@ -390,8 +384,7 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() {
Port: intstr.FromInt32(2379),
},
},
InitialDelaySeconds: 0,
PeriodSeconds: 5,
PeriodSeconds: 5,
}))
})
It("should correctly override all values", func() {
Expand Down Expand Up @@ -444,8 +437,7 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() {
Port: intstr.FromInt32(2379),
},
},
InitialDelaySeconds: 5,
PeriodSeconds: 5,
PeriodSeconds: 5,
}))
})
It("should correctly override all values", func() {
Expand Down Expand Up @@ -496,8 +488,7 @@ var _ = Describe("CreateOrUpdateStatefulSet handler", func() {
Port: intstr.FromInt32(2379),
},
},
InitialDelaySeconds: 5,
PeriodSeconds: 5,
PeriodSeconds: 5,
}
defaultProbeCopy := defaultProbe.DeepCopy()

Expand Down

0 comments on commit f5b2f67

Please sign in to comment.