diff --git a/kubernetes/apps/actions-runner-system/actions-runner-controller/runners/dapper-cluster-unprivileged/configmap.yaml b/kubernetes/apps/actions-runner-system/actions-runner-controller/runners/dapper-cluster-unprivileged/configmap.yaml index bb967d7471..999582c741 100644 --- a/kubernetes/apps/actions-runner-system/actions-runner-controller/runners/dapper-cluster-unprivileged/configmap.yaml +++ b/kubernetes/apps/actions-runner-system/actions-runner-controller/runners/dapper-cluster-unprivileged/configmap.yaml @@ -7,6 +7,8 @@ # - runAsGroup 0: containerbase images (renovate) keep their tool dirs # group-0-writable for arbitrary uids. # - no ServiceAccount token: these jobs never talk to the Kubernetes API. +# - /cache = persistent RWX workspace (pvc.yaml) so runs start warm; fsGroup +# 1001 makes it writable (and adds gid 1001 as a supplemental group). apiVersion: v1 kind: ConfigMap metadata: @@ -15,6 +17,9 @@ data: job.yaml: | spec: automountServiceAccountToken: false + securityContext: + fsGroup: 1001 + fsGroupChangePolicy: OnRootMismatch containers: - name: $job securityContext: @@ -24,3 +29,10 @@ data: env: - name: HOME value: /tmp + volumeMounts: + - name: cache + mountPath: /cache + volumes: + - name: cache + persistentVolumeClaim: + claimName: dapper-cluster-unprivileged-cache diff --git a/kubernetes/apps/actions-runner-system/actions-runner-controller/runners/dapper-cluster-unprivileged/kustomization.yaml b/kubernetes/apps/actions-runner-system/actions-runner-controller/runners/dapper-cluster-unprivileged/kustomization.yaml index 22ae92db26..6e77bdb514 100644 --- a/kubernetes/apps/actions-runner-system/actions-runner-controller/runners/dapper-cluster-unprivileged/kustomization.yaml +++ b/kubernetes/apps/actions-runner-system/actions-runner-controller/runners/dapper-cluster-unprivileged/kustomization.yaml @@ -5,4 +5,5 @@ kind: Kustomization resources: - ./configmap.yaml - ./helmrelease.yaml + - ./pvc.yaml - ./rbac.yaml diff --git a/kubernetes/apps/actions-runner-system/actions-runner-controller/runners/dapper-cluster-unprivileged/pvc.yaml b/kubernetes/apps/actions-runner-system/actions-runner-controller/runners/dapper-cluster-unprivileged/pvc.yaml new file mode 100644 index 0000000000..0cf6267df7 --- /dev/null +++ b/kubernetes/apps/actions-runner-system/actions-runner-controller/runners/dapper-cluster-unprivileged/pvc.yaml @@ -0,0 +1,17 @@ +--- +# Persistent workspace for job containers on the unprivileged runner set +# (mounted at /cache by the hook template). Renovate keeps its clone +# (persistRepoData), repository cache, package cache and containerbase tool +# downloads here, so runs only fetch deltas over the WAN instead of starting +# cold. RWX (cephfs) because job pods for different workflows can land on +# different nodes at the same time; workflows use their own subdirectory. +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: dapper-cluster-unprivileged-cache +spec: + accessModes: ["ReadWriteMany"] + storageClassName: cephfs-shared + resources: + requests: + storage: 20Gi