-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.yaml
More file actions
332 lines (324 loc) · 13 KB
/
Copy pathdeploy.yaml
File metadata and controls
332 lines (324 loc) · 13 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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
apiVersion: kube-deploy.centerionware.app/v1alpha1
kind: App
metadata:
name: kube-gitops
namespace: kube-deploy
spec:
repo: https://github.com/centerionware/kube-gitops
updateInterval: 10m
run:
command: ["/kube-gitops"]
port: 8080
replicas: 1
resources:
cpuRequest: 50m
memoryRequest: 64Mi
cpuLimit: 200m
memoryLimit: 128Mi
# kube-deploy creates the ServiceAccount named "kube-gitops" and binds
# the existing ClusterRole we define in resources below.
rbac:
clusterRoleBindings:
- kube-gitops
ingress:
enabled: true
host: gitops.centerionware.com
className: cloudflare-tunnel
env:
LOG_DEV_MODE: "false"
EXTERNAL_URL: "https://gitops.centerionware.com"
resources:
# ── ClusterRole ────────────────────────────────────────────────
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kube-gitops
rules:
- apiGroups: ["kube-gitops.centerionware.app"]
resources: ["gitrepos", "gitrepos/status", "prdeployments", "prdeployments/status"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: ["kube-deploy.centerionware.app"]
resources: ["apps", "apps/status", "containerapps", "containerapps/status"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "patch"]
- apiGroups: ["networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: ["gateway.networking.k8s.io"]
resources: ["httproutes"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
# ── GitRepo CRD ────────────────────────────────────────────────
- apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: gitrepos.kube-gitops.centerionware.app
spec:
group: kube-gitops.centerionware.app
scope: Namespaced
names:
plural: gitrepos
singular: gitrepo
kind: GitRepo
shortNames: ["gr"]
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
additionalPrinterColumns:
- name: Platform
type: string
jsonPath: .spec.platform
- name: Mode
type: string
jsonPath: .spec.trigger.mode
- name: Phase
type: string
jsonPath: .status.phase
- name: ActivePRs
type: integer
jsonPath: .status.activePrDeployments
- name: HookStatus
type: string
jsonPath: .status.webhookStatus
- name: HookID
type: string
jsonPath: .status.webhookId
- name: WebhookURL
type: string
jsonPath: .status.webhookUrl
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
required: ["platform", "repo", "gitSecret", "trigger"]
properties:
platform:
type: string
enum: ["github", "gitlab", "gitea", "forgejo"]
repo:
type: string
gitSecret:
type: string
trigger:
type: object
required: ["mode"]
properties:
mode:
type: string
enum: ["webhook", "poll"]
pollInterval:
type: string
default: "2m"
webhookSecret:
type: string
webhookPath:
type: string
prPolicy:
type: object
properties:
allowedAuthorAssociations:
type: array
items:
type: string
default: ["OWNER", "MEMBER", "COLLABORATOR"]
requireLabel:
type: string
allowCommentTrigger:
type: boolean
default: false
commentTriggerPhrase:
type: string
default: "/deploy"
allowedCommenters:
type: array
items:
type: string
prDeploy:
type: object
properties:
namespace:
type: string
nameTemplate:
type: string
default: "{{.RepoName}}-pr-{{.PRNumber}}"
ingressHostTemplate:
type: string
default: "pr-{{.PRNumber}}.{{.RepoName}}.{{.BaseDomain}}"
baseDomain:
type: string
injectPREnv:
type: boolean
default: true
build:
type: object
properties:
baseImage:
type: string
installCmd:
type: string
buildCmd:
type: string
dockerfileMode:
type: string
enum: ["auto", "generate", "inline"]
dockerfile:
type: string
output:
type: string
registry:
type: string
run:
type: object
properties:
command:
type: array
items:
type: string
port:
type: integer
replicas:
type: integer
default: 1
registry:
type: string
ingress:
type: object
properties:
enabled:
type: boolean
default: true
className:
type: string
tlsSecret:
type: string
annotations:
type: object
additionalProperties:
type: string
gateway:
type: object
properties:
enabled:
type: boolean
default: false
gatewayRef:
type: object
required: ["name"]
properties:
name:
type: string
namespace:
type: string
sectionName:
type: string
tlsSecret:
type: string
annotations:
type: object
additionalProperties:
type: string
env:
type: object
additionalProperties:
type: string
status:
type: object
x-kubernetes-preserve-unknown-fields: true
# ── PRDeployment CRD ───────────────────────────────────────────
- apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: prdeployments.kube-gitops.centerionware.app
spec:
group: kube-gitops.centerionware.app
scope: Namespaced
names:
plural: prdeployments
singular: prdeployment
kind: PRDeployment
shortNames: ["prd"]
versions:
- name: v1alpha1
served: true
storage: true
subresources:
status: {}
additionalPrinterColumns:
- name: Platform
type: string
jsonPath: .spec.platform
- name: PR
type: integer
jsonPath: .spec.prNumber
- name: Branch
type: string
jsonPath: .spec.branch
- name: Author
type: string
jsonPath: .spec.author
- name: State
type: string
jsonPath: .status.state
- name: AppPhase
type: string
jsonPath: .status.appPhase
- name: Image
type: string
jsonPath: .status.image
- name: Commit
type: string
jsonPath: .status.commit
- name: URL
type: string
jsonPath: .status.url
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
required: ["gitRepoRef", "platform", "repoURL", "prNumber", "branch", "headSHA", "author", "appRef", "appNamespace"]
properties:
gitRepoRef:
type: string
platform:
type: string
repoURL:
type: string
cloneURL:
type: string
description: "HEAD repo clone URL — differs from repoURL for fork PRs"
prNumber:
type: integer
branch:
type: string
headSHA:
type: string
author:
type: string
authorAssociation:
type: string
title:
type: string
appRef:
type: string
appNamespace:
type: string
status:
type: object
x-kubernetes-preserve-unknown-fields: true