Skip to content

Commit

Permalink
fix(deployment): fixed PR review change request
Browse files Browse the repository at this point in the history
  • Loading branch information
idan-starkware committed Jul 9, 2024
1 parent 9c7da04 commit 8f576a6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 28 deletions.
6 changes: 3 additions & 3 deletions deployments/helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ Build the p2p peer multiaddress string
*/}}
{{- define "p2p.bootstrapPeerMultiaddr" -}}
{{- if and .Values.p2p.enabled (not .Values.p2p.bootstrap) -}}
{{- $ip := .Values.p2p.nodeConfig.network_bootstrap_peer_multiaddr_ip -}}
{{- $port := .Values.p2p.nodeConfig.network_bootstrap_peer_multiaddr_port -}}
{{- $uid := .Values.p2p.nodeConfig.network_bootstrap_peer_multiaddr_uid -}}
{{- $ip := .Values.p2p.nodeConfig.bootstrapServer.multiaddrIp -}}
{{- $port := .Values.p2p.nodeConfig.bootstrapServer.multiaddrPort -}}
{{- $uid := .Values.p2p.nodeConfig.bootstrapServer.multiaddrUid -}}
{{- printf "/ip4/%s/tcp/%s/p2p/%s" $ip $port $uid -}}
{{- else -}}
{{- "" -}}
Expand Down
12 changes: 6 additions & 6 deletions deployments/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ spec:
cpu: {{ .Values.deployment.resources.requests.cpu | quote}}
memory: {{ .Values.deployment.resources.requests.memory }}
{{- if not .Values.backup.enabled }}
{{- with .Values.deployment.extraEnv }}
{{- with .Values.deployment.env }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
Expand All @@ -73,14 +73,14 @@ spec:
- {{ .Values.base_layer_node_url }}
{{- if .Values.p2p.enabled }}
- --network.tcp_port
- {{ default "10000" .Values.p2p.config.network_tcp_port | quote }}
- {{ default "10000" .Values.p2p.config.networkTcpPort | quote }}
- --storage.db_config.path_prefix
- {{ default "data" .Values.p2p.config.storage_db_config_path_prefix | quote }}
- {{ default "data" .Values.p2p.config.storageDbConfigPathPrefix | quote }}
- --network.#is_none
- {{ default false .Values.p2p.config.network_is_none | quote }}
- {{ default false .Values.p2p.config.networkIsNone | quote }}
{{- if not .Values.p2p.bootstrap }}
- --network.bootstrap_peer_multiaddr.#is_none
- {{ default false .Values.p2p.nodeConfig.network_bootstrap_peer_multiaddr_is_none | quote }}
- {{ default false .Values.p2p.nodeConfig.bootstrapServer.multiaddrIsNone | quote }}
- --network.bootstrap_peer_multiaddr
- {{ include "p2p.bootstrapPeerMultiaddr" . | quote }}
{{- end}}
Expand All @@ -104,7 +104,7 @@ spec:
name: monitoring
{{- end }}
{{- if .Values.p2p.enabled }}
- containerPort: {{ default "10000" .Values.p2p.config.network_tcp_port | quote }}
- containerPort: {{ default 10000 .Values.p2p.config.networkTcpPort }}
name: p2p
{{- end }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions deployments/helm/templates/p2p-service.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- if and (.Values.backup.enabled) .Values.p2p.enabled }}
{{- if and ( not .Values.backup.enabled ) .Values.p2p.enabled }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "papyrus.name" . }}-p2p-svc
name: {{ template "papyrus.name" . }}-p2p
labels:
{{- include "papyrus.labels" . | nindent 4 }}
spec:
Expand All @@ -15,7 +15,7 @@ spec:
port: {{ .Values.p2p.service.port }}
protocol: {{ .Values.p2p.service.protocol }}
targetPort: p2p
{{- if and (eq .Values.p2p.service.tpye "NodePort") .Values.p2p.service.nodePort }}
{{- if and (eq .Values.p2p.service.type "NodePort") .Values.p2p.service.nodePort }}
nodePort: {{ .Values.p2p.service.nodePort }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion deployments/helm/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "papyrus.name" . }}-svc
name: {{ template "papyrus.name" . }}
labels:
{{- include "papyrus.labels" . | nindent 4 }}
spec:
Expand Down
31 changes: 16 additions & 15 deletions deployments/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,34 @@ starknet:

p2p:
enabled: true
# Set to true if node is "bootstrap"
# Set to true if node act as bootstrap server
bootstrap: false
# General config
config:
# Optional - The node self port to listen | default "10000"
network_tcp_port:
networkTcpPort:
# Optional - The node data path | default "data"
storage_db_config_path_prefix:
storageDbConfigPathPrefix:
# Optional - network.#is_none flag | default "false"
network_is_none:
networkIsNone:
# Config to include only if "bootstrap: false"
nodeConfig:
# Mandatory - The network.#is_none flag on the bootsrap server
network_bootstrap_peer_multiaddr_is_none:
# Mandatory - The bootstrap server to connect to, ip adress
network_bootstrap_peer_multiaddr_ip:
# Mandatory - The bootstrap server to connect to, port
network_bootstrap_peer_multiaddr_port:
# Mandatory - The bootstrap server to connect to, uid
network_bootstrap_peer_multiaddr_uid:
bootstrapServer:
# Mandatory - The network.#is_none flag on the bootsrap server
multiaddrIsNone:
# Mandatory - The bootstrap server to connect to, ip adress
multiaddrIp:
# Mandatory - The bootstrap server to connect to, port
multiaddrPort:
# Mandatory - The bootstrap server to connect to, uid
multiaddrUid:
service:
# Specify service type, options are ClusterIP | NodePort | LoadBalancer
type: LoadBalancer
type: ClusterIP
port: 10000
protocol: TCP
nodePort:

deployment:
# The container image
image:
Expand Down Expand Up @@ -71,7 +72,7 @@ deployment:
cpu: 500m
memory: 1Gi
## Optionally specify extra environment variables to add to papyrus container
extraEnv: []
env: []
# - name: FOO
# value: BAR
extraArgs: {} # Optional additional deployment args
Expand Down

0 comments on commit 8f576a6

Please sign in to comment.