From 9d12ca48c12169eccfc17c7c1102ee36515a9872 Mon Sep 17 00:00:00 2001 From: Sebastien Baizet Date: Fri, 20 Sep 2024 15:08:23 +0200 Subject: [PATCH] gas-oracle --- charts/gas-oracle/Chart.yaml | 2 +- charts/gas-oracle/README.md | 5 ++- charts/gas-oracle/templates/config-file.yaml | 8 ++-- charts/gas-oracle/templates/helpers.tpl | 47 ++++++++++++++++++++ charts/gas-oracle/values.yaml | 5 ++- 5 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 charts/gas-oracle/templates/helpers.tpl diff --git a/charts/gas-oracle/Chart.yaml b/charts/gas-oracle/Chart.yaml index 57572768..3435edb1 100644 --- a/charts/gas-oracle/Chart.yaml +++ b/charts/gas-oracle/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: gas-oracle helm charts name: gas-oracle -version: 0.0.7 +version: 0.0.8 appVersion: v0.1.0 kubeVersion: ">=1.22.0-0" maintainers: diff --git a/charts/gas-oracle/README.md b/charts/gas-oracle/README.md index 360b14b0..7aba2813 100644 --- a/charts/gas-oracle/README.md +++ b/charts/gas-oracle/README.md @@ -1,6 +1,6 @@ # gas-oracle -![Version: 0.0.7](https://img.shields.io/badge/Version-0.0.7-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) +![Version: 0.0.8](https://img.shields.io/badge/Version-0.0.8-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) gas-oracle helm charts @@ -71,7 +71,7 @@ Kubernetes: `>=1.22.0-0` | initContainers.4-wait-for-l2-sequencer.image | string | `"atkrad/wait4x:latest"` | | | persistence.app_name.enabled | bool | `true` | | | persistence.app_name.mountPath | string | `"/app/conf/"` | | -| persistence.app_name.name | string | `"rollup-config"` | | +| persistence.app_name.name | string | `"gas-oracle-config"` | | | persistence.app_name.type | string | `"configMap"` | | | persistence.genesis.enabled | bool | `true` | | | persistence.genesis.mountPath | string | `"/app/genesis/"` | | @@ -104,6 +104,7 @@ Kubernetes: `>=1.22.0-0` | resources.limits.memory | string | `"500Mi"` | | | resources.requests.cpu | string | `"50m"` | | | resources.requests.memory | string | `"100Mi"` | | +| scrollConfig | string | `"{}\n"` | | | service.main.enabled | bool | `true` | | | service.main.ports.http.enabled | bool | `true` | | | service.main.ports.http.port | int | `80` | | diff --git a/charts/gas-oracle/templates/config-file.yaml b/charts/gas-oracle/templates/config-file.yaml index c8e53eda..d9b7c174 100644 --- a/charts/gas-oracle/templates/config-file.yaml +++ b/charts/gas-oracle/templates/config-file.yaml @@ -1,10 +1,10 @@ -{{- if .Values.global.isStandalone }} --- apiVersion: v1 kind: ConfigMap metadata: name: gas-oracle-config + labels: + {{- include "scroll-sdk.labels" $ | nindent 4 }} data: -{{ (.Files.Glob "configs/rollup-config.json").AsConfig | indent 2 }} ---- -{{- end }} + rollup-config.json: | +{{ .Values.scrollConfig | indent 4 }} diff --git a/charts/gas-oracle/templates/helpers.tpl b/charts/gas-oracle/templates/helpers.tpl new file mode 100644 index 00000000..d762ba10 --- /dev/null +++ b/charts/gas-oracle/templates/helpers.tpl @@ -0,0 +1,47 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "scroll-sdk.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "scroll-sdk.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} +{{/* +Create chart name and build as used by the chart label. +*/}} +{{- define "scroll-sdk.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} +{{/* +Common labels +*/}} +{{- define "scroll-sdk.labels" -}} +helm.sh/chart: {{ include "scroll-sdk.chart" . }} +{{ include "scroll-sdk.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/build: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} +{{/* +Selector labels +*/}} +{{- define "scroll-sdk.selectorLabels" -}} +app.kubernetes.io/name: {{ include "scroll-sdk.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/charts/gas-oracle/values.yaml b/charts/gas-oracle/values.yaml index bd621c8e..7f46dbe3 100644 --- a/charts/gas-oracle/values.yaml +++ b/charts/gas-oracle/values.yaml @@ -32,7 +32,7 @@ persistence: enabled: true type: configMap mountPath: /app/conf/ - name: rollup-config + name: gas-oracle-config genesis: enabled: true type: configMap @@ -150,3 +150,6 @@ serviceMonitor: - port: metrics interval: 1m scrapeTimeout: 10s + +scrollConfig: | + {}