Skip to content

Commit

Permalink
#82: added readiness probe usage of new rpc health info and replicas=…
Browse files Browse the repository at this point in the history
…2 for zero downtime during upgrade
  • Loading branch information
sreuland committed Apr 18, 2024
1 parent 964c341 commit 2e809ac
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions charts/soroban-rpc/templates/soroban-rpc-sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
# Currently Soroban RPC doesn't support HA deployments.
# For that reason we hardcode replicas value at 1
replicas: 1
# Currently Soroban RPC doesn't support HA deployments over a single shared data store
# but, each replica pod in a statefulset will have it's own data store on it's PVC.
# This statefulset creates two replicas which will be monitored by the readiness probe.
# Having two replicas also ensures zero downtime during upgrades as at least one replica is
# gauranteed to be running while the other one is upgraded and catching backup to network
# after restart
replicas: 2
serviceName: {{ template "common.fullname" . }}
selector:
matchLabels:
Expand Down Expand Up @@ -73,7 +77,11 @@ spec:
"jsonrpc": "2.0",
"id": 10235,
"method": "getHealth"
}' | grep "healthy"
}' | jq -es 'if (. | length) == 0 then null else .[0] end | .result | .status == "healthy" and (.latestLedger - .oldestLedger >= (.ledgerRetentionWindow - 10))' > /dev/null;
failureThreshold: 2
periodSeconds: 10
successThreshold: 2
timeoutSeconds: 5
{{- if (.Values.sorobanRpc).resources}}
resources:
{{ toYaml .Values.sorobanRpc.resources | indent 10 }}
Expand Down

0 comments on commit 2e809ac

Please sign in to comment.