Skip to content

Commit

Permalink
probestrategyreachable
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Oct 8, 2024
1 parent f0d8cb8 commit 0da846b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/v1/cosmosfullnode_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,16 @@ type PodSpec struct {
type FullNodeProbeStrategy string

const (
FullNodeProbeStrategyNone FullNodeProbeStrategy = "None"
FullNodeProbeStrategyNone FullNodeProbeStrategy = "None"
FullNodeProbeStrategyReachable FullNodeProbeStrategy = "Reachable"
FullNodeProbeStrategyInSync FullNodeProbeStrategy = "InSync"
)

// FullNodeProbesSpec configures probes for created pods
type FullNodeProbesSpec struct {
// Strategy controls the default probes added by the controller.
// None = Do not add any probes. May be necessary for Sentries using a remote signer.
// +kubebuilder:validation:Enum:=None
// +kubebuilder:validation:Enum:=None;Reachable;InSync
// +optional
Strategy FullNodeProbeStrategy `json:"strategy"`
}
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/cosmos.strange.love_cosmosfullnodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3931,6 +3931,8 @@ spec:
None = Do not add any probes. May be necessary for Sentries using a remote signer.
enum:
- None
- Reachable
- InSync
type: string
type: object
resources:
Expand Down
4 changes: 4 additions & 0 deletions internal/fullnode/pod_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ func podReadinessProbes(crd *cosmosv1.CosmosFullNode) []*corev1.Probe {
FailureThreshold: 5,
}

if crd.Spec.PodTemplate.Probes.Strategy == cosmosv1.FullNodeProbeStrategyReachable {
return []*corev1.Probe{mainProbe, nil}
}

sidecarProbe := &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Expand Down

0 comments on commit 0da846b

Please sign in to comment.