Matthias Andreas Benkard | c058c56 | 2023-01-08 19:04:34 +0100 | [diff] [blame] | 1 | --- |
| 2 | apiVersion: apps/v1 |
| 3 | kind: Deployment |
| 4 | metadata: |
| 5 | name: gitlab-runner |
| 6 | namespace: mulk |
| 7 | labels: |
| 8 | name: gitlab-runner |
| 9 | k8s-app: gitlab-runner |
| 10 | |
| 11 | spec: |
| 12 | replicas: 1 |
| 13 | |
| 14 | strategy: |
| 15 | rollingUpdate: |
| 16 | maxSurge: 1 |
| 17 | maxUnavailable: 1 |
| 18 | |
| 19 | selector: |
| 20 | matchLabels: |
| 21 | k8s-app: gitlab-runner |
| 22 | name: gitlab-runner |
| 23 | |
| 24 | template: |
| 25 | metadata: |
| 26 | labels: |
| 27 | name: gitlab-runner |
| 28 | k8s-app: gitlab-runner |
| 29 | |
| 30 | spec: |
| 31 | imagePullSecrets: |
| 32 | - name: portus-token |
| 33 | |
| 34 | runtimeClassName: kata |
| 35 | |
Matthias Andreas Benkard | 2a12e5f | 2023-01-21 18:54:50 +0100 | [diff] [blame] | 36 | initContainers: |
| 37 | - name: init |
| 38 | image: docker.io/library/busybox:latest |
| 39 | |
| 40 | command: |
| 41 | - sh |
| 42 | - -c |
| 43 | - cp -v /conf/gitlab-runner/* /etc/gitlab-runner/ |
| 44 | |
| 45 | volumeMounts: |
| 46 | - name: config-ro |
| 47 | mountPath: /conf/gitlab-runner |
| 48 | - name: config-rw |
| 49 | mountPath: /etc/gitlab-runner |
| 50 | |
Matthias Andreas Benkard | c058c56 | 2023-01-08 19:04:34 +0100 | [diff] [blame] | 51 | containers: |
| 52 | - name: master |
Matthias Andreas Benkard | 64ba410 | 2023-01-21 21:10:46 +0100 | [diff] [blame] | 53 | image: docker.benkard.de/mulk/gitlab-runner:hz62pcfdlpcbxygksisxjznj8bj27v42 |
Matthias Andreas Benkard | c058c56 | 2023-01-08 19:04:34 +0100 | [diff] [blame] | 54 | |
| 55 | securityContext: |
| 56 | # In a Kata container, this only gives the container full |
| 57 | # access to the guest VM rather than the host. (To ensure |
| 58 | # this, it is important to set privileged_without_host_devices |
| 59 | # = true in the [plugins.cri.containerd.runtimes.kata] section |
| 60 | # of containerd's config.toml.) |
| 61 | privileged: true |
| 62 | |
| 63 | volumeMounts: |
| 64 | # Configuration data. |
Matthias Andreas Benkard | 2a12e5f | 2023-01-21 18:54:50 +0100 | [diff] [blame] | 65 | - name: config-rw |
Matthias Andreas Benkard | c058c56 | 2023-01-08 19:04:34 +0100 | [diff] [blame] | 66 | mountPath: /etc/gitlab-runner |
| 67 | |
| 68 | # State. |
| 69 | - name: docker-data |
| 70 | mountPath: /vol/docker-data |
| 71 | - name: tmp |
| 72 | mountPath: /tmp |
| 73 | |
| 74 | resources: |
Matthias Andreas Benkard | 2a12e5f | 2023-01-21 18:54:50 +0100 | [diff] [blame] | 75 | requests: |
| 76 | memory: 128Mi |
Matthias Andreas Benkard | c058c56 | 2023-01-08 19:04:34 +0100 | [diff] [blame] | 77 | limits: |
Matthias Andreas Benkard | 2a12e5f | 2023-01-21 18:54:50 +0100 | [diff] [blame] | 78 | memory: 8Gi |
Matthias Andreas Benkard | c058c56 | 2023-01-08 19:04:34 +0100 | [diff] [blame] | 79 | |
| 80 | volumes: |
Matthias Andreas Benkard | 2a12e5f | 2023-01-21 18:54:50 +0100 | [diff] [blame] | 81 | - name: config-ro |
Matthias Andreas Benkard | c058c56 | 2023-01-08 19:04:34 +0100 | [diff] [blame] | 82 | secret: |
| 83 | secretName: gitlab-runner-config |
Matthias Andreas Benkard | 2a12e5f | 2023-01-21 18:54:50 +0100 | [diff] [blame] | 84 | - name: config-rw |
| 85 | emptyDir: {} |
Matthias Andreas Benkard | c058c56 | 2023-01-08 19:04:34 +0100 | [diff] [blame] | 86 | - name: docker-data |
| 87 | persistentVolumeClaim: |
| 88 | claimName: gitlab-runner-docker |
| 89 | - name: tmp |
| 90 | emptyDir: {} |
| 91 | |
| 92 | --- |
| 93 | apiVersion: v1 |
| 94 | kind: PersistentVolumeClaim |
| 95 | metadata: |
| 96 | name: gitlab-runner-docker |
| 97 | namespace: mulk |
| 98 | annotations: |
| 99 | volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path |
| 100 | volume.kubernetes.io/selected-node: ifirn |
| 101 | spec: |
| 102 | storageClassName: local-path |
| 103 | accessModes: |
| 104 | - ReadWriteOnce |
| 105 | resources: |
| 106 | requests: |
| 107 | storage: 1Gi |