From c2344dd97a90e3fa77ba6920e4069bb9254207cb Mon Sep 17 00:00:00 2001 From: Steven Platt Date: Tue, 1 Oct 2024 15:15:01 -0400 Subject: [PATCH 1/4] working persistent disk configuration --- .../aztec-network/templates/boot-node.yaml | 13 +++++++++++-- spartan/aztec-network/templates/metrics.yaml | 19 ++++++++++++++++--- .../aztec-network/templates/prover-node.yaml | 14 +++++++++++--- .../aztec-network/templates/validator.yaml | 14 +++++++++++--- spartan/aztec-network/values.yaml | 6 +++++- 5 files changed, 54 insertions(+), 12 deletions(-) diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index 6ea619b0059..693fd0e004b 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -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" --- apiVersion: v1 kind: Service diff --git a/spartan/aztec-network/templates/metrics.yaml b/spartan/aztec-network/templates/metrics.yaml index ff62fad5f2c..99c218dc06e 100644 --- a/spartan/aztec-network/templates/metrics.yaml +++ b/spartan/aztec-network/templates/metrics.yaml @@ -1,4 +1,3 @@ ---- apiVersion: apps/v1 kind: Deployment metadata: @@ -68,8 +67,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 diff --git a/spartan/aztec-network/templates/prover-node.yaml b/spartan/aztec-network/templates/prover-node.yaml index ccc0a92c96a..c55b442e255 100644 --- a/spartan/aztec-network/templates/prover-node.yaml +++ b/spartan/aztec-network/templates/prover-node.yaml @@ -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 diff --git a/spartan/aztec-network/templates/validator.yaml b/spartan/aztec-network/templates/validator.yaml index 4f7785efd89..897ff0952df 100644 --- a/spartan/aztec-network/templates/validator.yaml +++ b/spartan/aztec-network/templates/validator.yaml @@ -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 diff --git a/spartan/aztec-network/values.yaml b/spartan/aztec-network/values.yaml index 1f1c8146c76..dc5a192c839 100644 --- a/spartan/aztec-network/values.yaml +++ b/spartan/aztec-network/values.yaml @@ -52,9 +52,10 @@ bootNode: limits: memory: "4Gi" cpu: "4" + storage: "8Gi" validator: - replicas: 0 + replicas: 1 service: p2pPort: 40400 nodePort: 8080 @@ -74,6 +75,7 @@ validator: limits: memory: "28Gi" cpu: "7" + storage: "8Gi" proverNode: replicas: 1 @@ -90,6 +92,7 @@ proverNode: limits: memory: "120Gi" cpu: "15" + storage: "8Gi" pxe: logLevel: "debug" @@ -183,3 +186,4 @@ metrics: timeoutSeconds: 5 successThreshold: 1 failureThreshold: 3 + storage: "8Gi" From c10acc898b90bf90b4e0238706b8326a1d3fdc48 Mon Sep 17 00:00:00 2001 From: Steven Platt Date: Tue, 1 Oct 2024 17:48:13 -0400 Subject: [PATCH 2/4] repaired load balancer configs --- spartan/aztec-network/templates/anvil.yaml | 23 ++++++++++++++++++- .../aztec-network/templates/boot-node.yaml | 23 +++++++++++++++++-- spartan/aztec-network/templates/metrics.yaml | 4 ++++ .../aztec-network/templates/prover-node.yaml | 21 +++++++++++++++-- spartan/aztec-network/templates/pxe.yaml | 23 ++++++++++++++++++- .../aztec-network/templates/validator.yaml | 23 +++++++++++++++++-- 6 files changed, 109 insertions(+), 8 deletions(-) diff --git a/spartan/aztec-network/templates/anvil.yaml b/spartan/aztec-network/templates/anvil.yaml index a45c52d58b5..bdaea56bdec 100644 --- a/spartan/aztec-network/templates/anvil.yaml +++ b/spartan/aztec-network/templates/anvil.yaml @@ -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 }} \ No newline at end of file + {{- 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 }} \ No newline at end of file diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index 693fd0e004b..d101b2d6d33 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -145,7 +145,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: boot-node @@ -153,4 +153,23 @@ spec: - port: {{ .Values.bootNode.service.p2pPort }} name: p2p - port: {{ .Values.bootNode.service.nodePort }} - name: node \ No newline at end of file + 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 +{{ end }} \ No newline at end of file diff --git a/spartan/aztec-network/templates/metrics.yaml b/spartan/aztec-network/templates/metrics.yaml index 99c218dc06e..ab3ea2eeef1 100644 --- a/spartan/aztec-network/templates/metrics.yaml +++ b/spartan/aztec-network/templates/metrics.yaml @@ -16,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: - name: otel-collector image: "{{ .Values.images.otelCollector.image }}" @@ -57,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 }}" diff --git a/spartan/aztec-network/templates/prover-node.yaml b/spartan/aztec-network/templates/prover-node.yaml index c55b442e255..77f4c2b5c0d 100644 --- a/spartan/aztec-network/templates/prover-node.yaml +++ b/spartan/aztec-network/templates/prover-node.yaml @@ -114,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 \ No newline at end of file + 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 +{{ end }} \ No newline at end of file diff --git a/spartan/aztec-network/templates/pxe.yaml b/spartan/aztec-network/templates/pxe.yaml index 52f1b8aed6a..3725960a0b4 100644 --- a/spartan/aztec-network/templates/pxe.yaml +++ b/spartan/aztec-network/templates/pxe.yaml @@ -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 @@ -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 }} \ No newline at end of file diff --git a/spartan/aztec-network/templates/validator.yaml b/spartan/aztec-network/templates/validator.yaml index 897ff0952df..25fd6945ccd 100644 --- a/spartan/aztec-network/templates/validator.yaml +++ b/spartan/aztec-network/templates/validator.yaml @@ -123,7 +123,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: validator @@ -131,4 +131,23 @@ spec: - port: {{ .Values.validator.service.p2pPort }} name: p2p - port: {{ .Values.validator.service.nodePort }} - name: node \ No newline at end of file + 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 +{{ end }} \ No newline at end of file From 487794e956fd3af40628cb52d335c559011a729d Mon Sep 17 00:00:00 2001 From: Steven Platt Date: Wed, 2 Oct 2024 11:07:22 -0400 Subject: [PATCH 3/4] moved files system user to values file. --- spartan/aztec-network/templates/metrics.yaml | 4 ++-- spartan/aztec-network/values.yaml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spartan/aztec-network/templates/metrics.yaml b/spartan/aztec-network/templates/metrics.yaml index ab3ea2eeef1..0eb66ec0945 100644 --- a/spartan/aztec-network/templates/metrics.yaml +++ b/spartan/aztec-network/templates/metrics.yaml @@ -17,7 +17,7 @@ spec: app: metrics spec: securityContext: - fsGroup: 472 # required for Grafana write access to storage volume + fsGroup: {{ .Values.metrics.fileSystemUser }} # required for Grafana write access to storage volume containers: - name: otel-collector image: "{{ .Values.images.otelCollector.image }}" @@ -60,7 +60,7 @@ spec: - name: grafana-storage mountPath: /var/lib/grafana securityContext: - runAsUser: 472 # required for Grafana write access to storage volume + runAsUser: {{ .Values.metrics.fileSystemUser }} # required for Grafana write access to storage volume - name: jaeger image: "{{ .Values.images.jaeger.image }}" diff --git a/spartan/aztec-network/values.yaml b/spartan/aztec-network/values.yaml index dc5a192c839..eb106726b4d 100644 --- a/spartan/aztec-network/values.yaml +++ b/spartan/aztec-network/values.yaml @@ -187,3 +187,4 @@ metrics: successThreshold: 1 failureThreshold: 3 storage: "8Gi" + fileSystemUser: 472 From a193b08aaa1c17cad5cb3a7837ae02fa01103cec Mon Sep 17 00:00:00 2001 From: Steven Platt Date: Wed, 2 Oct 2024 16:03:10 -0400 Subject: [PATCH 4/4] removed storage class references --- spartan/aztec-network/templates/boot-node.yaml | 1 - spartan/aztec-network/templates/metrics.yaml | 1 - spartan/aztec-network/templates/prover-node.yaml | 1 - spartan/aztec-network/templates/validator.yaml | 1 - 4 files changed, 4 deletions(-) diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index d101b2d6d33..ec2b2f762ae 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -136,7 +136,6 @@ spec: resources: requests: storage: {{ .Values.bootNode.storage }} - storageClassName: "gp2" --- apiVersion: v1 kind: Service diff --git a/spartan/aztec-network/templates/metrics.yaml b/spartan/aztec-network/templates/metrics.yaml index 0eb66ec0945..fc3d6d3ee15 100644 --- a/spartan/aztec-network/templates/metrics.yaml +++ b/spartan/aztec-network/templates/metrics.yaml @@ -86,7 +86,6 @@ spec: resources: requests: storage: {{ .Values.metrics.storage }} - storageClassName: "gp2" --- apiVersion: v1 kind: Service diff --git a/spartan/aztec-network/templates/prover-node.yaml b/spartan/aztec-network/templates/prover-node.yaml index bf1bd6d7e4b..dfcb8b4bbb5 100644 --- a/spartan/aztec-network/templates/prover-node.yaml +++ b/spartan/aztec-network/templates/prover-node.yaml @@ -95,7 +95,6 @@ spec: resources: requests: storage: {{ .Values.proverNode.storage }} - storageClassName: "gp2" --- apiVersion: v1 kind: ConfigMap diff --git a/spartan/aztec-network/templates/validator.yaml b/spartan/aztec-network/templates/validator.yaml index 25fd6945ccd..205a32a74cd 100644 --- a/spartan/aztec-network/templates/validator.yaml +++ b/spartan/aztec-network/templates/validator.yaml @@ -104,7 +104,6 @@ spec: resources: requests: storage: {{ .Values.validator.storage }} - storageClassName: "gp2" --- apiVersion: v1 kind: ConfigMap