Matthias Andreas Benkard | 887523f | 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: |
| 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 | --- |
| 55 | apiVersion: v1 |
| 56 | kind: Service |
| 57 | metadata: |
| 58 | name: git-cgit |
| 59 | namespace: mulk |
| 60 | labels: |
| 61 | k8s-app: git |
| 62 | name: git-cgit |
| 63 | spec: |
| 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 | --- |
| 73 | apiVersion: v1 |
| 74 | kind: Service |
| 75 | metadata: |
| 76 | name: git-gitolite |
| 77 | namespace: mulk |
| 78 | labels: |
| 79 | k8s-app: git |
| 80 | name: git-gitolite |
| 81 | spec: |
| 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 | --- |
| 91 | apiVersion: v1 |
| 92 | kind: PersistentVolumeClaim |
| 93 | metadata: |
| 94 | name: git-data |
| 95 | namespace: mulk |
| 96 | labels: |
| 97 | name: git-data |
| 98 | k8s-app: git |
| 99 | spec: |
| 100 | accessModes: |
| 101 | - ReadWriteOnce |
| 102 | resources: |
| 103 | requests: |
| 104 | storage: 200Gi |
| 105 | storageClassName: local-path |
| 106 | --- |
| 107 | apiVersion: networking.k8s.io/v1 |
| 108 | kind: Ingress |
| 109 | metadata: |
| 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 |
| 116 | spec: |
| 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 | --- |
| 140 | apiVersion: networking.k8s.io/v1 |
| 141 | kind: Ingress |
| 142 | metadata: |
| 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 |
| 149 | spec: |
| 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 | --- |
| 166 | apiVersion: v1 |
| 167 | kind: ConfigMap |
| 168 | metadata: |
| 169 | name: git-config |
| 170 | namespace: mulk |
| 171 | data: |
| 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 Benkard | 53457f7 | 2021-12-28 17:44:20 +0100 | [diff] [blame] | 206 | |
| 207 | --- |
| 208 | |
| 209 | apiVersion: batch/v1 |
| 210 | kind: CronJob |
| 211 | |
| 212 | metadata: |
| 213 | name: git-github-replication |
| 214 | namespace: mulk |
| 215 | labels: &labels |
| 216 | k8s-app: git |
| 217 | |
| 218 | spec: |
| 219 | schedule: "*/120 * * * *" |
| 220 | |
| 221 | jobTemplate: |
| 222 | |
| 223 | spec: |
| 224 | ttlSecondsAfterFinished: 3600 |
| 225 | |
| 226 | template: |
| 227 | metadata: |
| 228 | name: git-github-replication |
| 229 | labels: *labels |
| 230 | |
| 231 | spec: |
| 232 | restartPolicy: OnFailure |
| 233 | |
| 234 | volumes: |
| 235 | - name: github-secrets |
| 236 | secret: |
| 237 | secretName: github-secrets |
| 238 | defaultMode: 0400 |
| 239 | - name: data |
| 240 | persistentVolumeClaim: |
| 241 | claimName: git-data |
| 242 | |
| 243 | containers: |
| 244 | - name: master |
| 245 | image: buildpack-deps:scm |
| 246 | command: |
| 247 | - bash |
| 248 | - -c |
| 249 | - | |
| 250 | for x in \ |
| 251 | aquifer \ |
| 252 | benki \ |
| 253 | cellspp \ |
| 254 | cl-json-template \ |
| 255 | cl-mulkutils \ |
| 256 | cl-protocols \ |
| 257 | cljssss-g \ |
| 258 | fibers \ |
| 259 | hellonet \ |
| 260 | instadump \ |
| 261 | json-template-r6rs \ |
| 262 | json-template-racket \ |
| 263 | json-template-typed-racket \ |
| 264 | logikorr \ |
| 265 | mulkcms \ |
| 266 | mulkjournal \ |
| 267 | mulklib \ |
| 268 | mulkrypt-for-racket \ |
| 269 | mulkyid \ |
| 270 | objective-cl \ |
| 271 | toilet |
| 272 | do |
| 273 | cd "/git/repositories/mulk/$x.git" |
| 274 | git push "git@github.com:benkard/${x}.git" master |
| 275 | done |
| 276 | true |
| 277 | resources: |
| 278 | limits: |
| 279 | memory: 100Mi |
| 280 | requests: |
| 281 | cpu: 20m |
| 282 | memory: 100Mi |
| 283 | volumeMounts: |
| 284 | - name: github-secrets |
| 285 | mountPath: /root/.ssh |
| 286 | readOnly: true |
| 287 | - name: data |
| 288 | mountPath: /git |