From 16a5202ecf5b3496feaa269aa991cfa3d7d05cea Mon Sep 17 00:00:00 2001 From: Morty Date: Wed, 11 Sep 2024 21:41:32 +0800 Subject: [PATCH] feat: add admin system(WIP) --- charts/admin-system-backend/Chart.yaml | 17 ++ charts/admin-system-backend/README.md | 142 ++++++++++++ charts/admin-system-backend/configs/.keep | 0 .../templates/common.yaml | 16 ++ charts/admin-system-backend/values.yaml | 204 ++++++++++++++++++ .../values/production.yaml | 0 charts/admin-system-cron/Chart.yaml | 17 ++ charts/admin-system-cron/README.md | 124 +++++++++++ charts/admin-system-cron/configs/.keep | 0 .../admin-system-cron/templates/common.yaml | 16 ++ charts/admin-system-cron/values.yaml | 154 +++++++++++++ .../admin-system-cron/values/production.yaml | 0 charts/admin-system-dashboard/Chart.yaml | 17 ++ charts/admin-system-dashboard/README.md | 71 ++++++ charts/admin-system-dashboard/configs/.keep | 0 .../templates/common.yaml | 16 ++ charts/admin-system-dashboard/values.yaml | 99 +++++++++ .../values/production.yaml | 0 charts/scroll-sdk/Chart.yaml | 11 +- charts/scroll-sdk/README.md | 14 +- charts/scroll-sdk/config.toml | 1 + .../templates/config-file-for-services.yaml | 20 ++ charts/scroll-sdk/values.yaml | 23 +- devnet/create-env-files.sh | 7 +- 24 files changed, 958 insertions(+), 11 deletions(-) create mode 100644 charts/admin-system-backend/Chart.yaml create mode 100644 charts/admin-system-backend/README.md create mode 100644 charts/admin-system-backend/configs/.keep create mode 100644 charts/admin-system-backend/templates/common.yaml create mode 100644 charts/admin-system-backend/values.yaml create mode 100644 charts/admin-system-backend/values/production.yaml create mode 100644 charts/admin-system-cron/Chart.yaml create mode 100644 charts/admin-system-cron/README.md create mode 100644 charts/admin-system-cron/configs/.keep create mode 100644 charts/admin-system-cron/templates/common.yaml create mode 100644 charts/admin-system-cron/values.yaml create mode 100644 charts/admin-system-cron/values/production.yaml create mode 100644 charts/admin-system-dashboard/Chart.yaml create mode 100644 charts/admin-system-dashboard/README.md create mode 100644 charts/admin-system-dashboard/configs/.keep create mode 100644 charts/admin-system-dashboard/templates/common.yaml create mode 100644 charts/admin-system-dashboard/values.yaml create mode 100644 charts/admin-system-dashboard/values/production.yaml diff --git a/charts/admin-system-backend/Chart.yaml b/charts/admin-system-backend/Chart.yaml new file mode 100644 index 00000000..ecf4c4d8 --- /dev/null +++ b/charts/admin-system-backend/Chart.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: v2 +description: admin-system-backend helm charts +name: admin-system-backend +version: 0.0.1 +appVersion: v0.1.0 +kubeVersion: ">=1.22.0-0" +maintainers: + - name: scroll-sre + email: sebastien@scroll.io +dependencies: + - name: common + repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm" + version: 1.5.1 + - name: external-secrets-lib + repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm" + version: 0.0.3 diff --git a/charts/admin-system-backend/README.md b/charts/admin-system-backend/README.md new file mode 100644 index 00000000..50b83651 --- /dev/null +++ b/charts/admin-system-backend/README.md @@ -0,0 +1,142 @@ +# admin-system-backend + +![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) + +admin-system-backend helm charts + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| scroll-sre | | | + +## Requirements + +Kubernetes: `>=1.22.0-0` + +| Repository | Name | Version | +|------------|------|---------| +| oci://ghcr.io/scroll-tech/scroll-sdk/helm | common | 1.5.1 | +| oci://ghcr.io/scroll-tech/scroll-sdk/helm | external-secrets-lib | 0.0.3 | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| command[0] | string | `"/bin/sh"` | | +| command[1] | string | `"-c"` | | +| command[2] | string | `"scroll-admin-system --config /app/config/admin-system-backend-config.json --genesis /app/genesis/genesis.json --http.port ${HTTP_PORT} --metrics --metrics.port ${METRICS_PORT}"` | | +| configMaps.model-conf.data."model.conf" | string | `"[request_definition]\nr = sub, obj, act\n[policy_definition]\np = sub, obj, act\n[role_definition]\ng = _, _\n[policy_effect]\ne = some(where (p.eft == allow))\n[matchers]\nm = g(r.sub, p.sub) && regexMatch(r.obj, p.obj) && regexMatch(r.act, p.act)\n"` | | +| configMaps.model-conf.enabled | bool | `true` | | +| configMaps.policy-csv.data."policy.csv" | string | `"p, undefined, ^\\/api\\/v1\\/login$, POST\np, undefined, ^\\/api\\/v1\\/otp\\/.*$, (GET)|(POST)\np, read, ^\\/api\\/v1\\/(chunk|batch|bundle|provertask|l2_block|prover|job)\\/.*$, GET\np, read, ^\\/api\\/v1\\/(chunk|batch|bundle|provertask|l2_block|prover)\\/search$, POST\np, readwrite, ^\\/api\\/v1\\/(chunk|batch|bundle|l2_block)\\/.*$, (POST)|(DELETE)\np, readwrite, ^\\/api\\/v1\\/provertask\\/(update|delete)$, (POST)|(DELETE)\np, admin, ^\\/api\\/v1\\/provertask\\/reassign$, POST\np, admin, ^\\/api\\/v1\\/(policy|user|prover_block|partner)\\/.*$,(GET)|(POST)|(DELETE)\np, admin, ^\\/api\\/v1\\/job\\/.*$, POST\ng, read, undefined\ng, readwrite, read\ng, admin, readwrite\n"` | | +| configMaps.policy-csv.enabled | bool | `true` | | +| controller.replicas | int | `1` | | +| controller.strategy | string | `"Recreate"` | | +| controller.type | string | `"deployment"` | | +| env[0].name | string | `"HTTP_PORT"` | | +| env[0].value | string | `"8080"` | | +| env[1].name | string | `"METRICS_PORT"` | | +| env[1].value | string | `"8090"` | | +| env[2].name | string | `"GIN_MODE"` | | +| env[2].value | string | `"release"` | | +| env[3].name | string | `"ENV"` | | +| env[3].value | string | `"fake"` | | +| env[4].name | string | `"CHAIN_ID"` | | +| env[4].value | string | `"222222"` | | +| global.fullnameOverride | string | `"admin-system-backend"` | | +| global.nameOverride | string | `"admin-system-backend"` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"scrolltech/scroll-admin-system"` | | +| image.tag | string | `"v0.1.0"` | | +| initContainers.1-wait-for-postgres.args[0] | string | `"tcp"` | | +| initContainers.1-wait-for-postgres.args[1] | string | `"$(DATABASE_HOST):$(DATABASE_PORT)"` | | +| initContainers.1-wait-for-postgres.args[2] | string | `"--timeout"` | | +| initContainers.1-wait-for-postgres.args[3] | string | `"0"` | | +| initContainers.1-wait-for-postgres.envFrom[0].configMapRef.name | string | `"admin-system-backend-env"` | | +| initContainers.1-wait-for-postgres.image | string | `"atkrad/wait4x:latest"` | | +| initContainers.2-init-db.command[0] | string | `"bash"` | | +| initContainers.2-init-db.command[1] | string | `"-c"` | | +| initContainers.2-init-db.command[2] | string | `"./init-db.sh"` | | +| initContainers.2-init-db.env[0].name | string | `"POSTGRES_DB"` | | +| initContainers.2-init-db.env[0].value | string | `"scroll_admin_system"` | | +| initContainers.2-init-db.env[1].name | string | `"PG_USER"` | | +| initContainers.2-init-db.env[1].valueFrom.secretKeyRef.key | string | `"PG_USER"` | | +| initContainers.2-init-db.env[1].valueFrom.secretKeyRef.name | string | `"db-secrets"` | | +| initContainers.2-init-db.env[2].name | string | `"PGPASSWORD"` | | +| initContainers.2-init-db.env[2].valueFrom.secretKeyRef.key | string | `"PGPASSWORD"` | | +| initContainers.2-init-db.env[2].valueFrom.secretKeyRef.name | string | `"db-secrets"` | | +| initContainers.2-init-db.env[3].name | string | `"PG_HOST"` | | +| initContainers.2-init-db.env[3].valueFrom.secretKeyRef.key | string | `"PG_HOST"` | | +| initContainers.2-init-db.env[3].valueFrom.secretKeyRef.name | string | `"db-secrets"` | | +| initContainers.2-init-db.env[4].name | string | `"PG_PORT"` | | +| initContainers.2-init-db.env[4].valueFrom.secretKeyRef.key | string | `"PG_PORT"` | | +| initContainers.2-init-db.env[4].valueFrom.secretKeyRef.name | string | `"db-secrets"` | | +| initContainers.2-init-db.env[5].name | string | `"DB_USER"` | | +| initContainers.2-init-db.env[5].value | string | `"scroll_admin_system"` | | +| initContainers.2-init-db.env[6].name | string | `"DB_PASSWORD"` | | +| initContainers.2-init-db.env[6].valueFrom.secretKeyRef.key | string | `"ADMIN_SYSTEM_PASSWORD"` | | +| initContainers.2-init-db.env[6].valueFrom.secretKeyRef.name | string | `"db-secrets"` | | +| initContainers.2-init-db.image | string | `"postgres:latest"` | | +| initContainers.2-init-db.volumeMounts[0].mountPath | string | `"/init-db.sh"` | | +| initContainers.2-init-db.volumeMounts[0].name | string | `"init-db"` | | +| initContainers.2-init-db.volumeMounts[0].subPath | string | `"init-db.sh"` | | +| initContainers.3-check-postgres-connection.args[0] | string | `"postgresql"` | | +| initContainers.3-check-postgres-connection.args[1] | string | `"$(DATABASE_URL)"` | | +| initContainers.3-check-postgres-connection.args[2] | string | `"--timeout"` | | +| initContainers.3-check-postgres-connection.args[3] | string | `"0"` | | +| initContainers.3-check-postgres-connection.envFrom[0].configMapRef.name | string | `"admin-system-backend-env"` | | +| initContainers.3-check-postgres-connection.image | string | `"atkrad/wait4x:latest"` | | +| initContainers.4-migrate-db.command[0] | string | `"/bin/sh"` | | +| initContainers.4-migrate-db.command[1] | string | `"-c"` | | +| initContainers.4-migrate-db.command[2] | string | `"ENV=fake CHAIN_ID=222222 db_cli migrate --config /app/config/admin-system-backend-config.json"` | | +| initContainers.4-migrate-db.image | string | `"scrolltech/scroll-admin-system:v0.1.0"` | | +| initContainers.4-migrate-db.volumeMounts[0].mountPath | string | `"/app/config/"` | | +| initContainers.4-migrate-db.volumeMounts[0].name | string | `"admin-system-backend"` | | +| persistence.app_name.enabled | string | `"yes"` | | +| persistence.app_name.mountPath | string | `"/app/config/"` | | +| persistence.app_name.name | string | `"admin-system-backend-config"` | | +| persistence.app_name.type | string | `"configMap"` | | +| persistence.genesis.enabled | string | `"yes"` | | +| persistence.genesis.mountPath | string | `"/app/genesis/"` | | +| persistence.genesis.name | string | `"genesis-config"` | | +| persistence.genesis.type | string | `"configMap"` | | +| persistence.init-db.defaultMode | string | `"0777"` | | +| persistence.init-db.enabled | string | `"yes"` | | +| persistence.init-db.mountPath | string | `"/init-db.sh"` | | +| persistence.init-db.name | string | `"init-db"` | | +| persistence.init-db.type | string | `"configMap"` | | +| persistence.model-conf.enabled | string | `"yes"` | | +| persistence.model-conf.mountPath | string | `"/app/conf/model.conf"` | | +| persistence.model-conf.name | string | `"admin-system-backend-model-conf"` | | +| persistence.model-conf.subPath | string | `"model.conf"` | | +| persistence.model-conf.type | string | `"configMap"` | | +| persistence.policy-csv.enabled | string | `"yes"` | | +| persistence.policy-csv.mountPath | string | `"/app/conf/policy.csv"` | | +| persistence.policy-csv.name | string | `"admin-system-backend-policy-csv"` | | +| persistence.policy-csv.subPath | string | `"policy.csv"` | | +| persistence.policy-csv.type | string | `"configMap"` | | +| probes.liveness.enabled | bool | `false` | | +| probes.readiness.enabled | bool | `false` | | +| probes.startup.enabled | bool | `false` | | +| resources.limits.cpu | string | `"100m"` | | +| resources.limits.memory | string | `"200Mi"` | | +| resources.requests.cpu | string | `"50m"` | | +| resources.requests.memory | string | `"50Mi"` | | +| service.main.enabled | bool | `true` | | +| service.main.ports.http.enabled | bool | `true` | | +| service.main.ports.http.port | int | `8080` | | +| service.main.ports.http.primary | bool | `true` | | +| service.main.ports.http.protocol | string | `"HTTP"` | | +| service.main.ports.metrics.enabled | bool | `true` | | +| service.main.ports.metrics.port | int | `8090` | | +| service.main.ports.metrics.targetPort | int | `8090` | | +| service.main.primary | bool | `true` | | +| serviceMonitor.main.enabled | bool | `true` | | +| serviceMonitor.main.endpoints[0].interval | string | `"1m"` | | +| serviceMonitor.main.endpoints[0].port | string | `"http"` | | +| serviceMonitor.main.endpoints[0].scrapeTimeout | string | `"10s"` | | +| serviceMonitor.main.labels.release | string | `"scroll-stack"` | | +| serviceMonitor.main.serviceName | string | `"{{ include \"scroll.common.lib.chart.names.fullname\" $ }}"` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) diff --git a/charts/admin-system-backend/configs/.keep b/charts/admin-system-backend/configs/.keep new file mode 100644 index 00000000..e69de29b diff --git a/charts/admin-system-backend/templates/common.yaml b/charts/admin-system-backend/templates/common.yaml new file mode 100644 index 00000000..0ec7409b --- /dev/null +++ b/charts/admin-system-backend/templates/common.yaml @@ -0,0 +1,16 @@ +--- +{{- include "scroll.common.loader.init" . }} + +{{- define "app-template.hardcodedValues" -}} +# Set the nameOverride based on the release name if no override has been set +{{ if not .Values.global.nameOverride }} +global: + nameOverride: "{{ .Release.Name }}" +{{ end }} +{{- end -}} +{{- $_ := mergeOverwrite .Values (include "app-template.hardcodedValues" . | fromYaml) -}} + +{{/* Render the templates */}} +{{ include "scroll.common.loader.generate" . }} +--- +{{- include "scrolllib.externalsecrets.tpl" . }} diff --git a/charts/admin-system-backend/values.yaml b/charts/admin-system-backend/values.yaml new file mode 100644 index 00000000..af833074 --- /dev/null +++ b/charts/admin-system-backend/values.yaml @@ -0,0 +1,204 @@ +--- +global: + nameOverride: &app_name admin-system-backend + fullnameOverride: *app_name + +controller: + replicas: 1 + strategy: Recreate + type: deployment + +image: + repository: scrolltech/scroll-admin-system + pullPolicy: Always + tag: v0.1.0 + +env: + - name: HTTP_PORT + value: "8080" + - name: METRICS_PORT + value: "8090" + - name: GIN_MODE + value: "release" + - name: ENV + value: "fake" + - name: CHAIN_ID + value: "222222" + +command: [ + "/bin/sh", + "-c", + "scroll-admin-system --config /app/config/admin-system-backend-config.json \ + --genesis /app/genesis/genesis.json \ + --http.port ${HTTP_PORT} \ + --metrics --metrics.port ${METRICS_PORT}", + ] + +resources: + requests: + memory: "50Mi" + cpu: "50m" + limits: + memory: "200Mi" + cpu: "100m" + +service: + main: + enabled: true + primary: true + ports: + http: + primary: true + enabled: true + port: 8080 + protocol: HTTP + metrics: + enabled: true + port: 8090 + targetPort: 8090 + +probes: + liveness: + enabled: false + readiness: + enabled: false + startup: + enabled: false + + +persistence: + *app_name: + enabled: yes + type: configMap + mountPath: /app/config/ + name: admin-system-backend-config + genesis: + enabled: yes + type: configMap + mountPath: /app/genesis/ + name: genesis-config + init-db: + enabled: yes + type: configMap + mountPath: /init-db.sh + name: init-db + defaultMode: "0777" + model-conf: + enabled: yes + type: configMap + mountPath: /app/conf/model.conf + subPath: model.conf + name: admin-system-backend-model-conf + policy-csv: + enabled: yes + type: configMap + mountPath: /app/conf/policy.csv + subPath: policy.csv + name: admin-system-backend-policy-csv + +initContainers: + 1-wait-for-postgres: + image: atkrad/wait4x:latest + args: + - tcp + - $(DATABASE_HOST):$(DATABASE_PORT) + - --timeout + - "0" + envFrom: + - configMapRef: + name: admin-system-backend-env + 2-init-db: + image: postgres:latest + env: + - name: POSTGRES_DB + value: scroll_admin_system + - name: PG_USER + valueFrom: + secretKeyRef: + name: db-secrets + key: PG_USER + - name: PGPASSWORD + valueFrom: + secretKeyRef: + name: db-secrets + key: PGPASSWORD + - name: PG_HOST + valueFrom: + secretKeyRef: + name: db-secrets + key: PG_HOST + - name: PG_PORT + valueFrom: + secretKeyRef: + name: db-secrets + key: PG_PORT + - name: DB_USER + value: scroll_admin_system + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: db-secrets + key: ADMIN_SYSTEM_PASSWORD + command: ["bash","-c","./init-db.sh"] + volumeMounts: + - name: init-db + mountPath: /init-db.sh + subPath: init-db.sh + 3-check-postgres-connection: + image: atkrad/wait4x:latest + args: + - postgresql + - $(DATABASE_URL) + - --timeout + - "0" + envFrom: + - configMapRef: + name: admin-system-backend-env + 4-migrate-db: + image: scrolltech/scroll-admin-system:v0.1.0 + command: ["/bin/sh","-c","ENV=fake CHAIN_ID=222222 db_cli migrate --config /app/config/admin-system-backend-config.json"] + volumeMounts: + - name: *app_name + mountPath: /app/config/ + +configMaps: + model-conf: + enabled: true + data: + model.conf: | + [request_definition] + r = sub, obj, act + [policy_definition] + p = sub, obj, act + [role_definition] + g = _, _ + [policy_effect] + e = some(where (p.eft == allow)) + [matchers] + m = g(r.sub, p.sub) && regexMatch(r.obj, p.obj) && regexMatch(r.act, p.act) + policy-csv: + enabled: true + data: + policy.csv: | + p, undefined, ^\/api\/v1\/login$, POST + p, undefined, ^\/api\/v1\/otp\/.*$, (GET)|(POST) + p, read, ^\/api\/v1\/(chunk|batch|bundle|provertask|l2_block|prover|job)\/.*$, GET + p, read, ^\/api\/v1\/(chunk|batch|bundle|provertask|l2_block|prover)\/search$, POST + p, readwrite, ^\/api\/v1\/(chunk|batch|bundle|l2_block)\/.*$, (POST)|(DELETE) + p, readwrite, ^\/api\/v1\/provertask\/(update|delete)$, (POST)|(DELETE) + p, admin, ^\/api\/v1\/provertask\/reassign$, POST + p, admin, ^\/api\/v1\/(policy|user|prover_block|partner)\/.*$,(GET)|(POST)|(DELETE) + p, admin, ^\/api\/v1\/job\/.*$, POST + g, read, undefined + g, readwrite, read + g, admin, readwrite +serviceMonitor: + main: + enabled: true + labels: + release: scroll-stack + serviceName: '{{ include "scroll.common.lib.chart.names.fullname" $ }}' + endpoints: + - port: http + interval: 1m + scrapeTimeout: 10s diff --git a/charts/admin-system-backend/values/production.yaml b/charts/admin-system-backend/values/production.yaml new file mode 100644 index 00000000..e69de29b diff --git a/charts/admin-system-cron/Chart.yaml b/charts/admin-system-cron/Chart.yaml new file mode 100644 index 00000000..7710e4b9 --- /dev/null +++ b/charts/admin-system-cron/Chart.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: v2 +description: admin-system-cron helm charts +name: admin-system-cron +version: 0.0.1 +appVersion: v0.1.0 +kubeVersion: ">=1.22.0-0" +maintainers: + - name: scroll-sre + email: sebastien@scroll.io +dependencies: + - name: common + repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm" + version: 1.5.1 + - name: external-secrets-lib + repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm" + version: 0.0.3 diff --git a/charts/admin-system-cron/README.md b/charts/admin-system-cron/README.md new file mode 100644 index 00000000..fc7f35cc --- /dev/null +++ b/charts/admin-system-cron/README.md @@ -0,0 +1,124 @@ +# admin-system-cron + +![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) + +admin-system-cron helm charts + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| scroll-sre | | | + +## Requirements + +Kubernetes: `>=1.22.0-0` + +| Repository | Name | Version | +|------------|------|---------| +| oci://ghcr.io/scroll-tech/scroll-sdk/helm | common | 1.5.1 | +| oci://ghcr.io/scroll-tech/scroll-sdk/helm | external-secrets-lib | 0.0.3 | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| command[0] | string | `"/bin/sh"` | | +| command[1] | string | `"-c"` | | +| command[2] | string | `"scroll-admin-cron --config /app/config/admin-system-backend-config.json --http.port ${HTTP_PORT} --metrics --metrics.port ${METRICS_PORT}"` | | +| controller.replicas | int | `1` | | +| controller.strategy | string | `"Recreate"` | | +| controller.type | string | `"deployment"` | | +| env[0].name | string | `"ENV"` | | +| env[0].value | string | `"fake"` | | +| env[1].name | string | `"CHAIN_ID"` | | +| env[1].value | string | `"222222"` | | +| env[2].name | string | `"HTTP_PORT"` | | +| env[2].value | string | `"8080"` | | +| env[3].name | string | `"METRICS_PORT"` | | +| env[3].value | string | `"8090"` | | +| env[4].name | string | `"GIN_MODE"` | | +| env[4].value | string | `"release"` | | +| global.fullnameOverride | string | `"admin-system-cron"` | | +| global.nameOverride | string | `"admin-system-cron"` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"scrolltech/scroll-admin-cron"` | | +| image.tag | string | `"v0.1.0"` | | +| initContainers.1-wait-for-postgres.args[0] | string | `"tcp"` | | +| initContainers.1-wait-for-postgres.args[1] | string | `"$(DATABASE_HOST):$(DATABASE_PORT)"` | | +| initContainers.1-wait-for-postgres.args[2] | string | `"--timeout"` | | +| initContainers.1-wait-for-postgres.args[3] | string | `"0"` | | +| initContainers.1-wait-for-postgres.envFrom[0].configMapRef.name | string | `"admin-system-backend-env"` | | +| initContainers.1-wait-for-postgres.image | string | `"atkrad/wait4x:latest"` | | +| initContainers.2-init-db.command[0] | string | `"bash"` | | +| initContainers.2-init-db.command[1] | string | `"-c"` | | +| initContainers.2-init-db.command[2] | string | `"./init-db.sh"` | | +| initContainers.2-init-db.env[0].name | string | `"POSTGRES_DB"` | | +| initContainers.2-init-db.env[0].value | string | `"scroll_admin_system"` | | +| initContainers.2-init-db.env[1].name | string | `"PG_USER"` | | +| initContainers.2-init-db.env[1].valueFrom.secretKeyRef.key | string | `"PG_USER"` | | +| initContainers.2-init-db.env[1].valueFrom.secretKeyRef.name | string | `"db-secrets"` | | +| initContainers.2-init-db.env[2].name | string | `"PGPASSWORD"` | | +| initContainers.2-init-db.env[2].valueFrom.secretKeyRef.key | string | `"PGPASSWORD"` | | +| initContainers.2-init-db.env[2].valueFrom.secretKeyRef.name | string | `"db-secrets"` | | +| initContainers.2-init-db.env[3].name | string | `"PG_HOST"` | | +| initContainers.2-init-db.env[3].valueFrom.secretKeyRef.key | string | `"PG_HOST"` | | +| initContainers.2-init-db.env[3].valueFrom.secretKeyRef.name | string | `"db-secrets"` | | +| initContainers.2-init-db.env[4].name | string | `"PG_PORT"` | | +| initContainers.2-init-db.env[4].valueFrom.secretKeyRef.key | string | `"PG_PORT"` | | +| initContainers.2-init-db.env[4].valueFrom.secretKeyRef.name | string | `"db-secrets"` | | +| initContainers.2-init-db.env[5].name | string | `"DB_USER"` | | +| initContainers.2-init-db.env[5].value | string | `"scroll_admin_system"` | | +| initContainers.2-init-db.env[6].name | string | `"DB_PASSWORD"` | | +| initContainers.2-init-db.env[6].valueFrom.secretKeyRef.key | string | `"ADMIN_SYSTEM_PASSWORD"` | | +| initContainers.2-init-db.env[6].valueFrom.secretKeyRef.name | string | `"db-secrets"` | | +| initContainers.2-init-db.image | string | `"postgres:latest"` | | +| initContainers.2-init-db.volumeMounts[0].mountPath | string | `"/init-db.sh"` | | +| initContainers.2-init-db.volumeMounts[0].name | string | `"init-db"` | | +| initContainers.2-init-db.volumeMounts[0].subPath | string | `"init-db.sh"` | | +| initContainers.3-check-postgres-connection.args[0] | string | `"postgresql"` | | +| initContainers.3-check-postgres-connection.args[1] | string | `"$(DATABASE_URL)"` | | +| initContainers.3-check-postgres-connection.args[2] | string | `"--timeout"` | | +| initContainers.3-check-postgres-connection.args[3] | string | `"0"` | | +| initContainers.3-check-postgres-connection.envFrom[0].configMapRef.name | string | `"admin-system-backend-env"` | | +| initContainers.3-check-postgres-connection.image | string | `"atkrad/wait4x:latest"` | | +| initContainers.4-migrate-db.command[0] | string | `"/bin/sh"` | | +| initContainers.4-migrate-db.command[1] | string | `"-c"` | | +| initContainers.4-migrate-db.command[2] | string | `"ENV=fake CHAIN_ID=222222 db_cli migrate --config /app/config/admin-system-backend-config.json"` | | +| initContainers.4-migrate-db.image | string | `"scrolltech/scroll-admin-system:v0.1.0"` | | +| initContainers.4-migrate-db.volumeMounts[0].mountPath | string | `"/app/config/"` | | +| initContainers.4-migrate-db.volumeMounts[0].name | string | `"admin-system-cron"` | | +| persistence.app_name.enabled | string | `"yes"` | | +| persistence.app_name.mountPath | string | `"/app/config/"` | | +| persistence.app_name.name | string | `"admin-system-backend-config"` | | +| persistence.app_name.type | string | `"configMap"` | | +| persistence.init-db.defaultMode | string | `"0777"` | | +| persistence.init-db.enabled | string | `"yes"` | | +| persistence.init-db.mountPath | string | `"/init-db.sh"` | | +| persistence.init-db.name | string | `"init-db"` | | +| persistence.init-db.type | string | `"configMap"` | | +| probes.liveness.enabled | bool | `false` | | +| probes.readiness.enabled | bool | `false` | | +| probes.startup.enabled | bool | `false` | | +| resources.limits.cpu | string | `"1"` | | +| resources.limits.memory | string | `"1Gi"` | | +| resources.requests.cpu | string | `"500m"` | | +| resources.requests.memory | string | `"500Mi"` | | +| service.main.enabled | bool | `true` | | +| service.main.ports.http.enabled | bool | `true` | | +| service.main.ports.http.port | int | `8080` | | +| service.main.ports.http.primary | bool | `true` | | +| service.main.ports.http.protocol | string | `"HTTP"` | | +| service.main.ports.metrics.enabled | bool | `true` | | +| service.main.ports.metrics.port | int | `8090` | | +| service.main.ports.metrics.targetPort | int | `8090` | | +| service.main.primary | bool | `true` | | +| serviceMonitor.main.enabled | bool | `true` | | +| serviceMonitor.main.endpoints[0].interval | string | `"1m"` | | +| serviceMonitor.main.endpoints[0].port | string | `"http"` | | +| serviceMonitor.main.endpoints[0].scrapeTimeout | string | `"10s"` | | +| serviceMonitor.main.labels.release | string | `"scroll-stack"` | | +| serviceMonitor.main.serviceName | string | `"{{ include \"scroll.common.lib.chart.names.fullname\" $ }}"` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) diff --git a/charts/admin-system-cron/configs/.keep b/charts/admin-system-cron/configs/.keep new file mode 100644 index 00000000..e69de29b diff --git a/charts/admin-system-cron/templates/common.yaml b/charts/admin-system-cron/templates/common.yaml new file mode 100644 index 00000000..0ec7409b --- /dev/null +++ b/charts/admin-system-cron/templates/common.yaml @@ -0,0 +1,16 @@ +--- +{{- include "scroll.common.loader.init" . }} + +{{- define "app-template.hardcodedValues" -}} +# Set the nameOverride based on the release name if no override has been set +{{ if not .Values.global.nameOverride }} +global: + nameOverride: "{{ .Release.Name }}" +{{ end }} +{{- end -}} +{{- $_ := mergeOverwrite .Values (include "app-template.hardcodedValues" . | fromYaml) -}} + +{{/* Render the templates */}} +{{ include "scroll.common.loader.generate" . }} +--- +{{- include "scrolllib.externalsecrets.tpl" . }} diff --git a/charts/admin-system-cron/values.yaml b/charts/admin-system-cron/values.yaml new file mode 100644 index 00000000..af73f7e7 --- /dev/null +++ b/charts/admin-system-cron/values.yaml @@ -0,0 +1,154 @@ +--- +global: + nameOverride: &app_name admin-system-cron + fullnameOverride: *app_name + +controller: + replicas: 1 + strategy: Recreate + type: deployment + +image: + repository: scrolltech/scroll-admin-cron + pullPolicy: Always + tag: v0.1.0 + +env: + - name: ENV + value: "fake" + - name: CHAIN_ID + value: "222222" + - name: HTTP_PORT + value: "8080" + - name: METRICS_PORT + value: "8090" + - name: GIN_MODE + value: "release" + +command: [ + "/bin/sh", + "-c", + "scroll-admin-cron --config /app/config/admin-system-backend-config.json \ + --http.port ${HTTP_PORT} \ + --metrics --metrics.port ${METRICS_PORT}", + ] + +resources: + requests: + memory: "500Mi" + cpu: "500m" + limits: + memory: "1Gi" + cpu: "1" + +service: + main: + enabled: true + primary: true + ports: + http: + primary: true + enabled: true + port: 8080 + protocol: HTTP + metrics: + enabled: true + port: 8090 + targetPort: 8090 + +probes: + liveness: + enabled: false + readiness: + enabled: false + startup: + enabled: false + +persistence: + *app_name: + enabled: yes + type: configMap + mountPath: /app/config/ + name: admin-system-backend-config + init-db: + enabled: yes + type: configMap + mountPath: /init-db.sh + name: init-db + defaultMode: "0777" + +initContainers: + 1-wait-for-postgres: + image: atkrad/wait4x:latest + args: + - tcp + - $(DATABASE_HOST):$(DATABASE_PORT) + - --timeout + - "0" + envFrom: + - configMapRef: + name: admin-system-backend-env + 2-init-db: + image: postgres:latest + env: + - name: POSTGRES_DB + value: scroll_admin_system + - name: PG_USER + valueFrom: + secretKeyRef: + name: db-secrets + key: PG_USER + - name: PGPASSWORD + valueFrom: + secretKeyRef: + name: db-secrets + key: PGPASSWORD + - name: PG_HOST + valueFrom: + secretKeyRef: + name: db-secrets + key: PG_HOST + - name: PG_PORT + valueFrom: + secretKeyRef: + name: db-secrets + key: PG_PORT + - name: DB_USER + value: scroll_admin_system + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: db-secrets + key: ADMIN_SYSTEM_PASSWORD + command: ["bash","-c","./init-db.sh"] + volumeMounts: + - name: init-db + mountPath: /init-db.sh + subPath: init-db.sh + 3-check-postgres-connection: + image: atkrad/wait4x:latest + args: + - postgresql + - $(DATABASE_URL) + - --timeout + - "0" + envFrom: + - configMapRef: + name: admin-system-backend-env + 4-migrate-db: + image: scrolltech/scroll-admin-system:v0.1.0 + command: ["/bin/sh","-c","ENV=fake CHAIN_ID=222222 db_cli migrate --config /app/config/admin-system-backend-config.json"] + volumeMounts: + - name: *app_name + mountPath: /app/config/ + +serviceMonitor: + main: + enabled: true + labels: + release: scroll-stack + serviceName: '{{ include "scroll.common.lib.chart.names.fullname" $ }}' + endpoints: + - port: http + interval: 1m + scrapeTimeout: 10s diff --git a/charts/admin-system-cron/values/production.yaml b/charts/admin-system-cron/values/production.yaml new file mode 100644 index 00000000..e69de29b diff --git a/charts/admin-system-dashboard/Chart.yaml b/charts/admin-system-dashboard/Chart.yaml new file mode 100644 index 00000000..bc70dc7c --- /dev/null +++ b/charts/admin-system-dashboard/Chart.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: v2 +description: admin-system-dashboard helm charts +name: admin-system-dashboard +version: 0.0.1 +appVersion: v0.1.0 +kubeVersion: ">=1.22.0-0" +maintainers: + - name: scroll-sre + email: sebastien@scroll.io +dependencies: + - name: common + repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm" + version: 1.5.1 + - name: external-secrets-lib + repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm" + version: 0.0.3 diff --git a/charts/admin-system-dashboard/README.md b/charts/admin-system-dashboard/README.md new file mode 100644 index 00000000..be425f6a --- /dev/null +++ b/charts/admin-system-dashboard/README.md @@ -0,0 +1,71 @@ +# admin-system-dashboard + +![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) + +admin-system-dashboard helm charts + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| scroll-sre | | | + +## Requirements + +Kubernetes: `>=1.22.0-0` + +| Repository | Name | Version | +|------------|------|---------| +| oci://ghcr.io/scroll-tech/scroll-sdk/helm | common | 1.5.1 | +| oci://ghcr.io/scroll-tech/scroll-sdk/helm | external-secrets-lib | 0.0.3 | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| configMaps.nginx.data."default.conf" | string | `"server {\n listen 80;\n listen [::]:80;\n server_name localhost;\n #access_log /var/log/nginx/host.access.log main;\n location / {\n root /usr/share/nginx/html;\n index index.html index.htm;\n try_files $uri /index.html;\n }\n location /api {\n proxy_pass http://admin-system-backend:8080;\n }\n error_page 500 502 503 504 /50x.html;\n location = /50x.html {\n root /usr/share/nginx/html;\n }\n}\n"` | | +| configMaps.nginx.enabled | bool | `true` | | +| configMaps.nginx.name | string | `"nginx"` | | +| controller.replicas | int | `1` | | +| controller.strategy | string | `"Recreate"` | | +| controller.type | string | `"deployment"` | | +| env[0].name | string | `"VITE_BASE_REST_URL"` | | +| env[0].value | string | `"http://admin-system-backend:8080/api/v1"` | | +| env[1].name | string | `"VITE_SCROLL_ENVIRONMENT"` | | +| env[1].value | string | `"scroll-sdk"` | | +| global.fullnameOverride | string | `"admin-system-dashboard"` | | +| global.nameOverride | string | `"admin-system-dashboard"` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"scrolltech/admin-dashboard"` | | +| image.tag | string | `"v0.0.16"` | | +| ingress.main.annotations | object | `{}` | | +| ingress.main.enabled | bool | `true` | | +| ingress.main.hosts[0].host | string | `"admin-system-dashboard.scrollsdk"` | | +| ingress.main.hosts[0].paths[0].path | string | `"/"` | | +| ingress.main.hosts[0].paths[0].pathType | string | `"Prefix"` | | +| ingress.main.ingressClassName | string | `"nginx"` | | +| ingress.main.labels | object | `{}` | | +| ingress.main.primary | bool | `true` | | +| persistence.nginx.enabled | string | `"yes"` | | +| persistence.nginx.mountPath | string | `"/etc/nginx/conf.d"` | | +| persistence.nginx.name | string | `"admin-system-dashboard-nginx"` | | +| persistence.nginx.type | string | `"configMap"` | | +| probes.liveness.enabled | bool | `false` | | +| probes.readiness.enabled | bool | `false` | | +| probes.startup.enabled | bool | `false` | | +| resources.limits.cpu | string | `"100m"` | | +| resources.limits.memory | string | `"200Mi"` | | +| resources.requests.cpu | string | `"50m"` | | +| resources.requests.memory | string | `"50Mi"` | | +| service.main.enabled | bool | `true` | | +| service.main.ports.http.enabled | bool | `true` | | +| service.main.ports.http.port | int | `80` | | +| serviceMonitor.main.enabled | bool | `true` | | +| serviceMonitor.main.endpoints[0].interval | string | `"1m"` | | +| serviceMonitor.main.endpoints[0].port | string | `"http"` | | +| serviceMonitor.main.endpoints[0].scrapeTimeout | string | `"10s"` | | +| serviceMonitor.main.labels.release | string | `"scroll-stack"` | | +| serviceMonitor.main.serviceName | string | `"{{ include \"scroll.common.lib.chart.names.fullname\" $ }}"` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) diff --git a/charts/admin-system-dashboard/configs/.keep b/charts/admin-system-dashboard/configs/.keep new file mode 100644 index 00000000..e69de29b diff --git a/charts/admin-system-dashboard/templates/common.yaml b/charts/admin-system-dashboard/templates/common.yaml new file mode 100644 index 00000000..0ec7409b --- /dev/null +++ b/charts/admin-system-dashboard/templates/common.yaml @@ -0,0 +1,16 @@ +--- +{{- include "scroll.common.loader.init" . }} + +{{- define "app-template.hardcodedValues" -}} +# Set the nameOverride based on the release name if no override has been set +{{ if not .Values.global.nameOverride }} +global: + nameOverride: "{{ .Release.Name }}" +{{ end }} +{{- end -}} +{{- $_ := mergeOverwrite .Values (include "app-template.hardcodedValues" . | fromYaml) -}} + +{{/* Render the templates */}} +{{ include "scroll.common.loader.generate" . }} +--- +{{- include "scrolllib.externalsecrets.tpl" . }} diff --git a/charts/admin-system-dashboard/values.yaml b/charts/admin-system-dashboard/values.yaml new file mode 100644 index 00000000..b162f731 --- /dev/null +++ b/charts/admin-system-dashboard/values.yaml @@ -0,0 +1,99 @@ +--- +global: + nameOverride: &app_name admin-system-dashboard + fullnameOverride: *app_name + +controller: + replicas: 1 + strategy: Recreate + type: deployment + +image: + repository: scrolltech/admin-dashboard + pullPolicy: Always + tag: v0.0.16 + +env: + - name: VITE_BASE_REST_URL + value: "http://admin-system-backend:8080/api/v1" + - name: VITE_SCROLL_ENVIRONMENT + value: "scroll-sdk" + +resources: + requests: + memory: "50Mi" + cpu: "50m" + limits: + memory: "200Mi" + cpu: "100m" + +service: + main: + enabled: true + ports: + http: + enabled: true + port: 80 + +probes: + liveness: + enabled: false + readiness: + enabled: false + startup: + enabled: false + +persistence: + nginx: + enabled: yes + type: configMap + mountPath: /etc/nginx/conf.d + name: admin-system-dashboard-nginx + +configMaps: + nginx: + name: nginx + enabled: true + data: + default.conf: | + server { + listen 80; + listen [::]:80; + server_name localhost; + #access_log /var/log/nginx/host.access.log main; + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri /index.html; + } + location /api { + proxy_pass http://admin-system-backend:8080; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } +serviceMonitor: + main: + enabled: true + labels: + release: scroll-stack + serviceName: '{{ include "scroll.common.lib.chart.names.fullname" $ }}' + endpoints: + - port: http + interval: 1m + scrapeTimeout: 10s + +ingress: + main: + enabled: true + primary: true + annotations: {} + labels: {} + ingressClassName: "nginx" + hosts: + - host: admin-system-dashboard.scrollsdk + paths: + - path: / + pathType: Prefix diff --git a/charts/admin-system-dashboard/values/production.yaml b/charts/admin-system-dashboard/values/production.yaml new file mode 100644 index 00000000..e69de29b diff --git a/charts/scroll-sdk/Chart.yaml b/charts/scroll-sdk/Chart.yaml index f0bd7589..9b603d27 100644 --- a/charts/scroll-sdk/Chart.yaml +++ b/charts/scroll-sdk/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: scroll helm charts to deploy scroll sdk name: scroll-sdk -version: 0.0.31 +version: 0.0.32 appVersion: v0.1.0 kubeVersion: ">=1.22.0-0" maintainers: @@ -105,3 +105,12 @@ dependencies: version: 0.0.2 repository: "oci://ghcr.io/scroll-tech/scroll-sdk/helm" condition: rpc-gateway.enabled + - name: admin-system-backend + version: 0.0.1 + condition: admin-system-backend.enabled + - name: admin-system-cron + version: 0.0.1 + condition: admin-system-cron.enabled + - name: admin-system-dashboard + version: 0.0.1 + condition: admin-system-dashboard.enabled diff --git a/charts/scroll-sdk/README.md b/charts/scroll-sdk/README.md index 4daa4f3a..aaa0ac78 100644 --- a/charts/scroll-sdk/README.md +++ b/charts/scroll-sdk/README.md @@ -1,6 +1,6 @@ # scroll-sdk -![Version: 0.0.31](https://img.shields.io/badge/Version-0.0.31-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) +![Version: 0.0.32](https://img.shields.io/badge/Version-0.0.32-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) scroll helm charts to deploy scroll sdk @@ -18,6 +18,9 @@ Kubernetes: `>=1.22.0-0` | Repository | Name | Version | |------------|------|---------| +| | admin-system-backend | 0.0.1 | +| | admin-system-cron | 0.0.1 | +| | admin-system-dashboard | 0.0.1 | | https://grafana.github.io/helm-charts | grafana | 7.3.11 | | https://grafana.github.io/helm-charts | loki-stack | 2.10.2 | | https://prometheus-community.github.io/helm-charts | kube-prometheus-stack | 59.0.0 | @@ -46,6 +49,13 @@ Kubernetes: `>=1.22.0-0` | Key | Type | Default | Description | |-----|------|---------|-------------| +| admin-system-backend.enabled | bool | `true` | | +| admin-system-cron.enabled | bool | `true` | | +| admin-system-dashboard.enabled | bool | `true` | | +| admin-system-dashboard.ingress.main.enabled | bool | `true` | | +| admin-system-dashboard.ingress.main.hosts[0].host | string | `"admin-system-dashboard.scrollsdk"` | | +| admin-system-dashboard.ingress.main.hosts[0].paths[0].path | string | `"/"` | | +| admin-system-dashboard.ingress.main.hosts[0].paths[0].pathType | string | `"Prefix"` | | | balance-checker.enabled | bool | `false` | | | blockscout-sc-verifier.enabled | bool | `false` | | | blockscout.enabled | bool | `true` | | @@ -63,7 +73,7 @@ Kubernetes: `>=1.22.0-0` | contracts.enabled | bool | `true` | | | coordinator-api.enabled | bool | `false` | | | coordinator-cron.enabled | bool | `false` | | -| db | object | `{"bridge_history_password":"test1234","chain_monitor_password":"test1234","event_watcher_password":"test1234","gas_oracle_password":"test1234","pg_host":"postgresql","pg_password":"qwerty12345","pg_port":"5432","pg_user":"postgres","rollup_node_password":"test1234","rpc_gateway_password":"test1234"}` | each services. A user with admin privilege is required. | +| db | object | `{"pg_host":"postgresql","pg_password":"qwerty12345","pg_port":"5432","pg_user":"postgres"}` | each services. A user with admin privilege is required. | | frontends.enabled | bool | `true` | | | frontends.ingress.main.enabled | bool | `true` | | | frontends.ingress.main.hosts[0].host | string | `"frontends.scrollsdk"` | | diff --git a/charts/scroll-sdk/config.toml b/charts/scroll-sdk/config.toml index 8f49a7fc..834a23a4 100644 --- a/charts/scroll-sdk/config.toml +++ b/charts/scroll-sdk/config.toml @@ -32,6 +32,7 @@ L2_GAS_ORACLE_SENDER_ADDR = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" [db] +ADMIN_SYSTEM_BACKEND_DB_CONNECTION_STRING = "postgresql://postgres:qwerty12345@postgresql:5432/scroll_admin_system?sslmode=disable" BLOCKSCOUT_DB_CONNECTION_STRING = "postgres://postgres:qwerty12345@postgresql:5432/blockscout" BRIDGE_HISTORY_DB_CONNECTION_STRING = "postgres://postgres:qwerty12345@postgresql:5432/scroll?sslmode=disable" CHAIN_MONITOR_DB_CONNECTION_STRING = "postgres://postgres:qwerty12345@postgresql:5432/scroll?sslmode=disable" diff --git a/charts/scroll-sdk/templates/config-file-for-services.yaml b/charts/scroll-sdk/templates/config-file-for-services.yaml index ebf2d968..af9afabb 100644 --- a/charts/scroll-sdk/templates/config-file-for-services.yaml +++ b/charts/scroll-sdk/templates/config-file-for-services.yaml @@ -237,6 +237,26 @@ data: {{ .Files.Get "configs/rollup-node.env" | indent 2 }} --- {{- end }} +{{- if index .Values "admin-system-backend" "enabled" }} +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + {{- include "scroll-sdk.labels" $ | nindent 4 }} + name: admin-system-backend-config +data: +{{ (.Files.Glob "admin-system-backend-config.json").AsConfig | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + {{- include "scroll-sdk.labels" $ | nindent 4 }} + name: admin-system-backend-env +data: +{{ .Files.Get "configs/admin-system-backend.env" | indent 2 }} +--- +{{- end }} {{- if index .Values "rollup-explorer-backend" "enabled" }} apiVersion: v1 kind: ConfigMap diff --git a/charts/scroll-sdk/values.yaml b/charts/scroll-sdk/values.yaml index 35fe27b9..8fffc290 100644 --- a/charts/scroll-sdk/values.yaml +++ b/charts/scroll-sdk/values.yaml @@ -180,6 +180,23 @@ rpc-gateway: - path: / pathType: Prefix +admin-system-backend: + enabled: true + +admin-system-cron: + enabled: true + +admin-system-dashboard: + enabled: true + ingress: + main: + enabled: true + hosts: + - host: admin-system-dashboard.scrollsdk + paths: + - path: / + pathType: Prefix + postgresql: enabled: true nameOverride: postgresql @@ -238,9 +255,3 @@ db: pg_user: "postgres" pg_password: "qwerty12345" pg_port: "5432" - bridge_history_password: "test1234" - chain_monitor_password: "test1234" - event_watcher_password: "test1234" - gas_oracle_password: "test1234" - rollup_node_password: "test1234" - rpc_gateway_password: "test1234" diff --git a/devnet/create-env-files.sh b/devnet/create-env-files.sh index 07cd6c52..9f78b28a 100755 --- a/devnet/create-env-files.sh +++ b/devnet/create-env-files.sh @@ -24,6 +24,9 @@ delete_file_if_exists() { get_service_configmap_variables() { local service_name=$1 case "$service_name" in + admin-system-backend) + echo "ADMIN_SYSTEM_BACKEND_DB_CONNECTION_STRING:DATABASE_URL" + ;; balance-checker) echo "CHAIN_ID_L1:SCROLL_L1_RPC CHAIN_ID_L2:SCROLL_L2_RPC" ;; @@ -52,7 +55,7 @@ get_service_configmap_variables() { echo "CHAIN_ID_L1:CHAIN_ID" ;; l1-explorer) - echo "CHAIN_ID_L1:CHAIN_ID L1_EXPLORER_DB_CONNECTION_STRING:DATABASE_URL L1_RPC_ENDPOINT:ETHEREUM_JSONRPC_HTTP_URL L1_RPC_ENDPOINT:ETHEREUM_JSONRPC_TRACE_URL L1_RPC_ENDPOINT:JSON_RPC L1_RPC_ENDPOINT_WEBSOCKET:ETHEREUM_JSONRPC_WS_URL L1_EXPLORER_DB_CONNECTION_STRING:DATABASE_URL" + echo "CHAIN_ID_L1:CHAIN_ID L1_RPC_ENDPOINT:ETHEREUM_JSONRPC_HTTP_URL L1_RPC_ENDPOINT:ETHEREUM_JSONRPC_TRACE_URL L1_RPC_ENDPOINT:JSON_RPC L1_RPC_ENDPOINT_WEBSOCKET:ETHEREUM_JSONRPC_WS_URL L1_EXPLORER_DB_CONNECTION_STRING:DATABASE_URL" ;; l2-bootnode) echo "CHAIN_ID_L2:CHAIN_ID L1_RPC_ENDPOINT:L2GETH_L1_ENDPOINT L2_GETH_STATIC_PEERS:L2GETH_PEER_LIST" @@ -142,7 +145,7 @@ extract_from_config_toml() { # List of services # Note: frontend is excluded from this list as its env file is generated by the container scroll-stack-contracts. -services_configmap=("balance-checker" "bridge-history-api" "bridge-history-fetcher" "blockscout" "chain-monitor" "contracts" "coordinator" "gas-oracle" "l1-devnet" "l1-explorer" "l2-bootnode" "l2-rpc" "l2-sequencer" "rollup-node") +services_configmap=("admin-system-backend" "balance-checker" "bridge-history-api" "bridge-history-fetcher" "blockscout" "chain-monitor" "contracts" "coordinator" "gas-oracle" "l1-devnet" "l1-explorer" "l2-bootnode" "l2-rpc" "l2-sequencer" "rollup-node") # Loop over the list of services and execute the function for service in "${services_configmap[@]}"; do