-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathhello-timer-resources.yaml
59 lines (59 loc) · 1.35 KB
/
hello-timer-resources.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
apiVersion: serverless.kyma-project.io/v1alpha1
kind: Function
metadata:
labels:
app.kubernetes.io/name: hello-timer
name: hello-timer
namespace: default
spec:
buildResources: {}
deps: |-
{
"name": "hello-timer",
"version": "0.0.1",
"dependencies": {}
}
maxReplicas: 1
minReplicas: 1
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 50m
memory: 64Mi
runtime: nodejs14
source: |-
module.exports = {
main: function (event, context) {
const nowUTC = (new Date()).toISOString();
console.log('run at', nowUTC);
return nowUTC;
}
}
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: trigger-job-hello-timer
namespace: default
spec:
schedule: "*/5 * * * *"
concurrencyPolicy: "Forbid"
failedJobsHistoryLimit: 1
successfulJobsHistoryLimit: 0
jobTemplate:
spec:
template:
spec:
containers:
- name: cron-trigger
image: eu.gcr.io/kyma-project/external/curlimages/curl:7.70.0
imagePullPolicy: IfNotPresent
command:
- sh
- -c
- |
curl hello-timer.default;
x=\$?; curl -fsI -X POST http://localhost:15020/quitquitquit && exit \$x
restartPolicy: Never