Skip to content

Commit

Permalink
feat: node config per node type (#16)
Browse files Browse the repository at this point in the history
* feat: node config per node type

Signed-off-by: Smuu <[email protected]>

* feat: config per type

Signed-off-by: Smuu <[email protected]>

* fix: condition

Signed-off-by: Smuu <[email protected]>

---------

Signed-off-by: Smuu <[email protected]>
  • Loading branch information
smuu authored Aug 7, 2024
1 parent 575904d commit 04f9223
Show file tree
Hide file tree
Showing 21 changed files with 996 additions and 280 deletions.
12 changes: 12 additions & 0 deletions charts/celestia-node/templates/configmap-address.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "common.names.fullname" . }}-address
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: node
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
address: {{ .Values.node.settings.address }}
87 changes: 87 additions & 0 deletions charts/celestia-node/templates/configmap-bridge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{{- if eq .Values.node.settings.nodeType "bridge" }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "common.names.fullname" . }}-configtoml
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: node
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
config.toml: |
[Node]
StartupTimeout = "{{ .Values.node.config.bridge.configtoml.Node.StartupTimeout }}"
ShutdownTimeout = "{{ .Values.node.config.bridge.configtoml.Node.ShutdownTimeout }}"
[Core]
IP = "{{ .Values.node.config.bridge.configtoml.Core.IP }}"
RPCPort = "{{ .Values.node.config.bridge.configtoml.Core.RPCPort }}"
GRPCPort = "{{ .Values.node.config.bridge.configtoml.Core.GRPCPort }}"
[State]
KeyringAccName = "{{ .Values.node.config.bridge.configtoml.State.KeyringAccName }}"
KeyringBackend = "{{ .Values.node.config.bridge.configtoml.State.KeyringBackend }}"
GranterAddress = {{ .Values.node.config.bridge.configtoml.State.GranterAddress }}
[P2P]
ListenAddresses = [{{ range $index, $element := .Values.node.config.bridge.configtoml.P2P.ListenAddresses }}{{ if $index }}, {{ end }}"{{ $element }}"{{ end }}]
AnnounceAddresses = {{ .Values.node.config.bridge.configtoml.P2P.AnnounceAddresses }}
NoAnnounceAddresses = [{{ range $index, $element := .Values.node.config.bridge.configtoml.P2P.NoAnnounceAddresses }}{{ if $index }}, {{ end }}"{{ $element }}"{{ end }}]
MutualPeers = {{ .Values.node.config.bridge.configtoml.P2P.MutualPeers }}
PeerExchange = {{ .Values.node.config.bridge.configtoml.P2P.PeerExchange }}
RoutingTableRefreshPeriod = "{{ .Values.node.config.bridge.configtoml.P2P.RoutingTableRefreshPeriod }}"
[P2P.ConnManager]
Low = {{ printf "%.0f" .Values.node.config.bridge.configtoml.P2P.ConnManager.Low }}
High = {{ printf "%.0f" .Values.node.config.bridge.configtoml.P2P.ConnManager.High }}
GracePeriod = "{{ .Values.node.config.bridge.configtoml.P2P.ConnManager.GracePeriod }}"
[RPC]
Address = "{{ .Values.node.config.bridge.configtoml.RPC.Address }}"
Port = "{{ .Values.node.config.bridge.configtoml.RPC.Port }}"
SkipAuth = {{ .Values.node.config.bridge.configtoml.RPC.SkipAuth }}
[Gateway]
Address = "{{ .Values.node.config.bridge.configtoml.Gateway.Address }}"
Port = "{{ .Values.node.config.bridge.configtoml.Gateway.Port }}"
Enabled = {{ .Values.node.config.bridge.configtoml.Gateway.Enabled }}
[Share]
UseShareExchange = {{ .Values.node.config.bridge.configtoml.Share.UseShareExchange }}
[Share.EDSStoreParams]
GCInterval = "{{ .Values.node.config.bridge.configtoml.Share.EDSStoreParams.GCInterval }}"
RecentBlocksCacheSize = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Share.EDSStoreParams.RecentBlocksCacheSize }}
BlockstoreCacheSize = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Share.EDSStoreParams.BlockstoreCacheSize }}
[Share.ShrExEDSParams]
ServerReadTimeout = "{{ .Values.node.config.bridge.configtoml.Share.ShrExEDSParams.ServerReadTimeout }}"
ServerWriteTimeout = "{{ .Values.node.config.bridge.configtoml.Share.ShrExEDSParams.ServerWriteTimeout }}"
HandleRequestTimeout = "{{ .Values.node.config.bridge.configtoml.Share.ShrExEDSParams.HandleRequestTimeout }}"
ConcurrencyLimit = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Share.ShrExEDSParams.ConcurrencyLimit }}
BufferSize = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Share.ShrExEDSParams.BufferSize }}
[Share.ShrExNDParams]
ServerReadTimeout = "{{ .Values.node.config.bridge.configtoml.Share.ShrExNDParams.ServerReadTimeout }}"
ServerWriteTimeout = "{{ .Values.node.config.bridge.configtoml.Share.ShrExNDParams.ServerWriteTimeout }}"
HandleRequestTimeout = "{{ .Values.node.config.bridge.configtoml.Share.ShrExNDParams.HandleRequestTimeout }}"
ConcurrencyLimit = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Share.ShrExNDParams.ConcurrencyLimit }}
[Share.PeerManagerParams]
PoolValidationTimeout = "{{ .Values.node.config.bridge.configtoml.Share.PeerManagerParams.PoolValidationTimeout }}"
PeerCooldown = "{{ .Values.node.config.bridge.configtoml.Share.PeerManagerParams.PeerCooldown }}"
GcInterval = "{{ .Values.node.config.bridge.configtoml.Share.PeerManagerParams.GcInterval }}"
EnableBlackListing = {{ .Values.node.config.bridge.configtoml.Share.PeerManagerParams.EnableBlackListing }}
[Share.Discovery]
PeersLimit = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Share.Discovery.PeersLimit }}
AdvertiseInterval = "{{ .Values.node.config.bridge.configtoml.Share.Discovery.AdvertiseInterval }}"
[Header]
TrustedHash = "{{ .Values.node.config.bridge.configtoml.Header.TrustedHash }}"
TrustedPeers = {{ .Values.node.config.bridge.configtoml.Header.TrustedPeers }}
[Header.Store]
StoreCacheSize = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Header.Store.StoreCacheSize }}
IndexCacheSize = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Header.Store.IndexCacheSize }}
WriteBatchSize = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Header.Store.WriteBatchSize }}
[Header.Syncer]
TrustingPeriod = "{{ .Values.node.config.bridge.configtoml.Header.Syncer.TrustingPeriod }}"
[Header.Server]
WriteDeadline = "{{ .Values.node.config.bridge.configtoml.Header.Server.WriteDeadline }}"
ReadDeadline = "{{ .Values.node.config.bridge.configtoml.Header.Server.ReadDeadline }}"
RangeRequestTimeout = "{{ .Values.node.config.bridge.configtoml.Header.Server.RangeRequestTimeout }}"
[Header.Client]
MaxHeadersPerRangeRequest = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Header.Client.MaxHeadersPerRangeRequest }}
RangeRequestTimeout = "{{ .Values.node.config.bridge.configtoml.Header.Client.RangeRequestTimeout }}"
[Pruner]
EnableService = {{ .Values.node.config.bridge.configtoml.Pruner.EnableService }}
{{- end }}
93 changes: 93 additions & 0 deletions charts/celestia-node/templates/configmap-full.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{{- if eq .Values.node.settings.nodeType "full" }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "common.names.fullname" . }}-configtoml
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: node
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
config.toml: |
[Node]
StartupTimeout = "{{ .Values.node.config.full.configtoml.Node.StartupTimeout }}"
ShutdownTimeout = "{{ .Values.node.config.full.configtoml.Node.ShutdownTimeout }}"
[Core]
IP = "{{ .Values.node.config.full.configtoml.Core.IP }}"
RPCPort = "{{ .Values.node.config.full.configtoml.Core.RPCPort }}"
GRPCPort = "{{ .Values.node.config.full.configtoml.Core.GRPCPort }}"
[State]
KeyringAccName = "{{ .Values.node.config.full.configtoml.State.KeyringAccName }}"
KeyringBackend = "{{ .Values.node.config.full.configtoml.State.KeyringBackend }}"
GranterAddress = {{ .Values.node.config.full.configtoml.State.GranterAddress }}
[P2P]
ListenAddresses = [{{ range $index, $element := .Values.node.config.full.configtoml.P2P.ListenAddresses }}{{ if $index }}, {{ end }}"{{ $element }}"{{ end }}]
AnnounceAddresses = {{ .Values.node.config.full.configtoml.P2P.AnnounceAddresses }}
NoAnnounceAddresses = [{{ range $index, $element := .Values.node.config.full.configtoml.P2P.NoAnnounceAddresses }}{{ if $index }}, {{ end }}"{{ $element }}"{{ end }}]
MutualPeers = {{ .Values.node.config.full.configtoml.P2P.MutualPeers }}
PeerExchange = {{ .Values.node.config.full.configtoml.P2P.PeerExchange }}
RoutingTableRefreshPeriod = "{{ .Values.node.config.full.configtoml.P2P.RoutingTableRefreshPeriod }}"
[P2P.ConnManager]
Low = {{ printf "%.0f" .Values.node.config.full.configtoml.P2P.ConnManager.Low }}
High = {{ printf "%.0f" .Values.node.config.full.configtoml.P2P.ConnManager.High }}
GracePeriod = "{{ .Values.node.config.full.configtoml.P2P.ConnManager.GracePeriod }}"
[RPC]
Address = "{{ .Values.node.config.full.configtoml.RPC.Address }}"
Port = "{{ .Values.node.config.full.configtoml.RPC.Port }}"
SkipAuth = {{ .Values.node.config.full.configtoml.RPC.SkipAuth }}
[Gateway]
Address = "{{ .Values.node.config.full.configtoml.Gateway.Address }}"
Port = "{{ .Values.node.config.full.configtoml.Gateway.Port }}"
Enabled = {{ .Values.node.config.full.configtoml.Gateway.Enabled }}
[Share]
UseShareExchange = {{ .Values.node.config.full.configtoml.Share.UseShareExchange }}
[Share.EDSStoreParams]
GCInterval = "{{ .Values.node.config.full.configtoml.Share.EDSStoreParams.GCInterval }}"
RecentBlocksCacheSize = {{ printf "%.0f" .Values.node.config.full.configtoml.Share.EDSStoreParams.RecentBlocksCacheSize }}
BlockstoreCacheSize = {{ printf "%.0f" .Values.node.config.full.configtoml.Share.EDSStoreParams.BlockstoreCacheSize }}
[Share.ShrExEDSParams]
ServerReadTimeout = "{{ .Values.node.config.full.configtoml.Share.ShrExEDSParams.ServerReadTimeout }}"
ServerWriteTimeout = "{{ .Values.node.config.full.configtoml.Share.ShrExEDSParams.ServerWriteTimeout }}"
HandleRequestTimeout = "{{ .Values.node.config.full.configtoml.Share.ShrExEDSParams.HandleRequestTimeout }}"
ConcurrencyLimit = {{ printf "%.0f" .Values.node.config.full.configtoml.Share.ShrExEDSParams.ConcurrencyLimit }}
BufferSize = {{ printf "%.0f" .Values.node.config.full.configtoml.Share.ShrExEDSParams.BufferSize }}
[Share.ShrExNDParams]
ServerReadTimeout = "{{ .Values.node.config.full.configtoml.Share.ShrExNDParams.ServerReadTimeout }}"
ServerWriteTimeout = "{{ .Values.node.config.full.configtoml.Share.ShrExNDParams.ServerWriteTimeout }}"
HandleRequestTimeout = "{{ .Values.node.config.full.configtoml.Share.ShrExNDParams.HandleRequestTimeout }}"
ConcurrencyLimit = {{ printf "%.0f" .Values.node.config.full.configtoml.Share.ShrExNDParams.ConcurrencyLimit }}
[Share.PeerManagerParams]
PoolValidationTimeout = "{{ .Values.node.config.full.configtoml.Share.PeerManagerParams.PoolValidationTimeout }}"
PeerCooldown = "{{ .Values.node.config.full.configtoml.Share.PeerManagerParams.PeerCooldown }}"
GcInterval = "{{ .Values.node.config.full.configtoml.Share.PeerManagerParams.GcInterval }}"
EnableBlackListing = {{ .Values.node.config.full.configtoml.Share.PeerManagerParams.EnableBlackListing }}
[Share.Discovery]
PeersLimit = {{ printf "%.0f" .Values.node.config.full.configtoml.Share.Discovery.PeersLimit }}
AdvertiseInterval = "{{ .Values.node.config.full.configtoml.Share.Discovery.AdvertiseInterval }}"
[Header]
TrustedHash = "{{ .Values.node.config.full.configtoml.Header.TrustedHash }}"
TrustedPeers = {{ .Values.node.config.full.configtoml.Header.TrustedPeers }}
[Header.Store]
StoreCacheSize = {{ printf "%.0f" .Values.node.config.full.configtoml.Header.Store.StoreCacheSize }}
IndexCacheSize = {{ printf "%.0f" .Values.node.config.full.configtoml.Header.Store.IndexCacheSize }}
WriteBatchSize = {{ printf "%.0f" .Values.node.config.full.configtoml.Header.Store.WriteBatchSize }}
[Header.Syncer]
TrustingPeriod = "{{ .Values.node.config.full.configtoml.Header.Syncer.TrustingPeriod }}"
[Header.Server]
WriteDeadline = "{{ .Values.node.config.full.configtoml.Header.Server.WriteDeadline }}"
ReadDeadline = "{{ .Values.node.config.full.configtoml.Header.Server.ReadDeadline }}"
RangeRequestTimeout = "{{ .Values.node.config.full.configtoml.Header.Server.RangeRequestTimeout }}"
[Header.Client]
MaxHeadersPerRangeRequest = {{ printf "%.0f" .Values.node.config.full.configtoml.Header.Client.MaxHeadersPerRangeRequest }}
RangeRequestTimeout = "{{ .Values.node.config.full.configtoml.Header.Client.RangeRequestTimeout }}"
[DASer]
SamplingRange = {{ printf "%.0f" .Values.node.config.full.configtoml.DASer.SamplingRange }}
ConcurrencyLimit = {{ printf "%.0f" .Values.node.config.full.configtoml.DASer.ConcurrencyLimit }}
BackgroundStoreInterval = "{{ .Values.node.config.full.configtoml.DASer.BackgroundStoreInterval }}"
SampleFrom = {{ printf "%.0f" .Values.node.config.full.configtoml.DASer.SampleFrom }}
SampleTimeout = "{{ .Values.node.config.full.configtoml.DASer.SampleTimeout }}"
[Pruner]
EnableService = {{ .Values.node.config.full.configtoml.Pruner.EnableService }}
{{- end }}
Loading

0 comments on commit 04f9223

Please sign in to comment.