Skip to content

Commit

Permalink
Merge pull request #43 from cloudkite-io/add-job-annotations
Browse files Browse the repository at this point in the history
add annotations support in jobs
  • Loading branch information
TeamoreA authored Jan 23, 2025
2 parents 874f0fd + ab7c57a commit 180b293
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion standard-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: standard-app
description: A Helm chart library by Cloudkite
type: application
version: 0.5.0
version: 0.5.1
maintainters:
- email: [email protected]
name: cloudkite
16 changes: 15 additions & 1 deletion standard-app/example.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,21 @@ secrets:
- secretKey: AWS_ACCESS_KEY_ID # - secretKey: & property: atribute for secrets are applicable to version 0.2.0, version 0.1.0 uses the key id without artribut names e.g (- AWS_ACCESS_KEY_ID)
- secretKey: AWS_SECRET_ACCESS_KEY

# TODO: add AWS Secrets Manager
jobs:
jobexample-1:
annotations:
annotation1: value1
command:
- "cmd1"
args:
- "arg1"
restartPolicy: OnFailure
resources:
requests:
memory: 0.5Gi
cpu: 50m
limits:
memory: 0.5Gi

cronjobs:
cronjobexample-1:
Expand Down
10 changes: 7 additions & 3 deletions standard-app/templates/workloads/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ $jobName }}-{{- $jobConfig.tag | default $.Values.tag }}
generateName: "{{ $jobName }}-"
{{- with $jobConfig.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app: {{ $jobName }}
product: {{ $.Release.Name }}
Expand Down Expand Up @@ -55,7 +59,7 @@ spec:
{{- end }}
{{- end }}
env:
{{- range $key, $value := $jobConfig.env }}
{{- range $key, $value := merge (default dict $jobConfig.env) (default dict $.Values.env) }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
Expand Down Expand Up @@ -88,6 +92,6 @@ spec:
{{- end }}
{{- end }}
{{- end }}
restartPolicy: Never
restartPolicy: {{ $jobConfig.restartPolicy | default "Never" }}
---
{{- end }}

0 comments on commit 180b293

Please sign in to comment.