From 04949a560474a2f417af8c3cf2fc67b2ee5a33dd Mon Sep 17 00:00:00 2001 From: Sebastien Baizet Date: Fri, 20 Sep 2024 14:48:10 +0200 Subject: [PATCH] coordinator-cron --- charts/coordinator-cron/Chart.yaml | 2 +- charts/coordinator-cron/README.md | 5 +- .../templates/config-file.yaml | 8 ++-- charts/coordinator-cron/templates/helpers.tpl | 47 +++++++++++++++++++ charts/coordinator-cron/values.yaml | 5 +- 5 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 charts/coordinator-cron/templates/helpers.tpl diff --git a/charts/coordinator-cron/Chart.yaml b/charts/coordinator-cron/Chart.yaml index 5e823f7e..26988f92 100644 --- a/charts/coordinator-cron/Chart.yaml +++ b/charts/coordinator-cron/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 description: coordinator-cron helm charts name: coordinator-cron -version: 0.0.6 +version: 0.0.7 appVersion: v0.1.0 kubeVersion: ">=1.22.0-0" maintainers: diff --git a/charts/coordinator-cron/README.md b/charts/coordinator-cron/README.md index 43b07c05..380fdbfb 100644 --- a/charts/coordinator-cron/README.md +++ b/charts/coordinator-cron/README.md @@ -1,6 +1,6 @@ # coordinator-cron -![Version: 0.0.6](https://img.shields.io/badge/Version-0.0.6-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square) +![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) coordinator-cron helm charts @@ -25,7 +25,7 @@ Kubernetes: `>=1.22.0-0` |-----|------|---------|-------------| | command[0] | string | `"/bin/sh"` | | | command[1] | string | `"-c"` | | -| command[2] | string | `"coordinator_cron --config /app/conf/coordinator-config.json --metrics --metrics.addr 0.0.0.0 --metrics.port ${METRICS_PORT} --log.debug"` | | +| command[2] | string | `"coordinator_cron --config /app/conf/coordinator-cron-config.json --metrics --metrics.addr 0.0.0.0 --metrics.port ${METRICS_PORT} --log.debug"` | | | defaultProbes.custom | bool | `true` | | | defaultProbes.enabled | bool | `true` | | | defaultProbes.spec.httpGet.path | string | `"/health"` | | @@ -76,6 +76,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 | `80` | | diff --git a/charts/coordinator-cron/templates/config-file.yaml b/charts/coordinator-cron/templates/config-file.yaml index b706f3b8..38d3efdc 100644 --- a/charts/coordinator-cron/templates/config-file.yaml +++ b/charts/coordinator-cron/templates/config-file.yaml @@ -1,10 +1,10 @@ -{{- if .Values.global.isStandalone }} --- apiVersion: v1 kind: ConfigMap metadata: name: coordinator-cron-config + labels: + {{- include "scroll-sdk.labels" $ | nindent 4 }} data: -{{ (.Files.Glob "configs/coordinator-config.json").AsConfig | indent 2 }} ---- -{{- end }} + coordinator-cron-config.json: | +{{ .Values.scrollConfig | indent 4 }} diff --git a/charts/coordinator-cron/templates/helpers.tpl b/charts/coordinator-cron/templates/helpers.tpl new file mode 100644 index 00000000..d762ba10 --- /dev/null +++ b/charts/coordinator-cron/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/coordinator-cron/values.yaml b/charts/coordinator-cron/values.yaml index aafa996b..6c205e5e 100644 --- a/charts/coordinator-cron/values.yaml +++ b/charts/coordinator-cron/values.yaml @@ -27,7 +27,7 @@ envFrom: command: [ "/bin/sh", "-c", - "coordinator_cron --config /app/conf/coordinator-config.json \ + "coordinator_cron --config /app/conf/coordinator-cron-config.json \ --metrics --metrics.addr 0.0.0.0 --metrics.port ${METRICS_PORT} \ --log.debug", ] @@ -102,3 +102,6 @@ serviceMonitor: - port: metrics interval: 1m scrapeTimeout: 10s + +scrollConfig: | + {}