-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathup-job-with-get-token.yaml
65 lines (65 loc) · 2.09 KB
/
up-job-with-get-token.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
60
61
62
63
64
65
apiVersion: batch/v1
kind: Job
metadata:
labels:
app.kubernetes.io/component: test
app.kubernetes.io/instance: observatorium-up
app.kubernetes.io/name: observatorium-up
app.kubernetes.io/version: master-2020-06-03-8a20b4e
name: observatorium-up
spec:
backoffLimit: 5
template:
metadata:
labels:
app.kubernetes.io/component: test
app.kubernetes.io/instance: observatorium-up
app.kubernetes.io/name: observatorium-up
app.kubernetes.io/version: master-2020-06-03-8a20b4e
spec:
containers:
- args:
- --endpoint-type=metrics
- --endpoint-write=http://FAKE.svc.cluster.local:8080/api/metrics/v1/test/api/v1/receive
- --endpoint-read=http://FAKE.svc.cluster.local:8080/api/metrics/v1/test/api/v1/query
- --period=1s
- --duration=2m
- --name=foo
- --labels=bar="baz"
- --latency=10s
- --initial-query-delay=5s
- --threshold=0.90
- --token-file=/var/shared/token
image: quay.io/observatorium/up:master-2020-06-03-8a20b4e
name: observatorium-up
resources: {}
volumeMounts:
- mountPath: /var/shared
name: shared
readOnly: true
initContainers:
- command:
- /bin/sh
- -c
- |
curl --request POST \
--silent \
\
--url http://FAKE.svc.cluster.local:%d/dex/token \
--header 'content-type: application/x-www-form-urlencoded' \
--data grant_type=password \
--data [email protected] \
--data password=password \
--data client_id=test \
--data client_secret=ZXhhbXBsZS1hcHAtc2VjcmV0 \
--data scope="openid email" | sed 's/^{.*"id_token":[^"]*"\([^"]*\)".*}/\1/' > /var/shared/token
image: docker.io/curlimages/curl
name: curl
volumeMounts:
- mountPath: /var/shared
name: shared
readOnly: false
restartPolicy: OnFailure
volumes:
- emptyDir: {}
name: shared