/
job.yml.sample
55 lines (55 loc) · 1.27 KB
/
job.yml.sample
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
apiVersion: v1
kind: ServiceAccount
metadata:
name: tasty-sa
namespace: openshift-infra
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tasty-sa
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: tasty-sa
namespace: openshift-infra
---
apiVersion: batch/v1
kind: Job
metadata:
name: install-operators
namespace: openshift-infra
labels:
app: tasty
spec:
backoffLimit: 12
template:
spec:
serviceAccountName: tasty-sa
restartPolicy: OnFailure
initContainers:
- name: wait-for-cluster-version
image: quay.io/karmab/kubectl:latest
command:
- "/bin/sh"
- "-c"
- |
#!/bin/sh
echo $KUBECONFIG
printenv
CLUSTER_VERSION=$(kubectl get clusterversion version -o jsonpath='{.status.history[0].state}')
[ "$CLUSTER_VERSION" == "Completed" ] && exit 0
containers:
- name: install-operators
image: quay.io/karmab/curl:latest
command:
- "/bin/sh"
- "-c"
- |
#!/bin/sh
curl -s -L https://github.com/karmab/tasty/releases/download/v0.4.0/tasty-linux-amd64 > /usr/bin/tasty
chmod u+x /usr/bin/tasty
tasty install yaks