-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathagent.yaml.in
86 lines (85 loc) · 2.18 KB
/
agent.yaml.in
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
84
85
86
---
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Namespace
metadata:
name: weave
- apiVersion: v1
kind: ServiceAccount
metadata:
name: weave-agent
namespace: weave
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: weave-agent
labels:
name: weave-agent
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '*'
verbs:
- '*'
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: weave-agent
labels:
name: weave-agent
roleRef:
kind: ClusterRole
name: weave-agent
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: weave-agent
namespace: weave
- apiVersion: apps/v1
kind: Deployment
metadata:
name: weave-agent
namespace: weave
spec:
replicas: 1
selector:
matchLabels:
name: weave-agent
# Wait 30 seconds to see if new version crashes before rolling next pod
minReadySeconds: 30
# Rolling update with 1 new instance added before removing any old instances
strategy:
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
revisionHistoryLimit: 2
template:
metadata:
labels:
name: weave-agent
spec:
serviceAccountName: weave-agent
containers:
- name: agent
image: @@IMAGE_URL@@
imagePullPolicy: IfNotPresent
env:
- name: WEAVE_CLOUD_TOKEN
valueFrom:
secretKeyRef:
name: weave-cloud
key: token
args:
- -agent.poll-url={{.Scheme}}://{{.LauncherHostname}}/k8s/agent.yaml?instanceID={{"{{.InstanceID}}"}}
- -wc.hostname={{.WCHostname}}
- -wc.token=$(WEAVE_CLOUD_TOKEN)
- -agent.report-errors=true
- -agent.cri-endpoint={{.CRIEndpoint}}
- -agent.read-only={{.ReadOnly}}