From 4723321ddcb8d48ff834d9211b3e16f62cf7fef5 Mon Sep 17 00:00:00 2001 From: Sebastien Baizet Date: Wed, 11 Sep 2024 10:25:36 +0200 Subject: [PATCH] allow multi replicas of bootnodes --- charts/l2-bootnode/README.md | 53 +++++++++---------- charts/l2-bootnode/values.yaml | 16 +++--- charts/l2-bootnode/values/production-2.yaml | 36 ------------- charts/l2-bootnode/values/production-3.yaml | 36 ------------- .../{production-1.yaml => production.yaml} | 0 5 files changed, 32 insertions(+), 109 deletions(-) delete mode 100644 charts/l2-bootnode/values/production-2.yaml delete mode 100644 charts/l2-bootnode/values/production-3.yaml rename charts/l2-bootnode/values/{production-1.yaml => production.yaml} (100%) diff --git a/charts/l2-bootnode/README.md b/charts/l2-bootnode/README.md index 6f650cb4..d4d2bc39 100644 --- a/charts/l2-bootnode/README.md +++ b/charts/l2-bootnode/README.md @@ -26,7 +26,7 @@ Kubernetes: `>=1.22.0-0` | command[0] | string | `"bash"` | | | command[1] | string | `"-c"` | | | command[2] | string | `"geth --datadir \"/l2geth/data\" init /l2geth/genesis/genesis.json && echo \"[Node.P2P] StaticNodes = $L2GETH_PEER_LIST\" > \"/l2geth/config.toml\" && geth --datadir \"/l2geth/data\" --port \"$L2GETH_P2P_PORT\" --syncmode full --networkid \"$CHAIN_ID\" --maxpeers \"$L2GETH_MAX_PEERS\" --netrestrict \"$L2GETH_NETRESTRICT\" --nat \"$L2GETH_NAT\" --bootnodes \"\" --gcmode archive --config \"/l2geth/config.toml\" --cache.noprefetch --verbosity 3 --pprof --pprof.addr \"0.0.0.0\" --pprof.port 6060 $CCC_FLAG $METRICS_FLAGS --txpool.globalqueue 4096 --txpool.globalslots 40960 --txpool.pricelimit \"$L2GETH_MIN_GAS_PRICE\" $LOCALS_FLAG --l1.endpoint \"$L2GETH_L1_ENDPOINT\" --l1.confirmations \"$L2GETH_L1_WATCHER_CONFIRMATIONS\" --l1.sync.startblock \"$L2GETH_L1_CONTRACT_DEPLOYMENT_BLOCK\" --miner.gasprice \"$L2GETH_MIN_GAS_PRICE\" --rpc.gascap 0 --gpo.ignoreprice \"$L2GETH_MIN_GAS_PRICE\" --metrics --metrics.expensive $L2GETH_EXTRA_PARAMS"` | | -| controller.replicas | int | `1` | | +| controller.replicas | int | `3` | | | controller.strategy | string | `"RollingUpdate"` | | | controller.type | string | `"statefulset"` | | | defaultProbes.custom | bool | `true` | | @@ -34,28 +34,26 @@ Kubernetes: `>=1.22.0-0` | defaultProbes.spec.httpGet.path | string | `"/"` | | | defaultProbes.spec.httpGet.port | int | `8545` | | | envFrom[0].configMapRef.name | string | `"l2-bootnode-env"` | | -| env[0].name | string | `"L2GETH_NODEKEY"` | | -| env[0].value | string | `""` | | -| env[10].name | string | `"L2GETH_EXTRA_PARAMS"` | | -| env[10].value | string | `""` | | -| env[1].name | string | `"L2GETH_L1_CONTRACT_DEPLOYMENT_BLOCK"` | | -| env[1].value | string | `"0"` | | -| env[2].name | string | `"L2GETH_L1_WATCHER_CONFIRMATIONS"` | | -| env[2].value | string | `"0x6"` | | -| env[3].name | string | `"L2GETH_P2P_PORT"` | | -| env[3].value | int | `30303` | | -| env[4].name | string | `"L2GETH_ENABLE_CCC"` | | -| env[4].value | bool | `false` | | -| env[5].name | string | `"L2GETH_CCC_RUST_LOG_LEVEL"` | | -| env[5].value | string | `"info"` | | -| env[6].name | string | `"L2GETH_MAX_PEERS"` | | -| env[6].value | int | `500` | | -| env[7].name | string | `"VERBOSITY"` | | -| env[7].value | int | `3` | | -| env[8].name | string | `"CCC_FLAG"` | | -| env[8].value | string | `"--ccc"` | | -| env[9].name | string | `"L2GETH_MIN_GAS_PRICE"` | | -| env[9].value | string | `"1000000"` | | +| env[0].name | string | `"L2GETH_L1_CONTRACT_DEPLOYMENT_BLOCK"` | | +| env[0].value | string | `"0"` | | +| env[1].name | string | `"L2GETH_L1_WATCHER_CONFIRMATIONS"` | | +| env[1].value | string | `"0x6"` | | +| env[2].name | string | `"L2GETH_P2P_PORT"` | | +| env[2].value | int | `30303` | | +| env[3].name | string | `"L2GETH_ENABLE_CCC"` | | +| env[3].value | bool | `false` | | +| env[4].name | string | `"L2GETH_CCC_RUST_LOG_LEVEL"` | | +| env[4].value | string | `"info"` | | +| env[5].name | string | `"L2GETH_MAX_PEERS"` | | +| env[5].value | int | `500` | | +| env[6].name | string | `"VERBOSITY"` | | +| env[6].value | int | `3` | | +| env[7].name | string | `"CCC_FLAG"` | | +| env[7].value | string | `"--ccc"` | | +| env[8].name | string | `"L2GETH_MIN_GAS_PRICE"` | | +| env[8].value | string | `"1000000"` | | +| env[9].name | string | `"L2GETH_EXTRA_PARAMS"` | | +| env[9].value | string | `""` | | | global.fullnameOverride | string | `"l2-bootnode"` | | | global.nameOverride | string | `"l2-bootnode"` | | | image.pullPolicy | string | `"Always"` | | @@ -69,11 +67,6 @@ Kubernetes: `>=1.22.0-0` | initContainers.wait-for-l1.volumeMounts[0].mountPath | string | `"/wait-for-l1.sh"` | | | initContainers.wait-for-l1.volumeMounts[0].name | string | `"wait-for-l1-script"` | | | initContainers.wait-for-l1.volumeMounts[0].subPath | string | `"wait-for-l1.sh"` | | -| persistence.data.accessMode | string | `"ReadWriteOnce"` | | -| persistence.data.enabled | bool | `true` | | -| persistence.data.mountPath | string | `"/l2geth/data"` | | -| persistence.data.size | string | `"10Gi"` | | -| persistence.data.type | string | `"pvc"` | | | persistence.env.enabled | bool | `true` | | | persistence.env.mountPath | string | `"/config/"` | | | persistence.env.name | string | `"l2-bootnode-env"` | | @@ -111,6 +104,10 @@ Kubernetes: `>=1.22.0-0` | serviceMonitor.main.endpoints[0].scrapeTimeout | string | `"10s"` | | | serviceMonitor.main.labels.release | string | `"scroll-sdk"` | | | serviceMonitor.main.serviceName | string | `"{{ include \"scroll.common.lib.chart.names.fullname\" $ }}"` | | +| volumeClaimTemplates[0].accessMode | string | `"ReadWriteOnce"` | | +| volumeClaimTemplates[0].mountPath | string | `"/l2geth/data"` | | +| volumeClaimTemplates[0].name | string | `"data"` | | +| volumeClaimTemplates[0].size | string | `"10Gi"` | | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) diff --git a/charts/l2-bootnode/values.yaml b/charts/l2-bootnode/values.yaml index df8db704..ef314a7e 100644 --- a/charts/l2-bootnode/values.yaml +++ b/charts/l2-bootnode/values.yaml @@ -4,7 +4,7 @@ global: fullnameOverride: *app_name controller: - replicas: 1 + replicas: 3 strategy: RollingUpdate type: statefulset @@ -14,8 +14,6 @@ image: tag: scroll-v5.7.11 env: - - name: L2GETH_NODEKEY - value: "" - name: L2GETH_L1_CONTRACT_DEPLOYMENT_BLOCK value: "0" - name: L2GETH_L1_WATCHER_CONFIRMATIONS @@ -96,12 +94,6 @@ probes: <<: *default_probes persistence: - data: - enabled: true - type: pvc - mountPath: /l2geth/data - accessMode: ReadWriteOnce - size: 10Gi env: enabled: true type: configMap @@ -118,6 +110,12 @@ persistence: name: wait-for-l1-script defaultMode: "0777" +volumeClaimTemplates: + - name: data + accessMode: "ReadWriteOnce" + size: "10Gi" + mountPath: "/l2geth/data" + service: main: enabled: true diff --git a/charts/l2-bootnode/values/production-2.yaml b/charts/l2-bootnode/values/production-2.yaml deleted file mode 100644 index 4ad5da8e..00000000 --- a/charts/l2-bootnode/values/production-2.yaml +++ /dev/null @@ -1,36 +0,0 @@ -global: - fullnameOverride: l2-bootnode-2 - -envFrom: - - configMapRef: - name: l2-bootnode-2-env - -initContainers: - wait-for-l1: - image: scrolltech/scroll-alpine:v0.0.1 - command: - - /bin/sh - - -c - - /wait-for-l1.sh $L2GETH_L1_ENDPOINT - envFrom: - - configMapRef: - name: l2-bootnode-2-env - volumeMounts: - - name: wait-for-l1-script - mountPath: /wait-for-l1.sh - subPath: wait-for-l1.sh - -persistence: - env: - enabled: true - type: configMap - mountPath: /config/ - name: l2-bootnode-2-env - -configMaps: - env: - enabled: true - data: - CHAIN_ID: "" - L2GETH_L1_ENDPOINT: "" - L2GETH_PEER_LIST: "" diff --git a/charts/l2-bootnode/values/production-3.yaml b/charts/l2-bootnode/values/production-3.yaml deleted file mode 100644 index 0e053dc3..00000000 --- a/charts/l2-bootnode/values/production-3.yaml +++ /dev/null @@ -1,36 +0,0 @@ -global: - fullnameOverride: l2-bootnode-3 - -envFrom: - - configMapRef: - name: l2-bootnode-3-env - -initContainers: - wait-for-l1: - image: scrolltech/scroll-alpine:v0.0.1 - command: - - /bin/sh - - -c - - /wait-for-l1.sh $L2GETH_L1_ENDPOINT - envFrom: - - configMapRef: - name: l2-bootnode-3-env - volumeMounts: - - name: wait-for-l1-script - mountPath: /wait-for-l1.sh - subPath: wait-for-l1.sh - -persistence: - env: - enabled: true - type: configMap - mountPath: /config/ - name: l2-bootnode-3-env - -configMaps: - env: - enabled: true - data: - CHAIN_ID: "" - L2GETH_L1_ENDPOINT: "" - L2GETH_PEER_LIST: "" diff --git a/charts/l2-bootnode/values/production-1.yaml b/charts/l2-bootnode/values/production.yaml similarity index 100% rename from charts/l2-bootnode/values/production-1.yaml rename to charts/l2-bootnode/values/production.yaml