Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add persistent storage for aztec nodes in the spartan cluster #8923

Merged
merged 7 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
23 changes: 22 additions & 1 deletion spartan/aztec-network/templates/anvil.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,25 @@ spec:
targetPort: {{ .Values.ethereum.service.targetPort }}
{{- if and (eq .Values.ethereum.service.type "NodePort") .Values.ethereum.service.nodePort }}
nodePort: {{ .Values.ethereum.service.nodePort }}
{{- end }}
{{- end }}
---
{{if .Values.network.public }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "aztec-network.fullname" . }}-ethereum-lb
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
type: LoadBalancer
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: ethereum
ports:
- protocol: TCP
port: {{ .Values.ethereum.service.port }}
targetPort: {{ .Values.ethereum.service.targetPort }}
{{- if and (eq .Values.ethereum.service.type "NodePort") .Values.ethereum.service.nodePort }}
nodePort: {{ .Values.ethereum.service.nodePort }}
{{- end }}
{{ end }}
36 changes: 32 additions & 4 deletions spartan/aztec-network/templates/boot-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,20 @@ spec:
resources:
{{- toYaml .Values.bootNode.resources | nindent 12 }}
volumes:
- name: shared-volume
emptyDir: {}
- name: scripts
configMap:
name: {{ include "aztec-network.fullname" . }}-deploy-contracts-script
volumeClaimTemplates:
- metadata:
name: shared-volume
labels:
{{- include "aztec-network.labels" . | nindent 8 }}
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: {{ .Values.bootNode.storage }}
storageClassName: "gp2"
stevenplatt marked this conversation as resolved.
Show resolved Hide resolved
---
apiVersion: v1
kind: Service
Expand All @@ -136,12 +145,31 @@ metadata:
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
type: {{if .Values.network.public }}"LoadBalancer"{{ else }}"ClusterIP"{{ end }}
type: ClusterIP
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: boot-node
ports:
- port: {{ .Values.bootNode.service.p2pPort }}
name: p2p
- port: {{ .Values.bootNode.service.nodePort }}
name: node
---
{{if .Values.network.public }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "aztec-network.fullname" . }}-boot-node-lb
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
type: LoadBalancer
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: boot-node
ports:
- port: {{ .Values.bootNode.service.p2pPort }}
name: p2p
- port: {{ .Values.bootNode.service.nodePort }}
name: node
name: node
{{ end }}
23 changes: 20 additions & 3 deletions spartan/aztec-network/templates/metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -17,6 +16,8 @@ spec:
{{- include "aztec-network.selectorLabels" . | nindent 8 }}
app: metrics
spec:
securityContext:
fsGroup: 472 # required for Grafana write access to storage volume
containers:
stevenplatt marked this conversation as resolved.
Show resolved Hide resolved
- name: otel-collector
image: "{{ .Values.images.otelCollector.image }}"
Expand Down Expand Up @@ -58,6 +59,8 @@ spec:
subPath: grafana-sources.yaml
- name: grafana-storage
mountPath: /var/lib/grafana
securityContext:
runAsUser: 472 # required for Grafana write access to storage volume

- name: jaeger
image: "{{ .Values.images.jaeger.image }}"
Expand All @@ -68,8 +71,22 @@ spec:
configMap:
name: {{ include "aztec-network.fullname" . }}-metrics
- name: grafana-storage
emptyDir: {}

persistentVolumeClaim:
claimName: {{ include "aztec-network.fullname" . }}-grafana-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "aztec-network.fullname" . }}-grafana-pvc
labels:
app: {{ include "aztec-network.name" . }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.metrics.storage }}
storageClassName: "gp2"
---
apiVersion: v1
kind: Service
Expand Down
35 changes: 30 additions & 5 deletions spartan/aztec-network/templates/prover-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,20 @@ spec:
resources:
{{- toYaml .Values.proverNode.resources | nindent 12 }}
volumes:
- name: shared-volume
emptyDir: {}
- name: scripts
configMap:
name: {{ include "aztec-network.fullname" . }}-configure-prover-env

volumeClaimTemplates:
- metadata:
name: shared-volume
labels:
{{- include "aztec-network.labels" . | nindent 8 }}
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: {{ .Values.proverNode.storage }}
storageClassName: "gp2"
---
apiVersion: v1
kind: ConfigMap
Expand All @@ -106,10 +114,27 @@ metadata:
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
type: {{if .Values.network.public }}"LoadBalancer"{{ else }}"ClusterIP"{{ end }}
type: ClusterIP
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: prover-node
ports:
- port: {{ .Values.proverNode.service.nodePort }}
name: node
---
{{if .Values.network.public }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "aztec-network.fullname" . }}-prover-node-lb
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
type: LoadBalancer
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: prover-node
ports:
- port: {{ .Values.proverNode.service.nodePort }}
name: node
name: node
{{ end }}
23 changes: 22 additions & 1 deletion spartan/aztec-network/templates/pxe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ metadata:
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
type: {{if .Values.network.public }}"LoadBalancer"{{ else }}"ClusterIP"{{ end }}
type: ClusterIP
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: pxe
Expand All @@ -77,4 +77,25 @@ spec:
{{- if and (eq .Values.pxe.service.type "NodePort") .Values.pxe.service.nodePort }}
nodePort: {{ .Values.pxe.service.nodePort }}
{{- end }}
---
{{if .Values.network.public }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "aztec-network.fullname" . }}-pxe-lb
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
type: LoadBalancer
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: pxe
ports:
- protocol: TCP
port: {{ .Values.pxe.service.port }}
targetPort: {{ .Values.pxe.service.targetPort }}
{{- if and (eq .Values.pxe.service.type "NodePort") .Values.pxe.service.nodePort }}
nodePort: {{ .Values.pxe.service.nodePort }}
{{- end }}
{{ end }}
{{- end }}
37 changes: 32 additions & 5 deletions spartan/aztec-network/templates/validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,20 @@ spec:
resources:
{{- toYaml .Values.validator.resources | nindent 12 }}
volumes:
- name: shared-volume
emptyDir: {}
- name: scripts
configMap:
name: {{ include "aztec-network.fullname" . }}-configure-validator-env

volumeClaimTemplates:
- metadata:
name: shared-volume
labels:
{{- include "aztec-network.labels" . | nindent 8 }}
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: {{ .Values.validator.storage }}
storageClassName: "gp2"
---
apiVersion: v1
kind: ConfigMap
Expand All @@ -115,12 +123,31 @@ metadata:
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
type: {{if .Values.network.public }}"LoadBalancer"{{ else }}"ClusterIP"{{ end }}
type: ClusterIP
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: validator
ports:
- port: {{ .Values.validator.service.p2pPort }}
name: p2p
- port: {{ .Values.validator.service.nodePort }}
name: node
---
{{if .Values.network.public }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "aztec-network.fullname" . }}-validator-lb
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
type: LoadBalancer
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: validator
ports:
- port: {{ .Values.validator.service.p2pPort }}
name: p2p
- port: {{ .Values.validator.service.nodePort }}
name: node
name: node
{{ end }}
6 changes: 5 additions & 1 deletion spartan/aztec-network/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ bootNode:
limits:
memory: "4Gi"
cpu: "4"
storage: "8Gi"

validator:
replicas: 0
replicas: 1
service:
p2pPort: 40400
nodePort: 8080
Expand All @@ -74,6 +75,7 @@ validator:
limits:
memory: "28Gi"
cpu: "7"
storage: "8Gi"

proverNode:
replicas: 1
Expand All @@ -90,6 +92,7 @@ proverNode:
limits:
memory: "120Gi"
cpu: "15"
storage: "8Gi"

pxe:
logLevel: "debug"
Expand Down Expand Up @@ -183,3 +186,4 @@ metrics:
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
storage: "8Gi"
Loading