-
Notifications
You must be signed in to change notification settings - Fork 322
Expand file tree
/
Copy pathdeployment-template.yaml
More file actions
254 lines (243 loc) · 6.2 KB
/
Copy pathdeployment-template.yaml
File metadata and controls
254 lines (243 loc) · 6.2 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
---
apiVersion: v1
kind: Namespace
metadata:
name: "{{ .namespace | default "keel" }}"
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: keel
namespace: "{{ .namespace | default "keel" }}"
labels:
app: keel
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: keel
rules:
- apiGroups:
- ""
resources:
- namespaces
verbs:
- watch
- list
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- watch
- list
- apiGroups:
- ""
- extensions
- apps
- batch
resources:
- pods
- replicasets
- replicationcontrollers
- statefulsets
- deployments
- daemonsets
- jobs
- cronjobs
verbs:
- get
- delete # required to delete pods during force upgrade of the same tag
- watch
- list
- update
- apiGroups:
- ""
resources:
- configmaps
- pods/portforward
verbs:
- get
- create
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: keel
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: keel
subjects:
- kind: ServiceAccount
name: keel
namespace: "{{ .namespace | default "keel" }}"
---
apiVersion: v1
kind: Service
metadata:
name: keel
namespace: "{{ .namespace | default "keel" }}"
labels:
app: keel
spec:
type: LoadBalancer
ports:
- port: 9300
targetPort: 9300
protocol: TCP
name: keel
selector:
app: keel
sessionAffinity: None
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: keel
namespace: "{{ .namespace | default "keel" }}"
labels:
app: keel
spec:
replicas: 1
selector:
matchLabels:
app: keel
template:
metadata:
labels:
app: keel
spec:
serviceAccountName: keel
containers:
{{ if .relay_key }}
- name: webhookrelayd
image: "webhookrelay/webhookrelayd:latest"
imagePullPolicy: Always
{{ if .relay_tunnel}}
command: ["/relayd", "--mode", "tunnel", "--tunnels", "{{ .relay_tunnel }}"]
{{ else }}
command: ["/relayd"]
{{ end}}
env:
- name: KEY
value: {{ .relay_key }}
- name: SECRET
value: {{ .relay_secret }}
{{ if .relay_bucket }}
- name: BUCKET
value: "{{ .relay_bucket }}"
{{ end }}
{{ end }}
- name: keel
# Note that we use appVersion to get images tag.
image: "keelhq/keel:{{ .tag | latestRegistrySemver "keelhq/keel" }}"
imagePullPolicy: Always
command: ["/bin/keel"]
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
# Enable GCR with pub/sub support
- name: PROJECT_ID
value: "{{ .project_id }}"
- name: PUBSUB
value: "{{ .pubsub }}" # Set to '1' or 'true' to enable GCR pubsub
# Basic auth (to enable UI/API)
- name: BASIC_AUTH_USER
value: {{ .username }}
- name: BASIC_AUTH_PASSWORD
value: {{ .password }}
- name: AUTHENTICATED_WEBHOOKS
value: "{{ .authenticated_webhooks | default "false" }}"
# Helm configuration
{{ if.tiller_namespace }}
- name: HELM_PROVIDER
value: "1"
- name: TILLER_NAMESPACE
value: "{{ .tiller_namespace }}"
{{ end}}
# Enable AWS ECR
- name: AWS_ACCESS_KEY_ID
value: ""
- name: AWS_SECRET_ACCESS_KEY
value: ""
- name: AWS_REGION
value: ""
# Enable webhook endpoint
- name: WEBHOOK_ENDPOINT
value: ""
# Enable mattermost endpoint
- name: MATTERMOST_ENDPOINT
value: ""
# Enable MS Teams webhook endpoint
- name: TEAMS_WEBHOOK_URL
value: "{{ .teams_webhook_url }}"
- name: SLACK_TOKEN
value: "{{ .slack_token }}"
- name: SLACK_CHANNELS
value: "{{ .slack_channel | default "general" }}"
- name: SLACK_APPROVALS_CHANNEL
value: "{{ .slack_approvals_channel | default "general" }}"
- name: SLACK_BOT_NAME
value: "{{ .bot_name | default "keel" }}"
# Enable hipchat approvials and notification
- name: HIPCHAT_TOKEN
value: ""
- name: HIPCHAT_CHANNELS
value: ""
- name: HIPCHAT_APPROVALS_CHANNEL
value: ""
- name: HIPCHAT_APPROVALS_BOT_NAME
value: ""
- name: HIPCHAT_APPROVALS_USER_NAME
value: ""
- name: HIPCHAT_APPROVALS_PASSWORT
value: ""
- name: NOTIFICATION_LEVEL
value: "info"
# Enable insecure registries
- name: INSECURE_REGISTRY
value: "true"
ports:
- containerPort: 9300
livenessProbe:
httpGet:
path: /healthz
port: 9300
initialDelaySeconds: 30
timeoutSeconds: 10
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 50m
memory: 64Mi
{{ if.volume_name }}
volumeMounts:
- mountPath: /data
name: keel-data # must match the name of the volume
# Provision a fresh volume for the pod
volumes:
- name: keel-data
gcePersistentDisk:
# This disk must already exist. Check Readme
pdName: {{ .volume_name | default "keel-data" }}
fsType: ext4
{{ end }}
---
# Source: keel/templates/pod-disruption-budget.yaml
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: keel
namespace: "{{ .namespace | default "keel" }}"
spec:
maxUnavailable: 1
selector:
matchLabels:
app: keel