Skip to content

Instantly share code, notes, and snippets.

@czunker
Created April 27, 2023 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save czunker/ee29f077a0babcf6f2ce847c29823e8c to your computer and use it in GitHub Desktop.
Save czunker/ee29f077a0babcf6f2ce847c29823e8c to your computer and use it in GitHub Desktop.
Manifest with two CronJobs, one with namespace, the other one without namespace
apiVersion: batch/v1
kind: CronJob
metadata:
name: hello
namespace: default
spec:
schedule: "* * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox:1.28
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
securityContext:
allowPrivilegeEscalation: true
restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: hello-2
spec:
schedule: "* * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox:1.28
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
securityContext:
allowPrivilegeEscalation: true
restartPolicy: OnFailure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment