From 3b51e05da0f6ded9b2b9f4b46813a97d67409a62 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Tue, 12 Apr 2022 12:58:08 -0400 Subject: [PATCH 1/2] Added exteranl mainnet 0.5.17 replica --- .../mainnet-replica-0-5-17/kustomization.yaml | 41 +++++++++++ .../mainnet-replica-0-5-17/patches/dtl.yaml | 41 +++++++++++ .../patches/l2geth-volume.yaml | 6 ++ .../patches/l2geth.yaml | 71 +++++++++++++++++++ .../patches/replica-healthcheck.yaml | 12 ++++ .../mainnet-replica-0-5-17/volumes.yaml | 24 +++++++ 6 files changed, 195 insertions(+) create mode 100644 infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/kustomization.yaml create mode 100644 infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/dtl.yaml create mode 100644 infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/l2geth-volume.yaml create mode 100644 infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/l2geth.yaml create mode 100644 infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/replica-healthcheck.yaml create mode 100644 infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/volumes.yaml diff --git a/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/kustomization.yaml b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/kustomization.yaml new file mode 100644 index 0000000000000..df55311544858 --- /dev/null +++ b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/kustomization.yaml @@ -0,0 +1,41 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: mainnet-replica-0-5-17 +commonLabels: + network: mainnet + provider: internal + +bases: + - ../../../envs/mainnet-gen5-berlin/ + - ../../../scripts + +resources: + - ../../bases/data-transport-layer + - ../../bases/l2geth-replica + - ../../bases/servicemonitors + - ../../bases/replica-healthcheck + - ./volumes.yaml + +images: + - name: ethereumoptimism/data-transport-layer + newName: ethereumoptimism/data-transport-layer + newTag: 0.5.25 + - name: ethereumoptimism/l2geth + newName: ethereumoptimism/l2geth + newTag: 0.5.17 + - name: ethereumoptimism/replica-healthcheck + newName: ethereumoptimism/replica-healthcheck + newTag: 0.3.3 + +patchesStrategicMerge: + - ./patches/dtl.yaml + - ./patches/l2geth.yaml + - ./patches/replica-healthcheck.yaml + +patches: + - path: ./patches/l2geth-volume.yaml + target: + group: apps + version: v1 + kind: StatefulSet + name: l2geth-replica \ No newline at end of file diff --git a/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/dtl.yaml b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/dtl.yaml new file mode 100644 index 0000000000000..975286c2aa229 --- /dev/null +++ b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/dtl.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: data-transport-layer +spec: + template: + spec: + initContainers: + - name: wait-for-l1 + env: + - name: L1_NODE_WEB3_URL + valueFrom: + secretKeyRef: + name: replica-secrets + key: l1-rpc-endpoint + containers: + - name: data-transport-layer + resources: + limits: + cpu: "2" + memory: 4Gi + requests: + cpu: "1" + memory: 1Gi + env: + - name: DATA_TRANSPORT_LAYER__L1_RPC_ENDPOINT + valueFrom: + secretKeyRef: + name: replica-secrets + key: l1-rpc-endpoint + - name: DATA_TRANSPORT_LAYER__L2_RPC_ENDPOINT + valueFrom: + secretKeyRef: + name: replica-secrets + key: l2-rpc-endpoint + - name: L1_NODE_WEB3_URL + valueFrom: + secretKeyRef: + name: replica-secrets + key: l1-rpc-endpoint \ No newline at end of file diff --git a/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/l2geth-volume.yaml b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/l2geth-volume.yaml new file mode 100644 index 0000000000000..60b117f7923bf --- /dev/null +++ b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/l2geth-volume.yaml @@ -0,0 +1,6 @@ +- op: replace + path: /spec/template/spec/volumes/0 + value: + name: l2geth-replica-data + persistentVolumeClaim: + claimName: l2geth-replica-data diff --git a/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/l2geth.yaml b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/l2geth.yaml new file mode 100644 index 0000000000000..a4e7d11d1c337 --- /dev/null +++ b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/l2geth.yaml @@ -0,0 +1,71 @@ +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: l2geth-replica +spec: + template: + spec: + containers: + - name: l2geth-replica + command: + - geth + - --config=/l2geth-config/l2geth.toml + - --datadir=$(DATADIR) + - --password=$(DATADIR)/password + - --allow-insecure-unlock + - --unlock=$(BLOCK_SIGNER_ADDRESS) + - --mine + - --miner.etherbase=$(BLOCK_SIGNER_ADDRESS) + - --metrics + - --metrics.influxdb + - --metrics.influxdb.endpoint=http://influxdb.monitoring:8086 + - --metrics.influxdb.database=$(NAMESPACE) + resources: + limits: + cpu: "8" + memory: 24Gi + requests: + cpu: "4" + memory: 12Gi +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: data-transport-layer +spec: + template: + spec: + initContainers: + - name: wait-for-l1 + env: + - name: L1_NODE_WEB3_URL + valueFrom: + secretKeyRef: + name: replica-secrets + key: l1-rpc-endpoint + containers: + - name: data-transport-layer + resources: + limits: + cpu: "2" + memory: 4Gi + requests: + cpu: "1" + memory: 1Gi + env: + - name: DATA_TRANSPORT_LAYER__L1_RPC_ENDPOINT + valueFrom: + secretKeyRef: + name: replica-secrets + key: l1-rpc-endpoint + - name: DATA_TRANSPORT_LAYER__L2_RPC_ENDPOINT + valueFrom: + secretKeyRef: + name: replica-secrets + key: l2-rpc-endpoint + - name: L1_NODE_WEB3_URL + valueFrom: + secretKeyRef: + name: replica-secrets + key: l1-rpc-endpoint \ No newline at end of file diff --git a/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/replica-healthcheck.yaml b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/replica-healthcheck.yaml new file mode 100644 index 0000000000000..2f6a29b4e5fbc --- /dev/null +++ b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/patches/replica-healthcheck.yaml @@ -0,0 +1,12 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: replica-healthcheck +spec: + template: + spec: + containers: + - name: replica-healthcheck + env: + - name: REPLICA_HEALTHCHECK__ETH_NETWORK_RPC_PROVIDER + value: https://mainnet.optimism.io diff --git a/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/volumes.yaml b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/volumes.yaml new file mode 100644 index 0000000000000..dbc28ae20f718 --- /dev/null +++ b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/volumes.yaml @@ -0,0 +1,24 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: l2geth-replica-data +spec: + storageClassName: premium-rwo + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 500Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: data-transport-layer-data +spec: + storageClassName: premium-rwo + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi \ No newline at end of file From 6e5aae34d5a85be3c225ce68e8360e35862a6104 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Tue, 12 Apr 2022 16:43:12 -0400 Subject: [PATCH 2/2] Update replicas to use new healthcheck script --- .../replica-healthcheck-v1/deployment.yaml | 24 +++++++++++++++++++ .../replica-healthcheck-v1/kustomization.yaml | 6 +++++ .../bases/servicemonitors/kustomization.yaml | 3 ++- .../replica-healthcheck-v1.yaml | 16 +++++++++++++ .../mainnet-replica-0-5-14/kustomization.yaml | 11 ++++++++- .../replica-healthcheck-v1.env | 2 ++ .../mainnet-replica-0-5-17/kustomization.yaml | 11 ++++++++- .../replica-healthcheck-v1.env | 2 ++ 8 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 infra/op-replica/kustomize/bases/replica-healthcheck-v1/deployment.yaml create mode 100644 infra/op-replica/kustomize/bases/replica-healthcheck-v1/kustomization.yaml create mode 100644 infra/op-replica/kustomize/bases/servicemonitors/replica-healthcheck-v1.yaml create mode 100644 infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-14/replica-healthcheck-v1.env create mode 100644 infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/replica-healthcheck-v1.env diff --git a/infra/op-replica/kustomize/bases/replica-healthcheck-v1/deployment.yaml b/infra/op-replica/kustomize/bases/replica-healthcheck-v1/deployment.yaml new file mode 100644 index 0000000000000..d4bd3c632120f --- /dev/null +++ b/infra/op-replica/kustomize/bases/replica-healthcheck-v1/deployment.yaml @@ -0,0 +1,24 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: replica-healthcheck-v1 +spec: + replicas: 1 + template: + spec: + containers: + - name: replica-healthcheck + image: ethereumoptimism/replica-healthcheck-v1 + envFrom: + - configMapRef: + name: replica-healthcheck-v1 + ports: + - containerPort: 7300 + name: metrics + resources: + limits: + memory: 256Mi + cpu: 512m + requests: + memory: 128Mi + cpu: 256m diff --git a/infra/op-replica/kustomize/bases/replica-healthcheck-v1/kustomization.yaml b/infra/op-replica/kustomize/bases/replica-healthcheck-v1/kustomization.yaml new file mode 100644 index 0000000000000..80c56b42d3093 --- /dev/null +++ b/infra/op-replica/kustomize/bases/replica-healthcheck-v1/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - deployment.yaml +commonLabels: + app: replica-healthcheck-v1 \ No newline at end of file diff --git a/infra/op-replica/kustomize/bases/servicemonitors/kustomization.yaml b/infra/op-replica/kustomize/bases/servicemonitors/kustomization.yaml index 3ee977e567d3e..9d15081d576ff 100644 --- a/infra/op-replica/kustomize/bases/servicemonitors/kustomization.yaml +++ b/infra/op-replica/kustomize/bases/servicemonitors/kustomization.yaml @@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ./data-transport-layer.yaml - - ./replica-healthcheck.yaml \ No newline at end of file + - ./replica-healthcheck.yaml + - ./replica-healthcheck-v1.yaml \ No newline at end of file diff --git a/infra/op-replica/kustomize/bases/servicemonitors/replica-healthcheck-v1.yaml b/infra/op-replica/kustomize/bases/servicemonitors/replica-healthcheck-v1.yaml new file mode 100644 index 0000000000000..81292e583651e --- /dev/null +++ b/infra/op-replica/kustomize/bases/servicemonitors/replica-healthcheck-v1.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: replica-healthcheck-v1 +spec: + selector: + matchLabels: + app: replica-healthcheck-v1 + provider: internal + podMetricsEndpoints: + - port: metrics + podTargetLabels: + - network + - provider + - sync_source \ No newline at end of file diff --git a/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-14/kustomization.yaml b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-14/kustomization.yaml index fff9c6cbd014b..330c943d7393b 100644 --- a/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-14/kustomization.yaml +++ b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-14/kustomization.yaml @@ -14,6 +14,7 @@ resources: - ../../bases/l2geth-replica - ../../bases/servicemonitors - ../../bases/replica-healthcheck + - ../../bases/replica-healthcheck-v1 - ./volumes.yaml - ./ingress.yaml @@ -27,6 +28,9 @@ images: - name: ethereumoptimism/replica-healthcheck newName: ethereumoptimism/replica-healthcheck newTag: 0.3.3 + - name: ethereumoptimism/replica-healthcheck-v1 + newName: ethereumoptimism/replica-healthcheck + newTag: 1.0.4 patchesStrategicMerge: - ./patches/dtl.yaml @@ -39,4 +43,9 @@ patches: group: apps version: v1 kind: StatefulSet - name: l2geth-replica \ No newline at end of file + name: l2geth-replica + +configMapGenerator: + - name: replica-healthcheck-v1 + envs: + - ./replica-healthcheck-v1.env diff --git a/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-14/replica-healthcheck-v1.env b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-14/replica-healthcheck-v1.env new file mode 100644 index 0000000000000..3501ab84ea9b6 --- /dev/null +++ b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-14/replica-healthcheck-v1.env @@ -0,0 +1,2 @@ +HEALTHCHECK__REFERENCE_RPC_PROVIDER=https://mainnet.optimism.io +HEALTHCHECK__TARGET_RPC_PROVIDER=http://l2geth-replica:8545 \ No newline at end of file diff --git a/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/kustomization.yaml b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/kustomization.yaml index df55311544858..381636f0e0d39 100644 --- a/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/kustomization.yaml +++ b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/kustomization.yaml @@ -14,6 +14,7 @@ resources: - ../../bases/l2geth-replica - ../../bases/servicemonitors - ../../bases/replica-healthcheck + - ../../bases/replica-healthcheck-v1 - ./volumes.yaml images: @@ -26,6 +27,9 @@ images: - name: ethereumoptimism/replica-healthcheck newName: ethereumoptimism/replica-healthcheck newTag: 0.3.3 + - name: ethereumoptimism/replica-healthcheck-v1 + newName: ethereumoptimism/replica-healthcheck + newTag: 1.0.4 patchesStrategicMerge: - ./patches/dtl.yaml @@ -38,4 +42,9 @@ patches: group: apps version: v1 kind: StatefulSet - name: l2geth-replica \ No newline at end of file + name: l2geth-replica + +configMapGenerator: + - name: replica-healthcheck-v1 + envs: + - ./replica-healthcheck-v1.env diff --git a/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/replica-healthcheck-v1.env b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/replica-healthcheck-v1.env new file mode 100644 index 0000000000000..3501ab84ea9b6 --- /dev/null +++ b/infra/op-replica/kustomize/public-overlays/mainnet-replica-0-5-17/replica-healthcheck-v1.env @@ -0,0 +1,2 @@ +HEALTHCHECK__REFERENCE_RPC_PROVIDER=https://mainnet.optimism.io +HEALTHCHECK__TARGET_RPC_PROVIDER=http://l2geth-replica:8545 \ No newline at end of file