blob: a0ad4419642ae4107a176cf90708734c7b3104bd [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
Matthias Andreas Benkard2f9c4fa2023-04-02 18:27:17 +0200239 defaultMode: 0444
Matthias Andreas Benkard53457f72021-12-28 17:44:20 +0100240 - name: data
241 persistentVolumeClaim:
242 claimName: git-data
243
244 containers:
245 - name: master
246 image: buildpack-deps:scm
Matthias Andreas Benkard2f9c4fa2023-04-02 18:27:17 +0200247 securityContext:
248 runAsUser: 100
249 runAsGroup: 101
Matthias Andreas Benkard53457f72021-12-28 17:44:20 +0100250 command:
251 - bash
252 - -c
253 - |
254 for x in \
255 aquifer \
256 benki \
257 cellspp \
258 cl-json-template \
259 cl-mulkutils \
260 cl-protocols \
261 cljssss-g \
262 fibers \
263 hellonet \
264 instadump \
Matthias Andreas Benkard2f9c4fa2023-04-02 18:27:17 +0200265 jgvariant \
Matthias Andreas Benkard53457f72021-12-28 17:44:20 +0100266 json-template-r6rs \
267 json-template-racket \
268 json-template-typed-racket \
269 logikorr \
270 mulkcms \
Matthias Andreas Benkard2f9c4fa2023-04-02 18:27:17 +0200271 mulkcms2 \
Matthias Andreas Benkard53457f72021-12-28 17:44:20 +0100272 mulkjournal \
273 mulklib \
Matthias Andreas Benkard2f9c4fa2023-04-02 18:27:17 +0200274 mulkontainers \
Matthias Andreas Benkard53457f72021-12-28 17:44:20 +0100275 mulkrypt-for-racket \
276 mulkyid \
277 objective-cl \
Matthias Andreas Benkard2f9c4fa2023-04-02 18:27:17 +0200278 quarkus-googlecloud-jsonlogging \
Matthias Andreas Benkard53457f72021-12-28 17:44:20 +0100279 toilet
280 do
281 cd "/git/repositories/mulk/$x.git"
Matthias Andreas Benkard2f9c4fa2023-04-02 18:27:17 +0200282 git fetch "https://gitlab.benkard.de/mulk/${x}.git" master:master
Matthias Andreas Benkard53457f72021-12-28 17:44:20 +0100283 git push "git@github.com:benkard/${x}.git" master
284 done
285 true
Matthias Andreas Benkard2f9c4fa2023-04-02 18:27:17 +0200286 env:
287 - name: HOME
288 value: /nonexistent
Matthias Andreas Benkard53457f72021-12-28 17:44:20 +0100289 resources:
290 limits:
291 memory: 100Mi
292 requests:
293 cpu: 20m
294 memory: 100Mi
295 volumeMounts:
296 - name: github-secrets
Matthias Andreas Benkard2f9c4fa2023-04-02 18:27:17 +0200297 mountPath: /nonexistent/.ssh
Matthias Andreas Benkard53457f72021-12-28 17:44:20 +0100298 readOnly: true
299 - name: data
300 mountPath: /git