From a0baf01ff937af51db8ab5cd39dd6502dc72e74f Mon Sep 17 00:00:00 2001 From: Dmitry K Date: Mon, 7 Aug 2023 17:26:30 -0700 Subject: [PATCH 1/3] disable health checks for localnet --- build/localnet/Tiltfile | 4 ++++ charts/pocket/README.md | 1 + charts/pocket/templates/statefulset.yaml | 2 ++ charts/pocket/values.yaml | 4 ++++ 4 files changed, 11 insertions(+) diff --git a/build/localnet/Tiltfile b/build/localnet/Tiltfile index d4534df35..71587b8c1 100644 --- a/build/localnet/Tiltfile +++ b/build/localnet/Tiltfile @@ -210,6 +210,7 @@ for x in range(localnet_config["validators"]["count"]): "genesis.externalConfigMap.name=v1-localnet-genesis", "genesis.externalConfigMap.key=genesis.json", "postgresql.primary.persistence.enabled=false", + "healthchecks.enabled=false", "podAnnotations.prometheus\\.io/scrape=true", "podAnnotations.prometheus\\.io/port=9000", "nodeType=validator", @@ -240,6 +241,7 @@ for x in range(localnet_config["servicers"]["count"]): "genesis.externalConfigMap.name=v1-localnet-genesis", "genesis.externalConfigMap.key=genesis.json", "postgresql.primary.persistence.enabled=false", + "healthchecks.enabled=false", "podAnnotations.prometheus\\.io/scrape=true", "podAnnotations.prometheus\\.io/port=9000", "config.servicer.enabled=true", @@ -271,6 +273,7 @@ for x in range(localnet_config["fishermen"]["count"]): "genesis.externalConfigMap.name=v1-localnet-genesis", "genesis.externalConfigMap.key=genesis.json", "postgresql.primary.persistence.enabled=false", + "healthchecks.enabled=false", "podAnnotations.prometheus\\.io/scrape=true", "podAnnotations.prometheus\\.io/port=9000", "config.fisherman.enabled=true", @@ -302,6 +305,7 @@ for x in range(localnet_config["full_nodes"]["count"]): "genesis.externalConfigMap.name=v1-localnet-genesis", "genesis.externalConfigMap.key=genesis.json", "postgresql.primary.persistence.enabled=false", + "healthchecks.enabled=false", "podAnnotations.prometheus\\.io/scrape=true", "podAnnotations.prometheus\\.io/port=9000", "nodeType=full", diff --git a/charts/pocket/README.md b/charts/pocket/README.md index bbac55a3d..ec95dfc35 100644 --- a/charts/pocket/README.md +++ b/charts/pocket/README.md @@ -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 | diff --git a/charts/pocket/templates/statefulset.yaml b/charts/pocket/templates/statefulset.yaml index 7f68f29c5..f7051b114 100644 --- a/charts/pocket/templates/statefulset.yaml +++ b/charts/pocket/templates/statefulset.yaml @@ -106,6 +106,7 @@ spec: valueFrom: fieldRef: fieldPath: status.podIP +{{ if .Values.healthchecks.enabled }} livenessProbe: httpGet: path: /v1/health @@ -114,6 +115,7 @@ spec: httpGet: path: /v1/health port: rpc +{{ end }} volumeMounts: - name: config-volume mountPath: /pocket/configs/config.json diff --git a/charts/pocket/values.yaml b/charts/pocket/values.yaml index 9587814c7..cde1c02c7 100644 --- a/charts/pocket/values.yaml +++ b/charts/pocket/values.yaml @@ -146,6 +146,10 @@ image: # -- image tag tag: "latest" +healthchecks: + # -- enable liveness and readiness probes + enabled: true + # -- image pull secrets imagePullSecrets: [] nameOverride: "" From 55438da4613105eb1f027a60d9071790ae72a4fd Mon Sep 17 00:00:00 2001 From: Dmitry K Date: Mon, 7 Aug 2023 17:41:59 -0700 Subject: [PATCH 2/3] provision RPC module before P2P to allow healthchecks to pass --- build/localnet/Tiltfile | 4 ---- shared/node.go | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/build/localnet/Tiltfile b/build/localnet/Tiltfile index 71587b8c1..d4534df35 100644 --- a/build/localnet/Tiltfile +++ b/build/localnet/Tiltfile @@ -210,7 +210,6 @@ for x in range(localnet_config["validators"]["count"]): "genesis.externalConfigMap.name=v1-localnet-genesis", "genesis.externalConfigMap.key=genesis.json", "postgresql.primary.persistence.enabled=false", - "healthchecks.enabled=false", "podAnnotations.prometheus\\.io/scrape=true", "podAnnotations.prometheus\\.io/port=9000", "nodeType=validator", @@ -241,7 +240,6 @@ for x in range(localnet_config["servicers"]["count"]): "genesis.externalConfigMap.name=v1-localnet-genesis", "genesis.externalConfigMap.key=genesis.json", "postgresql.primary.persistence.enabled=false", - "healthchecks.enabled=false", "podAnnotations.prometheus\\.io/scrape=true", "podAnnotations.prometheus\\.io/port=9000", "config.servicer.enabled=true", @@ -273,7 +271,6 @@ for x in range(localnet_config["fishermen"]["count"]): "genesis.externalConfigMap.name=v1-localnet-genesis", "genesis.externalConfigMap.key=genesis.json", "postgresql.primary.persistence.enabled=false", - "healthchecks.enabled=false", "podAnnotations.prometheus\\.io/scrape=true", "podAnnotations.prometheus\\.io/port=9000", "config.fisherman.enabled=true", @@ -305,7 +302,6 @@ for x in range(localnet_config["full_nodes"]["count"]): "genesis.externalConfigMap.name=v1-localnet-genesis", "genesis.externalConfigMap.key=genesis.json", "postgresql.primary.persistence.enabled=false", - "healthchecks.enabled=false", "podAnnotations.prometheus\\.io/scrape=true", "podAnnotations.prometheus\\.io/port=9000", "nodeType=full", diff --git a/shared/node.go b/shared/node.go index 39b905e38..d52bbd7d3 100644 --- a/shared/node.go +++ b/shared/node.go @@ -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 { 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 } From 6151cffba799745c9a084a51db6b4f47779df5e7 Mon Sep 17 00:00:00 2001 From: Dmitry K Date: Mon, 7 Aug 2023 17:50:58 -0700 Subject: [PATCH 3/3] Empty commit