blob: 2e66b9d98c25c2bdbcc29ea8ac57495a54af0cd0 [file] [log] [blame]
Matthias Andreas Benkard887523f2021-09-05 12:25:13 +02001---
2apiVersion: apps/v1
3kind: Deployment
4metadata:
5 name: git
6 namespace: mulk
7 labels:
8 name: git
9 k8s-app: git
10spec:
11 replicas: 1
12 selector:
13 matchLabels:
14 k8s-app: git
15 name: git
16 template:
17 metadata:
18 labels:
19 name: git
20 k8s-app: git
21 spec:
22 imagePullSecrets:
23 - name: kube-registry-token
24 containers:
25 - name: master
26 image: woahbase/alpine-cgit:latest
27 imagePullPolicy: Always
28 env: []
29 resources:
30 limits:
31 cpu: 2000m
32 memory: 100Mi
33 requests:
34 cpu: 10m
35 memory: 50Mi
36 ports:
37 - containerPort: 80
38 name: cgit-http
39 protocol: TCP
40 volumeMounts:
41 - name: data
42 mountPath: /home/git
43 - name: config
44 mountPath: /etc/cgitrc
45 subPath: cgitrc
46 readOnly: true
47 volumes:
48 - name: data
49 persistentVolumeClaim:
50 claimName: git-data
51 - name: config
52 configMap:
53 name: git-config
54---
55apiVersion: v1
56kind: Service
57metadata:
58 name: git-cgit
59 namespace: mulk
60 labels:
61 k8s-app: git
62 name: git-cgit
63spec:
64 selector:
65 k8s-app: git
66 type: ClusterIP
67 ports:
68 - name: http
69 port: 80
70 targetPort: cgit-http
71 protocol: TCP
72---
73apiVersion: v1
74kind: Service
75metadata:
76 name: git-gitolite
77 namespace: mulk
78 labels:
79 k8s-app: git
80 name: git-gitolite
81spec:
82 selector:
83 k8s-app: git
84 type: ClusterIP
85 ports:
86 - name: ssh
87 port: 22
88 targetPort: gitolite-ssh
89 protocol: TCP
90---
91apiVersion: v1
92kind: PersistentVolumeClaim
93metadata:
94 name: git-data
95 namespace: mulk
96 labels:
97 name: git-data
98 k8s-app: git
99spec:
100 accessModes:
101 - ReadWriteOnce
102 resources:
103 requests:
104 storage: 200Gi
105 storageClassName: local-path
106---
107apiVersion: networking.k8s.io/v1
108kind: Ingress
109metadata:
110 name: git-cgit-cgi
111 namespace: mulk
112 annotations:
113 cert-manager.io/cluster-issuer: letsencrypt-prod
114 kubernetes.io/ingress.class: nginx
115 nginx.ingress.kubernetes.io/rewrite-target: /cgit/cgit.cgi/$1$2
116spec:
117 rules:
118 - host: git.benkard.de
119 http:
120 paths:
121 - backend:
122 service:
123 name: git-cgit
124 port:
125 number: 80
126 path: /(.*)[.]git(/.*)?$
127 pathType: ImplementationSpecific
128 - backend:
129 service:
130 name: git-cgit
131 port:
132 number: 80
133 path: /(.*)(.*)?$
134 pathType: ImplementationSpecific
135 tls:
136 - hosts:
137 - git.benkard.de
138 secretName: git-cgit-cgi-tls
139---
140apiVersion: networking.k8s.io/v1
141kind: Ingress
142metadata:
143 name: git-cgit-assets
144 namespace: mulk
145 annotations:
146 cert-manager.io/cluster-issuer: letsencrypt-prod
147 kubernetes.io/ingress.class: nginx
148 nginx.ingress.kubernetes.io/rewrite-target: /cgit/$1
149spec:
150 rules:
151 - host: static.git.benkard.de
152 http:
153 paths:
154 - backend:
155 service:
156 name: git-cgit
157 port:
158 number: 80
159 path: /(.*)
160 pathType: ImplementationSpecific
161 tls:
162 - hosts:
163 - static.git.benkard.de
164 secretName: git-cgit-assets-tls
165---
166apiVersion: v1
167kind: ConfigMap
168metadata:
169 name: git-config
170 namespace: mulk
171data:
172 cgitrc: |-
173 css=https://static.git.benkard.de/cgit.css
174 logo=https://static.git.benkard.de/cgit.png
175
176 remove-suffix=1
177 enable-commit-graph=1
178 enable-index-links=1
179 enable-log-filecount=1
180 enable-log-linecount=1
181 enable-git-config=1
182 case-sensitive-sort=0
183
184 virtual-root=https://git.benkard.de/
185
186 #cache-size=10000
187 #cache-root=/var/cache/cgit
188
189 # needs Pygments
190 #source-filter=/usr/lib/cgit/filters/syntax-highlighting.py
191
192 about-filter=/usr/lib/cgit/filters/about-formatting.sh
193
194 clone-url=https://git.benkard.de/$CGIT_REPO_URL
195
196 readme=:README.md
197 readme=:README.markdown
198 readme=:README.html
199 readme=:README.txt
200 readme=:README
201
202 project-list=/home/git/projects.list
203 scan-path=/home/git/repositories/
204
205 #
Matthias Andreas Benkard53457f72021-12-28 17:44:20 +0100206
207---
208
209apiVersion: batch/v1
210kind: CronJob
211
212metadata:
213 name: git-github-replication
214 namespace: mulk
215 labels: &labels
216 k8s-app: git
217
218spec:
219 schedule: "*/120 * * * *"
Matthias Andreas Benkardd2755e92022-12-27 15:31:15 +0100220 concurrencyPolicy: Forbid
Matthias Andreas Benkard53457f72021-12-28 17:44:20 +0100221
222 jobTemplate:
223
224 spec:
225 ttlSecondsAfterFinished: 3600
226
227 template:
228 metadata:
229 name: git-github-replication
230 labels: *labels
231
232 spec:
233 restartPolicy: OnFailure
234
235 volumes:
236 - name: github-secrets
237 secret:
238 secretName: github-secrets
239 defaultMode: 0400
240 - name: data
241 persistentVolumeClaim:
242 claimName: git-data
243
244 containers:
245 - name: master
246 image: buildpack-deps:scm
247 command:
248 - bash
249 - -c
250 - |
251 for x in \
252 aquifer \
253 benki \
254 cellspp \
255 cl-json-template \
256 cl-mulkutils \
257 cl-protocols \
258 cljssss-g \
259 fibers \
260 hellonet \
261 instadump \
262 json-template-r6rs \
263 json-template-racket \
264 json-template-typed-racket \
265 logikorr \
266 mulkcms \
267 mulkjournal \
268 mulklib \
269 mulkrypt-for-racket \
270 mulkyid \
271 objective-cl \
272 toilet
273 do
274 cd "/git/repositories/mulk/$x.git"
275 git push "git@github.com:benkard/${x}.git" master
276 done
277 true
278 resources:
279 limits:
280 memory: 100Mi
281 requests:
282 cpu: 20m
283 memory: 100Mi
284 volumeMounts:
285 - name: github-secrets
286 mountPath: /root/.ssh
287 readOnly: true
288 - name: data
289 mountPath: /git