Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Health Checks] Provision RPC module before P2P module #972

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/pocket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ privateKeySecretKeyRef:
| genesis.preProvisionedGenesis.enabled | bool | `true` | Use genesis file supplied by the Helm chart, of false refer to `genesis.externalConfigMap` |
| genesis.preProvisionedGenesis.type | string | `"devnet"` | Type of the genesis file to use, can be `devnet`, `testnet`, `mainnet` |
| global.postgresql.service.ports.postgresql | string | `"5432"` | |
| healthchecks.enabled | bool | `true` | enable liveness and readiness probes |
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
| image.repository | string | `"ghcr.io/pokt-network/pocket-v1"` | image repository |
| image.tag | string | `"latest"` | image tag |
Expand Down
2 changes: 2 additions & 0 deletions charts/pocket/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
{{ if .Values.healthchecks.enabled }}
livenessProbe:
httpGet:
path: /v1/health
Expand All @@ -114,6 +115,7 @@ spec:
httpGet:
path: /v1/health
port: rpc
{{ end }}
volumeMounts:
- name: config-volume
mountPath: /pocket/configs/config.json
Expand Down
4 changes: 4 additions & 0 deletions charts/pocket/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ image:
# -- image tag
tag: "latest"

healthchecks:
# -- enable liveness and readiness probes
enabled: true

# -- image pull secrets
imagePullSecrets: []
nameOverride: ""
Expand Down
8 changes: 4 additions & 4 deletions shared/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ func (node *Node) Start() error {
return err
}

if err := node.GetBus().GetP2PModule().Start(); err != nil {
if err := node.GetBus().GetRPCModule().Start(); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment that the order of the Starts is important and should not be modified.

return err
}

if err := node.GetBus().GetUtilityModule().Start(); err != nil {
if err := node.GetBus().GetP2PModule().Start(); err != nil {
return err
}

if err := node.GetBus().GetConsensusModule().Start(); err != nil {
if err := node.GetBus().GetUtilityModule().Start(); err != nil {
return err
}

if err := node.GetBus().GetRPCModule().Start(); err != nil {
if err := node.GetBus().GetConsensusModule().Start(); err != nil {
return err
}

Expand Down
Loading