File tree Expand file tree Collapse file tree 2 files changed +61
-0
lines changed
examples/kubernetes/job-example Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ apiVersion : kro.run/v1alpha1
2+ kind : JobDeployment
3+ metadata :
4+ name : example-job-deployment
5+ spec :
6+ replicas : 2
7+ delayInSeconds : 20
Original file line number Diff line number Diff line change 1+ apiVersion : kro.run/v1alpha1
2+ kind : ResourceGraphDefinition
3+ metadata :
4+ name : job-deployment.kro.run
5+ spec :
6+ schema :
7+ apiVersion : v1alpha1
8+ kind : JobDeployment
9+ spec :
10+ replicas : integer | default=1
11+ delayInSeconds : integer | default=30
12+ resources :
13+ - id : job
14+ readyWhen :
15+ - ${job.status.completionTime != null}
16+ template :
17+ apiVersion : batch/v1
18+ kind : Job
19+ metadata :
20+ name : ${schema.metadata.name}-job
21+ spec :
22+ # NOTE: will not work if we delete the job after it finishes. It will try to recreate the job.
23+ # ttlSecondsAfterFinished: 30
24+ template :
25+ spec :
26+ restartPolicy : Never
27+ containers :
28+ - name : sleeper
29+ image : busybox
30+ command : ["sleep", "${string(schema.spec.delayInSeconds)}"]
31+ resources :
32+ limits :
33+ cpu : " 1"
34+ - id : deployment
35+ template :
36+ apiVersion : apps/v1
37+ kind : Deployment
38+ metadata :
39+ name : ${schema.metadata.name}
40+ spec :
41+ replicas : ${schema.spec.replicas}
42+ selector :
43+ matchLabels :
44+ app : ${schema.metadata.name}
45+ template :
46+ metadata :
47+ labels :
48+ app : ${schema.metadata.name}
49+ spec :
50+ containers :
51+ - name : web
52+ image : nginx
53+ ports :
54+ - containerPort : 80
You can’t perform that action at this time.
0 commit comments