Skip to content

Commit

Permalink
[geth] minor chart updates
Browse files Browse the repository at this point in the history
* update services tpls
* move metrics options from config to flags
* update geth version to latest
  • Loading branch information
VladStarr committed Oct 10, 2023
1 parent 106b153 commit 6683095
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 89 deletions.
4 changes: 2 additions & 2 deletions dysnix/geth/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: geth
description: Go-ethereum blockchain node Helm Chart

version: 1.0.8
appVersion: v1.13.1
version: 1.0.9
appVersion: v1.13.2

keywords:
- geth
Expand Down
33 changes: 19 additions & 14 deletions dysnix/geth/templates/_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,41 +55,41 @@ MaxBlockHistory = 1024
MaxPrice = 500000000000
IgnorePrice = 2

{{- with .Values.config.node }}
{{ with .Values.config.node -}}
[Node]
DataDir = "/root/.ethereum"
IPCPath = {{ .ipc.enabled | ternary .ipc.path "" | quote }}
HTTPHost = {{ .http.enabled | ternary "0.0.0.0" "" | quote }}
HTTPPort = {{ .http.port }}
HTTPVirtualHosts = {{ include "geth.tomlList" .http.vhosts }}
HTTPModules = {{ include "geth.tomlList" .http.modules }}
HTTPCors = {{ include "geth.tomlList" .http.cors }}
HTTPVirtualHosts = {{ include "toml.list" .http.vhosts }}
HTTPModules = {{ include "toml.list" .http.modules }}
HTTPCors = {{ include "toml.list" .http.cors }}
AuthAddr = "0.0.0.0"
AuthPort = {{ .authrpc.port }}
AuthVirtualHosts = {{ include "geth.tomlList" .authrpc.vhosts }}
AuthVirtualHosts = {{ include "toml.list" .authrpc.vhosts }}
WSHost = {{ .ws.enabled | ternary "0.0.0.0" "" | quote }}
WSPort = {{ .ws.port }}
WSModules = {{ include "geth.tomlList" .ws.modules }}
WSOrigins = {{ include "geth.tomlList" .ws.origins }}
WSModules = {{ include "toml.list" .ws.modules }}
WSOrigins = {{ include "toml.list" .ws.origins }}
GraphQLVirtualHosts = ["localhost"]
BatchRequestLimit = 1000
BatchResponseMaxSize = 25000000
JWTSecret = "/secrets/jwt.hex"
{{- end }}

{{- with .Values.config.node.p2p }}
{{ with .Values.config.node.p2p -}}
[Node.P2P]
MaxPeers = {{ int .maxPeers }}
NoDiscovery = {{ .noDiscovery }}
DiscoveryV4 = true
{{- if .bootstrapNodes }}
BootstrapNodes = {{ include "geth.tomlList" .bootstrapNodes }}
BootstrapNodes = {{ include "toml.list" .bootstrapNodes }}
{{- end }}
{{- if .bootstrapNodesV5 }}
BootstrapNodesV5 = {{ include "geth.tomlList" .bootstrapNodesV5 }}
BootstrapNodesV5 = {{ include "toml.list" .bootstrapNodesV5 }}
{{- end }}
StaticNodes = {{ include "geth.tomlList" .staticNodes }}
TrustedNodes = {{ include "geth.tomlList" .trustedNodes }}
StaticNodes = {{ include "toml.list" .staticNodes }}
TrustedNodes = {{ include "toml.list" .trustedNodes }}
ListenAddr = ":{{ .port }}"
DiscAddr = ":{{ .discoveryPort }}"
EnableMsgEvents = false
Expand All @@ -101,7 +101,11 @@ ReadHeaderTimeout = 30000000000
WriteTimeout = 30000000000
IdleTimeout = 120000000000

{{- with .Values.config.metrics }}
{{/*
https://github.com/ethereum/go-ethereum/issues/24178
Metrics section in TOML config does not work, so use only CLI flags
[Metrics]
Enabled = {{ .enabled }}
EnabledExpensive = {{ .expensive }}
Expand All @@ -115,4 +119,5 @@ InfluxDBTags = "host=localhost"
InfluxDBToken = "test"
InfluxDBBucket = "geth"
InfluxDBOrganization = "geth"
{{- end }}

*/}}
4 changes: 2 additions & 2 deletions dysnix/geth/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ Create the name of the service account to use
{{- end }}

{{/*
Toml list generation
Convert Golang slice to Toml array
*/}}
{{- define "geth.tomlList" -}}
{{- define "toml.list" -}}
{{- print "[" }}
{{- range $idx, $element := . }}
{{- if $idx }}, {{ end }}
Expand Down
30 changes: 17 additions & 13 deletions dysnix/geth/templates/service-authrpc.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
{{- if .Values.services.authrpc.enabled }}
{{- with .Values.services.authrpc }}
{{- if .enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "geth.fullname" . }}-authrpc
{{- if .Values.services.authrpc.annotations }}
name: {{ include "geth.fullname" $ }}-authrpc
{{- with .annotations }}
annotations:
{{- toYaml .Values.services.authrpc.annotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
service-type: authrpc
{{- include "geth.labels" . | nindent 4 }}
{{- include "geth.labels" $ | nindent 4 }}
spec:
type: {{ .Values.services.authrpc.type }}
{{- with .Values.services.authrpc.loadBalancerIP }}
type: {{ .type }}
{{- with .loadBalancerIP }}
loadBalancerIP: {{ . }}
{{- end }}
{{- with .Values.services.authrpc.clusterIP }}
{{- with .clusterIP }}
clusterIP: {{ . }}
{{- end }}
{{- with .Values.services.authrpc.externalTrafficPolicy }}
{{- with .externalTrafficPolicy }}
externalTrafficPolicy: {{ . }}
{{- end }}
{{- with .Values.services.authrpc.internalTrafficPolicy }}
{{- with .internalTrafficPolicy }}
internalTrafficPolicy: {{ . }}
{{- end }}
publishNotReadyAddresses: true
{{- with .publishNotReadyAddresses }}
publishNotReadyAddresses: {{ . }}
{{- end }}
ports:
- name: authrpc
port: {{ .Values.services.authrpc.port }}
port: {{ .port }}
targetPort: authrpc
selector:
{{- include "geth.selectorLabels" . | nindent 4 }}
{{- include "geth.selectorLabels" $ | nindent 4 }}
{{- end }}
{{- end }}
30 changes: 17 additions & 13 deletions dysnix/geth/templates/service-metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
{{- if .Values.services.metrics.enabled }}
{{- with .Values.services.metrics }}
{{- if .enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "geth.fullname" . }}-metrics
{{- if .Values.services.metrics.annotations }}
name: {{ include "geth.fullname" $ }}-metrics
{{- with .annotations }}
annotations:
{{- toYaml .Values.services.metrics.annotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
service-type: metrics
{{- include "geth.labels" . | nindent 4 }}
{{- include "geth.labels" $ | nindent 4 }}
spec:
type: {{ .Values.services.metrics.type }}
{{- with .Values.services.metrics.loadBalancerIP }}
type: {{ .type }}
{{- with .loadBalancerIP }}
loadBalancerIP: {{ . }}
{{- end }}
{{- with .Values.services.metrics.clusterIP }}
{{- with .clusterIP }}
clusterIP: {{ . }}
{{- end }}
{{- with .Values.services.metrics.externalTrafficPolicy }}
{{- with .externalTrafficPolicy }}
externalTrafficPolicy: {{ . }}
{{- end }}
{{- with .Values.services.metrics.internalTrafficPolicy }}
{{- with .internalTrafficPolicy }}
internalTrafficPolicy: {{ . }}
{{- end }}
publishNotReadyAddresses: true
{{- with .publishNotReadyAddresses }}
publishNotReadyAddresses: {{ . }}
{{- end }}
ports:
- name: metrics
port: {{ .Values.services.metrics.port }}
port: {{ .port }}
targetPort: metrics
selector:
{{- include "geth.selectorLabels" . | nindent 4 }}
{{- include "geth.selectorLabels" $ | nindent 4 }}
{{- end }}
{{- end }}
32 changes: 18 additions & 14 deletions dysnix/geth/templates/service-p2p-disc.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
{{- if and .Values.services.p2pDiscovery.enabled (not .Values.config.node.p2p.useHostPort) }}
{{- with .Values.services.p2pDiscovery }}
{{- if and .enabled (not $.Values.config.node.p2p.useHostPort) }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "geth.fullname" . }}-p2p-discovery
{{- if .Values.services.p2pDiscovery.annotations }}
name: {{ include "geth.fullname" $ }}-p2p-discovery
{{- with .annotations }}
annotations:
{{- toYaml .Values.services.p2pDiscovery.annotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
service-type: p2p-discovery
{{- include "geth.labels" . | nindent 4 }}
{{- include "geth.labels" $ | nindent 4 }}
spec:
type: {{ .Values.services.p2pDiscovery.type }}
{{- with .Values.services.p2pDiscovery.loadBalancerIP }}
type: {{ .type }}
{{- with .loadBalancerIP }}
loadBalancerIP: {{ . }}
{{- end }}
{{- with .Values.services.p2pDiscovery.clusterIP }}
{{- with .clusterIP }}
clusterIP: {{ . }}
{{- end }}
{{- with .Values.services.p2pDiscovery.externalTrafficPolicy }}
{{- with .externalTrafficPolicy }}
externalTrafficPolicy: {{ . }}
{{- end }}
{{- with .Values.services.p2pDiscovery.internalTrafficPolicy }}
{{- with .internalTrafficPolicy }}
internalTrafficPolicy: {{ . }}
{{- end }}
publishNotReadyAddresses: true
{{- with .publishNotReadyAddresses }}
publishNotReadyAddresses: {{ . }}
{{- end }}
ports:
- name: p2p-udp
port: {{ .Values.services.p2pDiscovery.port }}
port: {{ .port }}
targetPort: p2p-udp
protocol: UDP
{{- with .Values.services.p2pDiscovery.nodePort }}
{{- with .nodePort }}
nodePort: {{ . }}
{{- end }}
selector:
{{- include "geth.selectorLabels" . | nindent 4 }}
{{- include "geth.selectorLabels" $ | nindent 4 }}
{{- end }}
{{- end }}
32 changes: 18 additions & 14 deletions dysnix/geth/templates/service-p2p.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
{{- if and .Values.services.p2p.enabled (not .Values.config.node.p2p.useHostPort) }}
{{- with .Values.services.p2p }}
{{- if and .enabled (not $.Values.config.node.p2p.useHostPort) }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "geth.fullname" . }}-p2p
{{- if .Values.services.p2p.annotations }}
name: {{ include "geth.fullname" $ }}-p2p
{{- with .annotations }}
annotations:
{{- toYaml .Values.services.p2p.annotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
service-type: p2p
{{- include "geth.labels" . | nindent 4 }}
{{- include "geth.labels" $ | nindent 4 }}
spec:
type: {{ .Values.services.p2p.type }}
{{- with .Values.services.p2p.loadBalancerIP }}
type: {{ .type }}
{{- with .loadBalancerIP }}
loadBalancerIP: {{ . }}
{{- end }}
{{- with .Values.services.p2p.clusterIP }}
{{- with .clusterIP }}
clusterIP: {{ . }}
{{- end }}
{{- with .Values.services.p2p.externalTrafficPolicy }}
{{- with .externalTrafficPolicy }}
externalTrafficPolicy: {{ . }}
{{- end }}
{{- with .Values.services.p2p.internalTrafficPolicy }}
{{- with .internalTrafficPolicy }}
internalTrafficPolicy: {{ . }}
{{- end }}
publishNotReadyAddresses: true
{{- with .publishNotReadyAddresses }}
publishNotReadyAddresses: {{ . }}
{{- end }}
ports:
- name: p2p-tcp
port: {{ .Values.services.p2p.port }}
port: {{ .port }}
targetPort: p2p-tcp
protocol: TCP
{{- with .Values.services.p2p.nodePort }}
{{- with .nodePort }}
nodePort: {{ . }}
{{- end }}
selector:
{{- include "geth.selectorLabels" . | nindent 4 }}
{{- include "geth.selectorLabels" $ | nindent 4 }}
{{- end }}
{{- end }}
34 changes: 18 additions & 16 deletions dysnix/geth/templates/service-rpc.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,46 @@
{{- if .Values.services.rpc.enabled }}
{{- with .Values.services.rpc }}
{{- if .enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "geth.fullname" . }}-rpc
{{- if .Values.services.rpc.annotations }}
name: {{ include "geth.fullname" $ }}-rpc
{{- with .annotations }}
annotations:
{{- toYaml .Values.services.rpc.annotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
service-type: rpc
{{- include "geth.labels" . | nindent 4 }}
{{- include "geth.labels" $ | nindent 4 }}
spec:
type: {{ .Values.services.rpc.type }}
{{- with .Values.services.rpc.loadBalancerIP }}
type: {{ .type }}
{{- with .loadBalancerIP }}
loadBalancerIP: {{ . }}
{{- end }}
{{- with .Values.services.rpc.clusterIP }}
{{- with .clusterIP }}
clusterIP: {{ . }}
{{- end }}
{{- with .Values.services.rpc.externalTrafficPolicy }}
{{- with .externalTrafficPolicy }}
externalTrafficPolicy: {{ . }}
{{- end }}
{{- with .Values.services.rpc.internalTrafficPolicy }}
{{- with .internalTrafficPolicy }}
internalTrafficPolicy: {{ . }}
{{- end }}
{{- with .Values.services.rpc.publishNotReadyAddresses }}
{{- with .publishNotReadyAddresses }}
publishNotReadyAddresses: {{ . }}
{{- end }}
ports:
- name: http
port: {{ .Values.services.rpc.httpPort }}
port: {{ .httpPort }}
targetPort: http
{{- if .Values.config.node.ws.enabled }}
{{- if $.Values.config.node.ws.enabled }}
- name: ws
port: {{ .Values.services.rpc.wsPort }}
port: {{ .wsPort }}
targetPort: ws
{{- end }}
selector:
{{- include "geth.selectorLabels" . | nindent 4 }}
{{- with .Values.podStatusLabels }}
{{- include "geth.selectorLabels" $ | nindent 4 }}
{{- with $.Values.podStatusLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
Loading

0 comments on commit 6683095

Please sign in to comment.