Skip to content

Commit

Permalink
Use sts for op-geth/node and use LoadBalancer for op-geth and blockscout
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiker committed Jan 30, 2024
1 parent 0ef7800 commit 5a1c5fd
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 49 deletions.
1 change: 0 additions & 1 deletion templates/k8s/blockscout-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ spec:
name: blockscout
ports:
- containerPort: 4000
hostPort: 4000
protocol: TCP
volumeMounts:
- mountPath: /genesis.json
Expand Down
1 change: 0 additions & 1 deletion templates/k8s/blockscout-postgres-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ spec:
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: blockscout-postgres-pvc
restartPolicy: Always
volumes:
- name: blockscout-postgres-pvc
persistentVolumeClaim:
Expand Down
3 changes: 2 additions & 1 deletion templates/k8s/blockscout-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ metadata:
spec:
selector:
name: blockscout
type: LoadBalancer
ports:
- protocol: TCP
port: 4000
port: 80
targetPort: 4000
2 changes: 2 additions & 0 deletions templates/k8s/env-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ metadata:
name: env-cm
namespace: l2launcher
data:
L1_RPC: ""
L2_CHAIN_ID: ""
4 changes: 4 additions & 0 deletions templates/k8s/env-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ metadata:
name: env-secret
namespace: l2launcher
stringData:
ADMIN_KEY: ""
BATCHER_KEY: ""
PROPOSER_KEY: ""
SEQUENCER_KEY: ""
8 changes: 5 additions & 3 deletions templates/k8s/op-batcher-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ spec:
key: L1_RPC
- name: BATCHER_KEY
valueFrom:
configMapKeyRef:
name: env-cm
secretKeyRef:
name: env-secret
key: BATCHER_KEY
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-batcher:v1.4.2
name: op-batcher
restartPolicy: Always
ports:
- containerPort: 8548
protocol: TCP
11 changes: 0 additions & 11 deletions templates/k8s/op-geth-pvc.yaml

This file was deleted.

1 change: 1 addition & 0 deletions templates/k8s/op-geth-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
spec:
selector:
name: op-geth
type: LoadBalancer
ports:
- protocol: TCP
name: rpc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: op-geth
namespace: l2launcher
spec:
selector:
matchLabels:
name: op-geth
replicas: 1
replicas: 2
template:
metadata:
labels:
Expand Down Expand Up @@ -54,7 +54,7 @@ spec:
name: genesis-init-predeploy
volumeMounts:
- mountPath: /data
name: op-geth-pvc
name: op-geth-volume
- mountPath: /genesis
name: genesis-pvc
- mountPath: /genesis/predeploy.json
Expand Down Expand Up @@ -102,17 +102,23 @@ spec:
protocol: TCP
volumeMounts:
- mountPath: /data
name: op-geth-pvc
name: op-geth-volume
- mountPath: /genesis
name: genesis-pvc
readOnly: true
volumes:
- name: genesis-pvc
persistentVolumeClaim:
claimName: genesis-pvc
- name: op-geth-pvc
persistentVolumeClaim:
claimName: op-geth-pvc
- name: predeploy-json-cm
configMap:
name: predeploy-json-cm
volumeClaimTemplates:
- metadata:
name: op-geth-volume
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
11 changes: 0 additions & 11 deletions templates/k8s/op-node-pvc.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions templates/k8s/op-node-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ spec:
name: op-node
ports:
- protocol: TCP
name: rpc
port: 8547
targetPort: 8547
- protocol: TCP
name: p2p
port: 9003
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: op-node
namespace: l2launcher
spec:
replicas: 1
replicas: 2
selector:
matchLabels:
name: op-node
Expand All @@ -25,8 +25,9 @@ spec:
--rollup.config=/genesis/rollup.json \
--rpc.addr=0.0.0.0 \
--rpc.port=8547 \
--p2p.disable \
--rpc.enable-admin \
--p2p.listen.ip=0.0.0.0 \
--p2p.listen.tcp=9003 \
--p2p.sequencer.key=$${SEQUENCER_KEY#0x} \
--l1=$(L1_RPC) \
--l1.rpckind=any \
Expand All @@ -42,8 +43,8 @@ spec:
key: L1_RPC
- name: SEQUENCER_KEY
valueFrom:
configMapKeyRef:
name: env-cm
secretKeyRef:
name: env-secret
key: SEQUENCER_KEY
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.4.2
livenessProbe:
Expand All @@ -57,18 +58,26 @@ spec:
name: op-node
ports:
- containerPort: 8547
hostPort: 8547
protocol: TCP
- containerPort: 9003
protocol: TCP
volumeMounts:
- mountPath: /data
name: op-node-pvc
name: op-node-volume
- mountPath: /genesis
name: genesis-pvc
restartPolicy: Always
readOnly: true
volumes:
- name: op-node-pvc
persistentVolumeClaim:
claimName: op-node-pvc
- name: genesis-pvc
persistentVolumeClaim:
claimName: genesis-pvc
readOnly: true
volumeClaimTemplates:
- metadata:
name: op-node-volume
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
10 changes: 7 additions & 3 deletions templates/k8s/op-proposer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,23 @@ spec:
key: L1_RPC
- name: PROPOSER_KEY
valueFrom:
configMapKeyRef:
name: env-cm
secretKeyRef:
name: env-secret
key: PROPOSER_KEY
command:
- sh
- -c
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-proposer:v1.4.2
name: op-proposer
ports:
- containerPort: 8560
protocol: TCP
volumeMounts:
- mountPath: /genesis
name: genesis-pvc
restartPolicy: Always
readOnly: true
volumes:
- name: genesis-pvc
persistentVolumeClaim:
claimName: genesis-pvc
readOnly: true

0 comments on commit 5a1c5fd

Please sign in to comment.