Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/network/charts/network-nodes/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: network-nodes
description: A Helm chart for Kubernetes
type: application
version: 0.1.1
appVersion: "0.1.0"
appVersion: "0.1.1"
maintainers:
- name: SettleMint
email: support@settlemint.com
Expand Down
3 changes: 2 additions & 1 deletion charts/network/charts/network-nodes/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# network-nodes

![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.1](https://img.shields.io/badge/AppVersion-0.1.1-informational?style=flat-square)

A Helm chart for Kubernetes

Expand Down Expand Up @@ -30,6 +30,7 @@ A Helm chart for Kubernetes
| config.http.maxActiveConnections | int | `2000` | Maximum concurrent HTTP JSON-RPC connections. |
| config.http.maxBatchSize | int | `512` | Maximum number of batched JSON-RPC calls per request. |
| config.http.maxRequestContentLength | int | `524288000` | Maximum HTTP request body size in bytes. |
| config.logFormat | string | `"plain"` | Log output format. Supports "plain" (default) or "json". |
| config.logging | string | `"INFO"` | Log verbosity level for Besu components. |
| config.metrics.categories | list | `["BLOCKCHAIN","ETHEREUM","EXECUTORS","JVM","NETWORK","PEERS","PROCESS","PRUNER","RPC","SYNCHRONIZER","TRANSACTION_POOL"]` | Metrics categories exposed to Prometheus. |
| config.metrics.enabled | bool | `true` | Enable the Prometheus metrics endpoint. |
Expand Down
23 changes: 23 additions & 0 deletions charts/network/charts/network-nodes/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ If release name contains chart name it will be used as a full name.
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{- end }}

{{/*
Expand Down Expand Up @@ -61,6 +62,28 @@ Create the name of the service account to use
{{- end }}
{{- end }}

{{/*
Render optional Log4j environment variables when structured logging is enabled.
*/}}
{{- define "nodes.log4jEnv" -}}
{{- if eq (default "plain" .Values.config.logFormat) "json" }}
- name: LOG4J_CONFIGURATION_FILE
value: /etc/besu/log-config.xml
{{- end }}
{{- end }}

{{/*
Render optional volume mounts for the Log4j configuration file.
*/}}
{{- define "nodes.log4jVolumeMount" -}}
{{- if eq (default "plain" .Values.config.logFormat) "json" }}
- name: besu-config
mountPath: /etc/besu/log-config.xml
subPath: log-config.xml
readOnly: true
{{- end }}
{{- end }}

{{/*
Resolve the number of validator replicas, falling back to global overrides when provided.
*/}}
Expand Down
19 changes: 19 additions & 0 deletions charts/network/charts/network-nodes/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
{{- $persistenceEnabled := default false (get $persistence "enabled") }}
{{- $mountPath := default "" (get $persistence "mountPath") }}
{{- $privateKeyFilename := default "privateKey" .Values.config.privateKeyFilename }}
{{- $logFormat := default "plain" .Values.config.logFormat }}
data:
config.toml: |-
data-path="/data"
Expand Down Expand Up @@ -61,3 +62,21 @@ data:
metrics-host={{ .Values.config.metrics.host | quote }}
metrics-port={{ .Values.service.ports.metrics | int }}
metrics-category={{ .Values.config.metrics.categories | toJson }}
{{- if eq $logFormat "json" }}
log-config.xml: |-
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO" monitorInterval="5">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Log4j2 configuration has status="INFO". This will cause Log4j2 to print its internal status logging at the INFO level to standard output, which can be verbose. It's generally recommended to set this to WARN in production environments to only see important internal Log4j2 messages.

    <Configuration status="WARN" monitorInterval="5">

<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<JsonLayout compact="false" eventEol="true" properties="true" stacktrace="true">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The JsonLayout is configured with compact="false", which produces multi-line, pretty-printed JSON logs. While this is human-readable, most log processing systems work best with compact, single-line JSON objects per log event. Using compact="true" is generally better for log aggregation and parsing.

          <JsonLayout compact="true" eventEol="true" properties="true" stacktrace="true">

<KeyValuePair key="container" value="${hostName}" />
</JsonLayout>
</Console>
</Appenders>
<Loggers>
<Root level="{{ .Values.config.logging }}">
<AppenderRef ref="Console" />
</Root>
</Loggers>
</Configuration>
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- $log4jEnv := include "nodes.log4jEnv" . }}
{{- if $log4jEnv }}
{{ $log4jEnv | nindent 12 }}
{{- end }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
Expand Down Expand Up @@ -141,6 +145,10 @@ spec:
mountPath: /etc/besu/config.toml
subPath: config.toml
readOnly: true
{{- $log4jMount := include "nodes.log4jVolumeMount" . }}
{{- if $log4jMount }}
{{ $log4jMount | nindent 12 }}
{{- end }}
- name: besu-genesis
mountPath: /etc/besu/genesis.json
subPath: genesis.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- $log4jEnv := include "nodes.log4jEnv" . }}
{{- if $log4jEnv }}
{{ $log4jEnv | nindent 12 }}
{{- end }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
Expand Down Expand Up @@ -140,6 +144,10 @@ spec:
mountPath: /etc/besu/config.toml
subPath: config.toml
readOnly: true
{{- $log4jMount := include "nodes.log4jVolumeMount" . }}
{{- if $log4jMount }}
{{ $log4jMount | nindent 12 }}
{{- end }}
- name: besu-genesis
mountPath: /etc/besu/genesis.json
subPath: genesis.json
Expand Down
2 changes: 2 additions & 0 deletions charts/network/charts/network-nodes/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ service:
config:
# -- (string) Log verbosity level for Besu components.
logging: INFO
# -- (string) Log output format. Supports "plain" (default) or "json".
logFormat: plain
# -- (string) Ledger storage backend (FOREST or BONSAI).
dataStorageFormat: FOREST
# -- (string) Filename containing each node's private key within mounted secrets.
Expand Down