-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathagent.yaml
83 lines (82 loc) · 1.88 KB
/
agent.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: prefect-agent
namespace: prefect2
labels:
app: prefect-agent
spec:
selector:
matchLabels:
app: prefect-agent
replicas: 1
template:
metadata:
labels:
app: prefect-agent
spec:
containers:
- name: agent
image: prefecthq/prefect:2.8.5-python3.10
command: ["prefect", "agent", "start", "-q", "march-madness"]
imagePullPolicy: "IfNotPresent"
env:
- name: PREFECT_API_URL
valueFrom:
secretKeyRef:
name: api-url
key: prefect_api_url
- name: PREFECT_API_KEY
valueFrom:
secretKeyRef:
name: api-key
key: prefect_api_key
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: prefect-agent
namespace: prefect2
rules:
- apiGroups: [""]
resources: ["pods", "pods/log", "pods/status"]
verbs: ["get", "watch", "list"]
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: [ "get", "list", "watch", "create", "update", "patch", "delete" ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: prefect-agent-role-binding
namespace: prefect2
subjects:
- kind: ServiceAccount
name: default
namespace: prefect2
roleRef:
kind: Role
name: prefect-agent
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: prefect-agent
rules:
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: prefect-agent-cluster-role-binding
subjects:
- kind: ServiceAccount
name: default
namespace: prefect2
roleRef:
kind: ClusterRole
name: prefect-agent
apiGroup: rbac.authorization.k8s.io