Skip to content

Commit

Permalink
add change requests
Browse files Browse the repository at this point in the history
  • Loading branch information
aWN4Y25pa2EK committed Jun 27, 2024
1 parent b25ea9c commit 3670c71
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 23 deletions.
1 change: 1 addition & 0 deletions charts/celestia-node/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ In order to replicate the container startup scripts execute this command:
{{- end }}

{{- include "common.warnings.rollingTag" .Values.node.image }}
{{- include "node.validateValues" . }}
20 changes: 15 additions & 5 deletions charts/celestia-node/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,37 @@ Create the name of the service account to use
{{- end -}}
{{- end -}}


{{/*
Return the proper image name for the otel agent
*/}}
{{- define "node.otelAgent.image" -}}
{{- include "common.images.image" (dict "imageRoot" .Values.node.otelAgent.image "global" .Values.global) -}}
{{- end -}}

{{/*
Validate the node.settings.nodeType value.
*/}}
{{- define "node.validateValues.nodeType" -}}
{{- if not (hasKey .Values.node.settings "nodeType") -}}
Node type is not set. Must be one of 'bridge', 'full', or 'light'.
{{- else if and (ne .Values.node.settings.nodeType "bridge") (ne .Values.node.settings.nodeType "full") (ne .Values.node.settings.nodeType "light") -}}
Invalid node type: {{ .Values.node.settings.nodeType }}. Must be one of 'bridge', 'full', or 'light'.
{{- end -}}
{{- end -}}

# TODO: add validations for values
# Remember to add the validation message to NOTES.txt at the end ({{- include "node.validateValues" . }})
{{/*
Compile all warnings into a single message.
{{/*
Compile all warnings into a single message and fail the deployment if there are any.
*/}}
{{- define "node.validateValues" -}}
{{- $messages := list -}}
{{- $messages := append $messages (include "node.validateValues.foo" .) -}}
{{- $messages := append $messages (include "node.validateValues.bar" .) -}}
{{- $messages := append $messages (include "node.validateValues.nodeType" .) -}}
{{- $messages := without $messages "" -}}
{{- $message := join "\n" $messages -}}

{{- if $message -}}
{{- printf "\nVALUES VALIDATION:\n%s" $message -}}
{{- fail (printf "\nVALUES VALIDATION:\n%s" $message) -}}
{{- end -}}
{{- end -}}
6 changes: 3 additions & 3 deletions charts/celestia-node/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,17 @@ spec:
{{- if .Values.node.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.node.customReadinessProbe "context" $) | nindent 12 }}
{{- else if .Values.node.readinessProbe.enabled }}
{{- if or (eq .Values.node.nodeType "bridge") (eq .Values.node.nodeType "full") }}
{{- if or (eq .Values.node.settings.nodeType "bridge") (eq .Values.node.settings.nodeType "full") (eq .Values.node.settings.nodeType "light") }}
readinessProbe:
exec:
command:
- sh
- '-c'
- >
AUTH_TOKEN=$(celestia bridge auth read --node.store=/home/celestia 2>/dev/null);
{{- if eq .Values.node.nodeType "bridge" }}
{{- if eq .Values.node.settings.nodeType "bridge" }}
curl --max-time 0.5 -s -X POST -H "Content-type: application/json" -H "Accept: application/json" -H "Authorization: Bearer $AUTH_TOKEN" -d '{"id":1,"jsonrpc":"2.0","method":"header.SyncWait","params":[]}' "http://localhost:26658";
{{- else if eq .Values.node.nodeType "full" }}
{{- else if or (eq .Values.node.settings.nodeType "full") (eq .Values.node.settings.nodeType "light") }}
curl --max-time 0.5 -s -X POST -H "Content-type: application/json" -H "Accept: application/json" -H "Authorization: Bearer $AUTH_TOKEN" -d '{"id":1,"jsonrpc":"2.0","method":"das.WaitCatchUp","params":[]}' "http://localhost:26658";
{{- end }}
if [ "$?" -eq 0 ]; then exit 0; else echo "Catching up"; exit 1; fi
Expand Down
12 changes: 6 additions & 6 deletions charts/celestia-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ diagnosticMode:
## %%MAIN_CONTAINER/POD_DESCRIPTION%%
##
node:
## Select from: bridge, full, light
## Valid values:
## - bridge
## - full
## - light:
nodeType: bridge
## Celestia celestia-node image
## ref: https://github.com/celestiaorg/celestia-node/pkgs/container/celestia-node/versions?filters%5Bversion_type%5D=tagged
## @param node.image.registry [default: REGISTRY_NAME] celestia-node image registry
Expand Down Expand Up @@ -114,6 +108,12 @@ node:
pullSecrets: []
## @param node.settings Settings for the celestia-node
settings:
## Select from: bridge, full, light
## Valid values:
## - bridge
## - full
## - light:
nodeType: bridge
## @param node.settings.home Home directory for the celestia-node
##
# -- home directory for the celestia-node, defaults to /home/celestia
Expand Down
13 changes: 7 additions & 6 deletions examples/celestia-node/arabica-bridge.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
commonLabels:
commonLabels: &commonLabels
chain_id: arabica-11
environment: arabica
network: da
type: bridge # check
type: &nodeType bridge # check
secretName: &secretName keys-da-bridge-1 # check
persistence:
size: 1000Gi
dataSource:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: da-latest
node:
nodeType: bridge # check
persistentVolumeClaimRetentionPolicy:
whenDeleted: Delete
whenScaled: Retain
Expand Down Expand Up @@ -38,22 +38,23 @@ node:
periodSeconds: 10
failureThreshold: 60
args:
- bridge # check
- *nodeType
- start
- --p2p.network=arabica-11
- --node.store=$(CELESTIA_HOME)
- --metrics
- --metrics.tls=false
- --p2p.metrics
settings:
nodeType: *nodeType
address: "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMS0wMiAxMjo1NzoyMC4yNjk1Mjg2NTQgKzAwMDAgVVRDIG09KzAuMDQwNDkyNDk0IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoibHBUb0pLUkFvS3NPbmRhaCJ9.SFen5RaM_7JverpZQN6VxtJ06XePE5VKjyzMyIPgqURSge-XbiLHqA.vZ4fuVFbrLODe8RM.EGKwO3uGEifnPanziF-AD4i6q_92IetSVAEz-7Grg75AJyFLV3Flt4CmfLxrJ2JHWJEKUQBNyIU81u7pd01iNzEECDy9b0jO3DYZ_5PRET8zrVPv6SKKZ_U7MLWmAe_eUajipnbqZ6NzG8UcG4qAt278ttZB1KQsKqocKlE39fSvo3iaZEzOKxS0N3tU1Xw2C3w6HgHJFk0QiP36NIHuKoP_4QJkeAomhJX-cNOYwvTd8qTFTk2-1TzLJ5DasLXsVXTUSUzCzYQhEfL8F0qFoGvuY1dWRD5BESw2Gg2oLH1w957Xd2UhRbo5ORz9POR7goEv9AZ_rWrjSV8HozUmgFwDQyM89M7oiNedEfGQoDjypzcUBcVkZLEMIdrFRpshjcpNEzy6-PZ9rSxouKb7wemG_sueX3V3gIPCTfFr6hB8_b2mV-kKeIXQRS5pJz_wXxeFHFKOHDjt3L8n5eqh.fy-zygX7rjTUqgX02sZKKg"
node_id: "92a499fc2ce7cabd2de89416aa0d0d07838f625d"
secret:
name: keys-da-bridge-1
name: *secretName
config:
configtoml:
Core:
IP: consensus-validator-1
IP: consensus-validator
RPC:
Enabled: true
Address: 0.0.0.0
Expand Down
6 changes: 3 additions & 3 deletions examples/celestia-node/arabica-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ commonLabels:
chain_id: arabica-11
environment: arabica
network: da
type: full # check
type: &nodeType full # check
persistence:
size: 1000Gi
dataSource:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: da-latest
node:
nodeType: full # check
persistentVolumeClaimRetentionPolicy:
whenDeleted: Delete
whenScaled: Retain
Expand Down Expand Up @@ -46,14 +45,15 @@ node:
- --metrics.tls=false
- --p2p.metrics
settings:
nodeType: full # check
address: "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMS0wMiAxMjo1NzoyMC4yNjk1Mjg2NTQgKzAwMDAgVVRDIG09KzAuMDQwNDkyNDk0IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoibHBUb0pLUkFvS3NPbmRhaCJ9.SFen5RaM_7JverpZQN6VxtJ06XePE5VKjyzMyIPgqURSge-XbiLHqA.vZ4fuVFbrLODe8RM.EGKwO3uGEifnPanziF-AD4i6q_92IetSVAEz-7Grg75AJyFLV3Flt4CmfLxrJ2JHWJEKUQBNyIU81u7pd01iNzEECDy9b0jO3DYZ_5PRET8zrVPv6SKKZ_U7MLWmAe_eUajipnbqZ6NzG8UcG4qAt278ttZB1KQsKqocKlE39fSvo3iaZEzOKxS0N3tU1Xw2C3w6HgHJFk0QiP36NIHuKoP_4QJkeAomhJX-cNOYwvTd8qTFTk2-1TzLJ5DasLXsVXTUSUzCzYQhEfL8F0qFoGvuY1dWRD5BESw2Gg2oLH1w957Xd2UhRbo5ORz9POR7goEv9AZ_rWrjSV8HozUmgFwDQyM89M7oiNedEfGQoDjypzcUBcVkZLEMIdrFRpshjcpNEzy6-PZ9rSxouKb7wemG_sueX3V3gIPCTfFr6hB8_b2mV-kKeIXQRS5pJz_wXxeFHFKOHDjt3L8n5eqh.fy-zygX7rjTUqgX02sZKKg"
node_id: "92a499fc2ce7cabd2de89416aa0d0d07838f625d"
secret:
name: keys-da-bridge-1
config:
configtoml:
Core:
IP: consensus-validator-1
IP: consensus-validator
RPC:
Enabled: true
Address: 0.0.0.0
Expand Down
67 changes: 67 additions & 0 deletions examples/celestia-node/arabica-light.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
commonLabels: &commonLabels
chain_id: arabica-11
environment: arabica
network: da
type: &nodeType light # check
secretName: &secretName keys-da-bridge-1 # check
persistence:
size: 1000Gi
dataSource:
apiGroup: snapshot.storage.k8s.io
kind: VolumeSnapshot
name: da-latest
node:
persistentVolumeClaimRetentionPolicy:
whenDeleted: Delete
whenScaled: Retain
otelAgent:
enabled: true
grafanaOtelSecret:
name: grafana-otel-token
resources:
requests:
cpu: 3
memory: 15Gi
limits:
cpu: 6
memory: 24Gi
livenessProbe:
enabled: true
periodSeconds: 10
failureThreshold: 3
readinessProbe:
enabled: true
periodSeconds: 10
failureThreshold: 30
startupProbe:
enabled: true
periodSeconds: 10
failureThreshold: 60
args:
- *nodeType
- start
- --p2p.network=arabica-11
- --node.store=$(CELESTIA_HOME)
- --metrics
- --metrics.tls=false
- --p2p.metrics
settings:
nodeType: *nodeType
address: "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wMS0wMiAxMjo1NzoyMC4yNjk1Mjg2NTQgKzAwMDAgVVRDIG09KzAuMDQwNDkyNDk0IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoibHBUb0pLUkFvS3NPbmRhaCJ9.SFen5RaM_7JverpZQN6VxtJ06XePE5VKjyzMyIPgqURSge-XbiLHqA.vZ4fuVFbrLODe8RM.EGKwO3uGEifnPanziF-AD4i6q_92IetSVAEz-7Grg75AJyFLV3Flt4CmfLxrJ2JHWJEKUQBNyIU81u7pd01iNzEECDy9b0jO3DYZ_5PRET8zrVPv6SKKZ_U7MLWmAe_eUajipnbqZ6NzG8UcG4qAt278ttZB1KQsKqocKlE39fSvo3iaZEzOKxS0N3tU1Xw2C3w6HgHJFk0QiP36NIHuKoP_4QJkeAomhJX-cNOYwvTd8qTFTk2-1TzLJ5DasLXsVXTUSUzCzYQhEfL8F0qFoGvuY1dWRD5BESw2Gg2oLH1w957Xd2UhRbo5ORz9POR7goEv9AZ_rWrjSV8HozUmgFwDQyM89M7oiNedEfGQoDjypzcUBcVkZLEMIdrFRpshjcpNEzy6-PZ9rSxouKb7wemG_sueX3V3gIPCTfFr6hB8_b2mV-kKeIXQRS5pJz_wXxeFHFKOHDjt3L8n5eqh.fy-zygX7rjTUqgX02sZKKg"
node_id: "92a499fc2ce7cabd2de89416aa0d0d07838f625d"
secret:
name: *secretName
config:
configtoml:
Core:
IP: consensus-validator
RPC:
Enabled: true
Address: 0.0.0.0
Gateway:
Enabled: true
Address: 0.0.0.0
Node:
StartupTimeout: 2m
diagnosticMode:
enabled: false

0 comments on commit 3670c71

Please sign in to comment.