Skip to content

Instantly share code, notes, and snippets.

@knil-sama
Created December 23, 2018 16:47
Show Gist options
  • Select an option

  • Save knil-sama/30b88605fa39b3a1bb8b983dbd8d7f5d to your computer and use it in GitHub Desktop.

Select an option

Save knil-sama/30b88605fa39b3a1bb8b983dbd8d7f5d to your computer and use it in GitHub Desktop.
kind: CronJob
metadata:
name: example
spec:
schedule: "10 3,15,20 * * *"
concurrencyPolicy: "Forbid"
failedJobsHistoryLimit: 10
startingDeadlineSeconds: 1800 # 30 min
suspend: false
jobTemplate:
spec:
template:
metadata:
annotations:
log/format: json
spec:
containers:
- name: example
image: python
imagePullPolicy: Always
command: ["python"]
args: ["script"]
env:
- name: NAME_OF_VARIABLE_IN_JOB
valueFrom:
configMapKeyRef:
name: configmap_name
key: key_in_configmap
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: RELEASE_STAGE
value: {{ .Values.release_stage }}
- name: BUGSNAG_API_KEY
valueFrom:
secretKeyRef:
name: name_of_secret
key: API_KEY
envFrom:
- secretRef:
name: name_of_secret # secrets where we want to map full content
resources:
requests:
memory: "4Gi"
cpu: "1"
limits:
memory: "8Gi"
cpu: "2"
restartPolicy: Never
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment