forked from fbeltrao/aksjobscheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment-rbac.yaml
83 lines (83 loc) · 1.82 KB
/
deployment-rbac.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
apiVersion: v1
kind: ServiceAccount
metadata:
name: aks-jobscheduler
namespace: default
---
apiVersion: v1
kind: Secret
metadata:
name: aks-jobscheduler-secret
annotations:
kubernetes.io/service-account.name: aks-jobscheduler
type: kubernetes.io/service-account-token
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: default
name: jobs-manager
rules:
- apiGroups: ["batch", "extensions"]
resources: ["jobs"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: jobs-manager-binding
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: jobs-manager
subjects:
- kind: ServiceAccount
name: aks-jobscheduler
namespace: default
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jobscheduler-web
spec:
replicas: 1
selector:
matchLabels:
app: jobscheduler
template:
metadata:
labels:
app: jobscheduler
tier: web
spec:
serviceAccountName: aks-jobscheduler
containers:
- name: jobscheduler-web
image: fbeltrao/aksjobscheduler-server:1.1
imagePullPolicy: Always
ports:
- containerPort: 8000
env:
- name: STORAGEKEY
value: "<storage key>"
- name: STORAGEACCOUNT
value: "<storage account name>"
- name: EVENTGRIDSASKEY
value: "<optional event grid sas key to notify when job is done>"
- name: EVENTGRIDENDPOINT
value: "<optional event grid endpoint to notify when job is done>"
---
kind: Service
apiVersion: v1
metadata:
name: jobscheduler-web-svc
spec:
selector:
app: jobscheduler
tier: web
ports:
- protocol: TCP
port: 80
targetPort: 8000
type: LoadBalancer