diff --git a/charts/sophora-server/Chart.yaml b/charts/sophora-server/Chart.yaml index a944165..691ff52 100644 --- a/charts/sophora-server/Chart.yaml +++ b/charts/sophora-server/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.3.2 +version: 1.4.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/sophora-server/templates/_helpers.tpl b/charts/sophora-server/templates/_helpers.tpl index c5d3604..9295f32 100644 --- a/charts/sophora-server/templates/_helpers.tpl +++ b/charts/sophora-server/templates/_helpers.tpl @@ -120,3 +120,16 @@ Service Account Name {{- include "sophora-server.fullname" . | quote -}} {{- end }} {{- end }} + +{{/* +Renders a value that contains template. +Usage: +{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }} +*/}} +{{- define "common.tplvalues.render" -}} + {{- if typeIs "string" .value }} + {{- tpl .value .context }} + {{- else }} + {{- tpl (.value | toYaml) .context }} + {{- end }} +{{- end -}} diff --git a/charts/sophora-server/templates/extra-deploy.yaml b/charts/sophora-server/templates/extra-deploy.yaml new file mode 100644 index 0000000..9c3ee4b --- /dev/null +++ b/charts/sophora-server/templates/extra-deploy.yaml @@ -0,0 +1,5 @@ +{{- range .Values.extraDeploy }} +--- +{{ include "common.tplvalues.render" (dict "value" . "context" $) }} +{{- end }} + diff --git a/charts/sophora-server/test-values.yaml b/charts/sophora-server/test-values.yaml index ae1e47d..4aed924 100644 --- a/charts/sophora-server/test-values.yaml +++ b/charts/sophora-server/test-values.yaml @@ -132,6 +132,26 @@ clusterReplication: annotations: kubernetes.io/tls-acme: "true" +extraDeploy: + - | + apiVersion: keda.sh/v1alpha1 + kind: ScaledObject + metadata: + name: sophora-server + spec: + scaleTargetRef: + name: sophora-server + maxReplicaCount: 1 + minReplicaCount: 0 + pollingInterval: 30 + triggers: + - type: cron + metadata: + timezone: Europe/Berlin + start: 0 6 * * 1,2,3,4,5 + end: 0 23 * * 1,2,3,4,5 + desiredReplicas: "1" + tolerations: - effect: NoSchedule key: sophora-cluster-server diff --git a/charts/sophora-server/values.yaml b/charts/sophora-server/values.yaml index 9ad86c4..4877bf7 100644 --- a/charts/sophora-server/values.yaml +++ b/charts/sophora-server/values.yaml @@ -317,6 +317,8 @@ service: clusterIP: publishNotReadyAddresses: false +extraDeploy: [] + serviceMonitor: enabled: false interval: 10s