-
Notifications
You must be signed in to change notification settings - Fork 2
/
kubernetes-curl-job.yaml
46 lines (46 loc) · 1.51 KB
/
kubernetes-curl-job.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
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: my-kubernetes-job
labels:
app: my-kubernetes-app
type: cron
spec:
schedule: "* 1 * * *" # Run every hour
jobTemplate:
metadata:
labels:
app: my-kubernetes-job
type: cron
spec:
template:
spec:
containers:
- name: my-kubernetes-job
image: manusant/curl-jq
imagePullPolicy: IfNotPresent
env:
- name: WEBHOOK
value: <your-slack-web-hook>
- name: OAUTH_TOKEN_ENDPOINT
value: <yout-oauth-token-endpoint> # https://api.example.com/uaa/oauth/token
- name: BASIC_CLIENT_CREDENTIALS
value: <{base64}clientId:clientSecret}> # c2NoXXX1bGVyLXNlcnZpY2U6MTIzUVdFYXNk
- name: JOB_ENDPOINT
value: <http-endpointç-to-call>
- name: CHANNEL
value: "#<your-slack-channel>"
- name: SUCCESS_MESSAGE
value: "Your success message"
- name: FAIL_MESSAGE
value: "Your error message"
command: ["/scripts/kubernetes-curl-job.sh"]
volumeMounts:
- name: my-kubernetes-job-volume
mountPath: /scripts
volumes:
- name: my-kubernetes-job-volume
configMap:
name: kubernetes-curl-job-script
defaultMode: 0744
restartPolicy: Never