Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sophora-server]: add extra deploy option #32

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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