-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebhook.yaml
59 lines (58 loc) · 1.36 KB
/
webhook.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitea-resource-controller
namespace: gitea
spec:
replicas: 1
selector:
matchLabels:
app: gitea-resource-controller
template:
metadata:
labels:
app: gitea-resource-controller
spec:
initContainers:
- name: wait-for-gitea
image: busybox:1.28
command: ['sh', '-c', "until nslookup gitea-http; do echo waiting for gitea-http; sleep 2; done"]
containers:
- name: controller
image: python:3
command: ["python3", "/hooks/controller.py"]
ports:
- containerPort: 8080
name: web
volumeMounts:
- name: hooks
mountPath: /hooks
env:
- name: GITEA_BASE_URL
value: http://gitea-http:3000
- name: GITEA_ADMIN_USERNAME
valueFrom:
secretKeyRef:
key: username
name: gitea-admin-secret
- name: GITEA_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: gitea-admin-secret
volumes:
- name: hooks
configMap:
name: gitea-resource-controller
---
apiVersion: v1
kind: Service
metadata:
name: gitea-resource-controller
namespace: gitea
spec:
selector:
app: gitea-resource-controller
ports:
- port: 80
targetPort: web