Skip to content

Commit

Permalink
feat: Skip Validation, Disable HostPort, and Misc Fixes (#56)
Browse files Browse the repository at this point in the history
* feat: possibility to skip validation

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>

* feat: option to disable hostPort

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>

---------

Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>
  • Loading branch information
smuu authored Oct 1, 2024
1 parent 8d18034 commit 2147f63
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
6 changes: 5 additions & 1 deletion charts/celestia-app/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ Compile all warnings into a single message.
{{- $message := join "\n" $messages -}}

{{- if $message -}}
{{- printf "\nVALUES VALIDATION:\n%s" $message -}}
{{- if .Values.global.skipValidationWarnings -}}
{{- print (printf "\nVALUES VALIDATION WARNINGS:\n%s" $message) -}}
{{- else -}}
{{- fail (printf "\nVALUES VALIDATION:\n%s" $message) -}}
{{- end -}}
{{- end -}}
{{- end -}}
2 changes: 2 additions & 0 deletions charts/celestia-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
## @param global.imageRegistry Global Docker image registry
## @param global.imagePullSecrets Global Docker registry secret names as an array
## @param global.storageClass Global StorageClass for Persistent Volume(s)
## @param global.skipValidationWarnings Skip validation warnings
##
global:
imageRegistry: ""
Expand All @@ -19,6 +20,7 @@ global:
##
imagePullSecrets: []
storageClass: ""
skipValidationWarnings: false
## Compatibility adaptations for Kubernetes platforms
##
compatibility:
Expand Down
6 changes: 5 additions & 1 deletion charts/celestia-node/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ Compile all validation messages into a single message and fail the deployment if
{{- $message := join "\n" $messages -}}

{{- if $message -}}
{{- fail (printf "\nVALUES VALIDATION:\n%s" $message) -}}
{{- if .Values.global.skipValidationWarnings -}}
{{- print (printf "\nVALUES VALIDATION WARNINGS:\n%s" $message) -}}
{{- else -}}
{{- fail (printf "\nVALUES VALIDATION:\n%s" $message) -}}
{{- end -}}
{{- end -}}
{{- end -}}
18 changes: 18 additions & 0 deletions charts/celestia-node/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ spec:
- name: home-dir # This is needed so that the process has permissions to create files in the home directory
mountPath: /home
readOnly: false
{{- if .Values.node.settings.secret.enabled }}
- name: keys
image: busybox
command:
Expand All @@ -138,11 +139,14 @@ spec:
chown -R {{ .Values.node.containerSecurityContext.runAsUser }}:{{ .Values.node.containerSecurityContext.runAsGroup }} /keys-volume/
find /keys-volume/ -type f -exec chmod 0600 {} \;
volumeMounts:
{{- if .Values.node.settings.secret.enabled }}
- name: keys
mountPath: /keys
readOnly: true
{{- end }}
- name: keys-volume
mountPath: /keys-volume
{{- end }}
{{- if .Values.node.initContainers }}
{{- include "common.tplvalues.render" (dict "value" .Values.node.initContainers "context" $) | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -194,22 +198,32 @@ spec:
ports:
- name: p2p-tcp
containerPort: {{ .Values.node.containerPorts.p2p }}
{{- if .Values.node.enableHostPort }}
hostPort: {{ .Values.node.containerPorts.p2p }}
{{- end }}
protocol: TCP
- name: p2p-udp
containerPort: {{ .Values.node.containerPorts.p2p }}
{{- if .Values.node.enableHostPort }}
hostPort: {{ .Values.node.containerPorts.p2p }}
{{- end }}
protocol: UDP
- name: ws
containerPort: {{ .Values.node.containerPorts.ws }}
{{- if .Values.node.enableHostPort }}
hostPort: {{ .Values.node.containerPorts.ws }}
{{- end }}
protocol: TCP
- name: rest
containerPort: {{ .Values.node.containerPorts.rest }}
{{- if .Values.node.enableHostPort }}
hostPort: {{ .Values.node.containerPorts.rest }}
{{- end }}
- name: rpc
containerPort: {{ .Values.node.containerPorts.rpc }}
{{- if .Values.node.enableHostPort }}
hostPort: {{ .Values.node.containerPorts.rpc }}
{{- end }}
- name: profiling
containerPort: {{ .Values.node.containerPorts.profiling }}
- name: prometheus
Expand Down Expand Up @@ -294,6 +308,7 @@ spec:
{{- if .Values.node.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.node.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.node.otelAgent.enabled }}
- name: otel-agent
image: {{ template "node.otelAgent.image" . }}
imagePullPolicy: {{ .Values.node.otelAgent.image.pullPolicy }}
Expand Down Expand Up @@ -331,10 +346,12 @@ spec:
- name: otel-agent-config
mountPath: /etc/otelcol-contrib/config.yaml
subPath: config.yaml
{{- end }}
{{- if .Values.node.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.node.sidecars "context" $) | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.node.settings.secret.enabled }}
- name: keys
secret:
secretName: {{ .Values.node.settings.secret.name }}
Expand All @@ -349,6 +366,7 @@ spec:
path: uid
- key: address
path: address
{{- end }}
- name: keys-volume
emptyDir: {}
- name: home-dir
Expand Down
8 changes: 8 additions & 0 deletions charts/celestia-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
## @param global.imageRegistry Global Docker image registry
## @param global.imagePullSecrets Global Docker registry secret names as an array
## @param global.storageClass Global StorageClass for Persistent Volume(s)
## @param global.skipValidationWarnings Skip validation warnings
##
global:
imageRegistry: ""
Expand All @@ -19,6 +20,8 @@ global:
##
imagePullSecrets: []
storageClass: ""
## Use with caution, this will skip validation warnings
skipValidationWarnings: false
## Compatibility adaptations for Kubernetes platforms
##
compatibility:
Expand Down Expand Up @@ -139,6 +142,7 @@ node:
## - key: NJ3XILLTMVRXEZLUFZVHO5A
## - key: OAZHALLLMV4Q
secret:
enabled: true
# -- name of the secret, it must be set
name: SET_IT
ws:
Expand Down Expand Up @@ -547,6 +551,10 @@ node:
profiling: 6060
# -- Prometheus container port, 8890 by default
prometheus: 8890
## @param node.enableHostPort Enable hostPort for the node
##
# -- Enable hostPort for the node
enableHostPort: true
## Configure extra options for node containers' liveness and readiness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes
## @param node.livenessProbe.enabled Enable livenessProbe on node containers
Expand Down

0 comments on commit 2147f63

Please sign in to comment.