Skip to content

Commit

Permalink
[sophora-server]: add extra deploy option (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-schoener authored Jul 3, 2023
1 parent 6a95527 commit 8fad46a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/sophora-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions charts/sophora-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
5 changes: 5 additions & 0 deletions charts/sophora-server/templates/extra-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{- range .Values.extraDeploy }}
---
{{ include "common.tplvalues.render" (dict "value" . "context" $) }}
{{- end }}

20 changes: 20 additions & 0 deletions charts/sophora-server/test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions charts/sophora-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ service:
clusterIP:
publishNotReadyAddresses: false

extraDeploy: []

serviceMonitor:
enabled: false
interval: 10s
Expand Down

0 comments on commit 8fad46a

Please sign in to comment.