Skip to content

Commit

Permalink
add logic for nodeType validations, set ClusteIP for SVCs by default
Browse files Browse the repository at this point in the history
  • Loading branch information
aWN4Y25pa2EK committed Jun 28, 2024
1 parent c3ee6e9 commit 155ac04
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 64 deletions.
5 changes: 3 additions & 2 deletions charts/celestia-node/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,21 @@ Return the proper image name for the otel agent
{{- end -}}

{{/*
Validate the node.settings.nodeType value.
Validate the node.settings.nodeType value against the first argument in node.args.
*/}}
{{- 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'.
{{- else if not (eq .Values.node.settings.nodeType (first .Values.node.args)) -}}
The nodeType value ({{ .Values.node.settings.nodeType }}) does not match the first argument in args ({{ first .Values.node.args }}).
{{- 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 and fail the deployment if there are any.
*/}}
{{- define "node.validateValues" -}}
Expand Down
8 changes: 4 additions & 4 deletions charts/celestia-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,9 @@ service:
prometheus: 8890
## @param service.internal.clusterIP node internal service Cluster IP
## e.g.:
## clusterIP: None
## clusterIP: None # We use headless mode by default for stateful workloads.
##
clusterIP: ""
clusterIP: "None"
## @param service.internal.annotations Additional custom annotations for node internal service
##
annotations: {}
Expand All @@ -755,8 +755,8 @@ service:
enabled: true
## @param service.external.type node external service type
##
# -- external service type, LoadBalancer by default
type: LoadBalancer
# -- external service type, ClusterIP by default
type: ClusterIP
## @param service.external.ports.p2p Node external service P2P port
## @param service.external.ports.rest Node external service REST port
## @param service.external.ports.rpc Node external service RPC port
Expand Down
58 changes: 0 additions & 58 deletions examples/celestia-app/arabica.yaml

This file was deleted.

0 comments on commit 155ac04

Please sign in to comment.