TZ - TIMEZONE

This commit is contained in:
Stavros kois
2023-02-11 15:55:20 +02:00
parent 4c83b97371
commit 5bb4a8ab4a
5 changed files with 40 additions and 24 deletions
@@ -41,14 +41,14 @@ tests:
- it: should apply spec correctly
set:
cron: "*/5 * * * *"
someTZ: America/New_York
someTimezone: America/New_York
workload:
workload-name:
enabled: true
primary: true
type: CronJob
schedule: "{{ .Values.cron }}"
timezone: "{{ .Values.someTZ }}"
timezone: "{{ .Values.someTimezone }}"
concurrencyPolicy: Allow
failedJobsHistoryLimit: 2
successfulJobsHistoryLimit: 4
+13
View File
@@ -0,0 +1,13 @@
# Root Chart Context
| Key | Type | Required | Helm Template | Default | Description |
| :--------------- | :------: | :------: | :-----------: | :-----: | :------------------------------------------ |
| .Values.TIMEZONE | `string` | ✅ | ❌ | `UTC` | Timezone that is used everywhere applicable |
---
Examples:
```yaml
TIMEZONE: Europe/Berlin
```
+15 -15
View File
@@ -1,19 +1,19 @@
# CronJob
| Key | Type | Required | Helm Template | Default | Description |
| :-------------------------------------------------- | :------: | :------: | :-----------: | :----------------: | :---------------------------------------------------- |
| workload.[workload-name].schedule | `string` | ✅ | ✅ | `""` | Define the schedule |
| workload.[workload-name].timezone | `string` | ❌ | ✅ | `{{ .Values.TZ }}` | Define the timezone |
| workload.[workload-name].concurrencyPolicy | `string` | ❌ | ✅ | `Forbid` | Define the concurrencyPolicy (Allow, Replace, Forbid) |
| workload.[workload-name].failedJobsHistoryLimit | `int` | ❌ | ❌ | `1` | Define the failedJobsHistoryLimit |
| workload.[workload-name].successfulJobsHistoryLimit | `int` | ❌ | ❌ | `3` | Define the successfulJobsHistoryLimit |
| workload.[workload-name].startingDeadlineSeconds | `int` | ❌ | ❌ | | Define the startingDeadlineSeconds |
| workload.[workload-name].completionMode | `string` | ❌ | ❌ | `NonIndexed` | Define the completionMode (Indexed, NonIndexed) |
| workload.[workload-name].backoffLimit | `int` | ❌ | ❌ | `5` | Define the backoffLimit |
| workload.[workload-name].completions | `int` | ❌ | ❌ | | Define the completions |
| workload.[workload-name].parallelism | `int` | ❌ | ❌ | `1` | Define the parallelism |
| workload.[workload-name].ttlSecondsAfterFinished | `int` | ❌ | ❌ | `120` | Define the ttlSecondsAfterFinished |
| workload.[workload-name].activeDeadlineSeconds | `int` | ❌ | ❌ | | Define the activeDeadlineSeconds |
| Key | Type | Required | Helm Template | Default | Description |
| :-------------------------------------------------- | :------: | :------: | :-----------: | :----------------------: | :---------------------------------------------------- |
| workload.[workload-name].schedule | `string` | ✅ | ✅ | `""` | Define the schedule |
| workload.[workload-name].timezone | `string` | ❌ | ✅ | `{{ .Values.TIMEZONE }}` | Define the timezone |
| workload.[workload-name].concurrencyPolicy | `string` | ❌ | ✅ | `Forbid` | Define the concurrencyPolicy (Allow, Replace, Forbid) |
| workload.[workload-name].failedJobsHistoryLimit | `int` | ❌ | ❌ | `1` | Define the failedJobsHistoryLimit |
| workload.[workload-name].successfulJobsHistoryLimit | `int` | ❌ | ❌ | `3` | Define the successfulJobsHistoryLimit |
| workload.[workload-name].startingDeadlineSeconds | `int` | ❌ | ❌ | | Define the startingDeadlineSeconds |
| workload.[workload-name].completionMode | `string` | ❌ | ❌ | `NonIndexed` | Define the completionMode (Indexed, NonIndexed) |
| workload.[workload-name].backoffLimit | `int` | ❌ | ❌ | `5` | Define the backoffLimit |
| workload.[workload-name].completions | `int` | ❌ | ❌ | | Define the completions |
| workload.[workload-name].parallelism | `int` | ❌ | ❌ | `1` | Define the parallelism |
| workload.[workload-name].ttlSecondsAfterFinished | `int` | ❌ | ❌ | `120` | Define the ttlSecondsAfterFinished |
| workload.[workload-name].activeDeadlineSeconds | `int` | ❌ | ❌ | | Define the activeDeadlineSeconds |
---
@@ -32,7 +32,7 @@ workload:
primary: true
type: CronJob
schedule: "{{ .Values.cron }}"
timezone: "{{ .Values.someTZ }}"
timezone: "{{ .Values.someTimezone }}"
concurrencyPolicy: Allow
failedJobsHistoryLimit: 2
successfulJobsHistoryLimit: 4
@@ -8,13 +8,13 @@ objectData:
failedJobsHistoryLimit: The number of failed finished jobs to retain. Defaults to 1.
successfulJobsHistoryLimit: The number of successful finished jobs to retain. Defaults to 3.
startingDeadlineSeconds: Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Defaults to nil.
timezone: The timezone name. Defaults to .Values.TZ.
timezone: The timezone name. Defaults to .Values.TIMEZONE
+jobSpec data
*/}}
{{- define "ix.v1.common.lib.workload.cronjobSpec" -}}
{{- $objectData := .objectData -}}
{{- $rootCtx := .rootCtx -}}
timeZone: {{ (tpl ($objectData.timezone | default $rootCtx.Values.TZ) $rootCtx) | quote }}
timeZone: {{ (tpl ($objectData.timezone | default $rootCtx.Values.TIMEZONE) $rootCtx) | quote }}
schedule: {{ (tpl $objectData.schedule $rootCtx) | quote }}
concurrencyPolicy: {{ $objectData.concurrencyPolicy | default "Forbid" }}
failedJobsHistoryLimit: {{ $objectData.failedJobsHistoryLimit | default 1 }}
+8 -5
View File
@@ -44,7 +44,7 @@ ixCertificates: []
# Only for reference here
ixVolumes: []
# TODO: Docs
# TODO: Docs (for the imageName) convention
# -- Image values
image:
# -- Image repository
@@ -55,7 +55,8 @@ image:
pullPolicy: IfNotPresent
# TODO: Docs
TZ: UTC
TIMEZONE: UTC
# TODO: Docs
# -- Security Context
securityContext:
@@ -166,6 +167,7 @@ workload:
primary: true
type: Deployment
podSpec:
# TODO: Currently implementing
containers:
main:
enabled: true
@@ -235,7 +237,10 @@ serviceAccount: {}
# -- (docs/rbac.md)
rbac: {}
# NOTES.txt
# -- (docs/scaleExternalInterface.md)
scaleExternalInterface: []
# NOTES.txt TODO: Docs
notes:
header: |
# Welcome to SCALE
@@ -293,8 +298,6 @@ scaleGPU:
pod-name:
- container-name
# -- (docs/scaleExternalInterface.md)
scaleExternalInterface: []
# -- SCALE Certificate
scaleCert: