From d06846eb22bfbee9278523bb1ecbda76ac823f87 Mon Sep 17 00:00:00 2001 From: Sebastien Baizet Date: Fri, 20 Sep 2024 15:48:09 +0200 Subject: [PATCH] rollup-node --- .../templates/config-file.yaml | 2 +- charts/rollup-node/Chart.yaml | 2 +- charts/rollup-node/README.md | 3 +- charts/rollup-node/templates/config-file.yaml | 8 ++-- charts/rollup-node/templates/helpers.tpl | 47 +++++++++++++++++++ charts/rollup-node/values.yaml | 4 +- 6 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 charts/rollup-node/templates/helpers.tpl diff --git a/charts/balance-checker/templates/config-file.yaml b/charts/balance-checker/templates/config-file.yaml index 0bde592b..e3ed7871 100644 --- a/charts/balance-checker/templates/config-file.yaml +++ b/charts/balance-checker/templates/config-file.yaml @@ -7,4 +7,4 @@ metadata: {{- include "scroll-sdk.labels" $ | nindent 4 }} data: balance-checker-config.json : | -{{ .Values.scrollConfig | indent 4 }} +{{ .Values.scrollConfig | nindent 4 }} diff --git a/charts/rollup-node/Chart.yaml b/charts/rollup-node/Chart.yaml index 1c6ae4c0..5f2f9b32 100644 --- a/charts/rollup-node/Chart.yaml +++ b/charts/rollup-node/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: rollup-node helm charts name: rollup-node -version: 0.0.9 +version: 0.0.11 appVersion: v0.1.0 kubeVersion: ">=1.22.0-0" maintainers: diff --git a/charts/rollup-node/README.md b/charts/rollup-node/README.md index 910d19d7..5baad693 100644 --- a/charts/rollup-node/README.md +++ b/charts/rollup-node/README.md @@ -1,6 +1,6 @@ # rollup-node -![Version: 0.0.9](https://img.shields.io/badge/Version-0.0.9-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) +![Version: 0.0.11](https://img.shields.io/badge/Version-0.0.11-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) rollup-node helm charts @@ -97,6 +97,7 @@ Kubernetes: `>=1.22.0-0` | resources.limits.memory | string | `"200Mi"` | | | resources.requests.cpu | string | `"50m"` | | | resources.requests.memory | string | `"50Mi"` | | +| scrollConfig | string | `"{}\n"` | | | service.main.enabled | bool | `true` | | | service.main.ports.http.enabled | bool | `true` | | | service.main.ports.http.port | int | `8090` | | diff --git a/charts/rollup-node/templates/config-file.yaml b/charts/rollup-node/templates/config-file.yaml index 5044d2f1..28dee573 100644 --- a/charts/rollup-node/templates/config-file.yaml +++ b/charts/rollup-node/templates/config-file.yaml @@ -1,10 +1,10 @@ -{{- if .Values.global.isStandalone }} --- apiVersion: v1 kind: ConfigMap metadata: name: rollup-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/rollup-node/templates/helpers.tpl b/charts/rollup-node/templates/helpers.tpl new file mode 100644 index 00000000..d762ba10 --- /dev/null +++ b/charts/rollup-node/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/rollup-node/values.yaml b/charts/rollup-node/values.yaml index 325d5ee0..a64e97cc 100644 --- a/charts/rollup-node/values.yaml +++ b/charts/rollup-node/values.yaml @@ -55,7 +55,6 @@ probes: startup: enabled: false - persistence: *app_name: enabled: true @@ -152,3 +151,6 @@ serviceMonitor: - port: http interval: 1m scrapeTimeout: 10s + +scrollConfig: | + {}