diff --git a/charts/bridge-history-fetcher/Chart.yaml b/charts/bridge-history-fetcher/Chart.yaml index 9c2f2faa..de69d3cd 100644 --- a/charts/bridge-history-fetcher/Chart.yaml +++ b/charts/bridge-history-fetcher/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: bridge-history-fetcher helm charts name: bridge-history-fetcher -version: 0.0.8 +version: 0.0.9 appVersion: v0.1.0 kubeVersion: ">=1.22.0-0" maintainers: diff --git a/charts/bridge-history-fetcher/README.md b/charts/bridge-history-fetcher/README.md index bd781360..7ec98337 100644 --- a/charts/bridge-history-fetcher/README.md +++ b/charts/bridge-history-fetcher/README.md @@ -1,6 +1,6 @@ # bridge-history-fetcher -![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) +![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) bridge-history-fetcher helm charts @@ -25,7 +25,7 @@ Kubernetes: `>=1.22.0-0` |-----|------|---------|-------------| | command[0] | string | `"/bin/sh"` | | | command[1] | string | `"-c"` | | -| command[2] | string | `"bridgehistoryapi-fetcher --config /app/conf/bridge-history-config.json --metrics --metrics.addr 0.0.0.0 --metrics.port ${METRICS_PORT} --log.debug"` | | +| command[2] | string | `"bridgehistoryapi-fetcher --config /app/conf/bridge-history-fetcher-config.json --metrics --metrics.addr 0.0.0.0 --metrics.port ${METRICS_PORT} --log.debug"` | | | configMaps.migrate-db.data."migrate-db.json" | string | `"{\n \"l1\": {},\n \"l2\": {},\n \"db\": {\n \"driver_name\": \"postgres\",\n \"maxOpenNum\": 50,\n \"maxIdleNume\": 5,\n \"dsn\": \"\"\n }\n}\n"` | | | configMaps.migrate-db.enabled | bool | `true` | | | controller.replicas | int | `1` | | @@ -102,6 +102,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 | `8080` | | diff --git a/charts/bridge-history-fetcher/templates/config-file.yaml b/charts/bridge-history-fetcher/templates/config-file.yaml index 1053e3b4..85bca6a1 100644 --- a/charts/bridge-history-fetcher/templates/config-file.yaml +++ b/charts/bridge-history-fetcher/templates/config-file.yaml @@ -1,10 +1,10 @@ -{{- if .Values.global.isStandalone }} --- apiVersion: v1 kind: ConfigMap metadata: name: bridge-history-fetcher-config + labels: + {{- include "scroll-sdk.labels" $ | nindent 4 }} data: -{{ (.Files.Glob "configs/bridge-history-config.json").AsConfig | indent 2 }} ---- -{{- end }} + bridge-history-fetcher-config.json: | +{{ .Values.scrollConfig | indent 4 }} diff --git a/charts/bridge-history-fetcher/templates/helpers.tpl b/charts/bridge-history-fetcher/templates/helpers.tpl new file mode 100644 index 00000000..d762ba10 --- /dev/null +++ b/charts/bridge-history-fetcher/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/bridge-history-fetcher/values.yaml b/charts/bridge-history-fetcher/values.yaml index 9e65894e..bf3e81c7 100644 --- a/charts/bridge-history-fetcher/values.yaml +++ b/charts/bridge-history-fetcher/values.yaml @@ -16,7 +16,7 @@ command: [ "/bin/sh", "-c", - "bridgehistoryapi-fetcher --config /app/conf/bridge-history-config.json --metrics --metrics.addr 0.0.0.0 --metrics.port ${METRICS_PORT} --log.debug", + "bridgehistoryapi-fetcher --config /app/conf/bridge-history-fetcher-config.json --metrics --metrics.addr 0.0.0.0 --metrics.port ${METRICS_PORT} --log.debug", ] env: @@ -154,3 +154,6 @@ serviceMonitor: - port: metrics interval: 1m scrapeTimeout: 10s + +scrollConfig: | + {}