| Matthias Andreas Benkard | c756035 | 2021-09-05 12:25:13 +0200 | [diff] [blame] | 1 | --- |
| 2 | apiVersion: apps/v1 |
| 3 | kind: Deployment |
| 4 | metadata: |
| 5 | name: git |
| 6 | namespace: mulk |
| 7 | labels: |
| 8 | name: git |
| 9 | k8s-app: git |
| 10 | spec: |
| 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: |
| Matthias Andreas Benkard | c756035 | 2021-09-05 12:25:13 +0200 | [diff] [blame] | 22 | containers: |
| Matthias Andreas Benkard | faf5a09 | 2024-03-06 12:51:07 +0100 | [diff] [blame] | 23 | - name: cgit |
| 24 | image: docker.io/woahbase/alpine-cgit:latest |
| Matthias Andreas Benkard | c756035 | 2021-09-05 12:25:13 +0200 | [diff] [blame] | 25 | imagePullPolicy: Always |
| 26 | env: [] |
| Matthias Andreas Benkard | faf5a09 | 2024-03-06 12:51:07 +0100 | [diff] [blame] | 27 | command: |
| 28 | - /bin/sh |
| 29 | - -c |
| 30 | - apk update && apk add groff python3 py3-docutils py3-markdown py3-pygments && /init |
| Matthias Andreas Benkard | c756035 | 2021-09-05 12:25:13 +0200 | [diff] [blame] | 31 | resources: |
| 32 | limits: |
| 33 | cpu: 2000m |
| 34 | memory: 100Mi |
| 35 | requests: |
| 36 | cpu: 10m |
| 37 | memory: 50Mi |
| 38 | ports: |
| 39 | - containerPort: 80 |
| 40 | name: cgit-http |
| 41 | protocol: TCP |
| 42 | volumeMounts: |
| 43 | - name: data |
| 44 | mountPath: /home/git |
| 45 | - name: config |
| 46 | mountPath: /etc/cgitrc |
| 47 | subPath: cgitrc |
| 48 | readOnly: true |
| Matthias Andreas Benkard | 8c9b613 | 2024-03-06 12:51:33 +0100 | [diff] [blame] | 49 | - name: gitolite |
| 50 | image: docker.io/elsdoerfer/gitolite:latest |
| 51 | imagePullPolicy: Always |
| 52 | env: [] |
| 53 | #tty: true |
| 54 | #stdin: true |
| 55 | #command: |
| 56 | # - /bin/cat |
| 57 | resources: |
| 58 | limits: |
| 59 | cpu: 2000m |
| 60 | memory: 100Mi |
| 61 | requests: |
| 62 | cpu: 10m |
| 63 | memory: 50Mi |
| 64 | ports: |
| 65 | - containerPort: 2222 |
| 66 | name: gitolite-ssh |
| 67 | protocol: TCP |
| 68 | volumeMounts: |
| 69 | - name: data |
| 70 | mountPath: /home/git/repositories |
| 71 | subPath: repositories |
| 72 | #- name: data |
| 73 | # mountPath: /home/git/projects.list |
| 74 | # subPath: projects.list |
| 75 | - name: data |
| 76 | mountPath: /home/git/.gitolite |
| 77 | subPath: .gitolite |
| 78 | - name: data |
| 79 | mountPath: /home/git/.gitolite.rc |
| 80 | subPath: .gitolite.rc |
| 81 | - name: data |
| 82 | mountPath: /home/git/.ssh |
| 83 | subPath: .ssh |
| 84 | - name: ssh |
| 85 | mountPath: /etc/ssh |
| Matthias Andreas Benkard | c756035 | 2021-09-05 12:25:13 +0200 | [diff] [blame] | 86 | volumes: |
| 87 | - name: data |
| 88 | persistentVolumeClaim: |
| 89 | claimName: git-data |
| Matthias Andreas Benkard | 8c9b613 | 2024-03-06 12:51:33 +0100 | [diff] [blame] | 90 | - name: ssh |
| 91 | persistentVolumeClaim: |
| 92 | claimName: git-ssh |
| Matthias Andreas Benkard | c756035 | 2021-09-05 12:25:13 +0200 | [diff] [blame] | 93 | - name: config |
| 94 | configMap: |
| 95 | name: git-config |
| 96 | --- |
| 97 | apiVersion: v1 |
| 98 | kind: Service |
| 99 | metadata: |
| 100 | name: git-cgit |
| 101 | namespace: mulk |
| 102 | labels: |
| 103 | k8s-app: git |
| 104 | name: git-cgit |
| 105 | spec: |
| 106 | selector: |
| 107 | k8s-app: git |
| 108 | type: ClusterIP |
| 109 | ports: |
| 110 | - name: http |
| 111 | port: 80 |
| 112 | targetPort: cgit-http |
| 113 | protocol: TCP |
| 114 | --- |
| 115 | apiVersion: v1 |
| 116 | kind: Service |
| 117 | metadata: |
| 118 | name: git-gitolite |
| 119 | namespace: mulk |
| 120 | labels: |
| 121 | k8s-app: git |
| 122 | name: git-gitolite |
| 123 | spec: |
| 124 | selector: |
| 125 | k8s-app: git |
| Matthias Andreas Benkard | 8c9b613 | 2024-03-06 12:51:33 +0100 | [diff] [blame] | 126 | type: NodePort |
| Matthias Andreas Benkard | c756035 | 2021-09-05 12:25:13 +0200 | [diff] [blame] | 127 | ports: |
| 128 | - name: ssh |
| 129 | port: 22 |
| 130 | targetPort: gitolite-ssh |
| 131 | protocol: TCP |
| 132 | --- |
| 133 | apiVersion: v1 |
| 134 | kind: PersistentVolumeClaim |
| 135 | metadata: |
| 136 | name: git-data |
| 137 | namespace: mulk |
| 138 | labels: |
| 139 | name: git-data |
| 140 | k8s-app: git |
| 141 | spec: |
| 142 | accessModes: |
| 143 | - ReadWriteOnce |
| 144 | resources: |
| 145 | requests: |
| 146 | storage: 200Gi |
| 147 | storageClassName: local-path |
| 148 | --- |
| Matthias Andreas Benkard | 8c9b613 | 2024-03-06 12:51:33 +0100 | [diff] [blame] | 149 | apiVersion: v1 |
| 150 | kind: PersistentVolumeClaim |
| 151 | metadata: |
| 152 | name: git-ssh |
| 153 | namespace: mulk |
| 154 | labels: |
| 155 | name: git-ssh |
| 156 | k8s-app: git |
| 157 | spec: |
| 158 | accessModes: |
| 159 | - ReadWriteOnce |
| 160 | resources: |
| 161 | requests: |
| 162 | storage: 50Mi |
| 163 | storageClassName: local-path |
| 164 | --- |
| Matthias Andreas Benkard | c756035 | 2021-09-05 12:25:13 +0200 | [diff] [blame] | 165 | apiVersion: networking.k8s.io/v1 |
| 166 | kind: Ingress |
| 167 | metadata: |
| 168 | name: git-cgit-cgi |
| 169 | namespace: mulk |
| 170 | annotations: |
| 171 | cert-manager.io/cluster-issuer: letsencrypt-prod |
| 172 | kubernetes.io/ingress.class: nginx |
| 173 | nginx.ingress.kubernetes.io/rewrite-target: /cgit/cgit.cgi/$1$2 |
| 174 | spec: |
| 175 | rules: |
| 176 | - host: git.benkard.de |
| 177 | http: |
| 178 | paths: |
| 179 | - backend: |
| 180 | service: |
| 181 | name: git-cgit |
| 182 | port: |
| 183 | number: 80 |
| 184 | path: /(.*)[.]git(/.*)?$ |
| 185 | pathType: ImplementationSpecific |
| 186 | - backend: |
| 187 | service: |
| 188 | name: git-cgit |
| 189 | port: |
| 190 | number: 80 |
| 191 | path: /(.*)(.*)?$ |
| 192 | pathType: ImplementationSpecific |
| 193 | tls: |
| 194 | - hosts: |
| 195 | - git.benkard.de |
| 196 | secretName: git-cgit-cgi-tls |
| 197 | --- |
| 198 | apiVersion: networking.k8s.io/v1 |
| 199 | kind: Ingress |
| 200 | metadata: |
| 201 | name: git-cgit-assets |
| 202 | namespace: mulk |
| 203 | annotations: |
| 204 | cert-manager.io/cluster-issuer: letsencrypt-prod |
| 205 | kubernetes.io/ingress.class: nginx |
| 206 | nginx.ingress.kubernetes.io/rewrite-target: /cgit/$1 |
| 207 | spec: |
| 208 | rules: |
| 209 | - host: static.git.benkard.de |
| 210 | http: |
| 211 | paths: |
| 212 | - backend: |
| 213 | service: |
| 214 | name: git-cgit |
| 215 | port: |
| 216 | number: 80 |
| 217 | path: /(.*) |
| 218 | pathType: ImplementationSpecific |
| 219 | tls: |
| 220 | - hosts: |
| 221 | - static.git.benkard.de |
| 222 | secretName: git-cgit-assets-tls |
| 223 | --- |
| 224 | apiVersion: v1 |
| 225 | kind: ConfigMap |
| 226 | metadata: |
| 227 | name: git-config |
| 228 | namespace: mulk |
| 229 | data: |
| 230 | cgitrc: |- |
| 231 | css=https://static.git.benkard.de/cgit.css |
| 232 | logo=https://static.git.benkard.de/cgit.png |
| 233 | |
| 234 | remove-suffix=1 |
| 235 | enable-commit-graph=1 |
| 236 | enable-index-links=1 |
| 237 | enable-log-filecount=1 |
| 238 | enable-log-linecount=1 |
| 239 | enable-git-config=1 |
| 240 | case-sensitive-sort=0 |
| 241 | |
| 242 | virtual-root=https://git.benkard.de/ |
| 243 | |
| 244 | #cache-size=10000 |
| 245 | #cache-root=/var/cache/cgit |
| 246 | |
| 247 | # needs Pygments |
| 248 | #source-filter=/usr/lib/cgit/filters/syntax-highlighting.py |
| 249 | |
| 250 | about-filter=/usr/lib/cgit/filters/about-formatting.sh |
| 251 | |
| 252 | clone-url=https://git.benkard.de/$CGIT_REPO_URL |
| 253 | |
| 254 | readme=:README.md |
| 255 | readme=:README.markdown |
| 256 | readme=:README.html |
| 257 | readme=:README.txt |
| 258 | readme=:README |
| 259 | |
| 260 | project-list=/home/git/projects.list |
| 261 | scan-path=/home/git/repositories/ |
| 262 | |
| 263 | # |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 264 | |
| 265 | --- |
| 266 | |
| 267 | apiVersion: batch/v1 |
| 268 | kind: CronJob |
| 269 | |
| 270 | metadata: |
| 271 | name: git-github-replication |
| 272 | namespace: mulk |
| 273 | labels: &labels |
| 274 | k8s-app: git |
| 275 | |
| 276 | spec: |
| 277 | schedule: "*/120 * * * *" |
| Matthias Andreas Benkard | cbdcd90 | 2022-12-27 15:31:15 +0100 | [diff] [blame] | 278 | concurrencyPolicy: Forbid |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 279 | |
| 280 | jobTemplate: |
| 281 | |
| 282 | spec: |
| 283 | ttlSecondsAfterFinished: 3600 |
| 284 | |
| 285 | template: |
| 286 | metadata: |
| 287 | name: git-github-replication |
| 288 | labels: *labels |
| 289 | |
| 290 | spec: |
| 291 | restartPolicy: OnFailure |
| 292 | |
| 293 | volumes: |
| 294 | - name: github-secrets |
| 295 | secret: |
| 296 | secretName: github-secrets |
| Matthias Andreas Benkard | 11298da | 2023-04-02 18:27:17 +0200 | [diff] [blame] | 297 | defaultMode: 0444 |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 298 | - name: data |
| 299 | persistentVolumeClaim: |
| 300 | claimName: git-data |
| Matthias Andreas Benkard | 8c9b613 | 2024-03-06 12:51:33 +0100 | [diff] [blame] | 301 | - name: etc |
| 302 | emptyDir: {} |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 303 | |
| Matthias Andreas Benkard | 8c9b613 | 2024-03-06 12:51:33 +0100 | [diff] [blame] | 304 | initContainers: |
| 305 | - name: init |
| 306 | image: docker.io/library/buildpack-deps:scm |
| Matthias Andreas Benkard | 11298da | 2023-04-02 18:27:17 +0200 | [diff] [blame] | 307 | securityContext: |
| 308 | runAsUser: 100 |
| 309 | runAsGroup: 101 |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 310 | command: |
| 311 | - bash |
| 312 | - -c |
| 313 | - | |
| Matthias Andreas Benkard | 8c9b613 | 2024-03-06 12:51:33 +0100 | [diff] [blame] | 314 | echo git:x:106:107:Git:/home/git:/bin/sh >/etc/passwd |
| 315 | volumeMounts: |
| 316 | - name: etc |
| 317 | mountPath: /etc |
| 318 | |
| 319 | containers: |
| 320 | - name: main |
| 321 | image: docker.io/library/buildpack-deps:scm |
| 322 | securityContext: |
| 323 | runAsUser: 106 |
| 324 | runAsGroup: 107 |
| 325 | command: |
| 326 | - bash |
| 327 | - -c |
| 328 | - | |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 329 | for x in \ |
| Matthias Andreas Benkard | 06e9d79 | 2024-03-06 12:49:24 +0100 | [diff] [blame] | 330 | .github \ |
| 331 | aendggner \ |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 332 | aquifer \ |
| 333 | benki \ |
| 334 | cellspp \ |
| 335 | cl-json-template \ |
| 336 | cl-mulkutils \ |
| 337 | cl-protocols \ |
| 338 | cljssss-g \ |
| Matthias Andreas Benkard | 06e9d79 | 2024-03-06 12:49:24 +0100 | [diff] [blame] | 339 | demos \ |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 340 | fibers \ |
| 341 | hellonet \ |
| Matthias Andreas Benkard | 06e9d79 | 2024-03-06 12:49:24 +0100 | [diff] [blame] | 342 | hello-world-ng \ |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 343 | instadump \ |
| Matthias Andreas Benkard | 11298da | 2023-04-02 18:27:17 +0200 | [diff] [blame] | 344 | jgvariant \ |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 345 | json-template-r6rs \ |
| 346 | json-template-racket \ |
| 347 | json-template-typed-racket \ |
| Matthias Andreas Benkard | 06e9d79 | 2024-03-06 12:49:24 +0100 | [diff] [blame] | 348 | kubeia \ |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 349 | logikorr \ |
| 350 | mulkcms \ |
| Matthias Andreas Benkard | 11298da | 2023-04-02 18:27:17 +0200 | [diff] [blame] | 351 | mulkcms2 \ |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 352 | mulkjournal \ |
| 353 | mulklib \ |
| Matthias Andreas Benkard | 11298da | 2023-04-02 18:27:17 +0200 | [diff] [blame] | 354 | mulkontainers \ |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 355 | mulkrypt-for-racket \ |
| 356 | mulkyid \ |
| 357 | objective-cl \ |
| Matthias Andreas Benkard | 11298da | 2023-04-02 18:27:17 +0200 | [diff] [blame] | 358 | quarkus-googlecloud-jsonlogging \ |
| Matthias Andreas Benkard | 06e9d79 | 2024-03-06 12:49:24 +0100 | [diff] [blame] | 359 | renovate-config \ |
| 360 | rust-samples \ |
| 361 | rust-tutorial \ |
| 362 | sb-eval2 \ |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 363 | toilet |
| 364 | do |
| Matthias Andreas Benkard | 06e9d79 | 2024-03-06 12:49:24 +0100 | [diff] [blame] | 365 | if ! test -e "/git/repositories/mulk/$x.git"; then |
| 366 | continue |
| 367 | fi |
| 368 | |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 369 | cd "/git/repositories/mulk/$x.git" |
| Matthias Andreas Benkard | e96ddfb | 2024-03-06 12:50:00 +0100 | [diff] [blame] | 370 | |
| 371 | for branch in master main |
| 372 | do |
| 373 | git fetch "https://gitlab.benkard.de/mulk/${x}.git" "$branch:$branch" && \ |
| 374 | ( git push "ssh://mulk@gerrit.benkard.de:29418/${x}.git" "$branch"; \ |
| 375 | git push "git@github.com:benkard/${x}.git" "$branch" ) |
| 376 | done |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 377 | done |
| 378 | true |
| Matthias Andreas Benkard | 11298da | 2023-04-02 18:27:17 +0200 | [diff] [blame] | 379 | env: |
| 380 | - name: HOME |
| Matthias Andreas Benkard | 8c9b613 | 2024-03-06 12:51:33 +0100 | [diff] [blame] | 381 | value: /home/git |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 382 | resources: |
| 383 | limits: |
| 384 | memory: 100Mi |
| 385 | requests: |
| 386 | cpu: 20m |
| 387 | memory: 100Mi |
| 388 | volumeMounts: |
| 389 | - name: github-secrets |
| Matthias Andreas Benkard | 8c9b613 | 2024-03-06 12:51:33 +0100 | [diff] [blame] | 390 | mountPath: /home/git/.ssh |
| Matthias Andreas Benkard | 7d78f7f | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 391 | readOnly: true |
| 392 | - name: data |
| 393 | mountPath: /git |
| Matthias Andreas Benkard | 8c9b613 | 2024-03-06 12:51:33 +0100 | [diff] [blame] | 394 | - name: etc |
| 395 | subPath: passwd |
| 396 | mountPath: /etc/passwd |